Compare commits

...

119 Commits

Author SHA1 Message Date
Justin Clark-Casey (justincc) 105a51e3dd put in missing ; from last commit 2010-08-09 21:16:27 +01:00
Justin Clark-Casey (justincc) e971b1606f update version number and switch flavour to release 2010-08-09 21:14:06 +01:00
Diva Canto b280b8218e Enabled GridInfoServiceInConnector for standalones. 2010-08-08 09:50:03 -07:00
Melanie b0c86fea4c Add search URL to Login Service 2010-08-07 16:33:42 -07:00
Justin Clark-Casey (justincc) f30cd8391e minor: Remove overly verbose schedule full update log message for attachments 2010-08-07 22:30:46 +01:00
Diva Canto d44b7d9637 Added Check4096 config var under [GridService], at the request of many. Changed the iteration that Marck had on the Hyperlinker.
ATTENTION! CONFIGURATION CHANGE AFFECTING Robust.HG.ini.example and StandaloneCommon.ini.example.
2010-08-06 18:08:05 -07:00
Diva Canto a0fa6dc967 Marck's patch on 4096 checks with conflicts resolved. 2010-08-06 18:07:40 -07:00
Diva Canto db629af6d3 HACK ALERT! There's some underlying bug in the HTTP server that makes requests come up with Accept headers from previous requests. Until that gets fixed, this hack goes in. 2010-08-06 10:57:52 -07:00
Diva Canto dc08e1cbf9 Addresses http://opensimulator.org/mantis/view.php?id=4919 2010-08-05 09:41:24 -07:00
Diva Canto 73678947da Better debug messages 2010-08-04 11:18:33 -07:00
Diva Canto 2f52a3a153 Removed a few more obsolete default configs. 2010-08-04 07:52:28 -07:00
Melanie 8b6f39b206 remove more useless defaults 2010-08-04 07:52:17 -07:00
Melanie Thielker b9dc4ab4a1 Remove StandAlone from default hardcoded config 2010-08-03 20:10:13 -07:00
Diva Canto d97c741e67 Further bug fixing, still related to the issue earlier. 2010-08-03 18:18:01 -07:00
Diva Canto a34add9534 Another bug fixed. Same issue. 2010-08-03 17:29:52 -07:00
Diva Canto ed3073eae1 this is so bad, brain is beyond fried. must stop. 2010-08-03 17:06:22 -07:00
Diva Canto eafe6b294e sigh. fried brain. 2010-08-03 17:00:44 -07:00
Diva Canto fb23093087 One more buglet related to the issue at hand. 2010-08-03 16:35:16 -07:00
Diva Canto a46538485b One more thing related to the previous commit. Must avoid all in-process remote calls. 2010-08-03 16:28:06 -07:00
Diva Canto 62ffc566c3 Bug fix (HG): mantis #4891. This doesn't actually fix the underlying bug, but it clears up the circular dependency issue between Gatekeeper and UserAgents that had made me resort to in-process remote calls, which, in turn, were hitting bugs down there somewhere in mono.
NOTE: CONFIGURATION CHANGE IN ROBUST.HG.INI.EXAMPLE !!!###!!!
2010-08-03 16:03:50 -07:00
Diva Canto df976c9eb4 Weird 2010-07-31 16:45:18 -07:00
Diva Canto 63dd24a651 Show hyperlinks 2010-07-31 16:44:02 -07:00
Marck 692e684ced Implemented console command "show hyperlinks". 2010-07-31 16:42:42 -07:00
Melanie 875a623654 Thank you, Snoopy, for a patch to fix child prim movement. This still doesn't
address limiting link distance, but at least it makes the UI and LSL
match.
2010-07-31 09:30:44 -07:00
Diva Canto 81751a1753 Bug fix: make m_HypergridLinker static. 2010-07-30 18:06:34 -07:00
Diva Canto 44332d145a Slight improvement on previous commit. 2010-07-30 14:41:02 -07:00
Diva Canto 4a7588b0f0 Changed the way HG client verification is done: now transforming local and LAN client IPs into external IPs. This addresses some issues related to running both the user agents service and the viewer in the same machine/LAN, which then presents a problem when the user agent goes to an external network. 2010-07-30 14:40:45 -07:00
Melanie 72060741e1 Add some options 2010-07-24 23:37:08 +01:00
Melanie 4fcf76eb0b Fix some inventory issues 2010-07-24 23:20:58 +01:00
Justin Clark-Casey (justincc) 0e3daf703f remove compile.bat from a created binary distribution 2010-07-23 23:13:04 +01:00
Justin Clark-Casey (justincc) 02aa938ce1 in nant distbin, specifically only delete Regions.ini instead of the entire Regions directory 2010-07-23 22:37:33 +01:00
Justin Clark-Casey (justincc) 18117d8c9a Merge branch '0.7-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7-post-fixes 2010-07-23 22:37:10 +01:00
Diva Canto 536699cf43 Flipped the flavour on post-fixes to Post_Fixes. 2010-07-22 10:56:18 -07:00
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
Justin Clark-Casey (justincc) 79d33418f0 Merge branch '0.7-post-fixes' of ssh://opensimulator.org/var/git/opensim into 0.7-post-fixes 2010-07-20 21:57:03 +01: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
Justin Clark-Casey (justincc) 2f562639b9 Add region name on the end of script startup debug messages 2010-07-17 01:30:26 +01: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
71 changed files with 1479 additions and 834 deletions

View File

@ -20,6 +20,7 @@
<delete dir="${distbindir}/.nant"/>
<delete>
<fileset basedir="${distbindir}">
<include name="compile.bat"/>
<include name="BUILDING.txt"/>
<include name="Makefile"/>
<include name="nant-color"/>
@ -29,7 +30,7 @@
<include name="TESTING.txt"/>
<include name="TestResult.xml"/>
<include name="bin/OpenSim.Server.ini"/>
<include name="bin/Regions/*"/>
<include name="bin/Regions/Regions.ini"/>
<include name="bin/*.db"/>
<include name="**/.git/**"/>
<include name=".gitignore"/>

View File

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

View File

@ -62,6 +62,7 @@ namespace OpenSim.Data
List<RegionData> GetDefaultRegions(UUID scopeID);
List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y);
List<RegionData> GetHyperlinks(UUID scopeID);
}
[Flags]

View File

@ -310,23 +310,23 @@ namespace OpenSim.Data.MSSQL
public List<RegionData> GetDefaultRegions(UUID scopeID)
{
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0";
if (scopeID != UUID.Zero)
sql += " AND ScopeID = @scopeID";
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
conn.Open();
return RunCommand(cmd);
}
return Get((int)RegionFlags.DefaultRegion, scopeID);
}
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
{
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0";
// TODO: distance-sort results
return Get((int)RegionFlags.FallbackRegion, scopeID);
}
public List<RegionData> GetHyperlinks(UUID scopeID)
{
return Get((int)RegionFlags.Hyperlink, scopeID);
}
private List<RegionData> Get(int regionFlags, UUID scopeID)
{
string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0";
if (scopeID != UUID.Zero)
sql += " AND ScopeID = @scopeID";
@ -335,7 +335,6 @@ namespace OpenSim.Data.MSSQL
{
cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID));
conn.Open();
// TODO: distance-sort results
return RunCommand(cmd);
}
}

View File

@ -281,22 +281,26 @@ namespace OpenSim.Data.MySQL
return false;
}
public List<RegionData> GetDefaultRegions(UUID scopeID)
{
string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0";
if (scopeID != UUID.Zero)
command += " and ScopeID = ?scopeID";
MySqlCommand cmd = new MySqlCommand(command);
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
return RunCommand(cmd);
return Get((int)RegionFlags.DefaultRegion, scopeID);
}
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
{
string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0";
// TODO: distance-sort results
return Get((int)RegionFlags.FallbackRegion, scopeID);
}
public List<RegionData> GetHyperlinks(UUID scopeID)
{
return Get((int)RegionFlags.Hyperlink, scopeID);
}
private List<RegionData> Get(int regionFlags, UUID scopeID)
{
string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0";
if (scopeID != UUID.Zero)
command += " and ScopeID = ?scopeID";
@ -304,7 +308,6 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
// TODO: distance-sort results
return RunCommand(cmd);
}
}

View File

@ -164,30 +164,29 @@ namespace OpenSim.Data.Null
public List<RegionData> GetDefaultRegions(UUID scopeID)
{
if (Instance != this)
return Instance.GetDefaultRegions(scopeID);
List<RegionData> ret = new List<RegionData>();
foreach (RegionData r in m_regionData.Values)
{
if ((Convert.ToInt32(r.Data["flags"]) & 1) != 0)
ret.Add(r);
}
return ret;
return Get((int)RegionFlags.DefaultRegion, scopeID);
}
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
{
return Get((int)RegionFlags.FallbackRegion, scopeID);
}
public List<RegionData> GetHyperlinks(UUID scopeID)
{
return Get((int)RegionFlags.Hyperlink, scopeID);
}
private List<RegionData> Get(int regionFlags, UUID scopeID)
{
if (Instance != this)
return Instance.GetFallbackRegions(scopeID, x, y);
return Instance.Get(regionFlags, scopeID);
List<RegionData> ret = new List<RegionData>();
foreach (RegionData r in m_regionData.Values)
{
if ((Convert.ToInt32(r.Data["flags"]) & 2) != 0)
if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0)
ret.Add(r);
}

View File

@ -3,19 +3,10 @@
<Import assembly="OpenSim.Data.dll" />
<Import assembly="OpenSim.Framework.dll" />
</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">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IAssetDataPlugin" />
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/InventoryData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IInventoryDataPlugin" />
</ExtensionPoint>
<ExtensionPoint path = "/OpenSim/UserData">
<ExtensionNode name="Plugin" type="OpenSim.Framework.PluginExtensionNode" objectType="OpenSim.Data.IUserDataPlugin" />
</ExtensionPoint>
</Addin>

View File

@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLite
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();
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLite
{
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();

View File

@ -328,7 +328,7 @@ namespace OpenSim.Data.SQLiteLegacy
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();
@ -342,7 +342,7 @@ namespace OpenSim.Data.SQLiteLegacy
{
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();

View File

@ -781,7 +781,7 @@ namespace OpenSim.Data.Tests
// Ownership changes when you drop an object into an object
// 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.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.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)
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)

View File

@ -31,6 +31,7 @@ using System.Net.Sockets;
using System.Net;
using System.Net.NetworkInformation;
using System.Reflection;
using System.Text;
using log4net;
namespace OpenSim.Framework
@ -180,8 +181,16 @@ namespace OpenSim.Framework
throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client");
}
static IPAddress externalIPAddress;
static NetworkUtil()
{
try
{
externalIPAddress = GetExternalIP();
}
catch { /* ignore */ }
try
{
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
@ -244,5 +253,80 @@ namespace OpenSim.Framework
}
return defaultHostname;
}
public static IPAddress GetExternalIPOf(IPAddress user)
{
if (externalIPAddress == null)
return user;
if (user.ToString() == "127.0.0.1")
{
m_log.Info("[NetworkUtil] 127.0.0.1 user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
// Check if we're accessing localhost.
foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName()))
{
if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
{
m_log.Info("[NetworkUtil] Localhost user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
}
// Check for same LAN segment
foreach (KeyValuePair<IPAddress, IPAddress> subnet in m_subnets)
{
byte[] subnetBytes = subnet.Value.GetAddressBytes();
byte[] localBytes = subnet.Key.GetAddressBytes();
byte[] destBytes = user.GetAddressBytes();
if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length)
return user;
bool valid = true;
for (int i = 0; i < subnetBytes.Length; i++)
{
if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i]))
{
valid = false;
break;
}
}
if (subnet.Key.AddressFamily != AddressFamily.InterNetwork)
valid = false;
if (valid)
{
m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
}
// Otherwise, return user address
return user;
}
private static IPAddress GetExternalIP()
{
string whatIsMyIp = "http://www.whatismyip.com/automation/n09230945.asp";
WebClient wc = new WebClient();
UTF8Encoding utf8 = new UTF8Encoding();
string requestHtml = "";
try
{
requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
}
catch (WebException we)
{
m_log.Info("[NetworkUtil]: Exception in GetExternalIP: " + we.ToString());
return null;
}
IPAddress externalIp = IPAddress.Parse(requestHtml);
return externalIp;
}
}
}

View File

@ -319,6 +319,13 @@ namespace OpenSim.Framework.Servers.HttpServer
OSHttpRequest req = new OSHttpRequest(context, request);
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
HandleRequest(req, resp);
// !!!HACK ALERT!!!
// There seems to be a bug in the underlying http code that makes subsequent requests
// come up with trash in Accept headers. Until that gets fixed, we're cleaning them up here.
if (request.AcceptTypes != null)
for (int i = 0; i < request.AcceptTypes.Length; i++)
request.AcceptTypes[i] = string.Empty;
}
// public void ConvertIHttpClientContextToOSHttp(object stateinfo)

View File

@ -73,7 +73,18 @@ namespace OpenSim.Framework.Servers.HttpServer
{
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());
m_server.DoHTTPGruntWork(responsedata,
@ -106,4 +117,4 @@ namespace OpenSim.Framework.Servers.HttpServer
m_request.Enqueue(pPollServiceHttpRequest);
}
}
}
}

View File

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

View File

@ -307,21 +307,6 @@ namespace OpenSim
config.Set("EventQueue", true);
}
{
IConfig config = defaultConfig.Configs["StandAlone"];
if (null == config)
config = defaultConfig.AddConfig("StandAlone");
config.Set("accounts_authenticate", true);
config.Set("welcome_message", "Welcome to OpenSimulator");
config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
config.Set("inventory_source", "");
config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
config.Set("user_source", "");
config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
}
{
IConfig config = defaultConfig.Configs["Network"];

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IJ2KDecoder J2KDecoder;
public IAssetService AssetService;
public UUID AgentID;
public IHyperAssetService HyperAssets;
public IInventoryAccessModule InventoryAccessModule;
public OpenJPEG.J2KLayerInfo[] Layers;
public bool IsDecoded;
public bool HasAsset;
@ -375,14 +375,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UUID assetID = UUID.Zero;
if (asset != null)
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'
string userAssets = HyperAssets.GetUserAssetServer(AgentID);
if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer()))
// Unfortunately we need this here, there's no other way.
// This is due to the fact that textures opened directly from the agent's inventory
// 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);
AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived);
AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
return;
}
}

View File

@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected uint m_agentFOVCounter;
protected IAssetService m_assetService;
private IHyperAssetService m_hyperAssets;
private const bool m_checkPackets = true;
private Timer m_propertiesPacketTimer;
@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// m_attachmentsSent = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
@ -7196,59 +7194,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else // Agent
{
IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>();
InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId);
assetRequestItem = invService.GetItem(assetRequestItem);
if (assetRequestItem == null)
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null)
{
ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>();
if (lib != null)
assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
if (assetRequestItem == null)
return true;
}
if (!invAccess.GetAgentInventoryItem(this, itemID, requestID))
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 (!((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);
/* RequestAsset = OnRequestAsset;
if (RequestAsset != null)
{
RequestAsset(this, transfer);
}*/
return true;
}
@ -11459,15 +11420,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
{
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);
@ -11483,49 +11435,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="asset"></param>
protected void AssetReceived(string id, Object sender, AssetBase asset)
{
if (asset == null)
return;
TransferRequestPacket transferRequest = (TransferRequestPacket)sender;
UUID requestID = UUID.Zero;
byte source = (byte)SourceType.Asset;
if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
|| (transferRequest.TransferInfo.SourceType == 2222))
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
{
requestID = new UUID(transferRequest.TransferInfo.Params, 0);
}
else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
|| (transferRequest.TransferInfo.SourceType == 3333))
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
{
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
source = (byte)SourceType.SimInventoryItem;
//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
if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10)
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 object m_syncRoot = new object();
private IHyperAssetService m_hyperAssets;
public LLClientView Client { get { return m_client; } }
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_j2kDecodeModule = pJ2kDecodeModule;
m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>();
}
/// <summary>
@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
imgrequest.J2KDecoder = m_j2kDecodeModule;
imgrequest.AssetService = m_assetCache;
imgrequest.AgentID = m_client.AgentId;
imgrequest.HyperAssets = m_hyperAssets;
imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>();
imgrequest.DiscardLevel = newRequest.DiscardLevel;
imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber);
imgrequest.Priority = newRequest.Priority;

View File

@ -182,7 +182,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
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);
}
}

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* 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);
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)
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);
if (sp != null && !sp.IsChildAgent)
if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal);
}
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
if (presence != null && !presence.IsChildAgent)
if (presence != null)
presence.ControllingClient.SendAgentAlertMessage(message, modal);
}
@ -119,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
}
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);
}
@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
{
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null && !sp.IsChildAgent)
if (sp != null)
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);
if (sp != null && !sp.IsChildAgent)
if (sp != null)
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);
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
iarPath, iarPathExisting);
// m_log.DebugFormat(
// "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]",
// iarPath, iarPathExisting);
string iarPathToCreate = iarPath.Substring(iarPathExisting.Length);
CreateFoldersForPath(destFolder, iarPathExisting, iarPathToCreate, resolvedFolders, loadedNodes);
@ -255,12 +255,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
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))
{
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath);
// m_log.DebugFormat(
// "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath);
destFolder = resolvedFolders[archivePath];
}
else
@ -275,9 +275,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
else
{
m_log.DebugFormat(
"[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}",
originalArchivePath);
// m_log.DebugFormat(
// "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}",
// originalArchivePath);
archivePath = string.Empty;
destFolder = rootDestFolder;
}

View File

@ -206,11 +206,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
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);
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Found {0} items in FindItemByPath()", items.Count);
foreach (InventoryItemBase item in items)
{
// m_log.DebugFormat("[INVENTORY ARCHIVE UTILS]: Inspecting item {0} {1}", item.Name, item.ID);
if (item.Name == components[0])
return item;
}

View File

@ -63,13 +63,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
}
/// <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>
// Commenting for now! The mock inventory service needs more beef, at least for
// GetFolderForType
// REFACTORING PROBLEM. This needs to be rewritten.
[Test]
public void TestSaveIarV0_1()
public void TestSavePathToIarV0_1()
{
TestHelper.InMethod();
// 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.
}
/// <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>
/// 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.

View File

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

View File

@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return ret;
}
// DO NOT OVERRIDE THIS METHOD
// DO NOT OVERRIDE THE BASE METHOD
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
SceneObjectGroup objectGroup, IClientAPI remoteClient)
{
@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (!assetID.Equals(UUID.Zero))
{
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
if (remoteClient != null)
UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
}
else
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);
}
#endregion
public bool IsForeignUser(UUID userID, out string assetServerURL)
public override bool IsForeignUser(UUID userID, out string assetServerURL)
{
assetServerURL = string.Empty;
UserAccount account = null;
@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
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
#region Misc
@ -661,6 +712,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
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
}
}

View File

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

View File

@ -233,6 +233,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return m_GridService.GetFallbackRegions(scopeID, x, y);
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
return m_GridService.GetHyperlinks(scopeID);
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
return m_GridService.GetRegionFlags(scopeID, regionID);

View File

@ -136,6 +136,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
}
}
}

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)
@ -223,10 +220,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (m_InventoryURLs.ContainsKey(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
@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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);
@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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);
@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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);
@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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);
@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null)
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);
@ -331,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null)
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);
@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folderIDs.Count == 0)
return false;
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
//m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID);
@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null)
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);
@ -384,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == null)
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);
@ -401,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (item == null)
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);
@ -418,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (item == null)
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);
@ -437,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (items.Count == 0)
return true;
m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
//m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID);
@ -451,15 +451,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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)
return false;
if (itemIDs.Count == 0)
return true;
m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID);
string invURL = GetInventoryServiceURL(ownerID);
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)
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);
@ -491,7 +489,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (folder == 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);
@ -515,7 +513,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
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);

View File

@ -805,7 +805,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
imgstream = new MemoryStream();
// 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
if (OpenJPEG.DecodeToImage(mapasset.Data, out managedImage, out image))

View File

@ -258,21 +258,16 @@ namespace OpenSim.Region.DataSnapshot
private String GetRegionCategory(Scene scene)
{
//Boolean choice between:
// "PG" - Mormontown
// "Mature" - Sodom and Gomorrah
if (scene.RegionInfo.RegionSettings.Maturity == 1)
{
return "Mature";
}
else if (scene.RegionInfo.RegionSettings.Maturity == 0)
{
if (scene.RegionInfo.RegionSettings.Maturity == 0)
return "PG";
}
else
{
return "Unknown";
}
if (scene.RegionInfo.RegionSettings.Maturity == 1)
return "Mature";
if (scene.RegionInfo.RegionSettings.Maturity == 2)
return "Adult";
return "Unknown";
}
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,
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment);
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)
{
// First, make sore base is limited to the next perms
itemCopy.BasePermissions = item.BasePermissions & (item.NextPermissions | (uint)PermissionMask.Move);
// By default, current equals base
itemCopy.CurrentPermissions = itemCopy.BasePermissions & item.CurrentPermissions;
// Trying to do this right this time. This is evil. If
// you believe in Good, go elsewhere. Vampires and other
// evil creatores only beyond this point. You have been
// warned.
// If this is an object, replace current perms
// with folded perms
// We're going to mask a lot of things by the next 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)
{
itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
// Create a safe mask for the current perms
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
itemCopy.CurrentPermissions &= (item.NextPermissions | (uint)PermissionMask.Move);
// These will be applied to the root prim at next rez.
// 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
itemCopy.CurrentPermissions |= 8;
// Mask the base permissions. This is a conservative
// 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.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;
}
else
{
@ -839,6 +915,9 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectGroup group = part.ParentGroup;
if (group != null)
{
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
if (item == null)
return;
@ -978,9 +1057,21 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
// Only owner can copy
if (remoteClient.AgentId != taskItem.OwnerID)
return;
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
{
// 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);
}
@ -1263,10 +1354,48 @@ namespace OpenSim.Region.Framework.Scenes
{
agentTransactions.HandleTaskItemUpdateFromTransaction(
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))
{
remoteClient.SendAgentAlertMessage("Notecard saved", false);
part.GetProperties(remoteClient);
}
}
@ -1597,7 +1726,7 @@ namespace OpenSim.Region.Framework.Scenes
}
// Handle god perms
if (Permissions.IsGod(remoteClient.AgentId))
if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
{
permissionToTake = true;
permissionToTakeCopy = true;
@ -1608,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes
if (action == DeRezAction.SaveToExistingUserInventoryItem)
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
// becomes irrelevant. It already includes the permissionToTake
// permission and after excluding no copy items here, we can
@ -1619,6 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes
if (!permissionToTakeCopy)
return;
permissionToTake = true;
// Don't delete
permissionToDelete = false;
}

View File

@ -136,6 +136,7 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneCommunicationService m_sceneGridService;
public bool LoginsDisabled = true;
public bool LoadingPrims = false;
public new float TimeDilation
{
@ -1879,6 +1880,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public virtual void LoadPrimsFromStorage(UUID regionID)
{
LoadingPrims = true;
m_log.Info("[SCENE]: Loading objects from datastore");
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)");
LoadingPrims = false;
}
@ -2725,7 +2728,9 @@ namespace OpenSim.Region.Framework.Scenes
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
if (userVerification != null && ep != null)
{
if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address);
if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
{
// uh-oh, this is fishy
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);

View File

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

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)
|| 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);
}
@ -1999,8 +1999,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void ScheduleGroupForFullUpdate()
{
if (IsAttachment)
m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
// if (IsAttachment)
// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
checkAtTargets();
RootPart.ScheduleFullUpdate();

View File

@ -4137,6 +4137,13 @@ namespace OpenSim.Region.Framework.Scenes
case 16:
_nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) &
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;
}
SendFullUpdateToAllClients();

View File

@ -118,20 +118,20 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="linkNum">Link number for the part</param>
public void ResetInventoryIDs()
{
lock (Items)
lock (m_items)
{
if (0 == Items.Count)
if (0 == m_items.Count)
return;
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
Items.Clear();
IList<TaskInventoryItem> items = GetInventoryItems();
m_items.Clear();
foreach (TaskInventoryItem item in items)
{
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;
}
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
foreach (TaskInventoryItem item in items)
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
List<TaskInventoryItem> items = GetInventoryItems();
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;
}
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
foreach (TaskInventoryItem item in items)
{
if (groupID != item.GroupID)
{
item.GroupID = groupID;
}
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items)
{
if (groupID != item.GroupID)
item.GroupID = groupID;
}
}
@ -194,17 +192,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
{
lock (m_items)
{
foreach (TaskInventoryItem item in Items.Values)
{
if ((int)InventoryType.LSL == item.InvType)
{
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
Thread.Sleep(10); // workaround for Mono cpu utilization > 100% bug
}
}
}
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
}
public ArrayList GetScriptErrors(UUID itemID)
@ -218,7 +208,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (IScriptModule e in engines)
{
if (e != null)
{
{
ArrayList errors = e.GetScriptErrors(itemID);
foreach (Object line in errors)
ret.Add(line);
@ -237,16 +227,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
{
lock (Items)
{
foreach (TaskInventoryItem item in Items.Values)
{
if ((int)InventoryType.LSL == item.InvType)
{
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
}
}
}
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
}
/// <summary>
@ -259,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.InfoFormat(
// "[PRIM INVENTORY]: " +
// "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))
return;
@ -295,20 +278,20 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
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].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;
}
foreach (IScriptModule e in engines)
{
if (e != null)
{
// Stop an exception in setting saved state from propogating since this is not fatal.
try
{
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);
}
if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID]))
break;
}
}
m_part.ParentGroup.m_savedScriptState.Remove(oldID);
}
}
@ -388,21 +359,15 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
lock (m_items)
{
if (m_items.ContainsKey(itemId))
{
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
}
else
{
m_log.ErrorFormat(
"[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);
}
}
TaskInventoryItem item = GetInventoryItem(itemId);
if (item != null)
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
else
m_log.ErrorFormat(
"[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>
@ -443,16 +408,18 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Check if the inventory holds an item with a given name.
/// This method assumes that the task inventory is already locked.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
private bool InventoryContainsName(string name)
{
foreach (TaskInventoryItem item in Items.Values)
lock (m_items)
{
if (item.Name == name)
return true;
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Name == name)
return true;
}
}
return false;
}
@ -495,12 +462,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{
List<TaskInventoryItem> il;
lock (m_items)
{
il = new List<TaskInventoryItem>(m_items.Values);
}
List<TaskInventoryItem> il = GetInventoryItems();
foreach (TaskInventoryItem i in il)
{
@ -540,14 +502,12 @@ namespace OpenSim.Region.Framework.Scenes
item.GroupID = m_part.GroupID;
lock (m_items)
{
m_items.Add(item.ItemID, item);
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
m_inventorySerial++;
//m_inventorySerial += 2;
@ -571,9 +531,8 @@ namespace OpenSim.Region.Framework.Scenes
m_items.Add(item.ItemID, item);
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_inventorySerial++;
}
m_inventorySerial++;
}
/// <summary>
@ -628,45 +587,44 @@ namespace OpenSim.Region.Framework.Scenes
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))
{
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);
}
m_items[item.ItemID] = item;
m_inventorySerial++;
}
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>
@ -677,52 +635,37 @@ namespace OpenSim.Region.Framework.Scenes
/// in this prim's inventory.</returns>
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;
if (type == 10) // Script
{
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_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;
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;
@ -776,52 +719,50 @@ namespace OpenSim.Region.Framework.Scenes
// isn't available (such as drag from prim inventory to agent inventory)
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;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
UUID ownerID = item.OwnerID;
uint everyoneMask = 0;
uint baseMask = item.BasePermissions;
uint ownerMask = item.CurrentPermissions;
uint groupMask = item.GroupPermissions;
invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString());
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
invString.AddItemStart();
invString.AddNameValueLine("item_id", item.ItemID.ToString());
invString.AddNameValueLine("parent_id", m_part.UUID.ToString());
invString.AddPermissionsStart();
invString.AddPermissionsStart();
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("base_mask", Utils.UIntToHexString(baseMask));
invString.AddNameValueLine("owner_mask", Utils.UIntToHexString(ownerMask));
invString.AddNameValueLine("group_mask", Utils.UIntToHexString(groupMask));
invString.AddNameValueLine("everyone_mask", Utils.UIntToHexString(everyoneMask));
invString.AddNameValueLine("next_owner_mask", Utils.UIntToHexString(item.NextPermissions));
invString.AddNameValueLine("creator_id", item.CreatorID.ToString());
invString.AddNameValueLine("owner_id", ownerID.ToString());
invString.AddNameValueLine("creator_id", item.CreatorID.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.AddSectionEnd();
invString.AddNameValueLine("group_id", item.GroupID.ToString());
invString.AddSectionEnd();
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
invString.AddSaleStart();
invString.AddNameValueLine("sale_type", "not");
invString.AddNameValueLine("sale_price", "0");
invString.AddSectionEnd();
invString.AddSaleStart();
invString.AddNameValueLine("sale_type", "not");
invString.AddNameValueLine("sale_price", "0");
invString.AddSectionEnd();
invString.AddNameValueLine("name", item.Name + "|");
invString.AddNameValueLine("desc", item.Description + "|");
invString.AddNameValueLine("name", item.Name + "|");
invString.AddNameValueLine("desc", item.Description + "|");
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
invString.AddSectionEnd();
}
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
invString.AddSectionEnd();
}
fileData = Utils.StringToBytes(invString.BuildString);
@ -843,12 +784,10 @@ namespace OpenSim.Region.Framework.Scenes
{
if (HasInventoryChanged)
{
lock (Items)
{
datastore.StorePrimInventory(m_part.UUID, Items.Values);
}
HasInventoryChanged = false;
List<TaskInventoryItem> items = GetInventoryItems();
datastore.StorePrimInventory(m_part.UUID, items);
}
}
@ -1014,6 +953,30 @@ namespace OpenSim.Region.Framework.Scenes
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()
{
@ -1023,35 +986,20 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null) // No engine at all
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)
{
// Stop any exception from the script engine from propogating since setting state
// 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);
}
}
if (!ret.ContainsKey(item.ItemID))
ret[item.ItemID] = n;
break;
}
}
}
@ -1066,25 +1014,22 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null)
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 (engine != null)
{
if (item.OwnerChanged)
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
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

@ -930,7 +930,12 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void MakeChildAgent()
{
Animator.ResetAnimations();
// It looks like m_animator is set to null somewhere, and MakeChild
// is called after that. Probably in aborted teleports.
if (m_animator == null)
m_animator = new ScenePresenceAnimator(this);
else
Animator.ResetAnimations();
// m_log.DebugFormat(
// "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}",

View File

@ -451,12 +451,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Vector llVecNorm(LSL_Vector v)
{
m_host.AddScriptLPS(1);
double mag = LSL_Vector.Mag(v);
LSL_Vector nor = new LSL_Vector();
nor.x = v.x / mag;
nor.y = v.y / mag;
nor.z = v.z / mag;
return nor;
return LSL_Vector.Norm(v);
}
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
// Utility function for llRot2Euler
// 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
// Old implementation of llRot2Euler. Normalization not required as Atan2 function will
// only return values >= -PI (-180 degrees) and <= PI (180 degrees).
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 p = m * m - n * n;
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))),
NormalizeAngle(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))));
return new LSL_Vector(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)),
Math.Atan2(n, Math.Sqrt(p)),
Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)));
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
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:
@ -1953,13 +1934,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
else
{
if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f)
{
part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z);
SceneObjectGroup parent = part.ParentGroup;
parent.HasGroupChanged = true;
parent.ScheduleGroupForTerseUpdate();
}
LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos);
part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z);
SceneObjectGroup parent = part.ParentGroup;
parent.HasGroupChanged = true;
parent.ScheduleGroupForTerseUpdate();
}
}
@ -4950,7 +4929,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case ',':
if (parens == 0)
{
result.Add(src.Substring(start,length).Trim());
result.Add(new LSL_String(src.Substring(start,length).Trim()));
start += length+1;
length = 0;
}
@ -5879,6 +5858,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
PSYS_PART_MAX_AGE = 7,
PSYS_SRC_ACCEL = 8,
PSYS_SRC_PATTERN = 9,
PSYS_SRC_INNERANGLE = 10,
PSYS_SRC_OUTERANGLE = 11,
PSYS_SRC_TEXTURE = 12,
PSYS_SRC_BURST_RATE = 13,
PSYS_SRC_BURST_PART_COUNT = 15,
@ -6011,6 +5992,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
prules.Pattern = (Primitive.ParticleSystem.SourcePattern)tmpi;
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:
prules.Texture = KeyOrName(rules.GetLSLStringItem(i + 1));
break;
@ -6067,11 +6064,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_BEGIN:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.InnerAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
case (int)ScriptBaseClass.PSYS_SRC_ANGLE_END:
tempf = (float)rules.GetLSLFloatItem(i + 1);
prules.OuterAngle = (float)tempf;
prules.PartFlags |= 0x02; // Set new angle format.
break;
}

View File

@ -262,7 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
public static Vector3 Norm(Vector3 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
@ -663,13 +668,13 @@ namespace OpenSim.Region.ScriptEngine.Shared
Object[] ret;
if (start < 0)
start=m_data.Length-start;
start=m_data.Length+start;
if (start < 0)
start=0;
if (end < 0)
end=m_data.Length-end;
end=m_data.Length+end;
if (end < 0)
end=0;

View File

@ -488,6 +488,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (stateSource == (int)StateSource.ScriptedRez)
{
lock (m_CompileDict)
{
m_CompileDict[itemID] = 0;
}
DoOnRezScript(parms);
}
else
@ -696,9 +701,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
}
ScriptInstance instance = null;
lock (m_Scripts)
{
ScriptInstance instance = null;
// Create the object record
if ((!m_Scripts.ContainsKey(itemID)) ||
@ -765,8 +770,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
item.Name, startParam, postOnRez,
stateSource, m_MaxScriptQueue);
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
m_log.DebugFormat(
"[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID,
part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
if (presence != null)
{
@ -779,28 +786,29 @@ namespace OpenSim.Region.ScriptEngine.XEngine
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;
}
@ -813,60 +821,60 @@ namespace OpenSim.Region.ScriptEngine.XEngine
m_CompileDict.Remove(itemID);
}
IScriptInstance instance = null;
lock (m_Scripts)
{
// Do we even have it?
if (!m_Scripts.ContainsKey(itemID))
return;
IScriptInstance instance=m_Scripts[itemID];
instance=m_Scripts[itemID];
m_Scripts.Remove(itemID);
}
instance.ClearQueue();
instance.Stop(0);
instance.ClearQueue();
instance.Stop(0);
// 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
if (m_PrimObjects.ContainsKey(localID))
{
// Remove inventory item record
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 (m_PrimObjects[localID].Count == 0)
{
m_PrimObjects.Remove(localID);
// If there are no more scripts, remove prim
if (m_PrimObjects[localID].Count == 0)
{
m_PrimObjects.Remove(localID);
// 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;
if (handlerScriptRemoved != null)
handlerScriptRemoved(itemID);
@ -1000,26 +1008,33 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public bool PostObjectEvent(uint localID, EventParams p)
{
bool result = false;
List<UUID> uuids = null;
lock (m_PrimObjects)
{
if (!m_PrimObjects.ContainsKey(localID))
return false;
foreach (UUID itemID in m_PrimObjects[localID])
uuids = m_PrimObjects[localID];
}
foreach (UUID itemID in uuids)
{
IScriptInstance instance = null;
try
{
if (m_Scripts.ContainsKey(itemID))
{
IScriptInstance instance = m_Scripts[itemID];
if (instance != null)
{
instance.PostEvent(p);
result = true;
}
}
instance = m_Scripts[itemID];
}
catch { /* ignore race conditions */ }
if (instance != null)
{
instance.PostEvent(p);
result = true;
}
}
return result;
}
@ -1274,9 +1289,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
string xml = instance.GetXMLState();
XmlDocument sdoc = new XmlDocument();
sdoc.LoadXml(xml);
XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState");
XmlNode rootNode = rootL[0];
bool loadedState = true;
try
{
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">
XmlDocument doc = new XmlDocument();
@ -1292,8 +1321,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine
stateData.Attributes.Append(engineName);
doc.AppendChild(stateData);
XmlNode xmlstate = null;
// Add <ScriptState>...</ScriptState>
XmlNode xmlstate = doc.ImportNode(rootNode, true);
if (loadedState)
{
xmlstate = doc.ImportNode(rootNode, true);
}
else
{
xmlstate = doc.CreateElement("", "ScriptState", "");
}
stateData.AppendChild(xmlstate);
string assemName = instance.GetAssemblyName();

View File

@ -109,6 +109,9 @@ namespace OpenSim.Server.Handlers.Grid
case "get_fallback_regions":
return GetFallbackRegions(request);
case "get_hyperlinks":
return GetHyperlinks(request);
case "get_region_flags":
return GetRegionFlags(request);
}
@ -483,6 +486,36 @@ namespace OpenSim.Server.Handlers.Grid
return encoding.GetBytes(xmlString);
}
byte[] GetHyperlinks(Dictionary<string, object> request)
{
//m_log.DebugFormat("[GRID HANDLER]: GetHyperlinks");
UUID scopeID = UUID.Zero;
if (request.ContainsKey("SCOPEID"))
UUID.TryParse(request["SCOPEID"].ToString(), out scopeID);
else
m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get linked regions");
List<GridRegion> rinfos = m_GridService.GetHyperlinks(scopeID);
Dictionary<string, object> result = new Dictionary<string, object>();
if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0)))
result["result"] = "null";
else
{
int i = 0;
foreach (GridRegion rinfo in rinfos)
{
Dictionary<string, object> rinfoDict = rinfo.ToKeyValuePairs();
result["region" + i] = rinfoDict;
i++;
}
}
string xmlString = ServerUtils.BuildXmlResponse(result);
//m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
byte[] GetRegionFlags(Dictionary<string, object> request)
{
UUID scopeID = UUID.Zero;

View File

@ -283,6 +283,10 @@ namespace OpenSim.Server.Handlers.Simulation
if (m_SimulationService == null)
{
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;
}

View File

@ -556,6 +556,56 @@ namespace OpenSim.Services.Connectors
return rinfos;
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
sendData["SCOPEID"] = scopeID.ToString();
sendData["METHOD"] = "get_hyperlinks";
List<GridRegion> rinfos = new List<GridRegion>();
string reply = string.Empty;
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/grid",
ServerUtils.BuildQueryString(sendData));
//m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
}
catch (Exception e)
{
m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
return rinfos;
}
if (reply != string.Empty)
{
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
if (replyData != null)
{
Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
foreach (object r in rinfosList)
{
if (r is Dictionary<string, object>)
{
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
rinfos.Add(rinfo);
}
}
}
else
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
scopeID);
}
else
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
return rinfos;
}
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();

View File

@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
private bool GetBoolResponse(XmlRpcRequest request, out string reason)
{
//m_log.Debug("[HGrid]: Linking to " + uri);
//m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL);
XmlRpcResponse response = null;
try
{
@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid
}
catch (Exception e)
{
m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server ");
m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL);
reason = "Exception: " + e.Message;
return false;
}
if (response.IsFault)
{
m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString);
reason = "XMLRPC Fault";
return false;
}
@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid
// m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
try
{
if (hash == null)
{
m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL);
reason = "Internal error 1";
return false;
}
bool success = false;
reason = string.Empty;
Boolean.TryParse((string)hash["result"], out success);
if (hash.ContainsKey("result"))
Boolean.TryParse((string)hash["result"], out success);
else
{
reason = "Internal error 2";
m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL);
}
return success;
}
catch (Exception e)
{
m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace);
m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response.");
if (hash.ContainsKey("result") && hash["result"] != null)
m_log.ErrorFormat("Reply was ", (string)hash["result"]);
reason = "Exception: " + e.Message;
return false;
}

View File

@ -357,6 +357,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
return new List<GridRegion>(0);
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
// Hypergrid/linked regions are not supported
return new List<GridRegion>();
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
const int REGION_ONLINE = 4;

View File

@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public void Initialise(IConfigSource source)
{
if (Simian.IsSimianEnabled(source, "UserAccountServices", this.Name))
if (Simian.IsSimianEnabled(source, "UserAccountServices", "SimianUserAccountServiceConnector"))
{
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig == null)
@ -108,6 +108,23 @@ namespace OpenSim.Services.Connectors.SimianGrid
serviceUrl = 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
client.OnRequestAvatarProperties += RequestAvatarPropertiesHandler;
client.OnUpdateAvatarProperties += UpdateAvatarPropertiesHandler;
client.OnAvatarInterestUpdate += AvatarInterestUpdateHandler;
client.OnUserInfoRequest += UserInfoRequestHandler;
@ -302,12 +320,25 @@ namespace OpenSim.Services.Connectors.SimianGrid
System.Globalization.CultureInfo.InvariantCulture), charterMember, about["FLAbout"].AsString(), (uint)flags,
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
{
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,
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

@ -50,7 +50,7 @@ namespace OpenSim.Services.GridService
private bool m_DeleteOnUnregister = true;
private static GridService m_RootInstance = null;
protected IConfigSource m_config;
protected HypergridLinker m_HypergridLinker;
protected static HypergridLinker m_HypergridLinker;
protected IAuthenticationService m_AuthenticationService = null;
protected bool m_AllowDuplicateNames = false;
@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService
{
// Regions reserved for the null key cannot be taken.
if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString())
return "Region location us reserved";
return "Region location is reserved";
// Treat it as an auth request
//
@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService
{
int newFlags = 0;
string regionName = rdata.RegionName.Trim().Replace(' ', '_');
newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty));
newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty));
newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty));
rdata.Data["flags"] = newFlags.ToString();
@ -278,7 +279,11 @@ namespace OpenSim.Services.GridService
foreach (RegionData rdata in rdatas)
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);
@ -421,6 +426,22 @@ namespace OpenSim.Services.GridService
return ret;
}
public List<GridRegion> GetHyperlinks(UUID scopeID)
{
List<GridRegion> ret = new List<GridRegion>();
List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
foreach (RegionData r in regions)
{
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
ret.Add(RegionData2RegionInfo(r));
}
m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
return ret;
}
public int GetRegionFlags(UUID scopeID, UUID regionID)
{
RegionData region = m_Database.Get(regionID, scopeID);

View File

@ -62,6 +62,7 @@ namespace OpenSim.Services.GridService
protected GatekeeperServiceConnector m_GatekeeperConnector;
protected UUID m_ScopeID = UUID.Zero;
protected bool m_Check4096 = true;
// Hyperlink regions are hyperlinks on the map
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
@ -116,6 +117,8 @@ namespace OpenSim.Services.GridService
if (scope != string.Empty)
UUID.TryParse(scope, out m_ScopeID);
m_Check4096 = gridConfig.GetBoolean("Check4096", true);
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
@ -277,7 +280,7 @@ namespace OpenSim.Services.GridService
}
uint x, y;
if (!Check4096(handle, out x, out y))
if (m_Check4096 && !Check4096(handle, out x, out y))
{
RemoveHyperlinkRegion(regInfo.RegionID);
reason = "Region is too far (" + x + ", " + y + ")";
@ -332,18 +335,50 @@ namespace OpenSim.Services.GridService
/// <returns></returns>
public bool Check4096(ulong realHandle, out uint x, out uint y)
{
GridRegion defRegion = DefaultRegion;
uint ux = 0, uy = 0;
Utils.LongToUInts(realHandle, out ux, out uy);
x = ux / Constants.RegionSize;
y = uy / Constants.RegionSize;
if ((Math.Abs((int)defRegion.RegionLocX - ux) >= 4096 * Constants.RegionSize) ||
(Math.Abs((int)defRegion.RegionLocY - uy) >= 4096 * Constants.RegionSize))
const uint limit = (4096 - 1) * Constants.RegionSize;
uint xmin = ux - limit;
uint xmax = ux + limit;
uint ymin = uy - limit;
uint ymax = uy + limit;
// World map boundary checks
if (xmin < 0 || xmin > ux)
xmin = 0;
if (xmax > int.MaxValue || xmax < ux)
xmax = int.MaxValue;
if (ymin < 0 || ymin > uy)
ymin = 0;
if (ymax > int.MaxValue || ymax < uy)
ymax = int.MaxValue;
// Check for any regions that are within the possible teleport range to the linked region
List<GridRegion> regions = m_GridService.GetRegionRange(m_ScopeID, (int)xmin, (int)xmax, (int)ymin, (int)ymax);
if (regions.Count == 0)
{
return false;
}
else
{
// Check for regions which are not linked regions
List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
// would like to use .Except, but doesn't seem to exist
//IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
{
// Ewww! n^2
if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
return true;
return false;
});
if (availableRegions.Count == 0)
return false;
}
return true;
}
@ -378,32 +413,31 @@ namespace OpenSim.Services.GridService
public void HandleShow(string module, string[] cmd)
{
MainConsole.Instance.Output("Not Implemented Yet");
//if (cmd.Length != 2)
//{
// MainConsole.Instance.Output("Syntax: show hyperlinks");
// return;
//}
//List<GridRegion> regions = new List<GridRegion>(m_HypergridService.m_HyperlinkRegions.Values);
//if (regions == null || regions.Count < 1)
//{
// MainConsole.Instance.Output("No hyperlinks");
// return;
//}
if (cmd.Length != 2)
{
MainConsole.Instance.Output("Syntax: show hyperlinks");
return;
}
List<RegionData> regions = m_Database.GetHyperlinks(UUID.Zero);
if (regions == null || regions.Count < 1)
{
MainConsole.Instance.Output("No hyperlinks");
return;
}
//MainConsole.Instance.Output("Region Name Region UUID");
//MainConsole.Instance.Output("Location URI");
//MainConsole.Instance.Output("Owner ID ");
//MainConsole.Instance.Output("-------------------------------------------------------------------------------");
//foreach (GridRegion r in regions)
//{
// MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} \n\n",
// r.RegionName, r.RegionID,
// String.Format("{0},{1}", r.RegionLocX, r.RegionLocY), "http://" + r.ExternalHostName + ":" + r.HttpPort.ToString(),
// r.EstateOwner.ToString()));
//}
//return;
MainConsole.Instance.Output("Region Name Region UUID");
MainConsole.Instance.Output("Location URI");
MainConsole.Instance.Output("-------------------------------------------------------------------------------");
foreach (RegionData r in regions)
{
MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n",
r.RegionName, r.RegionID,
String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256),
"http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
}
return;
}
public void RunCommand(string module, string[] cmdparams)
{
List<string> args = new List<string>(cmdparams);

View File

@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
IGridService m_GridService;
IPresenceService m_PresenceService;
IUserAccountService m_UserAccountService;
IUserAgentService m_UserAgentService;
ISimulationService m_SimulationService;
private static bool m_Initialized = false;
string m_AuthDll;
private static IGridService m_GridService;
private static IPresenceService m_PresenceService;
private static IUserAccountService m_UserAccountService;
private static IUserAgentService m_UserAgentService;
private static ISimulationService m_SimulationService;
UUID m_ScopeID;
bool m_AllowTeleportsToAnyRegion;
string m_ExternalName;
GridRegion m_DefaultGatewayRegion;
private static UUID m_ScopeID;
private static bool m_AllowTeleportsToAnyRegion;
private static string m_ExternalName;
private static GridRegion m_DefaultGatewayRegion;
public GatekeeperService(IConfigSource config, ISimulationService simService)
{
IConfig serverConfig = config.Configs["GatekeeperService"];
if (serverConfig == null)
throw new Exception(String.Format("No section GatekeeperService in config file"));
if (!m_Initialized)
{
m_Initialized = true;
string accountService = serverConfig.GetString("UserAccountService", String.Empty);
string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty);
string gridService = serverConfig.GetString("GridService", String.Empty);
string presenceService = serverConfig.GetString("PresenceService", String.Empty);
string simulationService = serverConfig.GetString("SimulationService", String.Empty);
IConfig serverConfig = config.Configs["GatekeeperService"];
if (serverConfig == null)
throw new Exception(String.Format("No section GatekeeperService in config file"));
//m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty);
string accountService = serverConfig.GetString("UserAccountService", String.Empty);
string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty);
string gridService = serverConfig.GetString("GridService", String.Empty);
string presenceService = serverConfig.GetString("PresenceService", String.Empty);
string simulationService = serverConfig.GetString("SimulationService", String.Empty);
// These 3 are mandatory, the others aren't
if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty)
throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString());
UUID.TryParse(scope, out m_ScopeID);
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
// These 3 are mandatory, the others aren't
if (gridService == string.Empty || presenceService == string.Empty)
throw new Exception("Incomplete specifications, Gatekeeper Service cannot function.");
string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString());
UUID.TryParse(scope, out m_ScopeID);
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
m_ExternalName = serverConfig.GetString("ExternalName", string.Empty);
Object[] args = new Object[] { config };
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
Object[] args = new Object[] { config };
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args);
if (accountService != string.Empty)
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
if (homeUsersService != string.Empty)
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
if (accountService != string.Empty)
m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args);
if (homeUsersService != string.Empty)
m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args);
if (simService != null)
m_SimulationService = simService;
else if (simulationService != string.Empty)
m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
if (simService != null)
m_SimulationService = simService;
else if (simulationService != string.Empty)
m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args);
if (m_GridService == null || m_PresenceService == null || m_SimulationService == null)
throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function.");
if (m_GridService == null || m_PresenceService == null || m_SimulationService == null)
throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function.");
m_log.Debug("[GATEKEEPER SERVICE]: Starting...");
m_log.Debug("[GATEKEEPER SERVICE]: Starting...");
}
}
public GatekeeperService(IConfigSource config)
@ -280,18 +283,23 @@ namespace OpenSim.Services.HypergridService
return false;
}
Object[] args = new Object[] { userURL };
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args);
if (userAgentService != null)
if (userURL == m_ExternalName)
return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
else
{
try
Object[] args = new Object[] { userURL };
IUserAgentService userAgentService = new UserAgentServiceConnector(userURL);
if (userAgentService != null)
{
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
}
catch
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
return false;
try
{
return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID);
}
catch
{
m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL);
return false;
}
}
}

View File

@ -62,11 +62,18 @@ namespace OpenSim.Services.HypergridService
protected static IGridUserService m_GridUserService;
protected static IGridService m_GridService;
protected static GatekeeperServiceConnector m_GatekeeperConnector;
protected static IGatekeeperService m_GatekeeperService;
protected static string m_GridName;
protected static bool m_BypassClientVerification;
public UserAgentService(IConfigSource config)
{
if (!m_Initialized)
{
m_Initialized = true;
m_log.DebugFormat("[HOME USERS SECURITY]: Starting...");
IConfig serverConfig = config.Configs["UserAgentService"];
@ -75,16 +82,25 @@ namespace OpenSim.Services.HypergridService
string gridService = serverConfig.GetString("GridService", String.Empty);
string gridUserService = serverConfig.GetString("GridUserService", String.Empty);
string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty);
if (gridService == string.Empty || gridUserService == string.Empty)
m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false);
if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty)
throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function."));
Object[] args = new Object[] { config };
m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args);
m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args);
m_GatekeeperConnector = new GatekeeperServiceConnector();
m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args);
m_Initialized = true;
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
if (m_GridName == string.Empty)
{
serverConfig = config.Configs["GatekeeperService"];
m_GridName = serverConfig.GetString("ExternalName", string.Empty);
}
}
}
@ -131,7 +147,13 @@ namespace OpenSim.Services.HypergridService
agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random();
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
//bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
bool success = false;
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
if (m_GridName == gridName)
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
else
success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
if (!success)
{
@ -171,7 +193,7 @@ namespace OpenSim.Services.HypergridService
m_TravelingAgents[agentCircuit.SessionID] = travel;
}
travel.UserID = agentCircuit.AgentID;
travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort;
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
travel.ServiceToken = agentCircuit.ServiceSessionID;
if (old != null)
travel.ClientToken = old.ClientToken;
@ -207,16 +229,16 @@ namespace OpenSim.Services.HypergridService
return false;
TravelingAgentInfo travel = m_TravelingAgents[sessionID];
return travel.GridExternalName == thisGridExternalName;
}
public bool VerifyClient(UUID sessionID, string token)
{
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
//return true;
if (m_BypassClientVerification)
return true;
// Commenting this for now until I understand better what part of a sender's
// info stays unchanged throughout a session
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
if (m_TravelingAgents.ContainsKey(sessionID))
return m_TravelingAgents[sessionID].ClientToken == token;

View File

@ -92,6 +92,7 @@ namespace OpenSim.Services.Interfaces
List<GridRegion> GetDefaultRegions(UUID scopeID);
List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y);
List<GridRegion> GetHyperlinks(UUID scopeID);
int GetRegionFlags(UUID scopeID, UUID regionID);
}

View File

@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
MethodBase.GetCurrentMethod().DeclaringType);
protected IXInventoryData m_Database;
protected bool m_AllowDelete = true;
public XInventoryService(IConfigSource config) : base(config)
{
@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
{
dllName = authConfig.GetString("StorageProvider", dllName);
connString = authConfig.GetString("ConnectionString", connString);
m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
// realm = authConfig.GetString("Realm", realm);
}
@ -259,13 +261,15 @@ namespace OpenSim.Services.InventoryService
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 ...
//
List<InventoryItemBase> invItems = new List<InventoryItemBase>();
XInventoryItem[] items = m_Database.GetItems(
new string[] { "parentFolderID"},
new string[] { UUID.Zero.ToString() });
new string[] { "parentFolderID" },
new string[] { folderID.ToString() });
foreach (XInventoryItem i in items)
invItems.Add(ConvertToOpenSim(i));
@ -302,10 +306,15 @@ namespace OpenSim.Services.InventoryService
//
public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
{
if (!m_AllowDelete)
return false;
// Ignore principal ID, it's bogus at connector level
//
foreach (UUID id in folderIDs)
{
if (!ParentIsTrash(id))
continue;
InventoryFolderBase f = new InventoryFolderBase();
f.ID = id;
PurgeFolder(f);
@ -317,6 +326,12 @@ namespace OpenSim.Services.InventoryService
public virtual bool PurgeFolder(InventoryFolderBase folder)
{
if (!m_AllowDelete)
return false;
if (!ParentIsTrash(folder.ID))
return false;
XInventoryFolder[] subFolders = m_Database.GetFolders(
new string[] { "parentFolderID" },
new string[] { folder.ID.ToString() });
@ -356,6 +371,9 @@ namespace OpenSim.Services.InventoryService
public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs)
{
if (!m_AllowDelete)
return false;
// Just use the ID... *facepalms*
//
foreach (UUID id in itemIDs)
@ -517,5 +535,29 @@ namespace OpenSim.Services.InventoryService
return newItem;
}
private bool ParentIsTrash(UUID folderID)
{
XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()});
if (folder.Length < 1)
return false;
UUID parentFolder = folder[0].parentFolderID;
while (parentFolder != UUID.Zero)
{
XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
if (parent.Length < 1)
return false;
if (parent[0].type == (int)AssetType.TrashFolder)
return true;
if (parent[0].type == (int)AssetType.RootFolder)
return false;
parentFolder = parent[0].parentFolderID;
}
return false;
}
}
}

View File

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

View File

@ -73,6 +73,8 @@ namespace OpenSim.Services.LLLoginService
protected int m_MinLoginLevel;
protected string m_GatekeeperURL;
protected bool m_AllowRemoteSetLoginLevel;
protected string m_MapTileURL;
protected string m_SearchURL;
IConfig m_LoginServerConfig;
@ -100,6 +102,8 @@ namespace OpenSim.Services.LLLoginService
m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty);
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty);
// These are required; the others aren't
if (accountService == string.Empty || authService == string.Empty)
@ -356,7 +360,7 @@ namespace OpenSim.Services.LLLoginService
// Finally, fill out the response and return it
//
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_SearchURL);
m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client.");
return response;
@ -752,10 +756,8 @@ namespace OpenSim.Services.LLLoginService
m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
{
// We may need to do this at some point,
// so leaving it here in comments.
//IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address);
m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */);
return true;
}
return false;

View File

@ -241,36 +241,6 @@ namespace OpenSim.Tools.Configger
config.Set("EventQueue", true);
}
{
IConfig config = defaultConfig.Configs["StandAlone"];
if (null == config)
config = defaultConfig.AddConfig("StandAlone");
config.Set("accounts_authenticate", true);
config.Set("welcome_message", "Welcome to OpenSimulator");
config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll");
config.Set("inventory_source", "");
config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll");
config.Set("user_source", "");
config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar));
}
{
IConfig config = defaultConfig.Configs["Network"];
if (null == config)
config = defaultConfig.AddConfig("Network");
config.Set("default_location_x", 1000);
config.Set("default_location_y", 1000);
config.Set("grid_send_key", "null");
config.Set("grid_recv_key", "null");
config.Set("user_send_key", "null");
config.Set("user_recv_key", "null");
config.Set("secure_inventory_server", "true");
}
return defaultConfig;
}

Binary file not shown.

View File

@ -128,7 +128,7 @@
; -->>> There are multiple connection strings defined in several places. Check it carefully!
;
; 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
; 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=*****;";
@ -288,9 +288,6 @@
; if not defined - default machine name is being used
; (on Windows this mean NETBIOS name - useably only inside local network)
; ExternalHostNameForLSL=127.0.0.1
; Uncomment below to enable llRemoteData/remote channels
; remoteDataPort = 20800
; What is reported as the "X-Secondlife-Shard"
; Defaults to the user server url if not set
@ -1303,12 +1300,3 @@
;XmlRpcRouterModule = "XmlRpcRouterModule"
;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]
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
; * server instance, if none if specified above
@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[DatabaseService]
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
; * asset server. It is read by the asset IN connector (defined above)
@ -54,6 +54,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
Realm = "regions"
; AllowDuplicateNames = "True"
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>"
@ -207,6 +209,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
;; for the service
GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
GridService = "OpenSim.Services.GridService.dll:GridService"
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
;; The interface that local users get when they are in other grids.
;; This restricts the inventory operations while in other grids.

View File

@ -28,7 +28,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[DatabaseService]
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
@ -134,6 +134,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
WelcomeMessage = "Welcome, Avatar!"
AllowRemoteSetLoginLevel = "false"
; For snowglobe's web map
; MapTileURL = "";
[GridInfoService]
; These settings are used to return information on a get_grid_info call.

View File

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

View File

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

View File

@ -20,6 +20,7 @@
LibraryModule = true
LLLoginServiceInConnector = true
GridInfoServiceInConnector = true
[AssetService]
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"

View File

@ -17,7 +17,7 @@
; Uncomment these lines if you want to use mysql storage
; Change the connection string to your db details
;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]
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
@ -48,6 +48,9 @@
;;--- For MySql region storage (alternative)
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
; If HG, do you want this check on the distance to be performed?
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegioName> = "<flags>"
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
@ -73,3 +76,47 @@
; If false, HG TPs happen only to the Default regions specified in [GridService] section
AllowTeleportsToAnyRegion = true
[GridInfoService]
; These settings are used to return information on a get_grid_info call.
; Client launcher scripts and third-party clients make use of this to
; autoconfigure the client and to provide a nice user experience. If you
; want to facilitate that, you should configure the settings here according
; to your grid or standalone setup.
;
; See http://opensimulator.org/wiki/GridInfo
; login uri: for grid this is the login server URI
login = http://127.0.0.1:9000/
; long grid name: the long name of your grid
gridname = "the lost continent of hippo"
; short grid name: the short name of your grid
gridnick = "hippogrid"
; login page: optional: if it exists it will be used to tell the client to use
; this as splash page
; currently unused
;welcome = http://127.0.0.1/welcome
; helper uri: optional: if it exists if will be used to tell the client to use
; this for all economy related things
; currently unused
;economy = http://127.0.0.1:9000/
; web page of grid: optional: page providing further information about your grid
; currently unused
;about = http://127.0.0.1/about/
; account creation: optional: page providing further information about obtaining
; a user account on your grid
; currently unused
;register = http://127.0.0.1/register
; help: optional: page providing further assistance for users of your grid
; currently unused
;help = http://127.0.0.1/help
; password help: optional: page providing password assistance for users of your grid
; currently unused
;password = http://127.0.0.1/password

View File

@ -3,7 +3,10 @@
;; All optional settings are in StandaloneCommon.ini.example,
;; which you can copy and change.
;;
[Startup]
WorldMapModule = "HGWorldMap"
[Modules]
AssetServices = "HGAssetBroker"
InventoryServices = "HGInventoryBroker"
@ -24,6 +27,7 @@
NeighbourServiceInConnector = true
LibraryModule = true
LLLoginServiceInConnector = true
GridInfoServiceInConnector = true
AuthenticationServiceInConnector = true
SimulationServiceInConnector = true
@ -111,6 +115,8 @@
;; for the service
GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService"
GridService = "OpenSim.Services.GridService.dll:GridService"
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
;; The interface that local users get when they are in other grids
;; This greatly restricts the inventory operations while in other grids