Compare commits

...

558 Commits

Author SHA1 Message Date
Melanie
e321306517 Prevent object loss and positioning outside the region with failed object sim
crossings
2012-02-14 00:02:53 +01:00
Melanie
acfe7e555e Merge branch 'master' into careminster 2012-02-10 23:59:10 +00:00
Melanie
5023cc86f0 Change parser to leave embedded quotes alone if the pattern is recognized
as an OptionSet long option
2012-02-10 23:58:39 +00:00
Melanie
4455140f30 Change parser to leave embedded quotes alone if the pattern is recognized
as an OptionSet long option
2012-02-10 23:52:06 +00:00
Justin Clark-Casey (justincc)
71e484516a minor: Remove warning from RegionInfo due to repeated config.GetString() call where the first was unused. 2012-02-10 23:41:14 +00:00
Justin Clark-Casey (justincc)
38f878952c Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-10 23:39:59 +00:00
Justin Clark-Casey (justincc)
d80422eba7 Add line numbers to Util.PrintCallStack() 2012-02-10 23:39:32 +00:00
BlueWall
ee078f717a Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-10 16:28:11 -05:00
BlueWall
73f34de1f9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-02-10 16:27:14 -05:00
Justin Clark-Casey (justincc)
b3d152f3ba Fix an npc delete race condition with LSL sensors where an initial presence check could succeed but then the npc removed before the subequent npc check.
The resulting null would cause an exception.  We now check for null before looking at SenseAsAgent.
Hopefully fixes http://opensimulator.org/mantis/view.php?id=5872
2012-02-10 21:26:05 +00:00
PixelTomsen
a7dc7e636e Fix: Covenant view fails after updates or cache-clean see mantis http://opensimulator.org/mantis/view.php?id=2879
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-02-10 15:45:03 -05:00
Justin Clark-Casey (justincc)
44d84bc277 Fix bug where somebody taking a copy of an object they didn't own that was rezzed before the region was restarted would wrongly place the copy in the object owner's inventory.
Addresses http://opensimulator.org/mantis/view.php?id=5825
2012-02-10 19:58:34 +00:00
Melanie
215acbcc96 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
	OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
2012-02-10 10:20:51 +00:00
PixelTomsen
7273e05995 Fix: Unable to remove AV from friend list (sqldb-bug) http://opensimulator.org/mantis/view.php?id=3731 2012-02-10 02:30:55 +00:00
Justin Clark-Casey (justincc)
ddca5347c3 When an asset is uploaded (e.g. a mesh) set individual copy/move/transfer permissions, not PermissionMask.All
Setting PermissionMask.All will cause next permissions to replace current permissions when the object is rezzed, since bit 4 will be set.
This is not correct behaviour for a freshly uploaded mesh.  Freshly rezzed in-world prims also do not have bit 4 set (don't yet know exactly what this is).
Should resolve http://opensimulator.org/mantis/view.php?id=5651
2012-02-10 02:13:15 +00:00
Justin Clark-Casey (justincc)
e8cc1bd329 Fix another Torture test build break on Windows. 2012-02-09 20:12:29 +00:00
Justin Clark-Casey (justincc)
9c84a8162f If NPCModule.CreateNPC() fails to create the required ScenePresence (which should in theory never happen), don't add the NPC to the npc list but return UUID.Zero instead. 2012-02-09 01:17:59 +00:00
Justin Clark-Casey (justincc)
16c4636048 Add NPC torture tests for 100, 1000 and 2000 create and delete NPC calls. 2012-02-09 00:38:09 +00:00
Melanie
7c888f6af1 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneGraph.cs
2012-02-09 00:19:37 +00:00
Justin Clark-Casey (justincc)
dbe32a1f6d minor: put in commented out logging statements for future reuse 2012-02-09 00:10:45 +00:00
Justin Clark-Casey (justincc)
3fa61c4a39 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-08 22:21:15 +00:00
Justin Clark-Casey (justincc)
dfa19e23f0 Stop a scene object from attempting to link with itself (which results in an exception and constant complaints in v3 viewers).
Aims to address http://opensimulator.org/mantis/view.php?id=5878
2012-02-08 22:19:34 +00:00
Melanie
9c6ba8d18f Push more NPC stuff into threads 2012-02-08 13:04:23 +01:00
Robert Adams
d5c08c44bf Add missing reference to prebuild.xml for torture tests 2012-02-07 16:40:09 -08:00
Justin Clark-Casey (justincc)
bef2a368f4 Make WebStats logging report consistently as WEB STATS MODULE instead of VC, VS and WEBSTATS 2012-02-07 23:38:53 +00:00
Melanie
236e1c45f2 Merge branch 'master' into careminster 2012-02-07 23:30:48 +00:00
Justin Clark-Casey (justincc)
a4367e75d3 Set UseMeshiesPhysicsMesh = true in [Mesh] by default
This means that uploaded meshes will get a physics (collision) mesh if uploaded with that option via a viewer.
2012-02-07 23:15:23 +00:00
Justin Clark-Casey (justincc)
c87751a822 Add start GC memory and end GC memory to object stress test printouts.
This illustrates that references to Scene, SOG, etc. are not currently being released when a stress test ends (or at regression test end in general).
This means even the current stress tests take much more memory than they need, a problem that will have to be addressed.
2012-02-07 23:03:53 +00:00
Justin Clark-Casey (justincc)
1f402fdf5e Add url to logging if SynchronousRestFormsRequester.MakRequest() throws an exception in service connectors 2012-02-07 21:40:28 +00:00
Justin Clark-Casey (justincc)
bd928218dd Add TestAddTaskInventoryItem() 2012-02-07 21:00:47 +00:00
Justin Clark-Casey (justincc)
773994723a Add warning about only uncommenting EstateConnectionString if you know what you're doing to GridCommon.ini.example (was already in StandaloneCommon.ini.example) 2012-02-07 20:35:04 +00:00
Justin Clark-Casey (justincc)
7583768b9e Remove debug logging if physics actor is null in SOP.ApplyPhysics()
This is not valid in the case of BasicPhysics which can return a null PhysicsActor (though I think it should really return a do-nothing PhysicsActor).
2012-02-07 20:26:26 +00:00
Melanie
de255321f1 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-02-07 20:52:04 +01:00
Melanie
37049180f6 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-02-07 21:09:04 +00:00
Justin Clark-Casey (justincc)
c22970448f Add TestCompileAndStart100Scripts() torture test. 2012-02-07 19:42:32 +00:00
Justin Clark-Casey (justincc)
038d1bf742 Add a regression test to compile and start a script. Remove Path.GetDirectoryName when getting assembly loading path in Compiler.CompileFromDotNetText().
The Path.GetDirectoryName call in Compiler.CompileFromDotNetText is unnecessary since AppDomain.CurrentDomain.BaseDirectory is always a directory.
Later path concatenation is already done by Path.Combine() which handles any trailing slash.
Removing Path.GetDirectoryName() will not affect the runtime but allows NUnit to work since it doesn't add a trailing slash to AppDomain.CurrentDomain.BaseDirectory.
2012-02-07 17:44:37 +00:00
Melanie
a829f20828 Experimental. Expand Fire & Forget for NPC delete 2012-02-06 22:26:25 +01:00
Melanie
54fc78013d Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-02-05 20:58:04 +00:00
Melanie
130b1c0665 Revert my two quick fixes for the lag issue and put in the real fix, which
is to only write to the database if data was changed. I was writing to the db
on every step of every avatar. Sure to give us lag, that.
2012-02-05 20:47:02 +00:00
Melanie
a5fcdde179 Revert "Remove checks on ban list expiry on every move. To be re-added on parcel"
This reverts commit 35f14a262d.
2012-02-05 20:12:45 +00:00
Melanie
0904772a6f Revert "Check ban list for a particular parcel only when an avatar moves into it."
This reverts commit 8923ad755d.
2012-02-05 20:12:35 +00:00
BlueWall
4e11983c7c Make configuration uniform
Pickup the max physical prim size in Scene to make it uniform since adding code to get default size from the OpenSim*.ini.
2012-02-05 12:38:20 -05:00
Melanie
8923ad755d Check ban list for a particular parcel only when an avatar moves into it.
This restores functionality remove in the last commit without reintroducing
the performance penalty.
2012-02-05 04:03:32 +00:00
Melanie
35f14a262d Remove checks on ban list expiry on every move. To be re-added on parcel
boundary crossing only as soon as I'm properly awake. This should fix
recent performance issues
2012-02-05 03:44:15 +00:00
BlueWall
13999dfc1d Set PhysPrimMax default to 0 so ini files won't be overridden 2012-02-04 21:52:55 -05:00
nebadon
36ed0dcdaa change NonPhysicalPrimMax to NonphysicalPrimMax in Scenes.cs to make the
variable in OpenSim.ini and Regions.ini match
2012-02-04 19:45:10 -07:00
nebadon
44badf452e change NonPhysicalPrimMax to NonphysicalPrimMax to make this variable
work correctly, it was being ignored because of the case, this effects
OpenSim.ini.example and OpenSimDefaults.ini
2012-02-04 19:41:25 -07:00
BlueWall
df07b97abd Make NonphysicalPrimMax setting work properly
RegionInfo setting will override only if it is > 0
2012-02-04 21:30:16 -05:00
BlueWall
43b4e4cfc3 Quiet the map module logging 2012-02-04 19:08:52 -05:00
Melanie
ce5e900721 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/Resources/RegionStore.migrations
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
2012-02-04 11:48:20 +00:00
BlueWall
6034e5d112 Add default value to TelehubObject 2012-02-04 00:28:22 -05:00
Justin Clark-Casey (justincc)
8779ff3c8f Supply correct parameters to detailed authentication login fail message 2012-02-04 02:00:35 +00:00
Justin Clark-Casey (justincc)
edc11a1d39 Add missing RCERR_UNKNOWN and RCERR_SIM_PERF_LOW LSL constants that would eventually be used by llCastRay(), though OpenSim does not use these yet. 2012-02-04 01:04:00 +00:00
Justin Clark-Casey (justincc)
09d6521361 Correct RC_* LSL constants used by llCastRay().
Many thanks to WhiteStar for doing the research on this.
2012-02-04 01:00:11 +00:00
Justin Clark-Casey (justincc)
6c252a0fa1 Add TestRegionSettingsDeserialize 2012-02-04 00:55:03 +00:00
Justin Clark-Casey (justincc)
9b762a5a84 Only look for an uploaded transactional asset in Scene.UpdateTaskInventory if we have been passed a non-zero transaction ID.
This resolves the recent regression from deeb728 where notecards could not be saved in prim inventories.
This looks like a better solution than deeb728 since only non-caps updates pass in a transaction ID.
Hopefully resolves http://opensimulator.org/mantis/view.php?id=5873
2012-02-04 00:20:27 +00:00
Justin Clark-Casey (justincc)
2b6c5fcb31 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-03 23:48:12 +00:00
Justin Clark-Casey (justincc)
312e1457dd Change SceneObjectSerializer to use common ExternalRepresentationUtils.ExecuteReadProcessors() methods.
Adds ability to submit a customized exception message to match logging.
2012-02-03 23:47:01 +00:00
Snoopy Pfeffer
bd9d7484f0 Merge branch 'master' of ssh://snoopy@opensimulator.org/var/git/opensim 2012-02-04 00:39:58 +01:00
Dan Lake
4f8f44d9c3 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-03 15:21:37 -08:00
Dan Lake
ea19e50919 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
2012-02-03 15:21:07 -08:00
BlueWall
0742630d81 Merge branch 'master' of /home/opensim/src/opensim 2012-02-03 18:20:26 -05:00
Dan Lake
107cef2b0e Check for null scene in ScheduleFullUpdate and ScheduleTerseUpdate before triggering events on a potentially null Scene 2012-02-03 15:18:48 -08:00
Justin Clark-Casey (justincc)
ce34b359ad Extend m_avatars lock in NpcModule.CreateNPC over both creation of NPC scene presence and population of m_avatars.
This is required to stop a race where the SensorRepeat module can detect an NPC avatar before m_avatars is populated.
Extending the lock is the easiest to understand solution rather than getting complicated with null checks.
Hopefully resolves http://opensimulator.org/mantis/view.php?id=5872
2012-02-03 23:04:26 +00:00
PixelTomsen
5c545d1d2e Fix: Covenant changed time not set http://opensimulator.org/mantis/view.php?id=5869
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-02-03 18:02:51 -05:00
Snoopy Pfeffer
83ef13a79a Changed save oar and save iar parameter -p|--profile to -h|--home, including corresponding RemoteAdmin parameter 2012-02-03 23:53:18 +01:00
Justin Clark-Casey (justincc)
6234264211 Refactor common deserialization processor code to generic method ExternalRepresentationUtils.ExecuteReadProcessors() 2012-02-03 22:45:50 +00:00
Justin Clark-Casey (justincc)
f17066b7bf Change LandDataSerializer deserialization so that in the future it won't care about extra elements or element order.
This brings it into line with other deserializations such as object and will improve future backward compatibility.
2012-02-03 22:21:54 +00:00
Snoopy Pfeffer
1a18948935 Corrected console help texts for "save iar" 2012-02-03 23:04:18 +01:00
Melanie
0dbfa70443 Merge branch 'master' into careminster 2012-02-03 08:47:26 +00:00
Dan Lake
61adf36339 Commenting out new event until I can fix OpenSim tests. Currently, testing objects does not create a Scene or EventManager so triggering events crashes some tests 2012-02-02 18:19:22 -08:00
Dan Lake
ed846f11f1 OpenSim tests do not always create an EventManager so calls to trigger events during tests must check for null EventManager 2012-02-02 18:06:34 -08:00
Dan Lake
3257dbe76d Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-02 17:44:11 -08:00
Dan Lake
146d78edfa ObjectAddedToScene event should be fired when duplicating objects 2012-02-02 17:41:05 -08:00
Dan Lake
ee2b2aadc3 fix line endings 2012-02-02 17:39:05 -08:00
Melanie
bce5dfe711 Merge branch 'master' into careminster 2012-02-03 00:09:05 +00:00
Melanie
76a658324c Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-02-03 00:07:23 +00:00
Melanie
573a64ad24 Merge branch 'master' into careminster 2012-02-03 00:05:59 +00:00
Melanie
574c240202 Fix test failure 2012-02-03 00:05:36 +00:00
Melanie
bdc31bddfc Merge branch 'master' into careminster 2012-02-02 23:41:27 +00:00
Melanie
447a66d660 Replace ParcelAccessEntry with a new struct, LandAccessEntry, which more
accurately reflects the data sent by the viewer. Add times bans and the
expiration of timed bans.
Warning: Contains a Migration (and nuts)
2012-02-02 23:40:56 +00:00
Justin Clark-Casey (justincc)
54d473e200 D'oh - we want to call llGetLinkNumberOfSides() in the LSL_Stub, not llGetLinkNumber(). 2012-02-02 23:35:16 +00:00
Justin Clark-Casey (justincc)
264c83aec4 Add llGetLinkNumberOfSides to LSL_Stub and ILSL_Api
It already existed in LSL_Api but it also needs to exist in these two other places for a script to be able to see it.
Hopefully resolves http://opensimulator.org/mantis/view.php?id=5489
2012-02-02 22:48:36 +00:00
Melanie
8f8b5f9a4d Merge branch 'master' into careminster 2012-02-02 22:36:41 +00:00
Melanie
07c487a28f Make ban, eject, freeze and the scripted versions of those work. 2012-02-02 21:36:45 +01:00
Justin Clark-Casey (justincc)
17df4185ce Add stress tests for simple object add of 100 prim objects. Add time taken to output (this is unreliable). 2012-02-02 18:42:27 +00:00
Diva Canto
dbf6381e34 OpenID: server connector had a copy-and-paste error that made identity queries fail. 2012-02-02 08:39:23 -08:00
Melanie
fd7e82ee72 Streamline banning code using existing methods. 2012-02-02 16:51:39 +01:00
Melanie
857d4e60cc Rehook the eject and freeze events that had gotten unhooked in the merge 2012-02-02 13:46:46 +01:00
Melanie
567f4c51f8 Improve reliability of script state saving by covering various saving
and loading scenarios which resulted in loss of continuity on item ids
2012-02-02 01:52:17 +00:00
Melanie
6fe4b6fbe8 Fix remembering attachment point and position when an item is rezzed in world.
Also fix PRIM_LOCAL_POS returning 0 when used on child prims from a script
in the root.
2012-02-02 02:51:59 +01:00
Melanie
dbc3f1ff92 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/TaskInventoryItem.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
2012-02-02 01:53:13 +00:00
Dan Lake
0ce9ad4a56 Add event RegionHeartbeatEnd for modules interested in coordinating activity with region heartbeats 2012-02-01 17:01:28 -08:00
Dan Lake
c10193c72b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-01 16:25:35 -08:00
Melanie
45ad9e39a6 Improve reliability of script state saving by covering various saving
and loading scenarios which resulted in loss of continuity on item ids
2012-02-02 01:05:14 +01:00
Melanie
e5ae84b42b Re-Add the reading of attachment data hat was lost in the merge 2012-02-02 01:04:54 +01:00
Melanie
16aa00e944 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-02-01 10:08:45 +00:00
Melanie
003bd9f1b3 Small optimization to last commit 2012-02-01 10:05:04 +00:00
Melanie
cc1476fc36 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-02-01 09:45:42 +00:00
Melanie
241ddd031f Fix copy/paste errors 2012-02-01 09:45:15 +00:00
Melanie
c08d6df7e1 Prevent a changed attachment that has been saved from being saved again. 2012-02-01 09:38:20 +00:00
Melanie
fcc1fa2c32 Straighten out some attachment mess. Don't save attachment states for HG
visitors at all. On Leaving a sim, save only the changed ones. Don't save
all scripted stuff when leaving a sim.
2012-02-01 09:36:14 +00:00
Diva Canto
3d7b5e5e93 HG: This hopefully fixes the HG teleports back home to OSGrid. Looks like Uri.ToString() drops the port when it's port 80. 2012-01-31 22:00:59 -08:00
Justin Clark-Casey (justincc)
99e71222f0 Lay out script status in property per row format, since getting too long for console lines. 2012-02-01 00:27:42 +00:00
Justin Clark-Casey (justincc)
e3680f216e Add count of events queued for a particular script in "scripts show" console command 2012-02-01 00:17:02 +00:00
Justin Clark-Casey (justincc)
8b3da1bff4 Make script console commands only show for selected region. 2012-02-01 00:10:07 +00:00
Justin Clark-Casey (justincc)
437de6743c Implement "xengine status" console command to show various xengine stats 2012-02-01 00:07:06 +00:00
Justin Clark-Casey (justincc)
f028dca711 Add "show part uuid" and "show part name" console commands.
These commands will display part/prim details for a given uuid or name
The "show object uuid" and "show object name" commands will now only display details for objects (i.e. not child parts in a linkset).
This is for consistency with the "delete object" commands which only delete objects, not parts.
2012-01-31 23:35:13 +00:00
Justin Clark-Casey (justincc)
996cc6097e Implement "show object name <name>" console command to show details of an object with the given name 2012-01-31 23:21:02 +00:00
Justin Clark-Casey (justincc)
ac7cded080 Get rid of the "no objects found" feedback for now - this doesn't work well if a command is executed over multiple scenes. 2012-01-31 23:06:48 +00:00
Justin Clark-Casey (justincc)
ab89adfaef Implement "show object uuid <uuid>" console command.
This will show details about a part with the given uuid if it's found.
2012-01-31 23:03:39 +00:00
Justin Clark-Casey (justincc)
647b326edc Add more user feedback if an object isn't found for which delete was requested. 2012-01-31 22:27:05 +00:00
Justin Clark-Casey (justincc)
77b032549e Add the name of a deleted object to the console output 2012-01-31 22:22:32 +00:00
Justin Clark-Casey (justincc)
e3e38e34c5 If a particular region is selected in the console, only try to delete objects in that region, rather than in every region on the simulator
The old wrong behaviour was in place before the command was extracted to a module.
2012-01-31 22:21:10 +00:00
Justin Clark-Casey (justincc)
9bd02b5da1 Move object delete commands into a commands region module, in preparation for adding similar show commands. 2012-01-31 21:57:45 +00:00
Melanie
727ddffb71 Merge branch 'master' into careminster 2012-01-31 21:53:32 +00:00
Justin Clark-Casey (justincc)
2f84d5397b minor: remove mono compiler warning 2012-01-31 21:14:09 +00:00
Justin Clark-Casey (justincc)
1505c22995 Use Environment.TickCount & Int32.MaxValue; instead of Util.EnvironmentTickCount(); when producing the threads report to reduce wraparound.
This matches the tickcount masking in the thread watchdog.
For some reason, Util.EnvironmentTickCount() masks ticks by 0x3fffffff instead of 0xffffffff
2012-01-31 21:09:26 +00:00
Melanie
d76ca9cd93 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-01-31 20:54:04 +00:00
Melanie
1b63b21a4d Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Application/OpenSimBase.cs
2012-01-31 20:53:49 +00:00
Justin Clark-Casey (justincc)
10b9348071 Remove scene object null check on SceneGraph.AddSceneObject(). Complain explicitly if there's an attempt to add any object with a zero UUID.
Callers themselves need to check that they're not attempting to add a null scene object.
2012-01-31 20:30:30 +00:00
Justin Clark-Casey (justincc)
f3780b9eae Add torture tests to test adding 10,000, 100,000 and 200,000 single prim scene objects.
These can be run using the "nant torture" target.  They are not part of "nant test" due to their long-run future nature.
Such tests are designed to do some testing of extreme situations and give some feedback on memory usage, etc.
However, data can be inconsistent due to different machine circumstances and virtual machine actions.
This area is under development.
2012-01-31 19:56:37 +00:00
PixelTomsen
a98a146c50 Fix:llSetText - limited text to a maximum of 254 chars
mantis: http://opensimulator.org/mantis/view.php?id=5867

Signed-off-by: nebadon <michael@osgrid.org>
2012-01-31 10:17:38 -07:00
Melanie
c305b55012 Draw brders around parcels for sale 2012-01-31 06:31:02 +01:00
Melanie
d2dfa4cfe7 Make parcel sale overlays work. No auction support. 2012-01-31 03:09:44 +00:00
Melanie
71012ef883 Make parcel sale overlays work. No auction support. 2012-01-31 02:19:34 +01:00
Melanie
fe0975dc24 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-01-30 21:39:36 +00:00
Melanie
2b84b6d8b1 Use the requested sim's map, not our own 2012-01-30 21:39:12 +00:00
Justin Clark-Casey (justincc)
dbc039783b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-30 21:34:40 +00:00
Melanie
a0206e5a17 Comment debug spam 2012-01-30 22:30:20 +01:00
Melanie
0f181fe5d0 Fix displaying landmark and search info properly with long names 2012-01-30 22:30:02 +01:00
Melanie
cfe924e4a8 Merge branch 'master' into careminster 2012-01-30 21:40:50 +00:00
Melanie
e1cad4c34f Use the requested sim's map, not our own 2012-01-30 21:38:46 +00:00
Melanie
9dbb58ee8b Merge branch 'master' into careminster 2012-01-30 21:26:47 +00:00
Melanie
53c3faac5d Patch in the rest of the maptile stuff 2012-01-30 21:24:21 +00:00
Melanie
c4cc626dff Add the needed column in the regions table and a few tweaks.
Warning: Contains a Migration
Warning: Cannot guarantee nut free
2012-01-30 20:34:32 +00:00
Melanie
bde2ff5e78 Next step for world map overlays 2012-01-30 20:11:47 +00:00
Melanie
ea16c9f858 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Conflicts:
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
2012-01-30 19:49:12 +00:00
Melanie
df9c35bc0f Some plumbing for map overlays 2012-01-30 19:46:55 +00:00
Justin Clark-Casey (justincc)
9d93c4808e lock SceneObjectGroupsByFullID in SceneGraph.ForEachSOG() to stop failure if SceneObjectGroupsByFullID is updated elsewhere at the same time. 2012-01-30 19:21:58 +00:00
BlueWall
54e6b2402c Revert "Pickup map overlay tile from RegionSettings.ParcelImageID"
This reverts commit 00d1c88c59.

Need to dig a little deeper to see exactly how V1 viewers are using this
2012-01-30 12:39:08 -05:00
BlueWall
00d1c88c59 Pickup map overlay tile from RegionSettings.ParcelImageID 2012-01-30 11:49:22 -05:00
Melanie
ad02e01e77 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-01-30 16:44:26 +00:00
Melanie
1b600e7803 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLSimulationData.cs
2012-01-30 16:38:11 +00:00
Melanie
3de534896e Add ParcelImageID to RegionSettings so we can have that overlay.
Warning: Contains a Migration.
Warning: May contain nuts.
2012-01-30 16:22:21 +00:00
Melanie
9a86a713d3 Merge branch 'master' into careminster 2012-01-29 22:50:59 +00:00
Garmin Kawaguichi
5e60afe5ed Fix llEdgeOfWorld functionality - see mantis http://opensimulator.org/mantis/view.php?id=5865
Signed-off-by: nebadon <michael@osgrid.org>
2012-01-29 14:41:47 -07:00
PixelTomsen
e8b688b61f Fix:Get embedded objects in notecard http://opensimulator.org/mantis/view.php?id=2607
Signed-off-by: nebadon <michael@osgrid.org>
2012-01-29 12:40:43 -07:00
Melanie
7c824f02b4 Add the ability to abort a pending restart using the viewer UI or a
RemoteAdmin message
2012-01-28 22:19:10 +01:00
Melanie
498fe1afe7 Fix calculating land prim count type width issue 2012-01-28 21:23:54 +01:00
Melanie
dac826da4e Prevent an overlong description from messing up a ParcelInfoReply 2012-01-28 20:38:50 +01:00
BlueWall
f7c237c0e1 Merge branch 'master' of /home/opensim/var/repo/opensim into mapwork 2012-01-28 11:35:28 -05:00
BlueWall
ae057a7589 Adding our parcel's generated id to map packets 2012-01-28 10:36:39 -05:00
BlueWall
1a20b60d82 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-28 08:47:25 -05:00
Bo Iwu
2e31f12cf4 Send CHANGED_TELEPORT during local TP again - partially revert cf73afec35
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-01-28 08:43:58 -05:00
Justin Clark-Casey (justincc)
2ef9fd05fa Add an overloaded SceneObjectPart.UpdateTextureEntry(Primitive.TextureEntry texEntry) for region modules 2012-01-28 02:45:13 +00:00
Melanie
6fbc48ee9c Make all NPCs owned by default 2012-01-28 03:32:25 +01:00
Melanie
6db9109b3f Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-28 03:22:36 +01:00
Melanie
abffda269f Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
2012-01-28 04:05:53 +00:00
Justin Clark-Casey (justincc)
154ba0124a Add experimental --publish option to "save oar" so that OARs reloaded to the same grid don't have the publisher as owner. 2012-01-28 02:21:41 +00:00
Melanie
fbe324cc5e Fix build break 2012-01-28 03:15:17 +01:00
Melanie
090164ff7a Completely disable NPC being sensed as agents, the abuse potential is too great 2012-01-28 03:12:56 +01:00
Melanie
428407c5e4 Merge branch 'master' into careminster 2012-01-28 01:01:23 +00:00
Justin Clark-Casey (justincc)
088f1213b4 Remove accidental /user postfix from HomeURI in [HGInventoryAccessModule] in GridCommon.ini.example and from SRV_ProfileServerURI in [LoginService] in Robust.HG.ini.example
As per http://opensimulator.org/mantis/view.php?id=5852, confirmed by diva via aiaustin
2012-01-28 01:01:19 +00:00
Justin Clark-Casey (justincc)
e391d6390c Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-28 00:44:11 +00:00
Justin Clark-Casey (justincc)
deeb7287a2 Comment out xfer section in Scene.UpdateTaskInventory() which was causing spurious errors and "script saved" messages when script properties were changed.
Viewers since at least Linden Lab 1.23 use the script upload capability to save script changes.
It's unknown whether the commented out code was working for very old viewers or not.
Code is commented out to reduce complexity and so that useful error messages don't need to be removed.
If there is a substantial population using extremely old viewers that can't upgrade to a newer version 1 viewer (e.g. 1.23) or similar TPV then this can be revisited.
2012-01-28 00:39:53 +00:00
Melanie
7352aea9ac Remove IClientAPI from the money module. It was only used to pass in the
agent id anyway
2012-01-28 00:18:12 +00:00
Justin Clark-Casey (justincc)
7837c611fb Add OS_NPC_SENSE_AS_AGENT option to osNpcCreate().
This allows NPCs to be sensed as agents by LSL sensors rather than as a specific NPC type (which is currently an OpenSimulator-only extension).
Wiki doc on this and other recent NPC functions will follow soon
2012-01-28 00:00:12 +00:00
Melanie
26a4e8a161 Merge branch 'master' into careminster 2012-01-27 23:30:26 +00:00
Justin Clark-Casey (justincc)
31b87ff07b Increment LPS script stat for OSSL functions that were not already doing this 2012-01-27 23:24:49 +00:00
Justin Clark-Casey (justincc)
7c1d075a5a Implement osIsNpc(key npc):integer. This return TRUE if the given key belongs to an NPC in the region. FALSE if not or if the NPC module isn't present. 2012-01-27 23:17:13 +00:00
Justin Clark-Casey (justincc)
abf0dd4250 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-27 23:14:34 +00:00
Justin Clark-Casey (justincc)
9939f94f08 Implement osNpcGetOwner(key npc):key. This returns the owner for an 'owned' NPC, the npc's own key for an 'unowned' NPC and NULL_KEY is the input key was not an npc.
llGetOwnerKey() could also be extended but this does not allow one to distinguish between an unowned NPC and some other result (e.g. 'no such object' if NULL_KEY is the return.
Also, any future extensions to LSL functions by Linden Lab are unpredictable and OpenSim-specific extensions could clash.
2012-01-27 23:05:48 +00:00
Melanie
86b9e6fbed Merge branch 'master' into careminster 2012-01-27 19:47:24 +00:00
Diva Canto
91ac21b9ec HG Inventoty: Guard against items not found. 2012-01-26 17:00:58 -08:00
Melanie
9d60b84f78 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/EstateSettings.cs
2012-01-26 23:07:31 +00:00
BlueWall
6da82d9805 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-26 16:29:39 -05:00
PixelTomsen
616373db16 llManageEstateAccess implementation http://wiki.secondlife.com/wiki/LlManageEstateAccess
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-01-26 16:15:23 -05:00
Melanie
7229f6e64b Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-01-26 10:32:22 +00:00
Melanie
da720ce9be Support rejecting a teleport if a user is banned in all parcels that have
spawn points
2012-01-26 10:21:45 +00:00
Melanie
a537f7e1a3 Merge branch 'master' into careminster 2012-01-26 09:10:46 +00:00
BlueWall
a6abecf5fa Change references from sop to sog and add protection from null ref
I had code made additions to the map module that was based on the earlier work that I did before Melanie made improvements. Updating the new code to incorporate the same changes.
2012-01-26 00:33:34 -05:00
Justin Clark-Casey (justincc)
093469c33c Add basic TestAddScript() regression test 2012-01-26 01:16:03 +00:00
Melanie
36e6edfc65 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
2012-01-26 00:44:32 +00:00
Justin Clark-Casey (justincc)
13d9b64b1d Re-enable error logging associated with assembly and script loading failure in ScriptInstance.
Swallowing exceptions just leads to more mysterious failures later on.
2012-01-26 00:28:51 +00:00
Melanie
4ce42762ee Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-01-26 00:21:21 +00:00
Justin Clark-Casey (justincc)
55c6cbabfd refactor: change RezScriptFromAgentInventory(), RezNewScript() and AddInventoryItem() to accept an agent id rather than a full IClientAPI.
This stops some code having to make spurious client == null checks and reduces regression test complexity.
2012-01-26 00:10:37 +00:00
Justin Clark-Casey (justincc)
8e5502fdc2 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-25 23:24:44 +00:00
Justin Clark-Casey (justincc)
2de3a1b9da refactor: decompose most of RezScript() into RezScriptFromAgentInventory(), RezNewScript() and rename one RezScript() to RezScriptFromPrim() 2012-01-25 23:22:07 +00:00
nebadon
d053625663 Update save oar and save iar help responses to reflect new -h|--home
switches which replace -p|--profile ie: "save oar
--home=http://hg.osgrid.org:80 region.oar"
2012-01-25 15:59:07 -07:00
Robert Adams
e9de7e7107 Update BulletSim.dll with some interface changes and tuning (see opensim-libs). Change BSScene to use new interface. 2012-01-25 14:40:38 -08:00
Justin Clark-Casey (justincc)
2e7c1bcfd9 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-25 21:26:34 +00:00
Pixel Tomsen
8f53c768f5 llGetParcelMusicURL implementation http://wiki.secondlife.com/wiki/LlGetParcelMusicURL
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-01-25 15:48:38 -05:00
Justin Clark-Casey (justincc)
82c3d0cf89 minor: stop the WebStatsModule logging UPDATE or INSERT every time it updates bin/LocalUserStatistics.db 2012-01-25 20:36:51 +00:00
Justin Clark-Casey (justincc)
e20cf3789b Serialize calls to ODE Collide() function across OdeScene instances to prevent ODE crashes on simulators running more than one region.
It turns out that calls to Collide() are not thread-safe even for objects in different ODE physics worlds due to ODE static caches.
For simulators running multiple regions, not serializing calls from different scene loops will sooner or later cause OpenSim to crash with a native stack trace referencing OBBCollider.
This affects the default OPCODE collider but not GIMPACT.  However, GIMPACT fails for other reasons under some current simulator loads.
ODE provides a thread local storage option, but as of ODE r1755 (and r1840) DLLs compiled with this crash OpenSim immediately.
2012-01-25 19:31:50 +00:00
Melanie
7444f3bfad Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Conflicts:
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
2012-01-25 15:02:54 +00:00
Melanie
f84b69cad1 Change the WorldMapModule to use SOG rather than SOP for the telehub ans
cover a potential nullref
2012-01-25 15:00:06 +00:00
Melanie
b996517c94 Typo fix 2012-01-25 15:18:31 +01:00
Melanie
24862eaf15 Spin off starting scripts in rezzed objects into a thread to avoid a recursion
into the script engine if the script was suspended inside an event.
2012-01-25 14:44:09 +01:00
Melanie
2ca80add14 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneGraph.cs
2012-01-25 15:24:25 +00:00
BlueWall
959bcfa7f8 Merge branch 'master' of /home/opensim/src/opensim 2012-01-24 21:35:12 -05:00
BlueWall
7c514fe155 Telehub map items displayed 2012-01-24 21:33:11 -05:00
Dan Lake
3d1f43046d Removed unused delegates in SceneGraph: ObjectDuplicateDelegate, ObjectCreateDelegate, ObjectDeleteDelegate 2012-01-24 17:05:53 -08:00
Melanie
427ab55058 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneGraph.cs
2012-01-25 00:45:57 +00:00
Justin Clark-Casey (justincc)
2d0412d366 Make errors reported by OpenSim when it halts because it can't find certain config sections or files a bit more user friendly. 2012-01-24 22:35:55 +00:00
Justin Clark-Casey (justincc)
8e0eaa980f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-24 22:16:45 +00:00
Justin Clark-Casey (justincc)
09baa3e679 Comment out asset statistics section from periodic stats as these have not been recorded for a very long time.
Some might make a comeback in the future but others are of dubious usefuless for health check purposes, or the complexity of collection outweighs their usefulness.
Some data is available via other means (e.g. "fcache status").
2012-01-24 22:14:21 +00:00
BlueWall
3ae6345f1b Merge branch 'master' of /home/opensim/src/opensim 2012-01-24 17:14:08 -05:00
BlueWall
dc329202ef Put Telehubs on the map 2012-01-24 17:11:35 -05:00
Justin Clark-Casey (justincc)
5e445aaf7b Fix "Abnormal client thread terminations" stat in period CONNECTION STATISTICS to count the number of times clients are disconnected due to ack timeouts.
This has been broken for a long period and would only ever show 0.
2012-01-24 22:09:13 +00:00
Justin Clark-Casey (justincc)
ab8956d58f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-24 22:04:28 +00:00
Justin Clark-Casey (justincc)
e8f1e7e96e Comment out inventory statistics section from periodic stats, since this only contained the now uncollected and irrelevant inventory cache number. 2012-01-24 22:03:30 +00:00
Dan Lake
488fe0ae9c Removed unused events in SceneGraph: OnObjectCreate, OnObjectRemove, OnObjectDuplicate 2012-01-24 13:41:26 -08:00
Justin Clark-Casey (justincc)
7e76397a26 minor: correct text and usage for "image queues show" reigon console command. 2012-01-24 20:54:35 +00:00
Justin Clark-Casey (justincc)
a704d444f2 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-24 20:36:16 +00:00
Justin Clark-Casey (justincc)
8b035dc3c7 Restrict accessible of ODECharacter Shell and Body. Add method doc and some error log lines. 2012-01-24 18:46:24 +00:00
Melanie
18fd36cba4 Merge branch 'master' into careminster 2012-01-24 04:07:02 +00:00
Melanie
855d3a3ba5 Teleport routing, part 1 2012-01-24 04:06:37 +00:00
Melanie
a4977bbe19 Simplify and streamline telehub editing code. Verify rotations and fix
spwan point positioning on rotated telehubs.
2012-01-24 02:36:35 +00:00
Melanie
6581849d24 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-24 03:14:47 +01:00
Melanie
ef6d6d20b9 Merge branch 'master' into careminster 2012-01-24 02:36:54 +00:00
Melanie
f10288ceae Add handling bans properly 2012-01-24 03:14:00 +01:00
Melanie
0369d21917 Add teleport routing, first part 2012-01-24 03:13:44 +01:00
Melanie
0d2e02efb1 Reverse the spawn point distance vector 2012-01-24 01:30:41 +00:00
Melanie
c0e1784e86 Correct a coordinate to make the viewer like it 2012-01-24 01:18:13 +00:00
Melanie
cc02f78d4e Simplify and streamline telehub editing code. Verify rotations and fix
spwan point positioning on rotated telehubs.
2012-01-24 01:48:38 +01:00
Melanie
d51ae0ecac Merge branch 'master' into careminster 2012-01-24 01:31:07 +00:00
Melanie
696fbdfa24 Reverse the spawn point distance vector 2012-01-24 01:29:50 +00:00
Melanie
69e4debc42 Merge branch 'master' into careminster 2012-01-24 01:18:43 +00:00
Melanie
090bf7acca Correct a coordinate to make the viewer like it 2012-01-24 01:17:41 +00:00
Melanie
8fcb9bf418 Correct some SQL syntax 2012-01-24 00:57:52 +00:00
Melanie
7a87be5015 Fix merge artefacts and build break 2012-01-24 00:45:17 +00:00
Melanie
616f2b5861 Merge branch 'master' into careminster 2012-01-24 00:38:34 +00:00
Melanie
7bb01a17ee Add a forgotten parameter 2012-01-24 00:38:00 +00:00
Melanie
07ad821157 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLSimulationData.cs
	OpenSim/Framework/RegionSettings.cs
2012-01-24 00:36:42 +00:00
Melanie
87799c1f3d Change Telehubs to store only the data that is really needed and not
additional redundant information.
2012-01-24 00:32:10 +00:00
Melanie
c36c916342 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-01-23 21:25:59 +00:00
Melanie
48379e6442 IMPORTANT!!!!! Please READ. DO NOT Use this version or any before it since the
Telehub commits! They will eat your babies and corrupt your database while
they munch. DO NOT use anything from the first Telehub commit to this one.
FIRST GOOD COMMIT is the one FOLLOWING this one. You have been warned.
2012-01-23 21:23:55 +00:00
BlueWall
8db64dc77f Merge branch 'master' of /home/opensim/var/repo/opensim into telehub 2012-01-23 14:54:43 -05:00
BlueWall
6a85abbd14 Add update to Telehub position and rotation before adding SpawnPoints 2012-01-23 14:53:25 -05:00
BlueWall
c1f6478a37 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-23 11:10:56 -05:00
BlueWall
0037577814 Merge branch 'telehub' 2012-01-23 11:10:42 -05:00
BlueWall
9cfc43005d Cleanup 2012-01-23 10:28:18 -05:00
BlueWall
39c9b656c8 Cleanup unused parts, add some error handling 2012-01-23 09:42:15 -05:00
Melanie
22ae9331bb Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-23 13:51:20 +01:00
Melanie
4e0bb49394 Fix llLookAt the right way 2012-01-23 13:48:16 +01:00
Melanie
cd2bf64b87 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLSimulationData.cs
2012-01-23 00:24:31 +00:00
Melanie
f7bd7c5901 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-01-22 23:21:35 +00:00
Melanie
7c404375c7 Fix up some parameter naming 2012-01-22 23:20:10 +00:00
BlueWall
d1ef7ee5ca Add note about setting up test databases 2012-01-22 16:27:49 -05:00
BlueWall
74c1ed77a4 Finish connecting Telehub to database 2012-01-22 14:51:15 -05:00
BlueWall
1cd26ba85e Hooking up new telehub data to the database 2012-01-22 11:46:16 -05:00
Melanie
02572ab1d3 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/RegionSettings.cs
2012-01-22 16:35:14 +00:00
Melanie
24b20f6e4b Change the key name I missed in last commit 2012-01-22 15:35:14 +00:00
Melanie
68365c20c0 Move Telehub tables and data from EstateSettings to RegionSettings.
This is damage control es EstateSettings is not the place this can be put.
EstateSettings is nt unique to a region and therefore would introduce
a hard limit of one telehub per estate, completely shutting off the
option of having SL style telehubs, e.g. one per region. Whole
estate teleport routing can still be implemented id desiresd, this
way all options are open while the other way most options get closed
off.
2012-01-22 11:36:04 +00:00
BlueWall
32d58d6e3e Telehub Support:
Telehub settings now persist to the database and are saved across sim restarts. So-far this only works on MySQL. this is a work in progress, teleport routing is not yet implemented.
2012-01-21 23:26:27 -05:00
Melanie
ba3b0c69f1 Merge branch 'master' into careminster 2012-01-21 19:52:33 +00:00
BlueWall
590f707c42 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-20 23:54:29 -05:00
BlueWall
b6f3de5028 Telehub Support:
Support for viewer side of telehub management. Can manupulate Telehubs and SpawnPoints from the viewer estate managemnt tools. This is a work in progress and does not yet persist or affect teleport routing.
2012-01-20 23:50:37 -05:00
Justin Clark-Casey (justincc)
a0fb1e1788 Revert "Change linux, windows and mac ODE libraries to use the GIMPACT collider rather than OPCODE."
This reverts commit 4eef6725f4.

Reverting for now since this fails with "terminate called after throwing an instance of 'std::bad_alloc'" on Wright Plaza instances.
2012-01-20 17:51:12 +00:00
Justin Clark-Casey (justincc)
ea72428c9d Allow a viewer UDP image request retry to trigger another asset fetch if an existing fetch hasn't responded before a timeout.
This is to stop a high priority image/texture request from blocking the entire download queue if its asset fetch got dropped for some reason.
2012-01-19 23:09:16 +00:00
Justin Clark-Casey (justincc)
d38e2c0c91 Add image not in database test for LLImageManager 2012-01-19 21:57:12 +00:00
Justin Clark-Casey (justincc)
503faaea62 refactor: separate out common parts of LLImageManagerTests 2012-01-19 21:23:40 +00:00
Justin Clark-Casey (justincc)
381f74276b Add LLImageManager regression test for discard case 2012-01-19 21:14:09 +00:00
Justin Clark-Casey (justincc)
c92a9a6640 Add "image queues clear <first-name> <last-name>" console command
This allows a way to manually clear pending image queue requests for debug purposes
2012-01-19 19:49:06 +00:00
Justin Clark-Casey (justincc)
d75899f2d1 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-19 19:47:18 +00:00
BlueWall
8f871cca10 Add osGetGridHomeURI function
Add osGetHomeURI function to the family of osGetGrid* functions. Returns the SRV_HomeURI setting from the [LoginService] configuration.
2012-01-19 14:21:12 -05:00
Justin Clark-Casey (justincc)
9356963bd3 Add basic request and send image regression tests for LLImageManager 2012-01-19 19:00:11 +00:00
BlueWall
edb2e4c5b3 Change URI to lowercase to match existing 2012-01-19 13:55:53 -05:00
BlueWall
bf9ce4709f Add fetching of SRV_HomeURI to "/json_grid_info"
Make SRV_HomeURI available on the GridInfoService through the "/json_grid_info" URI. This i s mainly to service OSSL, but can be seen externally via the URI.
2012-01-19 13:48:31 -05:00
Dan Lake
e41f23dead Trigger event when prims are scheduled for an update. This gives modules early access to changed parameters. 2012-01-19 03:06:35 -08:00
Dan Lake
5ced49aaa8 Cleaned up Color and Text parameters in SOP and made LocalFlags public for module access. 2012-01-19 03:03:22 -08:00
Dan Lake
2c6272d11a Add a version of GetGroupByPrim to Scene which accepts UUID instead of localID 2012-01-19 03:01:37 -08:00
Dan Lake
f8079bcd72 Fixed bugs in earlier commit on custom user parameters in Regions.ini 2012-01-19 02:52:05 -08:00
BlueWall
eea726d74e RegionReady:
Back out some of the oar monitoring for the time being. Need to find  a better way to get feedback. Will re-visit this soon.
2012-01-18 20:30:57 -05:00
BlueWall
e7619f7518 Merge branch 'master' of /home/opensim/src/opensim 2012-01-17 22:44:16 -05:00
BlueWall
ba7d8cedec Add function osGetGridCustom
Add function osGetGridCustom to take an argument for the GridInfo kpv to retrieve from the GridInfoService
2012-01-17 22:38:36 -05:00
BlueWall
717656c453 Merge branch 'master' of /home/opensim/src/opensim 2012-01-17 22:10:47 -05:00
BlueWall
9ed9720861 Update osGetGrid**** functions
The osGetGrid**** functions will now get the grid settings from the GridInfoService. Set the GridInfoURI in your ./bin/config-include/GridCommon.ini [GridInfo] section.
2012-01-17 22:07:40 -05:00
BlueWall
939d60da59 Merge branch 'master' of /home/opensim/lib/osgrid/opensim 2012-01-17 21:10:31 -05:00
BlueWall
ef5575be1b Add json handler for GridInfo 2012-01-17 21:09:46 -05:00
Justin Clark-Casey (justincc)
4eef6725f4 Change linux, windows and mac ODE libraries to use the GIMPACT collider rather than OPCODE.
As discussed on the opensim-dev mailing list, this is to avoid a demonstrated ODE collider segfault when stress-testing a simulator running more than one region using the bundled pCampbot.exe
As before, the ODE revision used is r1755 - only the collider has changed.
Tests so far reveal little performance change.
However, if noticeable issues do arise, please report on mantis and/or the opensim-dev mailing list.
The previous libraries are temporarily in bin/Physics-previous-ode-libs
These can be copied back to bin if one wants to compare behaviour with the previous libraries.
2012-01-17 20:49:20 +00:00
Melanie
08b6b3bb48 Add some logging 2012-01-17 17:36:26 +01:00
Melanie
5afb70b9fe Fix prim calculations so that > 32767 prims are supported 2012-01-17 15:30:52 +01:00
Melanie
747c25e920 Spin off NPC deletion into a thread to avoid it being done on a script
microthread. A stab at fixing exceptions.
2012-01-17 11:18:56 +01:00
Melanie
7549836986 Merge branch 'master' into careminster 2012-01-16 23:10:41 +00:00
Melanie
e13a17cc0c Allow retrival of multiple user records in one operation, analog to presence 2012-01-16 23:09:24 +00:00
Melanie
b14a6acd2f Merge branch 'master' into careminster 2012-01-16 23:08:47 +00:00
Justin Clark-Casey (justincc)
59a0c50d48 Comment out noisy log lines I accidentally included in the nant build target adjustment commit.
Left in the method doc.
2012-01-16 23:04:08 +00:00
Justin Clark-Casey (justincc)
82ad9d4e04 Remove monocov and other obsolete nant build targets.
monocov was a code coverage attempt 3 years ago which no longer works.
other removed targets have been commented out or unused for a very long time
2012-01-16 22:58:58 +00:00
Melanie
d6b9504c84 Add methods to allow the groups modules to query online status and last login 2012-01-16 02:19:19 +01:00
Melanie
35911d2362 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-15 14:51:00 +01:00
Melanie
9447b6d15f Merge branch 'master' into careminster 2012-01-15 14:40:33 +00:00
Melanie
068b8e1f9b Disable using an agent ID to clone NPCs. The griefing potential is too great 2012-01-15 14:49:32 +01:00
Mic Bowman
2e4fbe6b17 protect the region ready alerts for loading oarfiles if no post URI is set 2012-01-14 23:43:21 -08:00
nebadon
43173f1b0d commented out redundant land owner checks for osTeleportAgent there is
no need for these checks just use Allow_osTeleportAgent = PARCEL_OWNER
also increased function to severe threat level to make it harder to
accidently enable it for everyone.
2012-01-14 18:36:46 -07:00
Melanie
ec299bfa87 Allow SmtpClients and other SSL users to work with our cert handler installed 2012-01-14 06:03:27 +00:00
Melanie
4cbf8d728e Fix merge 2012-01-14 05:39:56 +01:00
Melanie
43128c9016 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-01-14 06:09:19 +00:00
Melanie
72247bdaef Allow SmtpClients and other SSL users to work with our cert handler installed 2012-01-14 05:28:57 +01:00
Justin Clark-Casey (justincc)
82f0e19349 Extend scripts show command to accept a single item UUID parameter to display one script's status
Usage is now scripts show [<script-item-uuid>]
2012-01-14 00:44:19 +00:00
Justin Clark-Casey (justincc)
b5bb559cc0 Register the UrlModule for script engine events OnScriptRemoved and OnObjectRemoved just once in the UrlModule itself, rather than repeatedly for every script.
Doing this in every script is unnecessary since the event trigger is parameterized by the item id.
All that would happen is 2000 scripts would trigger 1999 unnecessary calls, and a large number of initialized scripts may eventually trigger a StackOverflowException.
Registration moved to UrlModule so that the handler is registered for all script engine implementations.
This required moving the OnScriptRemoved and OnObjectRemoved events (only used by UrlModule in core) from IScriptEngine to IScriptModule to avoid circular references.
2012-01-14 00:23:11 +00:00
Mic Bowman
a30a02e7ae Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-13 14:51:11 -08:00
Mic Bowman
e1a2c44ebe Cleaned up the LookAt code in SOP and SOG. Added support for incrementally
rotating physical objects. This does not use physics. Currently the rate
of change is determined as 1 / (PI * Strength).
2012-01-13 14:48:56 -08:00
BlueWall
cde80125ad Merge branch 'master' of /home/opensim/src/opensim 2012-01-13 17:16:20 -05:00
Bo Iwu
02d6b033d0 Fix improper code formatting introduced in 6214e6a217
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-01-13 17:10:48 -05:00
Mic Bowman
adea92f8b7 Fix llRotLookAt and llLookAt for non-physical objects. Per conversation
with Melanie and Nebadon, SL behavior seems to be that non physical
objects snap to the request rotation.
2012-01-13 11:37:17 -08:00
BlueWall
57ba9ef5ad Update RegionReadyModule
Fix triggering of alerts when rezzing first script to an empty region, add login disable when loading oars.
2012-01-13 11:35:44 -05:00
Melanie
982f3d58a9 Merge branch 'master' into careminster 2012-01-13 04:04:39 +00:00
Melanie
9dc7fef4f6 Merge branch 'master' into careminster 2012-01-13 02:27:20 +00:00
BlueWall
c5594e839e Undo some prior work
Move some added fuctions out of core into the addon module to keep things clean
2012-01-12 21:19:31 -05:00
BlueWall
acbff305f5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-01-12 21:06:27 -05:00
BlueWall
d40ec1c346 Move some interfaces to a more apropriate place 2012-01-12 20:49:50 -05:00
Justin Clark-Casey (justincc)
3b59af2225 Change the default osNpcCreate() to create an 'owned' npc rather than an 'unowned' one.
An owned NPC is one that only the original creator can manipulate and delete.
An unowned NPC is one that anybody with access to the osNpc* methods and knowledge of the avatar id can manipulate.
This is to correct an oversight I made in the original reimplementation where I mistakenly assumed that avatar IDs could be treated as private.
I am not anticipating that many people were deliberately making use of unowned npcs due to their insecure nature.
If you do need an unowned NPC please call the new overloaded osCreateNpc() function with the option OS_NPC_NOT_OWNED.
2012-01-13 00:03:39 +00:00
Justin Clark-Casey (justincc)
6e7154d55c Removing osNpcCreateOwned(). Please use osNpcCreate(string user, string name, vector position, string notecard, int options) instead with option OS_NPC_CREATOR_OWNED
Please note that correct option name is OS_NPC_CREATOR_OWNED not OS_NPC_CREATE_OWNED as mistakenly put in a previous commit.
2012-01-13 00:00:18 +00:00
Justin Clark-Casey (justincc)
47377f17c6 Add missing assert to confirm owner delete succeeded to the end of TestOsNpcRemoveOwned() 2012-01-12 23:46:43 +00:00
Justin Clark-Casey (justincc)
beab155434 Add api level test for removing an owned npc 2012-01-12 22:35:11 +00:00
Melanie
c7757d1038 Fix typo 2012-01-12 23:07:38 +01:00
Melanie
aa2cde2493 Disable unowned NPCs 2012-01-12 23:04:38 +01:00
Melanie
cf166d3f1e Merge branch 'master' into careminster 2012-01-12 23:22:55 +00:00
Justin Clark-Casey (justincc)
caa207f59f Add ossl level test for removing an unowned npc 2012-01-12 21:03:54 +00:00
Justin Clark-Casey (justincc)
1ac5aa6808 Add remove test for unowned avatars 2012-01-12 20:47:19 +00:00
Justin Clark-Casey (justincc)
c4972e7734 Add osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) variant.
This will be documented soon.  Options can currently be
  OS_NPC_CREATE_OWNED - creates a 'creator owned' avatar that will only respond to osNpc* functions made by scripts owned by the npc creator
  OS_NPC_NOT_OWNED    - creates an avatar which will respond to any osNpc* functions that a caller has permission to make (through the usual OSSL permission mechanisms).

options is being added to provide better scope for future extensibility without having to add more functions
The original non-options osNpcCreate() function will continue to exist.
2012-01-12 19:37:30 +00:00
Justin Clark-Casey (justincc)
d27dd3714f Allow all NPCs to show up on sensors as all osNpc* script methods now check for ownership permission before executing.
As per #opensim-dev irc discussion.
2012-01-12 19:19:34 +00:00
Justin Clark-Casey (justincc)
ba3491c76e Add permissions checks for owned avatars to all other osNpc* functions.
This is being done outside the npc module since the check is meaningless for region module callers, who can fake any id that they like.
2012-01-12 19:06:46 +00:00
Justin Clark-Casey (justincc)
0a1d61950b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-12 19:03:26 +00:00
Diva Canto
cadd645076 Renamed one var and deleted commented code. No functional changes. 2012-01-12 10:22:52 -08:00
Justin Clark-Casey (justincc)
b47c0d7e51 refactor: Move existing npc owner checks to NPCModule.CheckPermissions() methods and expose on interface for external calls. 2012-01-12 18:14:19 +00:00
Diva Canto
8bdd80abfa HG: normalize all externalized user ULRs to be the Home URL, i.e. the location of the user's UAS. This corrects an earlier design which had some cases pointing to the profile server. WARNING: CONFIGURATION CHANGES in both the sims (*Common.ini) and the Robust configs (Robust.HG.ini). Please check diff of the example files, but basically all vars that were pointing to profile should point to the UAS instead and should be called HomeURI. 2012-01-12 09:56:35 -08:00
Melanie
4492bc1bcd Merge branch 'master' into careminster 2012-01-12 17:52:29 +00:00
Bo Iwu
6214e6a217 Allow update of stored entries within User Management Module-this is needed for proper work of HG friends.
See http://opensimulator.org/mantis/view.php?id=5847
2012-01-12 17:51:13 +00:00
Michelle Argus
34137ed4ea Correcting ini.example were permissionmodules uses komma instead of space as separator 2012-01-12 12:27:41 -05:00
Melanie
5d9e135b5c Remove ViewObjectInventory method unsupported by core 2012-01-12 01:11:05 +01:00
Melanie
1a3a1e6665 Adapt a cast to using the new TeleportFlags 2012-01-11 19:00:17 +01:00
Justin Clark-Casey (justincc)
38db874755 If deserializing a scene object fails during IAR load then ignore the object rather than halting the IAR load with an exception. 2012-01-11 14:33:26 +00:00
Mic Bowman
5f7e392c7c Add a check to see if an asset exists before recreating it while
loading an archive. This does add an extra roundtrip to the asset
server if loading new assets but it protects against overwriting
(and potentially corrupting) existing assets.
2012-01-10 16:26:01 -08:00
Justin Clark-Casey (justincc)
53fb20880c minor: Fix wrong column length in image queues report 2012-01-10 22:02:35 +00:00
Justin Clark-Casey (justincc)
5002f06d24 rename "show image queue" to "show image queues" in line with other udp info commands.
Eliminate redundant one line methods
2012-01-10 21:36:35 +00:00
Justin Clark-Casey (justincc)
ef074deb52 Add "show image queue <first-name> <last-name>" region console command
This is so that we can inspect the image download queue (texture download via udp) for debugging purposes.
2012-01-10 21:30:12 +00:00
Melanie
8fa1108b72 Merge branch 'master' into careminster 2012-01-10 21:28:59 +00:00
Melanie
a4c2e7f599 Merge branch 'master' into careminster 2012-01-10 20:34:43 +00:00
BlueWall
a2fe3e2081 Remove DEBUG option
Remove DEBUG option from OpenSim.ini.example as it is handled in the console now with "debug teleport"
2012-01-10 15:29:08 -05:00
Diva Canto
ce44f56af9 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-10 11:11:08 -08:00
Diva Canto
7b84942f86 HG landing points: this hopefully fixes some confusion that was making HG avies always land in 0,0 2012-01-10 11:10:47 -08:00
Justin Clark-Casey (justincc)
18497cef73 Add avatar names to appearance log messages 2012-01-10 18:54:20 +00:00
Justin Clark-Casey (justincc)
a3bb1a81de correct very minor typo in "debug scene" help 2012-01-10 18:47:30 +00:00
BlueWall
66783398d0 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-10 13:43:42 -05:00
Justin Clark-Casey (justincc)
d67e9916b8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-10 18:42:37 +00:00
BlueWall
3deb52d399 Teleport Debugging
Move setting from ini to existing facitilies - thanks justincc

	toggle with console command: debug teleport
2012-01-10 13:41:35 -05:00
Justin Clark-Casey (justincc)
d67e8291c8 Add "app find <uuid-or-start-of-uuid>" command to find the appearance using a particular baked texture, if any.
This is for debugging to relate texture console entries back to particular users on the simulator end.
2012-01-10 18:41:07 +00:00
Melanie
1cc685e820 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2012-01-10 18:33:32 +00:00
Diva Canto
a22d0dcab9 HG Friends: fixed bug introduced by 571efeddb2 (r/17672) 2012-01-10 09:58:53 -08:00
BlueWall
707c8c6f2b Add some run-time debugging support
Add configuration option - DEBUG to enable debugging methods. This is temporary for helping users testing teleport routing be able to report back the data with the test cases. We can remove when finished with this, or leave it if it proves to be useful.

	Users: set DEBUG = true in OpenSim.ini to get more information from teleport routing. The default is false. It presently prints the TeleportFlags value.
2012-01-09 18:19:55 -05:00
BlueWall
b3a12167d6 Use our TeleportFlags
Switch to our TeleportFlags enum instead of LibOMV because we need to define a type for HG Logins. Also moved some debugging in ScenePresence into a function to make it simpler to enable/disable.
2012-01-09 17:54:35 -05:00
BlueWall
95345521f0 TP Routing debug
Fix test to checking against bitfield instead of int
2012-01-09 17:04:34 -05:00
BlueWall
3640afdd95 Fix teleport routing for incoming HG+Owner
Incoming HG owner/estate manager, etc. is routed according to the rules defined for teleports within the local grid. Left some commented debugging code inside so we can test other cases. Will remove when tings are settled in.
2012-01-09 14:31:22 -05:00
Melanie
bc08cc201b Merge branch 'master' into careminster 2012-01-09 19:22:06 +00:00
BlueWall
43145c7f67 Debugging HG teleport routing
Add some temporary debugging to the teleport routing to get a better view of what happens when HG jumps are made.
2012-01-09 13:07:02 -05:00
Melanie
520b8b342e Merge branch 'master' into careminster 2012-01-09 06:52:46 +00:00
BlueWall
34c42cdab0 Fix HG teleport routing
Needed to breakout the ViaHGLogin check to it's own section. For some reason it would not factor in when combined with the other teleport flag types.
2012-01-09 01:37:28 -05:00
Melanie
0e855fea7c Fix a build break 2012-01-09 01:05:19 +00:00
Melanie
1ebd79e413 Add the HG case to landing point checks 2012-01-09 00:54:59 +00:00
Melanie
0cf59534ff Update teleport routing to match Avination 2012-01-08 23:39:23 +00:00
Melanie
d5c5bbe0a1 Update teleport routing to match Avination 2012-01-08 23:38:43 +00:00
Melanie
44cde8d5c6 Update teleport routing to match Avination 2012-01-08 23:36:49 +00:00
BlueWall
37fc19fae0 Update building instructions
a good place to trigger a test on the opensimulator site
2012-01-08 18:21:09 -05:00
BlueWall
fb16d49511 Merge branch 'master' of /home/opensim/src/opensim 2012-01-08 17:56:03 -05:00
BlueWall
266167f5a3 Fix teleport routing
Route non-owner avatars according to land settings
2012-01-08 17:41:47 -05:00
Melanie
4bf2e19898 Merge branch 'master' into careminster 2012-01-07 18:11:21 +00:00
Melanie
32eb7ddc37 Fix threat level setting on osNpcPlayAnimation 2012-01-07 18:09:53 +00:00
Melanie
6f19e231b6 Don't try to save a NPCs attachment states on NPC delete 2012-01-07 18:09:45 +00:00
Melanie
94fa6cb071 Fix threat level setting on osNpcPlayAnimation 2012-01-07 12:29:59 +01:00
Melanie
efe51fd5cb Don't try to save a NPCs attachment states on NPC delete 2012-01-07 12:06:21 +01:00
Melanie
69c0f252a4 Force the group tag of NPCs to "- NPC -" unless the name is completely blank. 2012-01-07 12:05:42 +01:00
nebadon
58cb7cd084 fix a typo "osNpcCreated" to "osNpcCreate" in OSSL threat level check 2012-01-06 23:07:48 -07:00
Melanie
38ae479249 Make sure to prefix NPC names with "NPC:" so they can't be mistaken for users 2012-01-07 02:49:52 +01:00
Justin Clark-Casey (justincc)
f4231f0628 minor: remove mono compiler warning 2012-01-07 00:32:32 +00:00
Justin Clark-Casey (justincc)
ba163ab05b Add method doc to SPA.Falling and use automatic private get property 2012-01-07 00:29:55 +00:00
Justin Clark-Casey (justincc)
c5c079f6aa Fix bug where tapping home to stop falling would stop any avatar movement other than falling again.
Addresses http://opensimulator.org/mantis/view.php?id=5839
2012-01-07 00:17:40 +00:00
Melanie
679d155a39 Fix some syntax issues 2012-01-06 23:08:18 +00:00
Melanie
9668992493 Add osNpcPlayAnimation and osNpcStopAnimation which respect ownership as well 2012-01-06 22:59:50 +00:00
Melanie
1cffd8fa03 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-01-06 22:36:35 +00:00
Melanie
7518b075b7 Add osNpcCreateOwned to create an owned NPC. Those can be sensed only by the owner, can be destroyed only by the owner and only the owner can save their appearance. Added "NPC" as a flag to llSensor to sense NPCs and exclude them from "AGENT" results. 2012-01-06 22:35:06 +00:00
Justin Clark-Casey (justincc)
3073370d0e Allow RemoteAdmin to deal with all the different kinds of region id parameter that have been used in different methods.
See http://opensimulator.org/mantis/view.php?id=5814
Thanks Michelle Argus!
2012-01-06 22:29:27 +00:00
Justin Clark-Casey (justincc)
9bab43b4d1 eliminate a few tabs from OpenSimDefaults.ini 2012-01-06 21:36:30 +00:00
Melanie
70157a4ec5 Fix some syntax issues 2012-01-06 22:33:51 +01:00
Melanie
a47aa46962 Add osNpcPlayAnimation and osNpcStopAnimation which respect ownership as well 2012-01-06 22:59:08 +00:00
Melanie
a34278cfc3 Merge branch 'master' into careminster
Conflicts:
	OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
2012-01-06 22:41:26 +00:00
Justin Clark-Casey (justincc)
5f682b51ec Add disabled Cap_FetchInventory2 = "" reference to [ClientStack.LindenCaps] in line with all the other ones that are there 2012-01-06 21:29:18 +00:00
John Cochran
ff5a83d192 Fixed llAngleBetween() to allow denormal rotations 2012-01-06 21:14:42 +00:00
Justin Clark-Casey (justincc)
8c445dac67 Add script instruction count back to llRot2Euler. Other minor formatting/doc changes. 2012-01-06 21:12:22 +00:00
John Cochran
eb9bf71726 Replaced llRot2Euler function.
The original function suffered from unexpected results due to rounding
errors. An error of only 1 or 2 ulps would cause the code to not detect
a singularity at Y rotation +/- PI/2 and take the non-singularity code
path. The replacement code does not suffer from wildly inaccurate
results at the +/- PI/2 singularity. The check in the code for the
singularity isn't strictly needed, but gives more consistent results
At the singularity, the X and Z rotations add. The if check simply
forces the X rotation to be zero so the entirety of the X+Z rotation is
carried by Z.

Additionally, the test code has been updated to include test cases that
caused the old code to fail. The test algorithm is also updated to
perform a more meaningful test. The original code checked if the values
against expected values. This could fail at +/- PI rotations since a
rotation around an axis by PI causes the identical effect as a rotation
by -PI. The new test code checks that the returned angles can be used
to recreate a quaternion that causes the same rotation.
2012-01-06 21:08:54 +00:00
Justin Clark-Casey (justincc)
7661a0b2a9 Implement the FetchInventory2 capability. This accompanies the existing FetchInventoryDescendents2 capability.
Not yet enabled by default.  You can enable this by setting Cap_FetchInventory2 = "localhost" in the [ClientStack.LindenCaps] section of OpenSim.ini
Enabling both FetchInventory2 and FetchInventoryDescendents2 improves the situation with properly fetching attachments and hud objects
Probably because viewers are never expecting the odd situation where FetchInventoryDescendents2 is present but not FetchInventory2
However, for some reason attachments and hud objects occasionally fail to appear, though their status is correct in inventory
For attachments, focussing on the avatar makes them appear.  Hud objects have to be reattached.
2012-01-06 21:07:34 +00:00
Melanie
de9d6096a5 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-06 21:37:01 +01:00
Melanie
11c48ac807 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
2012-01-06 21:41:36 +00:00
John Cochran
e9b9eb6a4c Replaced llRot2Euler function.
The original function suffered from unexpected results due to rounding
errors. An error of only 1 or 2 ulps would cause the code to not detect
a singularity at Y rotation +/- PI/2 and take the non-singularity code
path. The replacement code does not suffer from wildly inaccurate
results at the +/- PI/2 singularity. The check in the code for the
singularity isn't strictly needed, but gives more consistent results
At the singularity, the X and Z rotations add. The if check simply
forces the X rotation to be zero so the entirety of the X+Z rotation is
carried by Z.

Additionally, the test code has been updated to include test cases that
caused the old code to fail. The test algorithm is also updated to
perform a more meaningful test. The original code checked if the values
against expected values. This could fail at +/- PI rotations since a
rotation around an axis by PI causes the identical effect as a rotation
by -PI. The new test code checks that the returned angles can be used
to recreate a quaternion that causes the same rotation.
2012-01-06 21:30:51 +00:00
Melanie
f1846045a6 Add osNpcCreateOwned to create an owned NPC. Those can be sensed only by the owner, can be destroyed only by the owner and only the owner can save their appearance. Added "NPC" as a flag to llSensor to sense NPCs and exclude them from "AGENT" results. 2012-01-06 21:34:43 +01:00
Melanie
2304420f6d Merge branch 'master' into careminster 2012-01-06 17:44:07 +00:00
Melanie
f8c15d38a6 If dragging a script that is no copy from prim inventory into agent
inventory, stop it first in scene. If deleting from prims, move to trash
rather then making it poof.
2012-01-06 17:43:35 +00:00
Melanie
3003133a66 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-01-06 17:39:39 +00:00
Melanie
81cf774fe8 Merge branch 'master' into careminster 2012-01-06 17:38:53 +00:00
Melanie
fbb2a7e90d Add ThreatLevel.NoAccess to OSSL. This allows to enable OSSL without enabling
any methods, even those without threat, automatically. It is for use with
setups wanting to allow only specific methods to specific users.
2012-01-06 17:37:22 +00:00
Melanie
31dc5aa728 If dragging a script that is no copy from prim inventory into agent
inventory, stop it first in scene. If deleting from prims, move to trash
rather then making it poof.
2012-01-06 13:15:04 +01:00
Melanie
db482cb7dd Fix up asset stuff 2012-01-06 00:04:32 +01:00
BlueWall
b06d878790 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-05 17:55:24 -05:00
Melanie
23ce1dfc27 Remove a dangling command registration 2012-01-05 23:54:51 +01:00
Melanie
fdfc4ab2a8 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
2012-01-06 00:08:18 +00:00
BlueWall
f252161941 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-05 17:54:51 -05:00
Justin Clark-Casey (justincc)
b86e7715a8 Improve "j2k decode" command to tell us how many layers and components were decoded, instead of just success/failure 2012-01-05 22:54:33 +00:00
BlueWall
e393b47da8 Merge branch 'new_modules' 2012-01-05 17:54:05 -05:00
BlueWall
2b4edd659f Adding empty ISearchModule interface 2012-01-05 17:53:03 -05:00
Justin Clark-Casey (justincc)
5ea9740f1b Add a "j2k decode" region console command that allows a manual request for a JPEG2000 decode of an asset
For debugging purposes.
2012-01-05 22:40:49 +00:00
Justin Clark-Casey (justincc)
da0fc3c8f5 Make "show asset" command available simulator side. Actually make the service command be "show asset" instead of "show digest" this time.
Last time I accidnetally just changed the usage message.
2012-01-05 21:11:32 +00:00
Justin Clark-Casey (justincc)
f06acc0a85 Add size and temporary information to "show asset" command 2012-01-05 21:05:10 +00:00
Justin Clark-Casey (justincc)
5b160f5b7b Rename 'show digest' console command to 'show asset' 2012-01-05 20:56:29 +00:00
Justin Clark-Casey (justincc)
7319ba62dd Move simulator asset info commands to an optional module from the connector. Make them conform with service side commands.
This stops them appearing twice when Hypergrid is enabled.
2012-01-05 20:51:49 +00:00
Justin Clark-Casey (justincc)
f2ff6d5186 Move asset commands from AssetService to AssetServerConnector so that we can harmonise the same commands on the simulator side.
No functional change.
2012-01-05 20:33:44 +00:00
Justin Clark-Casey (justincc)
50e459d265 recomment log messages I accidentally left uncommented 2012-01-05 19:44:06 +00:00
Justin Clark-Casey (justincc)
c201b54b85 Improve "app rebake" command to return a better message if no uploaded texture ids were available for the rebake request 2012-01-05 19:40:54 +00:00
Justin Clark-Casey (justincc)
da6c816204 Commenting out DataSnapShot message "Registering service discovery capability" for now.
Please uncomment if/when needed.
2012-01-05 17:10:38 +00:00
Melanie
2c401b7359 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-01-05 08:12:34 +00:00
Melanie
97ba3c9346 Small fix to GetWorldPosition to get closer to Avination sit behavior 2012-01-05 08:11:52 +00:00
Melanie
e9296721c7 That needs to be callable from elsewhere! 2012-01-05 08:04:04 +01:00
Melanie
85d82c8140 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-01-05 07:43:16 +01:00
Melanie
1ebc9d04aa Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
2012-01-05 08:15:33 +00:00
Melanie
045f3b8b11 Clean up GetWorldPosition 2012-01-05 07:37:31 +01:00
Melanie
32b8fa4a77 Prevent spurious "CHANGED_POSITION" during region backup 2012-01-05 07:37:09 +01:00
Justin Clark-Casey (justincc)
8fb70a2058 Add "appearance rebake" command to ask a specific viewer to rebake textures from the server end.
This is not as useful as it sounds, since you can only request rebakes for texture IDs already received.
In other words, if the viewer has never sent the server this information (which happens quite often) then it will have no effect.
Nonetheless, this is useful for diagnostic/debugging purposes.
2012-01-04 22:45:07 +00:00
Justin Clark-Casey (justincc)
0634c38505 Separate out rebake request code from cache validation code AvatarFactoryModule.
This allows some logic simplification and allows an external caller to manually request rebakes even if textures are uploaded (future command).
2012-01-04 22:22:46 +00:00
Justin Clark-Casey (justincc)
7e6c84c334 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-04 21:41:28 +00:00
Justin Clark-Casey (justincc)
3a64522267 Minor formatting changes and commented out log lines for future debugging of image manager (udp texture fetch). No significant functional changes. 2012-01-04 21:40:15 +00:00
Dan Lake
3a2ac0e2ee Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-04 12:01:32 -08:00
Dan Lake
fc391d4b10 Added EventManager.OnRegionStarted which is triggered when Heartbeat is started. 2012-01-04 12:01:18 -08:00
Justin Clark-Casey (justincc)
aa625da6a6 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-04 19:53:48 +00:00
Justin Clark-Casey (justincc)
82df5de5cf Remove the pointless LLClientView.m_imageManager null check.
Despite the code comments we never actually null it.
2012-01-04 16:15:05 +00:00
Dan Lake
ecf9824b63 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-03 16:52:53 -08:00
Dan Lake
0ab2289cdc Access to these static methods to serialize objects are useful outside of serializer 2012-01-03 16:52:08 -08:00
Justin Clark-Casey (justincc)
6166a40440 Update C5.dll to version 1.1.1 from 1.1.0
C5 is a collections library and can be found at http://www.itu.dk/research/c5/
This is used in the UDP texture (image) sending code.
2012-01-03 20:22:15 +00:00
Justin Clark-Casey (justincc)
983b49c0c8 commented out "Prevented flyoff" log message for now as this becomes problematic with bot testing.
Please uncomment if still needed.
2012-01-03 18:25:31 +00:00
Justin Clark-Casey (justincc)
01eacd3a31 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-03 18:22:14 +00:00
BlueWall
e78a3913e0 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-01-03 12:22:13 -05:00
BlueWall
2c8e72217e Merge branch 'new_modules' 2012-01-03 12:20:49 -05:00
BlueWall
6941058824 Profile Updates
Update basic profile to use the replaceable interface, making configuration less error-prone. Add support to query avatar's home user account and profile service for regions usng the updated OpenProfileModule with Hypergrid.
2012-01-03 11:10:23 -05:00
Justin Clark-Casey (justincc)
fa79588a20 minor: add missing newlines to pCampbot usage statement 2012-01-03 15:42:36 +00:00
Melanie
a6e305063e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs
	OpenSim/Services/Interfaces/IUserAccountService.cs
2012-01-02 21:41:36 +00:00
Justin Clark-Casey (justincc)
fac8c25851 Reduce accessibility of some J2KImage/LLImageManager properties and methods to reduce potential code complexity and make code reading easier. 2012-01-02 21:31:42 +00:00
Justin Clark-Casey (justincc)
014a86c26b Adding commented out log messages and some minor formatting for future bug hunting. No functional changes. 2012-01-02 19:46:30 +00:00
BlueWall
87374274b9 Fix for failed http request status
Thanks "sendapatch" for fixes to llHTTPRequest status reporting.
2012-01-01 23:44:46 -05:00
Diva Canto
56dbcae402 Bug fix in map tiles in standalone: the map has been blank since commit 01ae916bad r/17324 (Nov.18, justincc). But the root cause comes from commit 02e54c57c4 Author: Oren Hurvitz Date: 7/22/2011
This is a nasty situation. The map tile UUID is, in principle, stored authoritatively in RegionSettings. However, it also needs to be stored in the Grid Service because that's how other sims can retrieve it to send it in Map Blocks to non-V3 viewers. So every time the tile image changes, that change needs to propagate to the Grid Service, and this is done via RegisterRegion (ugh!). Interestingly, this problem didn't affect grids because by default AllowRemoteDelete is false, so the prior images aren't being deleted from the asset servers -- but they were not being correctly updated in the map either, the map was stuck with old images.
2011-12-30 21:32:28 -08:00
Diva Canto
5d8ed077bc Bring back the Hyperlinker to the Robust console. Moved the config to [GridService]. Changed all HG-related .inis, including HyperSimianGrid. No changes in user-facing inis. 2011-12-30 19:17:35 -08:00
Diva Canto
5aad1f7afe Default LocalToGrid to true. Fixes minor bug introduced yesterday where old robust UserAccount service would result is LocalToGrid at the sim being false. 2011-12-30 10:40:57 -08:00
Mic Bowman
967ea51980 Set the local grid flag in the user account through the simian connector
This should make bi-directional hypergrid work.
2011-12-29 16:37:16 -08:00
Diva Canto
571efeddb2 Added UserManagementModule.IsLocalGridUser(UUID) to be used throughout region Scenes and Modules. Changed existing modules to use it instead of assuming that foreign = null account. 2011-12-29 16:12:06 -08:00
Diva Canto
42f5394677 Added field LocalToGrid in UserAccount. Context: make HG work in Simian. 2011-12-29 15:39:12 -08:00
Diva Canto
98ab3dffa3 Deleted two obsolete files in Inventory modules. 2011-12-29 15:33:04 -08:00
Diva Canto
ef4d989f37 Deleted unused methods from HGAssetBroker 2011-12-29 15:21:56 -08:00
Diva Canto
6974596e83 Fixed mix-up in UserAccount fields when passing UserAccounts remotely. 2011-12-29 12:34:57 -08:00
Diva Canto
b756077269 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-29 12:18:22 -08:00
Diva Canto
70e36ee2b4 HG: more adjustments for making HG Simian work. Added server_uri as new key on get_agent_home in UAS. 2011-12-29 12:17:58 -08:00
Melanie
bde004c08e Merge branch 'master' into careminster 2011-12-28 09:24:35 +00:00
Melanie
5b52440e61 Introduce a LightShare kill packet ans send it when needed. Currently only
understood by AVN v0.3
2011-12-28 09:24:02 +00:00
Melanie
bf4d727cd5 Fix permissions being lost and correct slam behavior, removing icompatible
code inherited from core and dead code.
2011-12-27 14:04:49 +01:00
Melanie
ad1c6442cd Remove a debug spam 2011-12-27 01:40:44 +01:00
BlueWall
f36fe45fa7 Add Copy task to Prebuild.exe (vsxxxx targets)
<Files>
    <Match pattern="*.cs" recurse="true"/>
    <Match pattern="../bin/MyConfig.xml" buildAction="Copy" recurse="false" destination="$(OutputPath)" />
  </Files>
2011-12-25 00:04:42 -05:00
Diva Canto
b6cfe15c7c HG: more / love for Xmas 2011-12-24 07:44:26 -08:00
Melanie
41f6d6a5ff Introduce a LightShare kill packet ans send it when needed. Currently only
understood by AVN v0.3
2011-12-24 16:18:01 +01:00
Melanie
2e07d24199 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2011-12-24 01:46:04 +01:00
Melanie
c4e16b26bb Merge branch 'master' into careminster 2011-12-24 02:21:35 +00:00
Melanie
c9dbcfbb31 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2011-12-24 01:43:44 +01:00
Melanie
f2855d3668 Add setter for Acceleration on physics objects. 2011-12-24 01:41:32 +01:00
Melanie
5b28e29530 Fix camera orientation for sit targets to use the prim actually sat on.
Now SL compatible.
2011-12-24 01:40:58 +01:00
Melanie
04806e02ed Add PRIM_POS_LOCAL as an alias to PRIM_POSITION for setting the position.
For SL compatibility only
2011-12-24 01:40:09 +01:00
Diva Canto
f9a1fd5748 HG: one more adjustment with trailing /s 2011-12-23 15:08:13 -08:00
Diva Canto
d38b8caf2b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-23 10:58:55 -08:00
Diva Canto
26bb95fe3d HG: AAdded a few missing /'s at the end of URLs 2011-12-23 10:58:30 -08:00
Mic Bowman
c6ce464dbc remove the old region crossing handler 2011-12-23 10:13:32 -08:00
Melanie
b8a914b15b Merge branch 'master' into careminster 2011-12-23 01:00:34 +00:00
Mic Bowman
456c89a7a3 Fixes some problems with objects that attempt to cross a region boundary
into a region that does not exist. This is particularly problematic for
physical objects where the velocity continues to move them out of the
region causing an infinite number of failed region crossings. The patch
forces an object that fails a crossing to be non-physical and moves it
back into the starting region.
2011-12-22 16:59:51 -08:00
Mic Bowman
f394cb2e8f fix the UsesPhysics flag to reference the physics flag rather than the temponrez flag 2011-12-22 16:21:32 -08:00
Mic Bowman
6b08c051a3 Enables processing of hypergrid links through simiangrid services. Thanks
otakup0pe
2011-12-22 15:31:51 -08:00
Justin Clark-Casey (justincc)
790ca65c84 Align default ODE_STEPSIZE with that already used through OpenSimDefaults.ini 2011-12-22 20:22:15 +00:00
Justin Clark-Casey (justincc)
7ccd8f8f1d rename Scene.m_physicalPrim to PhysicalPrims since its public and access external as a property 2011-12-22 19:57:50 +00:00
Melanie
eef6f92029 Merge branch 'master' into careminster 2011-12-22 19:52:59 +00:00
Justin Clark-Casey (justincc)
f7dbdba447 Remove unused m_physicalPrim parameter from SOG.ApplyPhysics() 2011-12-22 19:52:09 +00:00
Justin Clark-Casey (justincc)
48113f0fc8 Make it possible to force all prims to be phantom via the collidable_prim boolean setting in the OpenSim.ini config [Startup] section.
Naturally, default is true.
When set to false, "phantom" flags on prims can be set as usual but all prims remain phantom.
This setting is for test purposes.
This switch does not affect the collision of avatars with the terrain.
2011-12-22 19:44:52 +00:00
Melanie
a15a58a7c1 Merge branch 'master' into careminster 2011-12-22 17:33:31 +00:00
Diva Canto
469955889e Region crossings redone: (1) removed WaitForCallback. Now that we are passing the entire agent with attachs in one big message we don't necessarily need to wait for confirmation. The callback sometimes is problematic and it adds delay to the process. (2) Z velocity sent to the viewer = 0. This is an heuristic; the Z velocity usually is negative, and it makes the viewer move the avie down. This only matters while the agent is in transit and therefore not being physically simulated by neither region. As soon as the receiving region receives CompleteMovement from the viewer, the position and velocity get corrected. 2011-12-22 09:30:06 -08:00
Melanie
b72dd852b7 Merge branch 'master' into careminster 2011-12-22 16:58:38 +00:00
Melanie
7f527814d5 And a typo fix 2011-12-22 16:57:49 +00:00
Melanie
66a0471efa Merge branch 'master' into careminster 2011-12-22 16:52:14 +00:00
Melanie
6412349dec Add a few comments, correct a merge artefact 2011-12-22 16:51:51 +00:00
Melanie
c63d5f8e0c Merge branch 'master' into careminster 2011-12-22 16:49:15 +00:00
Melanie
2347593dac Harmonizing SP with Avination 2011-12-22 16:48:52 +00:00
Melanie
b970d4f976 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2011-12-22 16:37:25 +00:00
Diva Canto
219ec7ef20 Fixing a bug introduced yesterday. This put the precondition test inside CheckForBorderCrossing the right way. 2011-12-22 08:18:03 -08:00
Diva Canto
bb0c6a498b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-21 15:17:44 -08:00
Diva Canto
ddff2f246c Moved an external test into the method that uses those preconditions. 2011-12-21 15:17:26 -08:00
Diva Canto
651f9f47d0 HG: Verify that the user is local 2011-12-21 14:56:38 -08:00
Dan Lake
7693e6a3a8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-20 14:46:44 -08:00
Dan Lake
41b02a7208 Remove unused SetAcceleration and add set on Acceleration parameter 2011-12-20 14:45:32 -08:00
Melanie
ca6113a4d5 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
2011-12-20 21:51:43 +00:00
Dan Lake
a1dc4e830d Remove unused SetAcceleration and add set on Acceleration parameter 2011-12-20 13:40:24 -08:00
Justin Clark-Casey (justincc)
fa0a71253f Though the viewer warns about receiving this, not sending appears to break baked texture caching when crossing region boundaries.
Needs further investigation.

Revert "Stop sending the viewer its own AvatarAppearance packet."

This reverts commit 92039f295d.
2011-12-20 18:54:15 +00:00
Diva Canto
dd69c9fd20 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-20 09:53:05 -08:00
Diva Canto
25cbba9bca Fixed bug of avie going under the terrain when crossing regions in certain directions. This was a 1-off bug: the terrain was being placed in 127, 127 resulting in a bounding box if -2, 256. I placed it in 128, 128 resulting in a bounding box of -1, 257. 2011-12-20 09:43:39 -08:00
Melanie
2b4ebe657c Merge branch 'master' into careminster 2011-12-19 23:16:20 +00:00
Justin Clark-Casey (justincc)
87a2d8d51b Move HandleObjectGroupUpdate() from GroupsModule to Scene.PacketHandlers.cs as this is updating SOG/SOP.GroupID, which is arguably generic. 2011-12-19 23:03:45 +00:00
Melanie
efa4284391 Merge branch 'master' into careminster 2011-12-19 21:30:57 +00:00
Justin Clark-Casey (justincc)
92039f295d Stop sending the viewer its own AvatarAppearance packet.
The viewer warns in the log if it receives this.
Stopping this doesn't appear to have adverse effects on viewer 1 or viewer 3 - the viewer gets its own appearance from body parts/clothes and self-baked textures.
2011-12-19 20:13:48 +00:00
Justin Clark-Casey (justincc)
2899de1a5c Stop unnecessarily sending the TextureEntry in client avatar updates.
As far as I know, viewers don't use this mechanism to recieve new TextureEntry data for avatars.  This is done via the AvatarAppearance packet instead.
Tested this back to viewer 1.23.
Replacing with Utils.EmptyBytes since converting the texture entry to bytes on each AvatarUpdate (or which there are many) is not cost-free.
2011-12-19 19:19:05 +00:00
Justin Clark-Casey (justincc)
e8fbeeba5f Fix race condition where the appearance update timer could be stopped just after another thread had started it on QueueAppearanceSave() or *Send()
However, the window for this race is very small, and the next queued appearance save or send would restart the timer anyway.
2011-12-19 19:08:24 +00:00
Justin Clark-Casey (justincc)
fc9400db07 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-19 19:07:35 +00:00
Justin Clark-Casey (justincc)
0b91ec8dd2 Migrate detailed "appearance show" report generation up to AvatarFactoryModule from AppearanceInfoModule so that it can be used in debug (inactive).
Further filters "debug packet <level>" to exclused [Request]ObjectPropertiesFamily if level is below 25.
Adjust some method doc
Minor changes to some logging messages.
2011-12-19 18:58:05 +00:00
nebadon
6baee2e10b addresses mantis #5827
RAdmin - admin_save_oar fails if noassets parameter missing
thanks Michelle Argus
2011-12-19 11:51:03 -07:00
Melanie
759f1d2dbe Merge branch 'master' into careminster 2011-12-18 10:49:45 +00:00
Melanie
c4f1906b0a Make raycast more efficient by checking exclusion flags earlier 2011-12-17 12:57:20 +01:00
Melanie
8a9a8ed5c9 Fix hit testing link sets properly. Fix raycasting for LSL. 2011-12-17 12:31:25 +01:00
Justin Clark-Casey (justincc)
4d065f0453 Provide user feedback on execution of "backup" region console command 2011-12-17 02:42:43 +00:00
Justin Clark-Casey (justincc)
684482352c Fix bug where objects couldn't be set back to the "none" group.
This is handled by treating UUID.Zero as a special case.
Currently, asking for the "none" group returns nothing because XMLRPC groups, at least, is not properly handling this case.
It may be better in the future to have GroupsModule return an appropriate GroupsData structure instead or require the underlying services to behave appropriately.
This is a further component of http://opensimulator.org/mantis/view.php?id=5588
2011-12-17 02:35:08 +00:00
Justin Clark-Casey (justincc)
f9137c923b Fix bug where objects could not be set to a new group if the group had been created in that client session, or if no other action has been performed on the object.
There were two problems here:
1) On object group update, we looked for the group is the IClientAPI group cache rather than in the groups service.  This fails to groups created newly in that session
2) On object group update, we weren't setting the HasGroupChanged flag.  This meant that the change was not persisted unless some other action set this flag.
This commit fixes these issues and hopefully addresses http://opensimulator.org/mantis/view.php?id=5588
This commit also moves HandleObjectGroupUpdate() to the GroupsModule from the Scene.PacketHandlers.cs file
2011-12-17 02:23:24 +00:00
Diva Canto
964ec57ffe Changed the async approach on close child agents. This may improve crossings a little bit. 2011-12-16 17:24:50 -08:00
Diva Canto
99623894c7 Commented a couple of verbose debug messages. 2011-12-16 17:23:30 -08:00
Justin Clark-Casey (justincc)
9b56cc69c1 Add Garmin Kawaguichi to CONTRIBUTORS.txt 2011-12-17 00:29:42 +00:00
Justin Clark-Casey (justincc)
7f019cc196 If a startup simulator script is present, run it after the normal region selection code rather than before.
This allows the script to change the selected region without having it immediately undone.
Thanks to Garmin Kawaguichi for this patch.
2011-12-17 00:27:19 +00:00
Justin Clark-Casey (justincc)
4f628849f3 Add more documentation to EstateConnectorString in StandaloneCommon.ini.example 2011-12-17 00:14:48 +00:00
Justin Clark-Casey (justincc)
1bf05fbb1f refactor: simplify methods in Scene.PacketHandlers.cs by using GetGroupByPrim() rather than retrieving GetEntities() and inspecting the entire list 2011-12-17 00:11:17 +00:00
Justin Clark-Casey (justincc)
a3a17e929e Stop generating client flags when we send out full object updates.
These were entirely unused.
2011-12-16 23:20:12 +00:00
Justin Clark-Casey (justincc)
5c4056660f Don't pass on ChaneWaterHeight event from EventManager is new water height is less than 0
This is to stop bad values and subsequent viewer crashes.
Thanks to Michelle Argus for this patch.
2011-12-16 21:16:01 +00:00
Justin Clark-Casey (justincc)
5d79f857b0 Comment out accidentally left in "Adding physics prim" log message 2011-12-16 20:54:28 +00:00
Justin Clark-Casey (justincc)
a9b39d6e5d Tunnel [GroupsModule] DebugEnabled setting down into XmlRpcGroupsServicesConnectorModule so that we can record cache misses 2011-12-16 20:53:50 +00:00
Diva Canto
8300bb651e Sends the consistent child agent position upon creation of the child agent in other regions, as opposed to <128, 128, 70> 2011-12-16 09:33:22 -08:00
Diva Canto
3bf699ad36 No functional changes. Changed the prefix of that log message [CONNECTION BEGIN] to [SCENE] because that's where the message happens.
Also changed the instantiation of a vector object to be done only once instead of every time we receive a position update.
2011-12-16 08:59:33 -08:00
Diva Canto
7e4a2d69d5 HG minor bug fix and marked one method obsolete in UAS. 2011-12-16 08:48:29 -08:00
Justin Clark-Casey (justincc)
8013c0d2f5 Stop pointlessly setting the m_colliderarr[] to false in the ODECharacter constructor 2011-12-15 22:33:14 +00:00
Justin Clark-Casey (justincc)
c0ba99e5ad Stop having to call SetHeight again in ScenePresence.AddToPhysicalScene() when we've already passed size information to the avatar at PhysicsScene.AddAvatar()
Eliminate some copypasta for height setting in OdeCharacter
2011-12-15 22:29:36 +00:00
Justin Clark-Casey (justincc)
99570d8ebb Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-15 21:59:01 +00:00
Justin Clark-Casey (justincc)
937c06db54 Code cleanup related to ScenePresence.PhysicsActor and OdeScene/OdeCharacter
Stop hiding RemoveAvatar failure, add log messages when characters are removed through defects or re-added unexpectedly.
Add commented out log lines for future use.
Use automatic property for PhysicsActor for better code readability and simplicity
2011-12-15 21:57:22 +00:00
nebadon
58ba81ae4e minor fix to MegaRegions, typo spotted by Ubit! 2011-12-15 10:49:15 -07:00
Justin Clark-Casey (justincc)
6f2d80cc93 minor: add some currently commented log lines for use in debugging 2011-12-14 21:27:47 +00:00
Melanie
69f29cb53e Merge branch 'master' into careminster 2011-12-14 19:50:43 +00:00
Justin Clark-Casey (justincc)
e830a77860 Simplify some manipulation of _taintedActors in OdeScene 2011-12-14 18:33:44 +00:00
Justin Clark-Casey (justincc)
a110a7bd6a Eliminate _taintedPrimsH and _taintedPrimsL (and _taintedPrimLock) in favour of just a _taintedPrims HashSet.
There's no point maintaining a list because any pending taint operations are all carried out in the same call anyway.
2011-12-14 18:03:25 +00:00
Justin Clark-Casey (justincc)
cec88872ae Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-12-14 17:59:55 +00:00
Justin Clark-Casey (justincc)
84023c8162 Fix off by one bug in objects GrabbingBehaviour of pCampBot.exe
Also fix usage message.
2011-12-14 16:43:49 +00:00
Melanie
898549d13e Merge branch 'master' into careminster 2011-12-14 08:57:55 +00:00
Dan Lake
f43e5f92fd Just adding a comment to SendFullUpdatToClient 2011-12-13 23:34:59 -08:00
Dan Lake
39736e52d8 Reorder clearing of upate schedule on SOP to before sending updates. Fix potential race condition. 2011-12-13 21:37:17 -08:00
Justin Clark-Casey (justincc)
b242ceda1e In AvatarFactoryModule.SetApperance(), perform ValidateBakedTextureCache() in the same thread rather than on another one.
The caller is already an async thread from LLClientView so this doesn't hold up the client.
However, launching on a separate thread does remove the effect of m_setAppearanceLock
This was potentially allowing two different SetAppearance threads to interfere with each other, though this probably rarely happens, if at all.
2011-12-13 20:42:39 +00:00
Melanie
df65245671 Spin off terrain save into a new thread and make it so that it uses the old
values for places where NaN are found.
2011-12-13 12:58:28 +01:00
Melanie
6d1d1c0dbf Comment debug spam 2011-12-13 00:36:44 +01:00
Melanie
d18a9f22e7 Prevent a nasty deadlock on teleport 2011-12-12 23:43:45 +01:00
Justin Clark-Casey (justincc)
3a06640730 Get rid of the 'lolcat' library asset.
This was both unused and an invalid jpeg2000 texture from way back in 2008
2011-12-12 21:17:01 +00:00
Justin Clark-Casey (justincc)
4dfd2c7d47 minor: remove pointless comment from OdeScene.cs 2011-12-12 19:31:50 +00:00
Justin Clark-Casey (justincc)
e9b59e7627 Remove long unused libdb_dotNET43.dll 2011-12-12 19:31:12 +00:00
Melanie
8418288e26 Make m_attachments private 2011-12-12 18:29:54 +01:00
Melanie
afab4b276e Remove spammy log messages when querying sim health 2011-12-12 13:51:31 +01:00
Melanie
95d533ce8a Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2011-12-12 11:09:13 +01:00
Melanie
943b37b8e6 Send changed animation event asynchronously 2011-12-12 11:08:50 +01:00
266 changed files with 13501 additions and 7973 deletions

View File

@@ -38,52 +38,8 @@
<include name=".hgignore"/>
</fileset>
</delete>
</target>
<!-- I don't think these targets are being actively used. But just in case, we'll just comment them out for now - justincc -->
<!--
<property name="projectdir" value="opensim-0.6.9" />
<target name="dist" depends="distdir">
<zip zipfile="${projectdir}.zip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</zip>
<tar destfile="${projectdir}.tar.gz" compression="GZip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</tar>
</target>
<target name="distdir">
<delete dir="${projectdir}" />
<copy todir="${projectdir}">
<fileset basedir=".">
<include name="ThirdPartyLicenses/**" />
<include name="CONTRIBUTORS.txt" />
<include name="README" />
<include name="OpenSim/**/*.cs" />
<include name="**/*.build" />
<include name="**/*.csproj" />
<include name="**/*.csproj.user" />
<include name="**/*.sln" />
<include name="bin/*.dll" />
<include name="bin/*.so" />
<include name="bin/*.config" />
<include name="bin/assets/**" />
<include name="bin/data/**" />
<include name="bin/OpenSim*xml" />
<include name="bin/OpenSim.ini" />
<include name="bin/defaultstripe.png" />
<exclude name="bin/OpenSim.*dll" />
</fileset>
</copy>
<touch file="${projectdir}/bin/startup_commands.txt" />
</target>
-->
<target name="test" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
@@ -153,116 +109,17 @@
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
<delete dir="%temp%"/>
</target>
<target name="test-cov" depends="build">
<!-- Code Coverage Test. Prototype, only works with mono 1.2. Instructions in http://opensimulator.org/wiki/Automated_Testing -->
<mkdir dir="cov" failonerror="false" />
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Framework.Servers.cov,+[OpenSim.Framework.Servers]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Framework.Servers" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Framework.Servers ./cov/OpenSim.Framework.Servers.cov" />
</exec>
<target name="torture" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
<!--
<exec program="mono">
<arg value="&#45;&#45;debug" />
<arg value="&#45;&#45;profile=monocov:outfile=./cov/OpenSim.Region.ClientStack.LindenUDP.cov,+[OpenSim.Region.ClientStack.LindenUDP]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.ClientStack.LindenUDP" />
<exec program="monocov">
<arg value="&#45;&#45;export-html=./cov/OpenSim.Region.ClientStack.LindenUDP ./cov/OpenSim.Region.ClientStack.LindenUDP.cov" />
</exec>
-->
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.ScriptEngine.Shared.cov,+[OpenSim.Region.ScriptEngine.Shared]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.ScriptEngine.Shared.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.ScriptEngine.Shared" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.ScriptEngine.Shared ./cov/OpenSim.Region.ScriptEngine.Shared.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools.cov,+[OpenSim.Region.ScriptEngine.Shared.CodeTools]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools ./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.CoreModules.cov,+[OpenSim.Region.CoreModules]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.CoreModules.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.CoreModules" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.CoreModules ./cov/OpenSim.Region.CoreModules.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.OptionalModules.cov,+[OpenSim.Region.OptionalModules]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.OptionalModules" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.OptionalModules ./cov/OpenSim.Region.OptionalModules.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.Framework.cov,+[OpenSim.Region.Framework]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Region.Framework" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Region.Framework ./cov/OpenSim.Region.Framework.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Data.SQLite.cov,+[OpenSim.Data.SQLite]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Data.SQLite.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Data.SQLite" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Data.SQLite ./cov/OpenSim.Data.SQLite.cov" />
</exec>
<exec program="mono">
<arg value="--debug" />
<arg value="--profile=monocov:outfile=./cov/OpenSim.Data.MySQL.cov,+[OpenSim.Data.MySQL.Tests]" />
<arg value="/usr/lib/nunit/nunit-console.exe" />
<arg value="./bin/OpenSim.Data.MySQL.Tests.dll" />
</exec>
<delete dir="./cov/OpenSim.Data.MySQL" />
<exec program="monocov">
<arg value="--export-html=./cov/OpenSim.Data.MySQL ./cov/OpenSim.Data.MySQL.cov" />
</exec>
<delete file="C:\NUnitPrimaryTrace.txt" failonerror="false" />
<delete file="TestResult.xml" failonerror="false" />
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.torture">
<arg value="./bin/OpenSim.Tests.Torture.dll" />
</exec>
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests.torture)==0}" />
<delete dir="%temp%"/>
</target>
<target name="find-nunit">
@@ -275,15 +132,12 @@
if="${int::parse(hasnunit2)==0}" />
<property name="nunitcmd" value="nunit-console"
if="${int::parse(hasnunit2)==1}" />
</target>
<!-- this is used for panda test execution -->
<!-- work in progress -->
<target name="test-xml" depends="build, find-nunit">
<mkdir dir="test-results" failonerror="false" />
<!-- Unit Test Assembly -->
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.tests">
@@ -356,36 +210,7 @@
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
</target>
<!-- <exec program="nunit-console.exe" failonerror="false" resultproperty="testresult.acceptancetestassembly"> -->
<!-- <arg value="AcceptanceTestAssembly.dll" /> -->
<!-- <arg value="/xml=AcceptanceTestAssembly-Results.xml" /> -->
<!-- </exec> -->
<!-- <fail message="Failures reported in unit tests." unless="${int::parse(testresult.unittestassembly)==0}" /> -->
<!-- <fail message="Failures reported in acceptance tests." unless="${int::parse(testresult.acceptancetestassembly)==0}" /> -->
<!-- </target> -->
<!-- <nunit2 failonerror="true" verbose="true"> -->
<!-- <formatter type="Xml" usefile="true" extension=".xml" outputdir="./test-results" /> -->
<!-- <test> -->
<!-- <assemblies> -->
<!-- <include name="./bin/OpenSim.Framework.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Framework.Servers.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.ScriptEngine.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.CoreModules.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.OptionalModules.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Region.Framework.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Data.SQLite.Tests.dll" /> -->
<!-- <include name="./bin/OpenSim.Data.MySQL.Tests.dll" /> -->
<!-- </assemblies> -->
<!-- </test> -->
<!-- </nunit2> -->
<!-- </target> -->
<target name="doxygen">
<exec program="doxygen" workingdir="doc" commandline="doxygen.conf" />

View File

@@ -17,13 +17,22 @@ Prereqs:
* On some Linux distributions you may need to install additional packages.
See http://opensimulator.org/wiki/Dependencies for more information.
* May also use xbuild (included in mono distributions)
* May use Monodevelop, a cross-platform IDE
From the distribution type:
* ./runprebuild.sh
* nant
* nant (or xbuild)
* cd bin
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* run mono OpenSim.exe
=== Using Monodevelop ===
From the distribution type:
* ./runprebuild.sh
* type monodevelop OpenSim.sln
=== References ===
Helpful resources:

View File

@@ -80,6 +80,7 @@ what it is today.
* dmiles (Daxtron Labs)
* dslake (Intel)
* FredoChaplin
* Garmin Kawaguichi
* Gerhard
* Godfrey
* Grumly57

View File

@@ -258,17 +258,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Request to restart Region.");
CheckStringParameters(requestData, responseData, new string[] {"regionID"});
CheckRegionParams(requestData, responseData);
UUID regionID = new UUID((string) requestData["regionID"]);
Scene rebootedScene = null;
GetSceneFromRegionParams(requestData, responseData, out rebootedScene);
Scene rebootedScene;
IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
responseData["success"] = false;
responseData["accepted"] = true;
if (!m_application.SceneManager.TryGetScene(regionID, out rebootedScene))
throw new Exception("region not found");
responseData["rebooting"] = true;
string message;
@@ -277,6 +275,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requestData.ContainsKey("alerts"))
{
string[] alertTimes = requestData["alerts"].ToString().Split( new char[] {','});
if (alertTimes.Length == 1 && Convert.ToInt32(alertTimes[0]) == -1)
{
if (restartModule != null)
{
message = "Restart has been cancelled";
if (requestData.ContainsKey("message"))
message = requestData["message"].ToString();
restartModule.AbortRestart(message);
responseData["success"] = true;
responseData["rebooting"] = false;
return;
}
}
foreach (string a in alertTimes)
times.Add(Convert.ToInt32(a));
}
@@ -309,7 +324,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
notice = false;
}
IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
if (restartModule != null)
{
restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice);
@@ -392,14 +406,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// }
CheckStringParameters(requestData, responseData, new string[] {"filename", "regionid"});
CheckRegionParams(requestData, responseData);
string file = (string) requestData["filename"];
UUID regionID = (UUID) (string) requestData["regionid"];
m_log.InfoFormat("[RADMIN]: Terrain Loading: {0}", file);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string file = (string)requestData["filename"];
responseData["accepted"] = true;
LoadHeightmap(file, regionID);
LoadHeightmap(file, scene.RegionInfo.RegionID);
responseData["success"] = true;
@@ -416,18 +431,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// m_log.DebugFormat("[RADMIN]: Save Terrain: XmlRpc {0}", request.ToString());
CheckStringParameters(requestData, responseData, new string[] { "filename", "regionid" });
CheckRegionParams(requestData, responseData);
Scene region = null;
GetSceneFromRegionParams(requestData, responseData, out region);
string file = (string)requestData["filename"];
UUID regionID = (UUID)(string)requestData["regionid"];
m_log.InfoFormat("[RADMIN]: Terrain Saving: {0}", file);
responseData["accepted"] = true;
Scene region = null;
if (!m_application.SceneManager.TryGetScene(regionID, out region))
throw new Exception("1: unable to get a scene with that name");
ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>();
if (null == terrainModule) throw new Exception("terrain module not available");
@@ -814,7 +827,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = true;
responseData["region_name"] = region.RegionName;
responseData["region_uuid"] = region.RegionID.ToString();
responseData["region_id"] = region.RegionID.ToString();
responseData["region_uuid"] = region.RegionID.ToString(); //Deprecate July 2012
m_log.Info("[RADMIN]: CreateRegion: request complete");
}
@@ -856,16 +870,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
lock (m_requestLock)
{
CheckStringParameters(requestData, responseData, new string[] {"region_name"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
string regionName = (string) requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(regionName, out scene))
throw new Exception(String.Format("region \"{0}\" does not exist", regionName));
GetSceneFromRegionParams(requestData, responseData, out scene);
m_application.RemoveRegion(scene, true);
responseData["success"] = true;
responseData["region_name"] = regionName;
responseData["region_name"] = scene.RegionInfo.RegionName;
responseData["region_id"] = scene.RegionInfo.RegionID;
m_log.Info("[RADMIN]: DeleteRegion: request complete");
}
@@ -905,44 +919,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
Scene scene = null;
lock (m_requestLock)
{
if (requestData.ContainsKey("region_id") &&
!String.IsNullOrEmpty((string) requestData["region_id"]))
{
// Region specified by UUID
UUID regionID = (UUID) (string) requestData["region_id"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
throw new Exception(String.Format("region \"{0}\" does not exist", regionID));
CheckRegionParams(requestData, responseData);
m_application.CloseRegion(scene);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
responseData["success"] = true;
responseData["region_id"] = regionID;
m_application.CloseRegion(scene);
response.Value = responseData;
}
else if (
requestData.ContainsKey("region_name")
&& !String.IsNullOrEmpty((string) requestData["region_name"]))
{
// Region specified by name
responseData["success"] = true;
responseData["region_name"] = scene.RegionInfo.RegionName;
responseData["region_id"] = scene.RegionInfo.RegionID;
string regionName = (string) requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(regionName, out scene))
throw new Exception(String.Format("region \"{0}\" does not exist", regionName));
m_application.CloseRegion(scene);
responseData["success"] = true;
responseData["region_name"] = regionName;
}
else
{
throw new Exception("no region specified");
}
response.Value = responseData;
m_log.Info("[RADMIN]: CloseRegion: request complete");
}
@@ -989,12 +980,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
lock (m_requestLock)
{
CheckStringParameters(requestData, responseData, new string[] {"region_name"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
string regionName = (string) requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(regionName, out scene))
throw new Exception(String.Format("region \"{0}\" does not exist", regionName));
GetSceneFromRegionParams(requestData, responseData, out scene);
// Modify access
scene.RegionInfo.EstateSettings.PublicAccess =
@@ -1024,7 +1013,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
responseData["success"] = true;
responseData["region_name"] = regionName;
responseData["region_name"] = scene.RegionInfo.RegionName;
responseData["region_id"] = scene.RegionInfo.RegionID;
m_log.Info("[RADMIN]: ModifyRegion: request complete");
}
@@ -1420,22 +1410,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
CheckStringParameters(requestData, responseData, new string[] {"filename"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string filename = (string) requestData["filename"];
Scene scene = null;
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TryGetScene(region_uuid, out scene))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(region_name, out scene))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
}
else throw new Exception("neither region_name nor region_uuid given");
bool mergeOar = false;
bool skipAssets = false;
@@ -1516,22 +1496,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
CheckStringParameters(requestData, responseData, new string[] {"filename"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string filename = (string)requestData["filename"];
Scene scene = null;
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TryGetScene(region_uuid, out scene))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(region_name, out scene))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
}
else throw new Exception("neither region_name nor region_uuid given");
Dictionary<string, object> options = new Dictionary<string, object>();
@@ -1540,12 +1510,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// options["version"] = (string)requestData["version"];
//}
if (requestData.Contains("profile"))
if (requestData.Contains("home"))
{
options["profile"] = (string)requestData["profile"];
options["home"] = (string)requestData["home"];
}
if (requestData["noassets"].ToString() == "true")
if ((string)requestData["noassets"] == "true")
{
options["noassets"] = (string)requestData["noassets"] ;
}
@@ -1603,25 +1573,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
CheckStringParameters(requestData, responseData, new string[] {"filename"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string filename = (string) requestData["filename"];
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else throw new Exception("neither region_name nor region_uuid given");
responseData["switched"] = true;
@@ -1669,23 +1626,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController
try
{
CheckStringParameters(requestData, responseData, new string[] {"filename"});
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
string filename = (string) requestData["filename"];
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else throw new Exception("neither region_name nor region_uuid given");
responseData["switched"] = true;
@@ -1724,35 +1670,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController
private void XmlRpcRegionQueryMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
{
m_log.Info("[RADMIN]: Received Query XML Administrator Request");
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
responseData["success"] = true;
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
CheckRegionParams(requestData, responseData);
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else
{
throw new Exception("neither region_name nor region_uuid given");
}
Scene scene = m_application.SceneManager.CurrentScene;
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
int flags;
string text;
@@ -1760,8 +1686,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["health"] = health;
responseData["flags"] = flags;
responseData["message"] = text;
m_log.Info("[RADMIN]: Query XML Administrator Request complete");
}
private void XmlRpcConsoleCommandMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
@@ -1787,24 +1711,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = true;
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
CheckRegionParams(requestData, responseData);
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else throw new Exception("neither region_name nor region_uuid given");
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
Scene scene = m_application.SceneManager.CurrentScene;
scene.RegionInfo.EstateSettings.EstateAccess = new UUID[]{};
if (scene.RegionInfo.Persistent)
@@ -1820,32 +1731,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else
{
throw new Exception("neither region_name nor region_uuid given");
}
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
int addedUsers = 0;
if (requestData.Contains("users"))
{
UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID;
IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService;
Scene scene = m_application.SceneManager.CurrentScene;
UUID scopeID = scene.RegionInfo.ScopeID;
IUserAccountService userService = scene.UserAccountService;
Hashtable users = (Hashtable) requestData["users"];
List<UUID> uuids = new List<UUID>();
foreach (string name in users.Values)
@@ -1884,32 +1780,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
responseData["success"] = true;
CheckRegionParams(requestData, responseData);
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else throw new Exception("neither region_name nor region_uuid given");
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
int removedUsers = 0;
if (requestData.Contains("users"))
{
UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID;
IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService;
UUID scopeID = scene.RegionInfo.ScopeID;
IUserAccountService userService = scene.UserAccountService;
//UserProfileCacheService ups = m_application.CommunicationsManager.UserProfileCacheService;
Scene scene = m_application.SceneManager.CurrentScene;
Hashtable users = (Hashtable) requestData["users"];
List<UUID> uuids = new List<UUID>();
foreach (string name in users.Values)
@@ -1936,6 +1818,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
responseData["removed"] = removedUsers;
responseData["success"] = true;
m_log.Info("[RADMIN]: Access List Remove Request complete");
}
@@ -1947,32 +1830,18 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
responseData["success"] = true;
CheckRegionParams(requestData, responseData);
if (requestData.Contains("region_uuid"))
{
UUID region_uuid = (UUID) (string) requestData["region_uuid"];
if (!m_application.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string) requestData["region_name"];
if (!m_application.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN]: Switched to region {0}", region_name);
}
else throw new Exception("neither region_name nor region_uuid given");
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
Scene scene = m_application.SceneManager.CurrentScene;
UUID[] accessControlList = scene.RegionInfo.EstateSettings.EstateAccess;
Hashtable users = new Hashtable();
foreach (UUID user in accessControlList)
{
UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID;
UserAccount account = m_application.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, user);
UUID scopeID = scene.RegionInfo.ScopeID;
UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, user);
if (account != null)
{
users[user.ToString()] = account.FirstName + " " + account.LastName;
@@ -1980,6 +1849,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
responseData["users"] = users;
responseData["success"] = true;
m_log.Info("[RADMIN]: Access List List Request complete");
}
@@ -2097,6 +1967,126 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
}
private void CheckRegionParams(Hashtable requestData, Hashtable responseData)
{
//Checks if region parameters exist and gives exeption if no parameters are given
if ((requestData.ContainsKey("region_id") && !String.IsNullOrEmpty((string)requestData["region_id"])) ||
(requestData.ContainsKey("region_name") && !String.IsNullOrEmpty((string)requestData["region_name"])))
{
return;
}
#region Deprecate July 2012
//region_ID, regionid, region_uuid will be deprecated in July 2012!!!!!!
else if (requestData.ContainsKey("regionid") &&
!String.IsNullOrEmpty((string)requestData["regionid"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
}
else if (requestData.ContainsKey("region_ID") &&
!String.IsNullOrEmpty((string)requestData["region_ID"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
}
else if (requestData.ContainsKey("regionID") &&
!String.IsNullOrEmpty((string)requestData["regionID"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
}
else if (requestData.ContainsKey("region_uuid") &&
!String.IsNullOrEmpty((string)requestData["region_uuid"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
}
#endregion
else
{
responseData["accepted"] = false;
throw new Exception("no region_name or region_id given");
}
}
private void GetSceneFromRegionParams(Hashtable requestData, Hashtable responseData, out Scene scene)
{
scene = null;
if (requestData.ContainsKey("region_id") &&
!String.IsNullOrEmpty((string)requestData["region_id"]))
{
UUID regionID = (UUID)(string)requestData["region_id"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
{
responseData["error"] = String.Format("Region ID {0} not found", regionID);
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
#region Deprecate July 2012
else if (requestData.ContainsKey("regionid") &&
!String.IsNullOrEmpty((string)requestData["regionid"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
UUID regionID = (UUID)(string)requestData["regionid"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
{
responseData["error"] = String.Format("Region ID {0} not found", regionID);
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
else if (requestData.ContainsKey("region_ID") &&
!String.IsNullOrEmpty((string)requestData["region_ID"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
UUID regionID = (UUID)(string)requestData["region_ID"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
{
responseData["error"] = String.Format("Region ID {0} not found", regionID);
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
else if (requestData.ContainsKey("regionID") &&
!String.IsNullOrEmpty((string)requestData["regionID"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
UUID regionID = (UUID)(string)requestData["regionID"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
{
responseData["error"] = String.Format("Region ID {0} not found", regionID);
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
else if (requestData.ContainsKey("region_uuid") &&
!String.IsNullOrEmpty((string)requestData["region_uuid"]))
{
m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
UUID regionID = (UUID)(string)requestData["region_uuid"];
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
{
responseData["error"] = String.Format("Region ID {0} not found", regionID);
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
#endregion
else if (requestData.ContainsKey("region_name") &&
!String.IsNullOrEmpty((string)requestData["region_name"]))
{
string regionName = (string)requestData["region_name"];
if (!m_application.SceneManager.TryGetScene(regionName, out scene))
{
responseData["error"] = String.Format("Region {0} not found", regionName);
throw new Exception(String.Format("Region {0} not found", regionName));
}
}
else
{
responseData["error"] = "no region_name or region_id given";
throw new Exception("no region_name or region_id given");
}
return;
}
private bool GetBoolean(Hashtable requestData, string tag, bool defaultValue)
{
// If an access value has been provided, apply it.

View File

@@ -0,0 +1,148 @@
/*
* 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 System.Collections;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Framework.Capabilities;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
namespace OpenSim.Capabilities.Handlers
{
public class FetchInventory2Handler
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_inventoryService;
public FetchInventory2Handler(IInventoryService invService)
{
m_inventoryService = invService;
}
public string FetchInventoryRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
// m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capabilty request");
OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request));
OSDArray itemsRequested = (OSDArray)requestmap["items"];
string reply;
LLSDFetchInventory llsdReply = new LLSDFetchInventory();
foreach (OSDMap osdItemId in itemsRequested)
{
UUID itemId = osdItemId["item_id"].AsUUID();
InventoryItemBase item = m_inventoryService.GetItem(new InventoryItemBase(itemId));
if (item != null)
{
// We don't know the agent that this request belongs to so we'll use the agent id of the item
// which will be the same for all items.
llsdReply.agent_id = item.Owner;
llsdReply.items.Array.Add(ConvertInventoryItem(item));
}
}
reply = LLSDHelpers.SerialiseLLSDReply(llsdReply);
return reply;
}
/// <summary>
/// Convert an internal inventory item object into an LLSD object.
/// </summary>
/// <param name="invItem"></param>
/// <returns></returns>
private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem)
{
LLSDInventoryItem llsdItem = new LLSDInventoryItem();
llsdItem.asset_id = invItem.AssetID;
llsdItem.created_at = invItem.CreationDate;
llsdItem.desc = invItem.Description;
llsdItem.flags = (int)invItem.Flags;
llsdItem.item_id = invItem.ID;
llsdItem.name = invItem.Name;
llsdItem.parent_id = invItem.Folder;
try
{
llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType);
llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType);
}
catch (Exception e)
{
m_log.ErrorFormat(
"[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}",
invItem.AssetType, invItem.InvType, invItem.Name, e.Message);
}
llsdItem.permissions = new LLSDPermissions();
llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
llsdItem.permissions.group_id = invItem.GroupID;
llsdItem.permissions.group_mask = (int)invItem.GroupPermissions;
llsdItem.permissions.is_owner_group = invItem.GroupOwned;
llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions;
llsdItem.permissions.owner_id = invItem.Owner;
llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
llsdItem.sale_info = new LLSDSaleInfo();
llsdItem.sale_info.sale_price = invItem.SalePrice;
switch (invItem.SaleType)
{
default:
llsdItem.sale_info.sale_type = "not";
break;
case 1:
llsdItem.sale_info.sale_type = "original";
break;
case 2:
llsdItem.sale_info.sale_type = "copy";
break;
case 3:
llsdItem.sale_info.sale_type = "contents";
break;
}
return llsdItem;
}
}
}

View File

@@ -0,0 +1,70 @@
/*
* 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 Nini.Config;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Base;
using OpenMetaverse;
namespace OpenSim.Capabilities.Handlers
{
public class FetchInventory2ServerConnector : ServiceConnector
{
private IInventoryService m_InventoryService;
private string m_ConfigName = "CapsService";
public FetchInventory2ServerConnector(IConfigSource config, IHttpServer server, string configName)
: base(config, server, configName)
{
if (configName != String.Empty)
m_ConfigName = configName;
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
string invService = serverConfig.GetString("InventoryService", String.Empty);
if (invService == String.Empty)
throw new Exception("No InventoryService in config file");
Object[] args = new Object[] { config };
m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);
if (m_InventoryService == null)
throw new Exception(String.Format("Failed to load InventoryService from {0}; config is {1}", invService, m_ConfigName));
FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
IRequestHandler reqHandler
= new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest);
server.AddStreamHandler(reqHandler);
}
}
}

View File

@@ -104,7 +104,7 @@ namespace OpenSim.Capabilities.Handlers
}
catch (Exception e)
{
m_log.Error("[UPLOAD BAKED TEXTURE HANDLER]: " + e.ToString());
m_log.ErrorFormat("[UPLOAD BAKED TEXTURE HANDLER]: {0}{1}", e.Message, e.StackTrace);
}
return null;
@@ -117,7 +117,7 @@ namespace OpenSim.Capabilities.Handlers
/// <param name="data"></param>
private void BakedTextureUploaded(UUID assetID, byte[] data)
{
// m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
// m_log.DebugFormat("[UPLOAD BAKED TEXTURE HANDLER]: Received baked texture {0}", assetID.ToString());
AssetBase asset;
asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString());

View File

@@ -240,78 +240,84 @@ namespace OpenSim.Capabilities.Handlers
if (containingFolder != null)
{
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
// containingFolder.Name, containingFolder.ID, agentID);
version = containingFolder.Version;
if (fetchItems)
{
/*
List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
foreach (InventoryItemBase item in contents.Items)
{
if (item.AssetType == (int)AssetType.Link)
{
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
// Take care of genuinely broken links where the target doesn't exist
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// rather than having to keep track of every folder requested in the recursion.
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link && linkedItem.AssetType == (int)AssetType.Object)
linkedItemsToAdd.Add(linkedItem);
}
}
foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
{
m_log.DebugFormat(
"[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
linkedItem.Name, folderID, agentID);
contents.Items.Insert(0, linkedItem);
}
*/
/*
// If the folder requested contains links, then we need to send those folders first, otherwise the links
// will be broken in the viewer.
HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
foreach (InventoryItemBase item in contents.Items)
{
if (item.AssetType == (int)AssetType.Link)
{
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
// Take care of genuinely broken links where the target doesn't exist
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// rather than having to keep track of every folder requested in the recursion.
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
{
// We don't need to send the folder if source and destination of the link are in the same
// folder.
if (linkedItem.Folder != containingFolder.ID)
linkedItemFolderIdsToSend.Add(linkedItem.Folder);
}
}
}
foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
{
m_log.DebugFormat(
"[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
linkedItemFolderId, folderID, agentID);
int dummyVersion;
InventoryCollection linkedCollection
= Fetch(
agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
contents.Folders.AddRange(linkedCollection.Folders);
contents.Items.AddRange(linkedCollection.Items);
}
*/
}
// if (fetchItems)
// {
// List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
//
// foreach (InventoryItemBase item in contents.Items)
// {
// if (item.AssetType == (int)AssetType.Link)
// {
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
//
// // Take care of genuinely broken links where the target doesn't exist
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// // rather than having to keep track of every folder requested in the recursion.
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
// linkedItemsToAdd.Insert(0, linkedItem);
// }
// }
//
// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
// {
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
// linkedItem.Name, folderID, agentID);
//
// contents.Items.Add(linkedItem);
// }
//
// // If the folder requested contains links, then we need to send those folders first, otherwise the links
// // will be broken in the viewer.
// HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
// foreach (InventoryItemBase item in contents.Items)
// {
// if (item.AssetType == (int)AssetType.Link)
// {
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
//
// // Take care of genuinely broken links where the target doesn't exist
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
// // rather than having to keep track of every folder requested in the recursion.
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
// {
// // We don't need to send the folder if source and destination of the link are in the same
// // folder.
// if (linkedItem.Folder != containingFolder.ID)
// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
// }
// }
// }
//
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
// {
// m_log.DebugFormat(
// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
// linkedItemFolderId, folderID, agentID);
//
// int dummyVersion;
// InventoryCollection linkedCollection
// = Fetch(
// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
//
// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
// linkedFolder.Owner = agentID;
// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
//
//// contents.Folders.AddRange(linkedCollection.Folders);
//
// contents.Folders.Add(linkedFolder);
// contents.Items.AddRange(linkedCollection.Items);
// }
// }
}
}
else

View File

@@ -95,4 +95,11 @@ namespace OpenSim.Framework.Capabilities
public UUID owner_id;
public int version;
}
}
[OSDMap]
public class LLSDFetchInventory
{
public UUID agent_id;
public OSDArray items = new OSDArray();
}
}

View File

@@ -681,7 +681,7 @@ VALUES
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
conn.Open();
foreach (ParcelManager.ParcelAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList)
foreach (LandAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList)
{
cmd.Parameters.AddRange(CreateLandAccessParameters(parcelAccessEntry, parcel.RegionUUID));
@@ -1252,7 +1252,7 @@ VALUES
,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se
,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit
,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position
,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
WHERE [regionUUID] = @regionUUID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
@@ -1307,14 +1307,14 @@ VALUES
[block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics],
[terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne],
[elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit],
[terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id]
[terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[covenant_datetime],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id]
)
VALUES
(@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide,
@block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics,
@terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne,
@elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit,
@terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)";
@terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant, @covenant_datetime, @sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
@@ -1376,7 +1376,7 @@ VALUES
Convert.ToSingle(row["sunvectorz"])
);
newSettings.Covenant = new UUID((Guid)row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
if (row["loaded_creation_id"] is DBNull)
@@ -1453,7 +1453,7 @@ VALUES
_Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
}
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
newData.ParcelAccessList = new List<LandAccessEntry>();
return newData;
}
@@ -1463,12 +1463,12 @@ VALUES
/// </summary>
/// <param name="row">datarecord with landaccess data</param>
/// <returns></returns>
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataRecord row)
private static LandAccessEntry BuildLandAccessData(IDataRecord row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
entry.Time = new DateTime();
entry.Expires = 0;
return entry;
}
@@ -1789,6 +1789,7 @@ VALUES
parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y));
parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z));
parameters.Add(_Database.CreateParameter("covenant", settings.Covenant));
parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID));
@@ -1851,7 +1852,7 @@ VALUES
/// <param name="parcelAccessEntry">parcel access entry.</param>
/// <param name="parcelID">parcel ID.</param>
/// <returns></returns>
private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID)
private SqlParameter[] CreateLandAccessParameters(LandAccessEntry parcelAccessEntry, UUID parcelID)
{
List<SqlParameter> parameters = new List<SqlParameter>();

View File

@@ -1043,3 +1043,11 @@ FOR CreatorID
ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL
COMMIT
:VERSION 29 #---------------------
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0
COMMIT

View File

@@ -210,7 +210,6 @@ namespace OpenSim.Data.MySQL
}
LoadBanList(es);
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");

View File

@@ -173,6 +173,11 @@ namespace OpenSim.Data.MySQL
int v = Convert.ToInt32(reader[name]);
m_Fields[name].SetValue(row, v);
}
else if (m_Fields[name].FieldType == typeof(uint))
{
uint v = Convert.ToUInt32(reader[name]);
m_Fields[name].SetValue(row, v);
}
else
{
m_Fields[name].SetValue(row, reader[name]);
@@ -294,4 +299,4 @@ namespace OpenSim.Data.MySQL
}
}
}
}
}

View File

@@ -561,45 +561,46 @@ namespace OpenSim.Data.MySQL
public virtual void StoreTerrain(double[,] ter, UUID regionID)
{
m_log.Info("[REGION DB]: Storing terrain");
lock (m_dbLock)
Util.FireAndForget(delegate(object x)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
double[,] oldTerrain = LoadTerrain(regionID);
m_log.Info("[REGION DB]: Storing terrain");
lock (m_dbLock)
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID";
cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString());
dbcon.Open();
using (MySqlCommand cmd2 = dbcon.CreateCommand())
using (MySqlCommand cmd = dbcon.CreateCommand())
{
try
{
cmd2.CommandText = "insert into terrain (RegionUUID, " +
"Revision, Heightfield) values (?RegionUUID, " +
"1, ?Heightfield)";
cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID";
cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString());
cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString());
cmd2.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter));
ExecuteNonQuery(cmd);
ExecuteNonQuery(cmd2);
}
catch
using (MySqlCommand cmd2 = dbcon.CreateCommand())
{
// If we get here there is a NaN in the terrain
// and the terrain can't be saved. A crash here
// is much better than losing all the work
m_log.ErrorFormat("[DATA]: Unable to save terrain. Stopping simulator to prevent data loss");
Environment.Exit(1);
try
{
cmd2.CommandText = "insert into terrain (RegionUUID, " +
"Revision, Heightfield) values (?RegionUUID, " +
"1, ?Heightfield)";
cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString());
cmd2.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter, oldTerrain));
ExecuteNonQuery(cmd);
ExecuteNonQuery(cmd2);
}
catch (Exception e)
{
m_log.ErrorFormat(e.ToString());
}
}
}
}
}
}
});
}
public virtual double[,] LoadTerrain(UUID regionID)
@@ -714,10 +715,10 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.Clear();
cmd.CommandText = "insert into landaccesslist (LandUUID, " +
"AccessUUID, Flags) values (?LandUUID, ?AccessUUID, " +
"?Flags)";
"AccessUUID, Flags, Expires) values (?LandUUID, ?AccessUUID, " +
"?Flags, ?Expires)";
foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList)
foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList)
{
FillLandAccessCommand(cmd, entry, parcel.LandData.GlobalID);
ExecuteNonQuery(cmd);
@@ -860,6 +861,8 @@ namespace OpenSim.Data.MySQL
}
}
LoadSpawnPoints(rs);
return rs;
}
@@ -1006,9 +1009,11 @@ namespace OpenSim.Data.MySQL
"elevation_2_sw, water_height, " +
"terrain_raise_limit, terrain_lower_limit, " +
"use_estate_sun, fixed_sun, sun_position, " +
"covenant, Sandbox, sunvectorx, sunvectory, " +
"covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " +
"sunvectorz, loaded_creation_datetime, " +
"loaded_creation_id, map_tile_ID, block_search, casino) values (?RegionUUID, ?BlockTerraform, " +
"loaded_creation_id, map_tile_ID, block_search, casino, " +
"TelehubObject, parcel_tile_ID) " +
"values (?RegionUUID, ?BlockTerraform, " +
"?BlockFly, ?AllowDamage, ?RestrictPushing, " +
"?AllowLandResell, ?AllowLandJoinDivide, " +
"?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
@@ -1020,10 +1025,11 @@ namespace OpenSim.Data.MySQL
"?Elevation2SE, ?Elevation1SW, ?Elevation2SW, " +
"?WaterHeight, ?TerrainRaiseLimit, " +
"?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " +
"?SunPosition, ?Covenant, ?Sandbox, " +
"?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " +
"?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
"?LoadedCreationDateTime, ?LoadedCreationID, " +
"?TerrainImageID, ?block_search, ?casino)";
"?TerrainImageID, ?block_search, ?casino, " +
"?TelehubObject, ?ParcelImageID)";
FillRegionSettingsCommand(cmd, rs);
@@ -1031,6 +1037,7 @@ namespace OpenSim.Data.MySQL
}
}
}
SaveSpawnPoints(rs);
}
public virtual List<LandData> LoadLandObjects(UUID regionUUID)
@@ -1301,7 +1308,7 @@ namespace OpenSim.Data.MySQL
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = DBGuid.FromDB(row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
if (row["loaded_creation_id"] is DBNull)
@@ -1310,6 +1317,8 @@ namespace OpenSim.Data.MySQL
newSettings.LoadedCreationID = (String) row["loaded_creation_id"];
newSettings.TerrainImageID = DBGuid.FromDB(row["map_tile_ID"]);
newSettings.ParcelImageID = DBGuid.FromDB(row["parcel_tile_ID"]);
newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]);
newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]);
newSettings.Casino = Convert.ToBoolean(row["casino"]);
@@ -1387,7 +1396,7 @@ namespace OpenSim.Data.MySQL
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
newData.ParcelAccessList = new List<LandAccessEntry>();
return newData;
}
@@ -1397,12 +1406,12 @@ namespace OpenSim.Data.MySQL
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataReader row)
private static LandAccessEntry BuildLandAccessData(IDataReader row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = DBGuid.FromDB(row["AccessUUID"]);
entry.Flags = (AccessList) Convert.ToInt32(row["Flags"]);
entry.Time = new DateTime();
entry.Expires = Convert.ToInt32(row["Expires"]);
return entry;
}
@@ -1411,7 +1420,7 @@ namespace OpenSim.Data.MySQL
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
private static Array SerializeTerrain(double[,] val)
private static Array SerializeTerrain(double[,] val, double[,] oldTerrain)
{
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double));
BinaryWriter bw = new BinaryWriter(str);
@@ -1420,7 +1429,11 @@ namespace OpenSim.Data.MySQL
for (int x = 0; x < (int)Constants.RegionSize; x++)
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
double height = val[x, y];
double height = 20.0;
if (oldTerrain != null)
height = oldTerrain[x, y];
if (!double.IsNaN(val[x, y]))
height = val[x, y];
if (height == 0.0)
height = double.Epsilon;
@@ -1640,12 +1653,15 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("FixedSun", settings.FixedSun);
cmd.Parameters.AddWithValue("SunPosition", settings.SunPosition);
cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString());
cmd.Parameters.AddWithValue("CovenantChangedDateTime", settings.CovenantChangedDateTime);
cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime);
cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID);
cmd.Parameters.AddWithValue("block_search", settings.GodBlockSearch);
cmd.Parameters.AddWithValue("casino", settings.Casino);
cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID);
cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject);
}
/// <summary>
@@ -1708,11 +1724,12 @@ namespace OpenSim.Data.MySQL
/// <param name="row"></param>
/// <param name="entry"></param>
/// <param name="parcelID"></param>
private static void FillLandAccessCommand(MySqlCommand cmd, ParcelManager.ParcelAccessEntry entry, UUID parcelID)
private static void FillLandAccessCommand(MySqlCommand cmd, LandAccessEntry entry, UUID parcelID)
{
cmd.Parameters.AddWithValue("LandUUID", parcelID.ToString());
cmd.Parameters.AddWithValue("AccessUUID", entry.AgentID.ToString());
cmd.Parameters.AddWithValue("Flags", entry.Flags);
cmd.Parameters.AddWithValue("Expires", entry.Expires.ToString());
}
/// <summary>
@@ -1847,5 +1864,72 @@ namespace OpenSim.Data.MySQL
}
}
}
private void LoadSpawnPoints(RegionSettings rs)
{
rs.ClearSpawnPoints();
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "select Yaw, Pitch, Distance from spawn_points where RegionID = ?RegionID";
cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
using (IDataReader r = cmd.ExecuteReader())
{
while (r.Read())
{
SpawnPoint sp = new SpawnPoint();
sp.Yaw = (float)r["Yaw"];
sp.Pitch = (float)r["Pitch"];
sp.Distance = (float)r["Distance"];
rs.AddSpawnPoint(sp);
}
}
}
}
}
}
private void SaveSpawnPoints(RegionSettings rs)
{
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "delete from spawn_points where RegionID = ?RegionID";
cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
cmd.CommandText = "insert into spawn_points (RegionID, Yaw, Pitch, Distance) values ( ?RegionID, ?Yaw, ?Pitch, ?Distance)";
foreach (SpawnPoint p in rs.SpawnPoints())
{
cmd.Parameters.AddWithValue("?RegionID", rs.RegionUUID.ToString());
cmd.Parameters.AddWithValue("?Yaw", p.Yaw);
cmd.Parameters.AddWithValue("?Pitch", p.Pitch);
cmd.Parameters.AddWithValue("?Distance", p.Distance);
cmd.ExecuteNonQuery();
cmd.Parameters.Clear();
}
}
}
}
}
}
}

View File

@@ -94,3 +94,12 @@ BEGIN;
alter table regions modify column regionName varchar(128) default NULL;
COMMIT;
:VERSION 9 # ------------
BEGIN;
alter table regions add column `parcelMapTexture` varchar(36) default NULL;
COMMIT;

View File

@@ -841,4 +841,45 @@ alter table regionban ENGINE = MyISAM;
alter table regionsettings ENGINE = MyISAM;
alter table terrain ENGINE = MyISAM;
COMMIT;
COMMIT;
:VERSION 39 #--------------- Telehub support
BEGIN;
CREATE TABLE IF NOT EXISTS `spawn_points` (
`RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
`Yaw` float NOT NULL,
`Pitch` float NOT NULL,
`Distance` float NOT NULL,
KEY `RegionID` (`RegionID`)
) ENGINE=Innodb;
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
COMMIT;
:VERSION 40 #---------------- Parcels for sale
BEGIN;
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 41 #---------------- Timed bans/access
BEGIN;
ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0;
COMMIT;
:VERSION 42 #--------------------- Region Covenant changed time
BEGIN;
ALTER TABLE regionsettings ADD COLUMN covenant_datetime int unsigned NOT NULL DEFAULT '0';
COMMIT;
:VERSION 43 #---------------------
BEGIN;
ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@@ -466,4 +466,9 @@ ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
COMMIT;
COMMIT;
:VERSION 22
BEGIN;
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
COMMIT;

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString());
cmd.Parameters.AddWithValue(":Friend", friend);
ExecuteNonQuery(cmd, cmd.Connection);
ExecuteNonQuery(cmd, m_Connection);
return true;
}

View File

@@ -759,7 +759,7 @@ namespace OpenSim.Data.SQLite
landaccesslist.Rows.Remove(rowsToDelete[iter]);
}
rowsToDelete.Clear();
foreach (ParcelManager.ParcelAccessEntry entry in parcel.LandData.ParcelAccessList)
foreach (LandAccessEntry entry in parcel.LandData.ParcelAccessList)
{
DataRow newAccessRow = landaccesslist.NewRow();
fillLandAccessRow(newAccessRow, entry, parcel.LandData.GlobalID);
@@ -1185,6 +1185,7 @@ namespace OpenSim.Data.SQLite
createCol(regionsettings, "fixed_sun", typeof (Int32));
createCol(regionsettings, "sun_position", typeof (Double));
createCol(regionsettings, "covenant", typeof(String));
createCol(regionsettings, "covenant_datetime", typeof(Int32));
createCol(regionsettings, "map_tile_ID", typeof(String));
regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] };
return regionsettings;
@@ -1456,7 +1457,7 @@ namespace OpenSim.Data.SQLite
newData.UserLocation = Vector3.Zero;
newData.UserLookAt = Vector3.Zero;
}
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
newData.ParcelAccessList = new List<LandAccessEntry>();
UUID authBuyerID = UUID.Zero;
UUID.TryParse((string)row["AuthbuyerID"], out authBuyerID);
@@ -1509,6 +1510,7 @@ namespace OpenSim.Data.SQLite
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.Covenant = new UUID((String) row["covenant"]);
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
return newSettings;
@@ -1519,12 +1521,12 @@ namespace OpenSim.Data.SQLite
/// </summary>
/// <param name="row"></param>
/// <returns></returns>
private static ParcelManager.ParcelAccessEntry buildLandAccessData(DataRow row)
private static LandAccessEntry buildLandAccessData(DataRow row)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = new UUID((string) row["AccessUUID"]);
entry.Flags = (AccessList) row["Flags"];
entry.Time = new DateTime();
entry.Expires = 0;
return entry;
}
@@ -1787,7 +1789,7 @@ namespace OpenSim.Data.SQLite
/// <param name="row"></param>
/// <param name="entry"></param>
/// <param name="parcelID"></param>
private static void fillLandAccessRow(DataRow row, ParcelManager.ParcelAccessEntry entry, UUID parcelID)
private static void fillLandAccessRow(DataRow row, LandAccessEntry entry, UUID parcelID)
{
row["LandUUID"] = parcelID.ToString();
row["AccessUUID"] = entry.AgentID.ToString();
@@ -1833,6 +1835,7 @@ namespace OpenSim.Data.SQLite
row["fixed_sun"] = settings.FixedSun;
row["sun_position"] = settings.SunPosition;
row["covenant"] = settings.Covenant.ToString();
row["covenant_datetime"] = settings.CovenantChangedDateTime;
row["map_tile_ID"] = settings.TerrainImageID.ToString();
}

View File

@@ -685,7 +685,7 @@ namespace OpenSim.Data.Tests
SceneObjectGroup sog = GetMySOG("object1");
InventoryItemBase i = NewItem(item1, zero, zero, itemname1, zero);
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, item1);
Assert.That(t.Name, Is.EqualTo(itemname1), "Assert.That(t.Name, Is.EqualTo(itemname1))");
@@ -762,7 +762,7 @@ namespace OpenSim.Data.Tests
i.CreationDate = creationd;
SceneObjectGroup sog = GetMySOG("object1");
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, i, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, i, zero), Is.True);
TaskInventoryItem t = sog.GetInventoryItem(sog.RootPart.LocalId, id);
Assert.That(t.Name, Is.EqualTo(name), "Assert.That(t.Name, Is.EqualTo(name))");
@@ -807,10 +807,10 @@ namespace OpenSim.Data.Tests
SceneObjectGroup sog = FindSOG("object1", region1);
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib1, zero), Is.True);
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib2, zero), Is.True);
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib3, zero), Is.True);
Assert.That(sog.AddInventoryItem(null, sog.RootPart.LocalId, ib4, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib1, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib2, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib3, zero), Is.True);
Assert.That(sog.AddInventoryItem(zero, sog.RootPart.LocalId, ib4, zero), Is.True);
TaskInventoryItem t1 = sog.GetInventoryItem(sog.RootPart.LocalId, i1);
Assert.That(t1.Name, Is.EqualTo(ib1.Name), "Assert.That(t1.Name, Is.EqualTo(ib1.Name))");

View File

@@ -296,7 +296,7 @@ namespace OpenSim.Framework
if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos);
m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos);
//m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos);
try
{

View File

@@ -264,10 +264,12 @@ namespace OpenSim.Framework
}
/// <summary>
/// Set up appearance textures.
/// Returns boolean that indicates whether the new entries actually change the
/// existing values.
/// Set up appearance texture ids.
/// </summary>
/// <returns>
/// True if any existing texture id was changed by the new data.
/// False if there were no changes or no existing texture ids.
/// </returns>
public virtual bool SetTextureEntries(Primitive.TextureEntry textureEntry)
{
if (textureEntry == null)
@@ -284,25 +286,30 @@ namespace OpenSim.Framework
if (newface == null)
{
if (oldface == null) continue;
if (oldface == null)
continue;
}
else
{
if (oldface != null && oldface.TextureID == newface.TextureID) continue;
if (oldface != null && oldface.TextureID == newface.TextureID)
continue;
}
changed = true;
}
m_texture = textureEntry;
return changed;
}
/// <summary>
/// Set up visual parameters for the avatar and refresh the avatar height
/// Returns boolean that indicates whether the new entries actually change the
/// existing values.
/// </summary>
/// <returns>
/// True if any existing visual parameter was changed by the new data.
/// False if there were no changes or no existing visual parameters.
/// </returns>
public virtual bool SetVisualParams(byte[] visualParams)
{
if (visualParams == null)

View File

@@ -478,7 +478,7 @@ namespace OpenSim.Framework
/// <param name="hash"></param>
public virtual void Unpack(OSDMap args, IScene scene)
{
m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
//m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Unpack data");
if (args.ContainsKey("region_id"))
UUID.TryParse(args["region_id"].AsString(), out RegionID);

View File

@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using log4net;
using OpenSim.Framework;
@@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console
public class Parser
{
// If an unquoted portion ends with an element matching this regex
// and the next element contains a space, then we have stripped
// embedded quotes that should not have been stripped
private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$");
public static string[] Parse(string text)
{
List<string> result = new List<string>();
@@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console
if (index % 2 == 0)
{
string[] words = unquoted[index].Split(new char[] {' '});
bool option = false;
foreach (string w in words)
{
if (w != String.Empty)
{
if (optionRegex.Match(w) == Match.Empty)
option = false;
else
option = true;
result.Add(w);
}
}
// The last item matched the regex, put the quotes back
if (option)
{
// If the line ended with it, don't do anything
if (index < (unquoted.Length - 1))
{
// Get and remove the option name
string optionText = result[result.Count - 1];
result.RemoveAt(result.Count - 1);
// Add the quoted value back
optionText += "\"" + unquoted[index + 1] + "\"";
// Push the result into our return array
result.Add(optionText);
// Skip the already used value
index++;
}
}
}
else

View File

@@ -425,5 +425,11 @@ namespace OpenSim.Framework
AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges);
AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome);
}
public bool GroupAccess(UUID groupID)
{
return l_EstateGroups.Contains(groupID);
}
}
}

View File

@@ -177,7 +177,7 @@ namespace OpenSim.Framework
public delegate void ParcelAccessListUpdateRequest(UUID agentID, uint flags,
int landLocalID, UUID transactionID, int sequenceID,
int sections, List<ParcelManager.ParcelAccessEntry> entries,
int sections, List<LandAccessEntry> entries,
IClientAPI remote_client);
public delegate void ParcelPropertiesRequest(
@@ -361,6 +361,8 @@ namespace OpenSim.Framework
public delegate void EstateChangeInfo(IClientAPI client, UUID invoice, UUID senderID, UInt32 param1, UInt32 param2);
public delegate void EstateManageTelehub(IClientAPI client, UUID invoice, UUID senderID, string cmd, UInt32 param1);
public delegate void RequestTerrain(IClientAPI remoteClient, string clientFileName);
public delegate void BakeTerrain(IClientAPI remoteClient);
@@ -774,6 +776,7 @@ namespace OpenSim.Framework
event ModifyTerrain OnModifyTerrain;
event BakeTerrain OnBakeTerrain;
event EstateChangeInfo OnEstateChangeInfo;
event EstateManageTelehub OnEstateManageTelehub;
// [Obsolete("LLClientView Specific.")]
event SetAppearance OnSetAppearance;
// [Obsolete("LLClientView Specific - Replace and rename OnAvatarUpdate. Difference from SetAppearance?")]
@@ -1082,7 +1085,15 @@ namespace OpenSim.Framework
void SendWindData(Vector2[] windSpeeds);
void SendCloudData(float[] cloudCover);
/// <summary>
/// Sent when an agent completes its movement into a region.
/// </summary>
/// <remarks>
/// This packet marks completion of the arrival of a root avatar in a region, whether through login, region
/// crossing or direct teleport.
/// </remarks>
void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look);
void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourExternalEndPoint);
/// <summary>
@@ -1141,6 +1152,8 @@ namespace OpenSim.Framework
void SendTaskInventory(UUID taskID, short serial, byte[] fileName);
void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint);
/// <summary>
/// Used by the server to inform the client of new inventory items and folders.
/// </summary>
@@ -1230,7 +1243,7 @@ namespace OpenSim.Framework
void SendEstateCovenantInformation(UUID covenant);
void SendDetailedEstateData(UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags,
uint sunPosition, UUID covenant, string abuseEmail, UUID estateOwner);
uint sunPosition, UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner);
/// <summary>
/// Send land properties to the client.
@@ -1246,7 +1259,7 @@ namespace OpenSim.Framework
float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity,
uint regionFlags);
void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID);
void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID);
void SendForceClientSelectObjects(List<uint> objectIDs);
void SendCameraConstraint(Vector4 ConstraintPlane);
void SendLandObjectOwners(LandData land, List<UUID> groups, Dictionary<UUID, int> ownersAndCount);

View File

@@ -73,9 +73,9 @@ namespace OpenSim.Framework
bool IsRestrictedFromLand(UUID avatar);
void SendLandUpdateToClient(IClientAPI remote_client);
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<UUID> CreateAccessListArrayByFlag(AccessList flag);
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
void SendAccessList(UUID agentID, UUID sessionID, uint flags, int sequenceID, IClientAPI remote_client);
void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<ParcelManager.ParcelAccessEntry> entries, IClientAPI remote_client);
void UpdateAccessList(uint flags, UUID transactionID, int sequenceID, int sections, List<LandAccessEntry> entries, IClientAPI remote_client);
void UpdateLandBitmapByteArray();
void SetLandBitmapFromByteArray();
bool[,] GetLandBitmap();
@@ -130,5 +130,11 @@ namespace OpenSim.Framework
/// </summary>
/// <param name="url"></param>
void SetMusicUrl(string url);
/// <summary>
/// Get the music url for this land parcel
/// </summary>
/// <returns>The music url.</returns>
string GetMusicUrl();
}
}

View File

@@ -36,8 +36,8 @@ namespace OpenSim.Framework
int amount);
int GetBalance(UUID agentID);
bool UploadCovered(IClientAPI client, int amount);
bool AmountCovered(IClientAPI client, int amount);
bool UploadCovered(UUID agentID, int amount);
bool AmountCovered(UUID agentID, int amount);
void ApplyCharge(UUID agentID, int amount, string text);
void ApplyUploadCharge(UUID agentID, int amount, string text);
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);

View File

@@ -34,6 +34,7 @@ namespace OpenSim.Framework
string Name { get; set; }
UUID UUID { get; }
uint LocalId { get; }
Vector3 AbsolutePosition { get; }
}
}

View File

@@ -33,6 +33,12 @@ namespace OpenSim.Framework
public interface ISceneObject
{
UUID UUID { get; }
/// <summary>
/// The owner of this object.
/// </summary>
UUID OwnerID { get; set; }
ISceneObject CloneForNewScene();
string ToXml2();
string ExtraToXmlString();

View File

@@ -34,6 +34,13 @@ using OpenMetaverse;
namespace OpenSim.Framework
{
public class LandAccessEntry
{
public UUID AgentID;
public int Expires;
public AccessList Flags;
}
/// <summary>
/// Details of a Parcel of land
/// </summary>
@@ -73,7 +80,7 @@ namespace OpenSim.Framework
private string _mediaURL = String.Empty;
private string _musicURL = String.Empty;
private UUID _ownerID = UUID.Zero;
private List<ParcelManager.ParcelAccessEntry> _parcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
private List<LandAccessEntry> _parcelAccessList = new List<LandAccessEntry>();
private float _passHours = 0;
private int _passPrice = 0;
private int _salePrice = 0; //Unemeplemented. Parcels price.
@@ -450,7 +457,7 @@ namespace OpenSim.Framework
/// <summary>
/// List of access data for the parcel. User data, some bitflags, and a time
/// </summary>
public List<ParcelManager.ParcelAccessEntry> ParcelAccessList {
public List<LandAccessEntry> ParcelAccessList {
get {
return _parcelAccessList;
}
@@ -638,12 +645,12 @@ namespace OpenSim.Framework
landData._simwidePrims = _simwidePrims;
landData._parcelAccessList.Clear();
foreach (ParcelManager.ParcelAccessEntry entry in _parcelAccessList)
foreach (LandAccessEntry entry in _parcelAccessList)
{
ParcelManager.ParcelAccessEntry newEntry = new ParcelManager.ParcelAccessEntry();
LandAccessEntry newEntry = new LandAccessEntry();
newEntry.AgentID = entry.AgentID;
newEntry.Flags = entry.Flags;
newEntry.Time = entry.Time;
newEntry.Expires = entry.Expires;
landData._parcelAccessList.Add(newEntry);
}
@@ -668,4 +675,4 @@ namespace OpenSim.Framework
return land;
}
}
}
}

View File

@@ -450,13 +450,17 @@ namespace OpenSim.Framework
public string GetOtherSetting(string key)
{
string val;
m_otherSettings.TryGetValue(key, out val);
return val;
string keylower = key.ToLower();
if (m_otherSettings.TryGetValue(keylower, out val))
return val;
m_log.DebugFormat("[RegionInfo] Could not locate value for parameter {0}", key);
return null;
}
public void SetOtherSetting(string key, string value)
{
m_otherSettings[key] = value;
string keylower = key.ToLower();
m_otherSettings[keylower] = value;
}
private void ReadNiniConfig(IConfigSource source, string name)
@@ -498,12 +502,12 @@ namespace OpenSim.Framework
HashSet<String> allKeys = new HashSet<String>();
foreach (string s in config.GetKeys())
{
allKeys.Add(s.ToLower());
allKeys.Add(s);
}
// RegionUUID
//
allKeys.Remove(("RegionUUID").ToLower());
allKeys.Remove("RegionUUID");
string regionUUID = config.GetString("RegionUUID", string.Empty);
if (regionUUID == String.Empty)
{
@@ -518,7 +522,7 @@ namespace OpenSim.Framework
// Location
//
allKeys.Remove(("Location").ToLower());
allKeys.Remove("Location");
string location = config.GetString("Location", String.Empty);
if (location == String.Empty)
{
@@ -534,7 +538,7 @@ namespace OpenSim.Framework
// InternalAddress
//
IPAddress address;
allKeys.Remove(("InternalAddress").ToLower());
allKeys.Remove("InternalAddress");
if (config.Contains("InternalAddress"))
{
address = IPAddress.Parse(config.GetString("InternalAddress", String.Empty));
@@ -548,7 +552,7 @@ namespace OpenSim.Framework
// InternalPort
//
int port;
allKeys.Remove(("InternalPort").ToLower());
allKeys.Remove("InternalPort");
if (config.Contains("InternalPort"))
{
port = config.GetInt("InternalPort", 9000);
@@ -562,7 +566,7 @@ namespace OpenSim.Framework
// AllowAlternatePorts
//
allKeys.Remove(("AllowAlternatePorts").ToLower());
allKeys.Remove("AllowAlternatePorts");
if (config.Contains("AllowAlternatePorts"))
{
m_allow_alternate_ports = config.GetBoolean("AllowAlternatePorts", true);
@@ -576,7 +580,7 @@ namespace OpenSim.Framework
// ExternalHostName
//
allKeys.Remove(("ExternalHostName").ToLower());
allKeys.Remove("ExternalHostName");
string externalName;
if (config.Contains("ExternalHostName"))
{
@@ -601,29 +605,29 @@ namespace OpenSim.Framework
// RegionType
m_regionType = config.GetString("RegionType", String.Empty);
allKeys.Remove(("RegionType").ToLower());
allKeys.Remove("RegionType");
// Prim stuff
//
m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 256);
allKeys.Remove(("NonphysicalPrimMax").ToLower());
m_physPrimMax = config.GetInt("PhysicalPrimMax", 10);
allKeys.Remove(("PhysicalPrimMax").ToLower());
m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0);
allKeys.Remove("NonphysicalPrimMax");
m_physPrimMax = config.GetInt("PhysicalPrimMax", 0);
allKeys.Remove("PhysicalPrimMax");
m_clampPrimSize = config.GetBoolean("ClampPrimSize", false);
allKeys.Remove(("ClampPrimSize").ToLower());
allKeys.Remove("ClampPrimSize");
m_objectCapacity = config.GetInt("MaxPrims", 15000);
allKeys.Remove(("MaxPrims").ToLower());
allKeys.Remove("MaxPrims");
m_agentCapacity = config.GetInt("MaxAgents", 100);
allKeys.Remove(("MaxAgents").ToLower());
allKeys.Remove("MaxAgents");
// Multi-tenancy
//
ScopeID = new UUID(config.GetString("ScopeID", UUID.Zero.ToString()));
allKeys.Remove(("ScopeID").ToLower());
allKeys.Remove("ScopeID");
foreach (String s in allKeys)
{
m_otherSettings.Add(s, config.GetString(s));
SetOtherSetting(s, config.GetString(s));
}
}

View File

@@ -26,11 +26,53 @@
*/
using System;
using System.Collections.Generic;
using System.IO;
using OpenMetaverse;
namespace OpenSim.Framework
{
public struct SpawnPoint
{
public float Yaw;
public float Pitch;
public float Distance;
public void SetLocation(Vector3 pos, Quaternion rot, Vector3 point)
{
// The point is an absolute position, so we need the relative
// location to the spawn point
Vector3 offset = point - pos;
Distance = Vector3.Mag(offset);
// Next we need to rotate this vector into the spawn point's
// coordinate system
rot.W = -rot.W;
offset = offset * rot;
Vector3 dir = Vector3.Normalize(offset);
// Get the bearing (yaw)
Yaw = (float)Math.Atan2(dir.Y, dir.X);
// Get the elevation (pitch)
Pitch = (float)-Math.Atan2(dir.Z, Math.Sqrt(dir.X * dir.X + dir.Y * dir.Y));
}
public Vector3 GetLocation(Vector3 pos, Quaternion rot)
{
Quaternion y = Quaternion.CreateFromEulers(0, 0, Yaw);
Quaternion p = Quaternion.CreateFromEulers(0, Pitch, 0);
Vector3 dir = new Vector3(1, 0, 0) * p * y;
Vector3 offset = dir * (float)Distance;
offset *= rot;
return pos + offset;
}
}
public class RegionSettings
{
public delegate void SaveDelegate(RegionSettings rs);
@@ -331,6 +373,14 @@ namespace OpenSim.Framework
set { m_SunVector = value; }
}
private UUID m_ParcelImageID;
public UUID ParcelImageID
{
get { return m_ParcelImageID; }
set { m_ParcelImageID = value; }
}
private UUID m_TerrainImageID;
public UUID TerrainImageID
@@ -363,6 +413,14 @@ namespace OpenSim.Framework
set { m_Covenant = value; }
}
private int m_CovenantChanged = 0;
public int CovenantChangedDateTime
{
get { return m_CovenantChanged; }
set { m_CovenantChanged = value; }
}
private int m_LoadedCreationDateTime;
public int LoadedCreationDateTime
{
@@ -410,5 +468,58 @@ namespace OpenSim.Framework
get { return m_Casino; }
set { m_Casino = value; }
}
// Telehub support
private bool m_TelehubEnabled = false;
public bool HasTelehub
{
get { return m_TelehubEnabled; }
set { m_TelehubEnabled = value; }
}
// Connected Telehub object
private UUID m_TelehubObject;
public UUID TelehubObject
{
get
{
return m_TelehubObject;
}
set
{
m_TelehubObject = value;
}
}
// Our Connected Telehub's SpawnPoints
public List<SpawnPoint> l_SpawnPoints = new List<SpawnPoint>();
// Add a SpawnPoint
// ** These are not region coordinates **
// They are relative to the Telehub coordinates
//
public void AddSpawnPoint(SpawnPoint point)
{
l_SpawnPoints.Add(point);
}
// Remove a SpawnPoint
public void RemoveSpawnPoint(int point_index)
{
l_SpawnPoints.RemoveAt(point_index);
}
// Return the List of SpawnPoints
public List<SpawnPoint> SpawnPoints()
{
return l_SpawnPoints;
}
// Clear the SpawnPoints List of all entries
public void ClearSpawnPoints()
{
l_SpawnPoints.Clear();
}
}
}
}

View File

@@ -24,11 +24,13 @@
* (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 System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Xml;
using log4net;
using OpenMetaverse;
using OpenSim.Services.Interfaces;
@@ -39,18 +41,86 @@ namespace OpenSim.Framework.Serialization.External
/// </summary>
public class ExternalRepresentationUtils
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Populate a node with data read from xml using a dictinoary of processors
/// </summary>
/// <param name="nodeToFill"></param>
/// <param name="processors">/param>
/// <param name="xtr"></param>
public static void ExecuteReadProcessors<NodeType>(
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
{
ExecuteReadProcessors(
nodeToFill,
processors,
xtr,
(o, name, e)
=> m_log.ErrorFormat(
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
name, e.Message, e.StackTrace));
}
/// <summary>
/// Populate a node with data read from xml using a dictinoary of processors
/// </summary>
/// <param name="nodeToFill"></param>
/// <param name="processors"></param>
/// <param name="xtr"></param>
/// <param name="parseExceptionAction">
/// Action to take if there is a parsing problem. This will usually just be to log the exception
/// </param>
public static void ExecuteReadProcessors<NodeType>(
NodeType nodeToFill,
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
XmlTextReader xtr,
Action<NodeType, string, Exception> parseExceptionAction)
{
string nodeName = string.Empty;
while (xtr.NodeType != XmlNodeType.EndElement)
{
nodeName = xtr.Name;
// m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName);
Action<NodeType, XmlTextReader> p = null;
if (processors.TryGetValue(xtr.Name, out p))
{
// m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName);
try
{
p(nodeToFill, xtr);
}
catch (Exception e)
{
parseExceptionAction(nodeToFill, nodeName, e);
if (xtr.NodeType == XmlNodeType.EndElement)
xtr.Read();
}
}
else
{
// m_log.DebugFormat("[LandDataSerializer]: caught unknown element {0}", nodeName);
xtr.ReadOuterXml(); // ignore
}
}
}
/// <summary>
/// Takes a XML representation of a SceneObjectPart and returns another XML representation
/// with creator data added to it.
/// </summary>
/// <param name="xml">The SceneObjectPart represented in XML2</param>
/// <param name="profileURL">The URL of the profile service for the creator</param>
/// <param name="homeURL">The URL of the user agents service (home) for the creator</param>
/// <param name="userService">The service for retrieving user account information</param>
/// <param name="scopeID">The scope of the user account information (Grid ID)</param>
/// <returns>The SceneObjectPart represented in XML2</returns>
public static string RewriteSOP(string xml, string profileURL, IUserAccountService userService, UUID scopeID)
public static string RewriteSOP(string xml, string homeURL, IUserAccountService userService, UUID scopeID)
{
if (xml == string.Empty || profileURL == string.Empty || userService == null)
if (xml == string.Empty || homeURL == string.Empty || userService == null)
return xml;
XmlDocument doc = new XmlDocument();
@@ -83,7 +153,7 @@ namespace OpenSim.Framework.Serialization.External
if (!hasCreatorData && creator != null)
{
XmlElement creatorData = doc.CreateElement("CreatorData");
creatorData.InnerText = profileURL + "/" + creator.PrincipalID + ";" + creator.FirstName + " " + creator.LastName;
creatorData.InnerText = homeURL + ";" + creator.FirstName + " " + creator.LastName;
sop.AppendChild(creatorData);
}
}

View File

@@ -28,8 +28,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
@@ -40,8 +42,119 @@ namespace OpenSim.Framework.Serialization.External
/// </summary>
public class LandDataSerializer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors
= new Dictionary<string, Action<LandData, XmlTextReader>>();
private static Dictionary<string, Action<LandAccessEntry, XmlTextReader>> m_laeProcessors
= new Dictionary<string, Action<LandAccessEntry, XmlTextReader>>();
static LandDataSerializer()
{
// LandData processors
m_ldProcessors.Add(
"Area", (ld, xtr) => ld.Area = Convert.ToInt32(xtr.ReadElementString("Area")));
m_ldProcessors.Add(
"AuctionID", (ld, xtr) => ld.AuctionID = Convert.ToUInt32(xtr.ReadElementString("AuctionID")));
m_ldProcessors.Add(
"AuthBuyerID", (ld, xtr) => ld.AuthBuyerID = UUID.Parse(xtr.ReadElementString("AuthBuyerID")));
m_ldProcessors.Add(
"Category", (ld, xtr) => ld.Category = (ParcelCategory)Convert.ToSByte(xtr.ReadElementString("Category")));
m_ldProcessors.Add(
"ClaimDate", (ld, xtr) => ld.ClaimDate = Convert.ToInt32(xtr.ReadElementString("ClaimDate")));
m_ldProcessors.Add(
"ClaimPrice", (ld, xtr) => ld.ClaimPrice = Convert.ToInt32(xtr.ReadElementString("ClaimPrice")));
m_ldProcessors.Add(
"GlobalID", (ld, xtr) => ld.GlobalID = UUID.Parse(xtr.ReadElementString("GlobalID")));
m_ldProcessors.Add(
"GroupID", (ld, xtr) => ld.GroupID = UUID.Parse(xtr.ReadElementString("GroupID")));
m_ldProcessors.Add(
"IsGroupOwned", (ld, xtr) => ld.IsGroupOwned = Convert.ToBoolean(xtr.ReadElementString("IsGroupOwned")));
m_ldProcessors.Add(
"Bitmap", (ld, xtr) => ld.Bitmap = Convert.FromBase64String(xtr.ReadElementString("Bitmap")));
m_ldProcessors.Add(
"Description", (ld, xtr) => ld.Description = xtr.ReadElementString("Description"));
m_ldProcessors.Add(
"Flags", (ld, xtr) => ld.Flags = Convert.ToUInt32(xtr.ReadElementString("Flags")));
m_ldProcessors.Add(
"LandingType", (ld, xtr) => ld.LandingType = Convert.ToByte(xtr.ReadElementString("LandingType")));
m_ldProcessors.Add(
"Name", (ld, xtr) => ld.Name = xtr.ReadElementString("Name"));
m_ldProcessors.Add(
"Status", (ld, xtr) => ld.Status = (ParcelStatus)Convert.ToSByte(xtr.ReadElementString("Status")));
m_ldProcessors.Add(
"LocalID", (ld, xtr) => ld.LocalID = Convert.ToInt32(xtr.ReadElementString("LocalID")));
m_ldProcessors.Add(
"MediaAutoScale", (ld, xtr) => ld.MediaAutoScale = Convert.ToByte(xtr.ReadElementString("MediaAutoScale")));
m_ldProcessors.Add(
"MediaID", (ld, xtr) => ld.MediaID = UUID.Parse(xtr.ReadElementString("MediaID")));
m_ldProcessors.Add(
"MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL"));
m_ldProcessors.Add(
"MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL"));
m_ldProcessors.Add(
"ParcelAccessList", ProcessParcelAccessList);
m_ldProcessors.Add(
"PassHours", (ld, xtr) => ld.PassHours = Convert.ToSingle(xtr.ReadElementString("PassHours")));
m_ldProcessors.Add(
"PassPrice", (ld, xtr) => ld.PassPrice = Convert.ToInt32(xtr.ReadElementString("PassPrice")));
m_ldProcessors.Add(
"SalePrice", (ld, xtr) => ld.SalePrice = Convert.ToInt32(xtr.ReadElementString("SalePrice")));
m_ldProcessors.Add(
"SnapshotID", (ld, xtr) => ld.SnapshotID = UUID.Parse(xtr.ReadElementString("SnapshotID")));
m_ldProcessors.Add(
"UserLocation", (ld, xtr) => ld.UserLocation = Vector3.Parse(xtr.ReadElementString("UserLocation")));
m_ldProcessors.Add(
"UserLookAt", (ld, xtr) => ld.UserLookAt = Vector3.Parse(xtr.ReadElementString("UserLookAt")));
// No longer used here //
// m_ldProcessors.Add("Dwell", (landData, xtr) => return);
m_ldProcessors.Add(
"OtherCleanTime", (ld, xtr) => ld.OtherCleanTime = Convert.ToInt32(xtr.ReadElementString("OtherCleanTime")));
// LandAccessEntryProcessors
m_laeProcessors.Add(
"AgentID", (lae, xtr) => lae.AgentID = UUID.Parse(xtr.ReadElementString("AgentID")));
m_laeProcessors.Add(
"Time", (lae, xtr) =>
{
// We really don't care about temp vs perm here and this
// would break on old oars. Assume all bans are perm
xtr.ReadElementString("Time");
lae.Expires = 0; // Convert.ToUint( xtr.ReadElementString("Time"));
}
);
m_laeProcessors.Add(
"AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList")));
}
public static void ProcessParcelAccessList(LandData ld, XmlTextReader xtr)
{
if (!xtr.IsEmptyElement)
{
while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
{
LandAccessEntry lae = new LandAccessEntry();
xtr.ReadStartElement("ParcelAccessEntry");
ExternalRepresentationUtils.ExecuteReadProcessors<LandAccessEntry>(lae, m_laeProcessors, xtr);
xtr.ReadEndElement();
ld.ParcelAccessList.Add(lae);
}
}
xtr.Read();
}
/// <summary>
/// Reify/deserialize landData
/// </summary>
@@ -63,69 +176,14 @@ namespace OpenSim.Framework.Serialization.External
{
LandData landData = new LandData();
StringReader sr = new StringReader(serializedLandData);
XmlTextReader xtr = new XmlTextReader(sr);
xtr.ReadStartElement("LandData");
landData.Area = Convert.ToInt32( xtr.ReadElementString("Area"));
landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID"));
landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID"));
landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category"));
landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate"));
landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice"));
landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID"));
landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID"));
landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned"));
landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap"));
landData.Description = xtr.ReadElementString("Description");
landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags"));
landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType"));
landData.Name = xtr.ReadElementString("Name");
landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status"));
landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID"));
landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale"));
landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID"));
landData.MediaURL = xtr.ReadElementString("MediaURL");
landData.MusicURL = xtr.ReadElementString("MusicURL");
landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID"));
landData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
xtr.Read();
if (xtr.Name != "ParcelAccessList")
throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name));
if (!xtr.IsEmptyElement)
using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData)))
{
while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
{
ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry();
reader.ReadStartElement("LandData");
xtr.ReadStartElement("ParcelAccessEntry");
pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID"));
pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time"));
pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList"));
xtr.ReadEndElement();
ExternalRepresentationUtils.ExecuteReadProcessors<LandData>(landData, m_ldProcessors, reader);
landData.ParcelAccessList.Add(pae);
}
reader.ReadEndElement();
}
xtr.Read();
landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours"));
landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice"));
landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice"));
landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID"));
landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation"));
landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt"));
// No longer used here
xtr.ReadElementString("Dwell");
landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime"));
xtr.ReadEndElement();
xtr.Close();
sr.Close();
return landData;
}
@@ -162,11 +220,11 @@ namespace OpenSim.Framework.Serialization.External
xtw.WriteElementString("OwnerID", landData.OwnerID.ToString());
xtw.WriteStartElement("ParcelAccessList");
foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList)
foreach (LandAccessEntry pal in landData.ParcelAccessList)
{
xtw.WriteStartElement("ParcelAccessEntry");
xtw.WriteElementString("AgentID", pal.AgentID.ToString());
xtw.WriteElementString("Time", pal.Time.ToString("s"));
xtw.WriteElementString("Time", pal.Expires.ToString());
xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags));
xtw.WriteEndElement();
}

View File

@@ -41,14 +41,13 @@ namespace OpenSim.Framework.Serialization.External
{
/// <summary>
/// Serialize and deserialize user inventory items as an external format.
/// </summary>
/// XXX: Please do not use yet.
/// </summary>
public class UserInventoryItemSerializer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private delegate void InventoryItemXmlProcessor(InventoryItemBase item, XmlTextReader reader);
private static Dictionary<string, InventoryItemXmlProcessor> m_InventoryItemXmlProcessors = new Dictionary<string, InventoryItemXmlProcessor>();
private static Dictionary<string, Action<InventoryItemBase, XmlTextReader>> m_InventoryItemXmlProcessors
= new Dictionary<string, Action<InventoryItemBase, XmlTextReader>>();
#region InventoryItemBase Processor initialization
static UserInventoryItemSerializer()
@@ -205,39 +204,14 @@ namespace OpenSim.Framework.Serialization.External
{
reader.ReadStartElement("InventoryItem");
string nodeName = string.Empty;
while (reader.NodeType != XmlNodeType.EndElement)
{
nodeName = reader.Name;
InventoryItemXmlProcessor p = null;
if (m_InventoryItemXmlProcessors.TryGetValue(reader.Name, out p))
{
//m_log.DebugFormat("[XXX] Processing: {0}", reader.Name);
try
{
p(item, reader);
}
catch (Exception e)
{
m_log.DebugFormat("[InventoryItemSerializer]: exception while parsing {0}: {1}", nodeName, e);
if (reader.NodeType == XmlNodeType.EndElement)
reader.Read();
}
}
else
{
// m_log.DebugFormat("[InventoryItemSerializer]: caught unknown element {0}", nodeName);
reader.ReadOuterXml(); // ignore
}
}
ExternalRepresentationUtils.ExecuteReadProcessors<InventoryItemBase>(
item, m_InventoryItemXmlProcessors, reader);
reader.ReadEndElement(); // InventoryItem
}
//m_log.DebugFormat("[XXX]: parsed InventoryItemBase {0} - {1}", obj.Name, obj.UUID);
return item;
}
public static string Serialize(InventoryItemBase inventoryItem, Dictionary<string, object> options, IUserAccountService userAccountService)
@@ -305,14 +279,14 @@ namespace OpenSim.Framework.Serialization.External
writer.WriteEndElement();
if (options.ContainsKey("creators") && inventoryItem.CreatorData != null && inventoryItem.CreatorData != string.Empty)
writer.WriteElementString("CreatorData", inventoryItem.CreatorData);
else if (options.ContainsKey("profile"))
else if (options.ContainsKey("home"))
{
if (userAccountService != null)
{
UserAccount account = userAccountService.GetUserAccount(UUID.Zero, inventoryItem.CreatorIdAsUuid);
if (account != null)
{
writer.WriteElementString("CreatorData", (string)options["profile"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName);
writer.WriteElementString("CreatorData", (string)options["home"] + "/" + inventoryItem.CreatorIdAsUuid + ";" + account.FirstName + " " + account.LastName);
}
writer.WriteElementString("CreatorID", inventoryItem.CreatorId);
}

View File

@@ -33,8 +33,11 @@ using OpenSim.Framework;
namespace OpenSim.Framework.Serialization.External
{
/// <summary>
/// Serialize and deserialize region settings as an external format.
/// Serialize and deserialize user profiles as an external format.
/// </summary>
/// <remarks>
/// Currently UNUSED.
/// </remarks>
public class UserProfileSerializer
{
public const int MAJOR_VERSION = 0;

View File

@@ -27,11 +27,12 @@
using System;
using System.Collections.Generic;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using NUnit.Framework;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Serialization.Tests
{
@@ -42,7 +43,7 @@ namespace OpenSim.Framework.Serialization.Tests
private LandData landWithParcelAccessList;
private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>2009-10-01T00:00:00</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>2010-10-20T00:00:00</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
[SetUp]
public void setup()
@@ -73,16 +74,16 @@ namespace OpenSim.Framework.Serialization.Tests
this.landWithParcelAccessList = this.land.Copy();
this.landWithParcelAccessList.ParcelAccessList.Clear();
ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry();
LandAccessEntry pae0 = new LandAccessEntry();
pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c");
pae0.Flags = AccessList.Ban;
pae0.Time = new DateTime(2009, 10, 01);
pae0.Expires = 0;
this.landWithParcelAccessList.ParcelAccessList.Add(pae0);
ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry();
LandAccessEntry pae1 = new LandAccessEntry();
pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e");
pae1.Flags = AccessList.Access;
pae1.Time = new DateTime(2010, 10, 20);
pae1.Expires = 0;
this.landWithParcelAccessList.ParcelAccessList.Add(pae1);
}
@@ -92,6 +93,8 @@ namespace OpenSim.Framework.Serialization.Tests
[Test]
public void LandDataSerializerSerializeTest()
{
TestHelpers.InMethod();
string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n");
Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
@@ -112,20 +115,32 @@ namespace OpenSim.Framework.Serialization.Tests
/// Test the LandDataSerializer.Deserialize() method
/// </summary>
[Test]
public void TestLandDataSerializerDeserializeFromStringTest()
public void TestLandDataDeserializeNoAccessLists()
{
LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
Assert.That(reifiedLandData != null, "Deserialize(string) returned null");
Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList);
Assert.That(reifiedLandDataWithParcelAccessList != null,
LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized);
Assert.That(ld != null, "Deserialize(string) returned null");
Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID");
Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name");
}
[Test]
public void TestLandDataDeserializeWithAccessLists()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList);
Assert.That(ld != null,
"Deserialize(string) returned null (pre-serialized with parcel access list)");
Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID,
Assert.That(ld.GlobalID == this.landWithParcelAccessList.GlobalID,
"Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)");
Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name,
Assert.That(ld.Name == this.landWithParcelAccessList.Name,
"Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)");
Assert.That(ld.ParcelAccessList.Count, Is.EqualTo(2));
Assert.That(ld.ParcelAccessList[0].AgentID, Is.EqualTo(UUID.Parse("62d65d45-c91a-4f77-862c-46557d978b6c")));
}
}
}
}

View File

@@ -0,0 +1,134 @@
/*
* 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 System.Collections.Generic;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using NUnit.Framework;
using OpenSim.Framework;
using OpenSim.Framework.Serialization.External;
using OpenSim.Tests.Common;
namespace OpenSim.Framework.Serialization.Tests
{
[TestFixture]
public class RegionSettingsSerializerTests
{
private string m_serializedRs = @"<?xml version=""1.0"" encoding=""utf-16""?>
<RegionSettings>
<General>
<AllowDamage>True</AllowDamage>
<AllowLandResell>True</AllowLandResell>
<AllowLandJoinDivide>True</AllowLandJoinDivide>
<BlockFly>True</BlockFly>
<BlockLandShowInSearch>True</BlockLandShowInSearch>
<BlockTerraform>True</BlockTerraform>
<DisableCollisions>True</DisableCollisions>
<DisablePhysics>True</DisablePhysics>
<DisableScripts>True</DisableScripts>
<MaturityRating>1</MaturityRating>
<RestrictPushing>True</RestrictPushing>
<AgentLimit>40</AgentLimit>
<ObjectBonus>1.4</ObjectBonus>
</General>
<GroundTextures>
<Texture1>00000000-0000-0000-0000-000000000020</Texture1>
<Texture2>00000000-0000-0000-0000-000000000040</Texture2>
<Texture3>00000000-0000-0000-0000-000000000060</Texture3>
<Texture4>00000000-0000-0000-0000-000000000080</Texture4>
<ElevationLowSW>1.9</ElevationLowSW>
<ElevationLowNW>15.9</ElevationLowNW>
<ElevationLowSE>49</ElevationLowSE>
<ElevationLowNE>45.3</ElevationLowNE>
<ElevationHighSW>2.1</ElevationHighSW>
<ElevationHighNW>4.5</ElevationHighNW>
<ElevationHighSE>9.2</ElevationHighSE>
<ElevationHighNE>19.2</ElevationHighNE>
</GroundTextures>
<Terrain>
<WaterHeight>23</WaterHeight>
<TerrainRaiseLimit>17.9</TerrainRaiseLimit>
<TerrainLowerLimit>0.4</TerrainLowerLimit>
<UseEstateSun>True</UseEstateSun>
<FixedSun>true</FixedSun>
<SunPosition>12</SunPosition>
</Terrain>
</RegionSettings>";
private RegionSettings m_rs;
[SetUp]
public void Setup()
{
m_rs = new RegionSettings();
m_rs.AgentLimit = 17;
m_rs.AllowDamage = true;
m_rs.AllowLandJoinDivide = true;
m_rs.AllowLandResell = true;
m_rs.BlockFly = true;
m_rs.BlockShowInSearch = true;
m_rs.BlockTerraform = true;
m_rs.DisableCollisions = true;
m_rs.DisablePhysics = true;
m_rs.DisableScripts = true;
m_rs.Elevation1NW = 15.9;
m_rs.Elevation1NE = 45.3;
m_rs.Elevation1SE = 49;
m_rs.Elevation1SW = 1.9;
m_rs.Elevation2NW = 4.5;
m_rs.Elevation2NE = 19.2;
m_rs.Elevation2SE = 9.2;
m_rs.Elevation2SW = 2.1;
m_rs.FixedSun = true;
m_rs.SunPosition = 12.0;
m_rs.ObjectBonus = 1.4;
m_rs.RestrictPushing = true;
m_rs.TerrainLowerLimit = 0.4;
m_rs.TerrainRaiseLimit = 17.9;
m_rs.TerrainTexture1 = UUID.Parse("00000000-0000-0000-0000-000000000020");
m_rs.TerrainTexture2 = UUID.Parse("00000000-0000-0000-0000-000000000040");
m_rs.TerrainTexture3 = UUID.Parse("00000000-0000-0000-0000-000000000060");
m_rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080");
m_rs.UseEstateSun = true;
m_rs.WaterHeight = 23;
}
[Test]
public void TestRegionSettingsDeserialize()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
RegionSettings deserRs = RegionSettingsSerializer.Deserialize(m_serializedRs);
Assert.That(deserRs, Is.Not.Null);
Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2));
Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics));
Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit));
}
}
}

View File

@@ -251,7 +251,7 @@ namespace OpenSim.Framework.Servers
sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
int timeNow = Util.EnvironmentTickCount();
int timeNow = Environment.TickCount & Int32.MaxValue;
sb.AppendFormat(reportFormat, "ID", "NAME", "LAST UPDATE (MS)", "LIFETIME (MS)", "PRIORITY", "STATE");
sb.Append(Environment.NewLine);

View File

@@ -42,15 +42,15 @@ namespace OpenSim.Framework.Statistics
{
private long abnormalClientThreadTerminations;
private long assetsInCache;
private long texturesInCache;
private long assetCacheMemoryUsage;
private long textureCacheMemoryUsage;
private TimeSpan assetRequestTimeAfterCacheMiss;
private long blockedMissingTextureRequests;
// private long assetsInCache;
// private long texturesInCache;
// private long assetCacheMemoryUsage;
// private long textureCacheMemoryUsage;
// private TimeSpan assetRequestTimeAfterCacheMiss;
// private long blockedMissingTextureRequests;
private long assetServiceRequestFailures;
private long inventoryServiceRetrievalFailures;
// private long assetServiceRequestFailures;
// private long inventoryServiceRetrievalFailures;
private volatile float timeDilation;
private volatile float simFps;
@@ -79,27 +79,27 @@ namespace OpenSim.Framework.Statistics
/// </summary>
public long AbnormalClientThreadTerminations { get { return abnormalClientThreadTerminations; } }
/// <summary>
/// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
/// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
/// haven't yet been implemented...
/// </summary>
public long AssetsInCache { get { return assetsInCache; } }
/// <value>
/// Currently unused
/// </value>
public long TexturesInCache { get { return texturesInCache; } }
/// <value>
/// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
/// </value>
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
/// <value>
/// Currently unused
/// </value>
public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
// /// <summary>
// /// These statistics are being collected by push rather than pull. Pull would be simpler, but I had the
// /// notion of providing some flow statistics (which pull wouldn't give us). Though admittedly these
// /// haven't yet been implemented...
// /// </summary>
// public long AssetsInCache { get { return assetsInCache; } }
//
// /// <value>
// /// Currently unused
// /// </value>
// public long TexturesInCache { get { return texturesInCache; } }
//
// /// <value>
// /// Currently misleading since we can't currently subtract removed asset memory usage without a performance hit
// /// </value>
// public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
//
// /// <value>
// /// Currently unused
// /// </value>
// public long TextureCacheMemoryUsage { get { return textureCacheMemoryUsage; } }
public float TimeDilation { get { return timeDilation; } }
public float SimFps { get { return simFps; } }
@@ -123,32 +123,33 @@ namespace OpenSim.Framework.Statistics
public float ActiveScripts { get { return activeScripts; } }
public float ScriptLinesPerSecond { get { return scriptLinesPerSecond; } }
/// <summary>
/// This is the time it took for the last asset request made in response to a cache miss.
/// </summary>
public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } }
/// <summary>
/// Number of persistent requests for missing textures we have started blocking from clients. To some extent
/// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
/// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
/// driver bugs on clients (though this seems less likely).
/// </summary>
public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
/// <summary>
/// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as
/// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted
/// as a failure
/// </summary>
public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
// /// <summary>
// /// This is the time it took for the last asset request made in response to a cache miss.
// /// </summary>
// public TimeSpan AssetRequestTimeAfterCacheMiss { get { return assetRequestTimeAfterCacheMiss; } }
//
// /// <summary>
// /// Number of persistent requests for missing textures we have started blocking from clients. To some extent
// /// this is just a temporary statistic to keep this problem in view - the root cause of this lies either
// /// in a mishandling of the reply protocol, related to avatar appearance or may even originate in graphics
// /// driver bugs on clients (though this seems less likely).
// /// </summary>
// public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
//
// /// <summary>
// /// Record the number of times that an asset request has failed. Failures are effectively exceptions, such as
// /// request timeouts. If an asset service replies that a particular asset cannot be found, this is not counted
// /// as a failure
// /// </summary>
// public long AssetServiceRequestFailures { get { return assetServiceRequestFailures; } }
/// <summary>
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not
/// cover situations where the inventory service accepts the request but never returns any data, since
/// we do not yet timeout this situation.
/// </summary>
public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <remarks>Commented out because we do not cache inventory at this point</remarks>
// public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <summary>
/// Retrieve the total frame time (in ms) of the last frame
@@ -171,58 +172,58 @@ namespace OpenSim.Framework.Statistics
abnormalClientThreadTerminations++;
}
public void AddAsset(AssetBase asset)
{
assetsInCache++;
//assetCacheMemoryUsage += asset.Data.Length;
}
public void RemoveAsset(UUID uuid)
{
assetsInCache--;
}
// public void AddAsset(AssetBase asset)
// {
// assetsInCache++;
// //assetCacheMemoryUsage += asset.Data.Length;
// }
//
// public void RemoveAsset(UUID uuid)
// {
// assetsInCache--;
// }
//
// public void AddTexture(AssetBase image)
// {
// if (image.Data != null)
// {
// texturesInCache++;
//
// // This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
// textureCacheMemoryUsage += image.Data.Length;
// }
// }
//
// /// <summary>
// /// Signal that the asset cache has been cleared.
// /// </summary>
// public void ClearAssetCacheStatistics()
// {
// assetsInCache = 0;
// assetCacheMemoryUsage = 0;
// texturesInCache = 0;
// textureCacheMemoryUsage = 0;
// }
//
// public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts)
// {
// assetRequestTimeAfterCacheMiss = ts;
// }
//
// public void AddBlockedMissingTextureRequest()
// {
// blockedMissingTextureRequests++;
// }
//
// public void AddAssetServiceRequestFailure()
// {
// assetServiceRequestFailures++;
// }
public void AddTexture(AssetBase image)
{
if (image.Data != null)
{
texturesInCache++;
// This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
textureCacheMemoryUsage += image.Data.Length;
}
}
/// <summary>
/// Signal that the asset cache has been cleared.
/// </summary>
public void ClearAssetCacheStatistics()
{
assetsInCache = 0;
assetCacheMemoryUsage = 0;
texturesInCache = 0;
textureCacheMemoryUsage = 0;
}
public void AddAssetRequestTimeAfterCacheMiss(TimeSpan ts)
{
assetRequestTimeAfterCacheMiss = ts;
}
public void AddBlockedMissingTextureRequest()
{
blockedMissingTextureRequests++;
}
public void AddAssetServiceRequestFailure()
{
assetServiceRequestFailures++;
}
public void AddInventoryServiceRetrievalFailure()
{
inventoryServiceRetrievalFailures++;
}
// public void AddInventoryServiceRetrievalFailure()
// {
// inventoryServiceRetrievalFailures++;
// }
/// <summary>
/// Register as a packet queue stats provider
@@ -290,8 +291,8 @@ namespace OpenSim.Framework.Statistics
public override string Report()
{
StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("ASSET STATISTICS");
sb.Append(Environment.NewLine);
// sb.Append("ASSET STATISTICS");
// sb.Append(Environment.NewLine);
/*
sb.Append(
@@ -307,7 +308,8 @@ Asset service request failures: {6}"+ Environment.NewLine,
BlockedMissingTextureRequests,
AssetServiceRequestFailures));
*/
/*
sb.Append(
string.Format(
@"Asset cache contains {0,6} assets
@@ -318,7 +320,7 @@ Asset service request failures: {3}" + Environment.NewLine,
assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0,
BlockedMissingTextureRequests,
AssetServiceRequestFailures));
*/
sb.Append(Environment.NewLine);
sb.Append("CONNECTION STATISTICS");
@@ -328,13 +330,13 @@ Asset service request failures: {3}" + Environment.NewLine,
"Abnormal client thread terminations: {0}" + Environment.NewLine,
abnormalClientThreadTerminations));
sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
"Initial inventory caching failures: {0}" + Environment.NewLine,
InventoryServiceRetrievalFailures));
// sb.Append(Environment.NewLine);
// sb.Append("INVENTORY STATISTICS");
// sb.Append(Environment.NewLine);
// sb.Append(
// string.Format(
// "Initial inventory caching failures: {0}" + Environment.NewLine,
// InventoryServiceRetrievalFailures));
sb.Append(Environment.NewLine);
sb.Append("FRAME STATISTICS");
@@ -390,17 +392,17 @@ Asset service request failures: {3}" + Environment.NewLine,
public override string XReport(string uptime, string version)
{
OSDMap args = new OSDMap(30);
args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
BlockedMissingTextureRequests));
args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
AssetServiceRequestFailures));
args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
abnormalClientThreadTerminations));
args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
InventoryServiceRetrievalFailures));
// args["AssetsInCache"] = OSD.FromString (String.Format ("{0:0.##}", AssetsInCache));
// args["TimeAfterCacheMiss"] = OSD.FromString (String.Format ("{0:0.##}",
// assetRequestTimeAfterCacheMiss.Milliseconds / 1000.0));
// args["BlockedMissingTextureRequests"] = OSD.FromString (String.Format ("{0:0.##}",
// BlockedMissingTextureRequests));
// args["AssetServiceRequestFailures"] = OSD.FromString (String.Format ("{0:0.##}",
// AssetServiceRequestFailures));
// args["abnormalClientThreadTerminations"] = OSD.FromString (String.Format ("{0:0.##}",
// abnormalClientThreadTerminations));
// args["InventoryServiceRetrievalFailures"] = OSD.FromString (String.Format ("{0:0.##}",
// InventoryServiceRetrievalFailures));
args["Dilatn"] = OSD.FromString (String.Format ("{0:0.##}", timeDilation));
args["SimFPS"] = OSD.FromString (String.Format ("{0:0.##}", simFps));
args["PhyFPS"] = OSD.FromString (String.Format ("{0:0.##}", physicsFps));

View File

@@ -64,7 +64,8 @@ namespace OpenSim.Framework
private UUID _permsGranter;
private int _permsMask;
private int _type = 0;
private UUID _oldID = UUID.Zero;
private UUID _oldID;
private UUID _loadedID = UUID.Zero;
private bool _ownerChanged = false;
@@ -234,6 +235,15 @@ namespace OpenSim.Framework
}
}
public UUID LoadedItemID {
get {
return _loadedID;
}
set {
_loadedID = value;
}
}
public UUID LastOwnerID {
get {
return _lastOwnerID;
@@ -359,8 +369,8 @@ namespace OpenSim.Framework
/// <param name="partID">The new part ID to which this item belongs</param>
public void ResetIDs(UUID partID)
{
if (_oldID == UUID.Zero)
_oldID = ItemID;
LoadedItemID = OldItemID;
OldItemID = ItemID;
ItemID = UUID.Random();
ParentPartID = partID;
ParentID = partID;

View File

@@ -1676,13 +1676,14 @@ namespace OpenSim.Framework
/// </summary>
public static void PrintCallStack()
{
StackTrace stackTrace = new StackTrace(); // get call stack
StackTrace stackTrace = new StackTrace(true); // get call stack
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
// write call stack method names
foreach (StackFrame stackFrame in stackFrames)
{
m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name
MethodBase mb = stackFrame.GetMethod();
m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name
}
}

View File

@@ -107,15 +107,13 @@ namespace OpenSim
}
else
{
m_log.ErrorFormat("Master ini file {0} not found", masterFilePath);
m_log.ErrorFormat("Master ini file {0} not found", Path.GetFullPath(masterFilePath));
Environment.Exit(1);
}
}
}
string iniFileName =
startupConfig.GetString("inifile", "OpenSim.ini");
string iniFileName = startupConfig.GetString("inifile", "OpenSim.ini");
if (IsUri(iniFileName))
{
@@ -131,8 +129,7 @@ namespace OpenSim
if (!File.Exists(Application.iniFilePath))
{
iniFileName = "OpenSim.xml";
Application.iniFilePath = Path.GetFullPath(
Path.Combine(Util.configDir(), iniFileName));
Application.iniFilePath = Path.GetFullPath(Path.Combine(Util.configDir(), iniFileName));
}
if (File.Exists(Application.iniFilePath))
@@ -142,15 +139,12 @@ namespace OpenSim
}
}
string iniDirName =
startupConfig.GetString("inidirectory", "config");
string iniDirPath =
Path.Combine(Util.configDir(), iniDirName);
string iniDirName = startupConfig.GetString("inidirectory", "config");
string iniDirPath = Path.Combine(Util.configDir(), iniDirName);
if (Directory.Exists(iniDirPath))
{
m_log.InfoFormat("Searching folder {0} for config ini files",
iniDirPath);
m_log.InfoFormat("Searching folder {0} for config ini files", iniDirPath);
string[] fileEntries = Directory.GetFiles(iniDirName);
foreach (string filePath in fileEntries)
@@ -172,7 +166,6 @@ namespace OpenSim
if (sources.Count == 0)
{
m_log.FatalFormat("[CONFIG]: Could not load any configuration");
m_log.FatalFormat("[CONFIG]: Did you copy the OpenSimDefaults.ini.example file to OpenSimDefaults.ini?");
Environment.Exit(1);
}

View File

@@ -188,6 +188,18 @@ namespace OpenSim
}
}
// Hook up to the watchdog timer
Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
PrintFileToConsole("startuplogo.txt");
// For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region",
new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
else
ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
//Run Startup Commands
if (String.IsNullOrEmpty(m_startupCommandsFile))
{
@@ -206,18 +218,6 @@ namespace OpenSim
m_scriptTimer.Interval = 1200*1000;
m_scriptTimer.Elapsed += RunAutoTimerScript;
}
// Hook up to the watchdog timer
Watchdog.OnWatchdogTimeout += WatchdogTimeoutHandler;
PrintFileToConsole("startuplogo.txt");
// For now, start at the 'root' level by default
if (m_sceneManager.Scenes.Count == 1) // If there is only one region, select it
ChangeSelectedRegion("region",
new string[] {"change", "region", m_sceneManager.Scenes[0].RegionInfo.RegionName});
else
ChangeSelectedRegion("region", new string[] {"change", "region", "root"});
}
/// <summary>
@@ -250,8 +250,10 @@ namespace OpenSim
+ "If level <= 0 then no extra http logging is done.\n",
Debug);
m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
m_console.Commands.AddCommand("region", false, "debug scene",
"debug scene <cripting> <collisions> <physics>",
"debug scene <scripting> <collisions> <physics>",
"Turn on scene debugging", Debug);
m_console.Commands.AddCommand("region", false, "change region",
@@ -289,12 +291,16 @@ namespace OpenSim
m_console.Commands.AddCommand("region", false, "save oar",
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
"save oar [-p|--profile=<url>] [--noassets] [--perm=<permissions>] [<OAR path>]",
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
"Save a region's data to an OAR archive.",
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
"-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
"-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
+ "--noassets stops assets being saved to the OAR." + Environment.NewLine
+ "--perm stops objects with insufficient permissions from being saved to the OAR." + Environment.NewLine
+ "--publish saves an OAR stripped of owner and last owner information." + Environment.NewLine
+ " on reload, the estate owner will be the owner of all objects" + Environment.NewLine
+ " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published" + Environment.NewLine
+ " this option is EXPERIMENTAL" + Environment.NewLine
+ "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR." + Environment.NewLine
+ " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer" + Environment.NewLine
+ "The OAR path must be a filesystem path."
+ " If this is not given then the oar is saved to region.oar in the current directory.",
@@ -796,6 +802,7 @@ namespace OpenSim
break;
case "backup":
MainConsole.Instance.Output("Triggering save of pending object updates to persistent store");
m_sceneManager.BackupCurrentScene();
break;
@@ -806,7 +813,7 @@ namespace OpenSim
if (m_sceneManager.TryGetScene(regRemoveName, out removeScene))
RemoveRegion(removeScene, false);
else
MainConsole.Instance.Output("no region with that name");
MainConsole.Instance.Output("No region with that name");
break;
case "delete-region":
@@ -947,6 +954,21 @@ namespace OpenSim
break;
case "teleport":
foreach(Scene s in m_sceneManager.Scenes)
{
if (s.DEBUG)
{
s.DEBUG = false;
MainConsole.Instance.Output("Teleport debugging is disabled!");
}
else{
s.DEBUG = true;
MainConsole.Instance.Output("Teleport debugging is enabled!");
}
}
break;
default:
MainConsole.Instance.Output("Unknown debug command");
break;

View File

@@ -46,7 +46,7 @@ using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Physics.Manager;
using OpenSim.Server.Base;
using OpenSim.Server.Base;
using OpenSim.Services.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Services.UserAccountService;
@@ -211,16 +211,16 @@ namespace OpenSim
// Load the simulation data service
IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
if (simDataConfig == null)
throw new Exception("Configuration file is missing the [SimulationDataStore] section");
throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
if (String.IsNullOrEmpty(module))
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section");
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section.");
m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });
// Load the estate data service
IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
if (estateDataConfig == null)
throw new Exception("Configuration file is missing the [EstateDataStore] section");
throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
if (String.IsNullOrEmpty(module))
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
@@ -432,10 +432,14 @@ namespace OpenSim
// TODO : Try setting resource for region xstats here on scene
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
}
try
{
scene.RegisterRegionWithGrid();
@@ -460,9 +464,6 @@ namespace OpenSim
scene.SnmpService.BootInfo("Grid Registration done", scene);
}
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
// We need to do this after we've initialized the
// scripting engines.
scene.CreateScriptInstances();

View File

@@ -94,6 +94,7 @@ namespace OpenSim.Region.ClientStack.Linden
private static readonly string m_notecardUpdatePath = "0004/";
private static readonly string m_notecardTaskUpdatePath = "0005/";
// private static readonly string m_fetchInventoryPath = "0006/";
private static readonly string m_copyFromNotecardPath = "0007/";
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
@@ -180,6 +181,7 @@ namespace OpenSim.Region.ClientStack.Linden
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
// As of RC 1.22.9 of the Linden client this is
// supported
@@ -366,7 +368,7 @@ namespace OpenSim.Region.ClientStack.Linden
if (mm != null)
{
if (!mm.UploadCovered(client, mm.UploadCharge))
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
@@ -420,7 +422,7 @@ namespace OpenSim.Region.ClientStack.Linden
string assetType)
{
m_log.DebugFormat(
"Uploaded asset {0} for inventory item {1}, inv type {2}, asset type {3}",
"[BUNCH OF CAPS]: Uploaded asset {0} for inventory item {1}, inv type {2}, asset type {3}",
assetID, inventoryItem, inventoryType, assetType);
sbyte assType = 0;
@@ -623,7 +625,12 @@ namespace OpenSim.Region.ClientStack.Linden
item.AssetType = assType;
item.InvType = inType;
item.Folder = parentFolder;
item.CurrentPermissions = (uint)PermissionMask.All;
// If we set PermissionMask.All then when we rez the item the next permissions will replace the current
// (owner) permissions. This becomes a problem if next permissions are changed.
item.CurrentPermissions
= (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
item.BasePermissions = (uint)PermissionMask.All;
item.EveryOnePermissions = 0;
item.NextPermissions = (uint)PermissionMask.All;
@@ -723,6 +730,75 @@ namespace OpenSim.Region.ClientStack.Linden
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
}
/// <summary>
/// Called by the CopyInventoryFromNotecard caps handler.
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
public string CopyInventoryFromNotecard(string request, string path, string param,
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
Hashtable response = new Hashtable();
response["int_response_code"] = 404;
response["content_type"] = "text/plain";
response["keepalive"] = false;
response["str_response_string"] = "";
try
{
OSDMap content = (OSDMap)OSDParser.DeserializeLLSDXml(request);
UUID objectID = content["object-id"].AsUUID();
UUID notecardID = content["notecard-id"].AsUUID();
UUID folderID = content["folder-id"].AsUUID();
UUID itemID = content["item-id"].AsUUID();
// m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, FolderID:{0}, ItemID:{1}, NotecardID:{2}, ObjectID:{3}", folderID, itemID, notecardID, objectID);
if (objectID != UUID.Zero)
{
SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
if (part != null)
{
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, m_HostCapsObj.AgentID))
{
return LLSDHelpers.SerialiseLLSDReply(response);
}
}
}
InventoryItemBase item = null;
InventoryItemBase copyItem = null;
IClientAPI client = null;
m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
item = m_Scene.InventoryService.GetItem(new InventoryItemBase(itemID));
if (item != null)
{
copyItem = m_Scene.GiveInventoryItem(m_HostCapsObj.AgentID, item.Owner, itemID, folderID);
if (copyItem != null && client != null)
{
m_log.InfoFormat("[CAPS]: CopyInventoryFromNotecard, ItemID:{0}, FolderID:{1}", copyItem.ID, copyItem.Folder);
client.SendBulkUpdateInventory(copyItem);
}
}
else
{
m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard - Failed to retrieve item {0} from notecard {1}", itemID, notecardID);
if (client != null)
client.SendAlertMessage("Failed to retrieve item");
}
}
catch (Exception e)
{
m_log.ErrorFormat("[CAPS]: CopyInventoryFromNotecard : {0}", e.ToString());
}
response["int_response_code"] = 200;
return LLSDHelpers.SerialiseLLSDReply(response);
}
}
public class AssetUploader
@@ -1018,4 +1094,4 @@ namespace OpenSim.Region.ClientStack.Linden
fs.Close();
}
}
}
}

View File

@@ -0,0 +1,151 @@
/*
* 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 System.Collections;
using System.Reflection;
using log4net;
using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OpenSim.Capabilities.Handlers;
namespace OpenSim.Region.ClientStack.Linden
{
/// <summary>
/// This module implements both WebFetchInventoryDescendents and FetchInventoryDescendents2 capabilities.
/// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class FetchInventory2Module : INonSharedRegionModule
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public bool Enabled { get; private set; }
private Scene m_scene;
private IInventoryService m_inventoryService;
private string m_fetchInventory2Url;
private FetchInventory2Handler m_fetchHandler;
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_fetchInventory2Url = config.GetString("Cap_FetchInventory2", string.Empty);
if (m_fetchInventory2Url != string.Empty)
Enabled = true;
}
public void AddRegion(Scene s)
{
if (!Enabled)
return;
m_scene = s;
}
public void RemoveRegion(Scene s)
{
if (!Enabled)
return;
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public void RegionLoaded(Scene s)
{
if (!Enabled)
return;
m_inventoryService = m_scene.InventoryService;
// We'll reuse the same handler for all requests.
if (m_fetchInventory2Url == "localhost")
m_fetchHandler = new FetchInventory2Handler(m_inventoryService);
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public void PostInitialise() {}
public void Close() {}
public string Name { get { return "FetchInventory2Module"; } }
public Type ReplaceableInterface
{
get { return null; }
}
#endregion
private void RegisterCaps(UUID agentID, Caps caps)
{
RegisterFetchCap(agentID, caps, "FetchInventory2", m_fetchInventory2Url);
}
private void RegisterFetchCap(UUID agentID, Caps caps, string capName, string url)
{
string capUrl;
if (url == "localhost")
{
capUrl = "/CAPS/" + UUID.Random();
IRequestHandler reqHandler
= new RestStreamHandler("POST", capUrl, m_fetchHandler.FetchInventoryRequest);
caps.RegisterHandler(capName, reqHandler);
}
else
{
capUrl = url;
caps.RegisterHandler(capName, capUrl);
}
// m_log.DebugFormat(
// "[FETCH INVENTORY2 MODULE]: Registered capability {0} at {1} in region {2} for {3}",
// capName, capUrl, m_scene.RegionInfo.RegionName, agentID);
}
}
}

View File

@@ -50,8 +50,7 @@ namespace OpenSim.Region.ClientStack.Linden
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule
{
// private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
// private IAssetService m_assetService;
@@ -147,7 +146,7 @@ namespace OpenSim.Region.ClientStack.Linden
{
if (m_scene.TryGetClient(agentID, out client))
{
if (!mm.UploadCovered(client, mm.UploadCharge))
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
@@ -210,6 +209,9 @@ namespace OpenSim.Region.ClientStack.Linden
UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
string assetType,UUID AgentID)
{
// m_log.DebugFormat(
// "[NEW FILE AGENT INVENTORY VARIABLE PRICE MODULE]: Upload complete for {0}", inventoryItem);
sbyte assType = 0;
sbyte inType = 0;
@@ -259,13 +261,13 @@ namespace OpenSim.Region.ClientStack.Linden
item.AssetType = assType;
item.InvType = inType;
item.Folder = parentFolder;
item.CurrentPermissions = (uint)PermissionMask.All;
item.CurrentPermissions
= (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
item.BasePermissions = (uint)PermissionMask.All;
item.EveryOnePermissions = 0;
item.NextPermissions = (uint)PermissionMask.All;
item.CreationDate = Util.UnixTimeSinceEpoch();
m_scene.AddInventoryItem(item);
}
}
}
}

View File

@@ -339,7 +339,7 @@ namespace OpenSim.Region.ClientStack.Linden
m_scene.AddSceneObject(grp);
grp.AbsolutePosition = obj.Position;
}
allparts[i] = grp;
}

View File

@@ -45,6 +45,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private const int IMAGE_PACKET_SIZE = 1000;
private const int FIRST_PACKET_SIZE = 600;
/// <summary>
/// If we've requested an asset but not received it in this ticks timeframe, then allow a duplicate
/// request from the client to trigger a fresh asset request.
/// </summary>
/// <remarks>
/// There are 10,000 ticks in a millisecond
/// </remarks>
private const int ASSET_REQUEST_TIMEOUT = 100000000;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public uint LastSequence;
@@ -56,9 +65,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public IAssetService AssetService;
public UUID AgentID;
public IInventoryAccessModule InventoryAccessModule;
public OpenJPEG.J2KLayerInfo[] Layers;
public bool IsDecoded;
public bool HasAsset;
private OpenJPEG.J2KLayerInfo[] m_layers;
/// <summary>
/// Has this request decoded the asset data?
/// </summary>
public bool IsDecoded { get; private set; }
/// <summary>
/// Has this request received the required asset data?
/// </summary>
public bool HasAsset { get; private set; }
/// <summary>
/// Time in milliseconds at which the asset was requested.
/// </summary>
public long AssetRequestTime { get; private set; }
public C5.IPriorityQueueHandle<J2KImage> PriorityQueueHandle;
private uint m_currentPacket;
@@ -82,7 +105,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="packetsToSend">Maximum number of packets to send during this call</param>
/// <param name="packetsSent">Number of packets sent during this call</param>
/// <returns>True if the transfer completes at the current discard level, otherwise false</returns>
public bool SendPackets(LLClientView client, int packetsToSend, out int packetsSent)
public bool SendPackets(IClientAPI client, int packetsToSend, out int packetsSent)
{
packetsSent = 0;
@@ -102,7 +125,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_currentPacket = 2;
}
while (sendMore && packetsSent < packetsToSend && m_currentPacket <= m_stopPacket)
{
sendMore = SendPacket(client);
@@ -114,17 +137,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return (m_currentPacket > m_stopPacket);
}
/// <summary>
/// This is where we decide what we need to update
/// and assign the real discardLevel and packetNumber
/// assuming of course that the connected client might be bonkers
/// </summary>
public void RunUpdate()
{
//This is where we decide what we need to update
//and assign the real discardLevel and packetNumber
//assuming of course that the connected client might be bonkers
if (!HasAsset)
{
if (!m_assetRequested)
if (!m_assetRequested || DateTime.UtcNow.Ticks > AssetRequestTime + ASSET_REQUEST_TIMEOUT)
{
// m_log.DebugFormat(
// "[J2KIMAGE]: Requesting asset {0} from request in packet {1}, already requested? {2}, due to timeout? {3}",
// TextureID, LastSequence, m_assetRequested, DateTime.UtcNow.Ticks > AssetRequestTime + ASSET_REQUEST_TIMEOUT);
m_assetRequested = true;
AssetRequestTime = DateTime.UtcNow.Ticks;
AssetService.Get(TextureID.ToString(), this, AssetReceived);
}
}
@@ -137,6 +167,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
//Request decode
m_decodeRequested = true;
// m_log.DebugFormat("[J2KIMAGE]: Requesting decode of asset {0}", TextureID);
// Do we have a jpeg decoder?
if (J2KDecoder != null)
{
@@ -149,7 +182,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// Send it off to the jpeg decoder
J2KDecoder.BeginDecode(TextureID, m_asset, J2KDecodedCallback);
}
}
else
{
@@ -170,14 +202,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DiscardLevel >= 0 || m_stopPacket == 0)
{
// This shouldn't happen, but if it does, we really can't proceed
if (Layers == null)
if (m_layers == null)
{
m_log.Warn("[J2KIMAGE]: RunUpdate() called with missing Layers. Canceling texture transfer");
m_currentPacket = m_stopPacket;
return;
}
int maxDiscardLevel = Math.Max(0, Layers.Length - 1);
int maxDiscardLevel = Math.Max(0, m_layers.Length - 1);
// Treat initial texture downloads with a DiscardLevel of -1 a request for the highest DiscardLevel
if (DiscardLevel < 0 && m_stopPacket == 0)
@@ -187,9 +219,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
DiscardLevel = (sbyte)Math.Min(DiscardLevel, maxDiscardLevel);
//Calculate the m_stopPacket
if (Layers.Length > 0)
if (m_layers.Length > 0)
{
m_stopPacket = (uint)GetPacketForBytePosition(Layers[(Layers.Length - 1) - DiscardLevel].End);
m_stopPacket = (uint)GetPacketForBytePosition(m_layers[(m_layers.Length - 1) - DiscardLevel].End);
//I don't know why, but the viewer seems to expect the final packet if the file
//is just one packet bigger.
if (TexturePacketCount() == m_stopPacket + 1)
@@ -203,7 +235,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
if (m_stopPacket == 1 && Layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
if (m_stopPacket == 1 && m_layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
m_currentPacket = StartPacket;
}
@@ -211,7 +243,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
private bool SendFirstPacket(LLClientView client)
private bool SendFirstPacket(IClientAPI client)
{
if (client == null)
return false;
@@ -246,7 +278,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return false;
}
private bool SendPacket(LLClientView client)
private bool SendPacket(IClientAPI client)
{
if (client == null)
return false;
@@ -331,20 +363,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (m_currentPacket == 0)
return 0;
if (m_currentPacket == 1)
return FIRST_PACKET_SIZE;
int result = FIRST_PACKET_SIZE + ((int)m_currentPacket - 2) * IMAGE_PACKET_SIZE;
if (result < 0)
{
result = FIRST_PACKET_SIZE;
}
return result;
}
private void J2KDecodedCallback(UUID AssetId, OpenJPEG.J2KLayerInfo[] layers)
{
Layers = layers;
m_layers = layers;
IsDecoded = true;
RunUpdate();
}
@@ -375,9 +408,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void AssetReceived(string id, Object sender, AssetBase asset)
{
// m_log.DebugFormat(
// "[J2KIMAGE]: Received asset {0} ({1} bytes)", id, asset != null ? asset.Data.Length.ToString() : "n/a");
UUID assetID = UUID.Zero;
if (asset != null)
{
assetID = asset.FullID;
}
else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule))
{
// Unfortunately we need this here, there's no other way.
@@ -388,14 +426,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
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(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived);
if (!assetServerURL.EndsWith("/") && !assetServerURL.EndsWith("="))
assetServerURL = assetServerURL + "/";
m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", assetServerURL + id);
AssetService.Get(assetServerURL + id, InventoryAccessModule, AssetReceived);
return;
}
}
AssetDataCallback(assetID, asset);
}
}
}

View File

@@ -220,6 +220,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event BakeTerrain OnBakeTerrain;
public event RequestTerrain OnUploadTerrain;
public event EstateChangeInfo OnEstateChangeInfo;
public event EstateManageTelehub OnEstateManageTelehub;
public event EstateRestartSimRequest OnEstateRestartSimRequest;
public event EstateChangeCovenantRequest OnEstateChangeCovenantRequest;
public event UpdateEstateAccessDeltaRequest OnUpdateEstateAccessDeltaRequest;
@@ -306,6 +307,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
/// <summary>
/// Handles UDP texture download.
/// </summary>
public LLImageManager ImageManager { get; private set; }
private readonly LLUDPServer m_udpServer;
private readonly LLUDPClient m_udpClient;
private readonly UUID m_sessionId;
@@ -351,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
protected Scene m_scene;
protected LLImageManager m_imageManager;
protected string m_firstName;
protected string m_lastName;
protected Thread m_clientThread;
@@ -452,6 +457,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public LLClientView(EndPoint remoteEP, Scene scene, LLUDPServer udpServer, LLUDPClient udpClient, AuthenticateResponse sessionInfo,
UUID agentId, UUID sessionId, uint circuitCode)
{
// DebugPacketLevel = 1;
RegisterInterface<IClientIM>(this);
RegisterInterface<IClientChat>(this);
RegisterInterface<IClientIPEndpoint>(this);
@@ -468,7 +475,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
m_agentId = agentId;
m_sessionId = sessionId;
@@ -520,8 +527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
IsActive = false;
// Shutdown the image manager
if (m_imageManager != null)
m_imageManager.Close();
ImageManager.Close();
// Fire the callback for this connection closing
if (OnConnectionClosed != null)
@@ -598,8 +604,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// Add a handler for the given packet type.
/// </summary>
/// <remarks>The packet is handled on its own thread. If packets must be handled in the order in which thye
/// are received then please us ethe synchronous version of this method.</remarks>
/// <remarks>
/// The packet is handled on its own thread. If packets must be handled in the order in which they
/// are received then please use the synchronous version of this method.
/// </remarks>
/// <param name="packetType"></param>
/// <param name="handler"></param>
/// <returns>true if the handler was added. This is currently always the case.</returns>
@@ -778,9 +786,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(handshake, ThrottleOutPacketType.Task);
}
/// <summary>
///
/// </summary>
public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
{
AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete);
@@ -2761,7 +2766,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
reply.Data.ParcelID = parcelID;
reply.Data.OwnerID = land.OwnerID;
reply.Data.Name = Utils.StringToBytes(land.Name);
reply.Data.Desc = Utils.StringToBytes(land.Description);
if (land != null && land.Description != null && land.Description != String.Empty)
reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length));
else
reply.Data.Desc = new Byte[0];
reply.Data.ActualArea = land.Area;
reply.Data.BillableArea = land.Area; // TODO: what is this?
@@ -3490,6 +3498,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending avatar appearance for {0} with {1} bytes to {2} {3}",
// agentID, textureEntry.Length, Name, AgentId);
AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance);
// TODO: don't create new blocks if recycling an old packet
avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
@@ -3511,7 +3523,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
{
//m_log.DebugFormat("[CLIENT]: Sending animations to {0}", Name);
// m_log.DebugFormat("[LLCLIENTVIEW]: Sending animations for {0} to {1}", sourceAgentId, Name);
AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation);
// TODO: don't create new blocks if recycling an old packet
@@ -3546,6 +3558,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </summary>
public void SendAvatarDataImmediate(ISceneEntity avatar)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending immediate object update for avatar {0} {1} to {2} {3}",
// avatar.Name, avatar.UUID, Name, AgentId);
ScenePresence presence = avatar as ScenePresence;
if (presence == null)
return;
@@ -3555,7 +3571,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
objupdate.RegionData.RegionHandle = presence.RegionHandle;
objupdate.RegionData.TimeDilation = ushort.MaxValue;
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
objupdate.ObjectData[0] = CreateAvatarUpdateBlock(presence);
@@ -3980,15 +3996,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0)
{
ProcessTextureRequests();
}
}
void ProcessTextureRequests()
{
if (m_imageManager != null)
m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
}
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
@@ -4489,7 +4497,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EstateCovenantReplyPacket einfopack = new EstateCovenantReplyPacket();
EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
edata.CovenantID = covenant;
edata.CovenantTimestamp = 0;
edata.CovenantTimestamp = (uint) m_scene.RegionInfo.RegionSettings.CovenantChangedDateTime;
edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName);
einfopack.Data = edata;
@@ -4497,8 +4505,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
public void SendDetailedEstateData(
UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition,
UUID covenant, string abuseEmail, UUID estateOwner)
UUID invoice, string estateName, uint estateID, uint parentEstate, uint estateFlags, uint sunPosition,
UUID covenant, uint covenantChanged, string abuseEmail, UUID estateOwner)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending detailed estate data to {0} with covenant asset id {1}", Name, covenant);
@@ -4523,7 +4531,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
returnblock[4].Parameter = Utils.StringToBytes(sunPosition.ToString());
returnblock[5].Parameter = Utils.StringToBytes(parentEstate.ToString());
returnblock[6].Parameter = Utils.StringToBytes(covenant.ToString());
returnblock[7].Parameter = Utils.StringToBytes("1160895077"); // what is this?
returnblock[7].Parameter = Utils.StringToBytes(covenantChanged.ToString());
returnblock[8].Parameter = Utils.StringToBytes("1"); // what is this?
returnblock[9].Parameter = Utils.StringToBytes(abuseEmail);
@@ -4533,6 +4541,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task);
}
public void SendTelehubInfo(UUID ObjectID, string ObjectName, Vector3 ObjectPos, Quaternion ObjectRot, List<Vector3> SpawnPoint)
{
TelehubInfoPacket packet = (TelehubInfoPacket)PacketPool.Instance.GetPacket(PacketType.TelehubInfo);
packet.TelehubBlock.ObjectID = ObjectID;
packet.TelehubBlock.ObjectName = Utils.StringToBytes(ObjectName);
packet.TelehubBlock.TelehubPos = ObjectPos;
packet.TelehubBlock.TelehubRot = ObjectRot;
packet.SpawnPointBlock = new TelehubInfoPacket.SpawnPointBlockBlock[SpawnPoint.Count];
for (int n = 0; n < SpawnPoint.Count; n++)
{
packet.SpawnPointBlock[n] = new TelehubInfoPacket.SpawnPointBlockBlock{SpawnPointPos = SpawnPoint[n]};
}
OutPacket(packet, ThrottleOutPacketType.Task);
}
#endregion
#region Land Data Sending Methods
@@ -4608,7 +4633,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (landData.SimwideArea > 0)
{
int simulatorCapacity = (int)((double)(landData.SimwideArea * m_scene.RegionInfo.ObjectCapacity) * m_scene.RegionInfo.RegionSettings.ObjectBonus) / 65536;
int simulatorCapacity = (int)((long)landData.SimwideArea * (long)m_scene.RegionInfo.ObjectCapacity * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus / 65536L);
// Never report more than sim total capacity
if (simulatorCapacity > m_scene.RegionInfo.ObjectCapacity)
simulatorCapacity = m_scene.RegionInfo.ObjectCapacity;
@@ -4659,7 +4684,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
public void SendLandAccessListData(List<UUID> avatars, uint accessFlag, int localLandID)
public void SendLandAccessListData(List<LandAccessEntry> accessList, uint accessFlag, int localLandID)
{
ParcelAccessListReplyPacket replyPacket = (ParcelAccessListReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelAccessListReply);
replyPacket.Data.AgentID = AgentId;
@@ -4668,12 +4693,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
replyPacket.Data.SequenceID = 0;
List<ParcelAccessListReplyPacket.ListBlock> list = new List<ParcelAccessListReplyPacket.ListBlock>();
foreach (UUID avatar in avatars)
foreach (LandAccessEntry entry in accessList)
{
ParcelAccessListReplyPacket.ListBlock block = new ParcelAccessListReplyPacket.ListBlock();
block.Flags = accessFlag;
block.ID = avatar;
block.Time = 0;
block.ID = entry.AgentID;
block.Time = entry.Expires;
list.Add(block);
}
@@ -4949,8 +4974,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
update.Scale = new Vector3(0.45f, 0.6f, 1.9f);
update.Text = Utils.EmptyBytes;
update.TextColor = new byte[4];
// Don't send texture anim for avatars - this has no meaning for them.
update.TextureAnim = Utils.EmptyBytes;
update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
// Don't send texture entry for avatars here - this is accomplished via the AvatarAppearance packet
update.TextureEntry = Utils.EmptyBytes;
// update.TextureEntry = (data.Appearance.Texture != null) ? data.Appearance.Texture.GetBytes() : Utils.EmptyBytes;
update.UpdateFlags = (uint)(
PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner |
PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer |
@@ -5137,7 +5168,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage, false);
AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship);
AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship);
AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFrendship);
AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFriendship);
AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject);
AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
@@ -5860,7 +5891,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
private bool HandlerTerminateFrendship(IClientAPI sender, Packet Pack)
private bool HandlerTerminateFriendship(IClientAPI sender, Packet Pack)
{
TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack;
@@ -5875,13 +5906,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
UUID exFriendID = tfriendpack.ExBlock.OtherID;
FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship;
if (handlerTerminateFriendship != null)
FriendshipTermination TerminateFriendshipHandler = OnTerminateFriendship;
if (TerminateFriendshipHandler != null)
{
handlerTerminateFriendship(this, listOwnerAgentID, exFriendID);
TerminateFriendshipHandler(this, listOwnerAgentID, exFriendID);
return true;
}
return true;
return false;
}
private bool HandleFindAgent(IClientAPI client, Packet Packet)
@@ -6060,7 +6091,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// for the client session anyway, in order to protect ourselves against bad code in plugins
try
{
byte[] visualparams = new byte[appear.VisualParam.Length];
for (int i = 0; i < appear.VisualParam.Length; i++)
visualparams[i] = appear.VisualParam[i].ParamValue;
@@ -7531,12 +7561,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if ((ImageType)block.Type == ImageType.Baked)
args.Priority *= 2.0f;
// in the end, we null this, so we have to check if it's null
if (m_imageManager != null)
{
m_imageManager.EnqueueReq(args);
}
ImageManager.EnqueueReq(args);
}
return true;
}
@@ -7662,6 +7689,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
}
else
if (transfer.TransferInfo.SourceType == (int)SourceType.SimEstate)
{
//TransferRequestPacket does not include covenant uuid?
//get scene covenant uuid
taskID = m_scene.RegionInfo.RegionSettings.Covenant;
}
MakeAssetRequest(transfer, taskID);
@@ -8614,13 +8648,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
#endregion
List<ParcelManager.ParcelAccessEntry> entries = new List<ParcelManager.ParcelAccessEntry>();
List<LandAccessEntry> entries = new List<LandAccessEntry>();
foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List)
{
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = block.ID;
entry.Flags = (AccessList)block.Flags;
entry.Time = Util.ToDateTime(block.Time);
entry.Expires = block.Time;
entries.Add(entry);
}
@@ -8975,7 +9009,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private bool HandleEstateOwnerMessage(IClientAPI sender, Packet Pack)
{
EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
//m_log.Debug(messagePacket.ToString());
// m_log.InfoFormat("[LLCLIENTVIEW]: Packet: {0}", Utils.BytesToString(messagePacket.MethodData.Method));
GodLandStatRequest handlerLandStatRequest;
#region Packet Session and User Check
@@ -9274,6 +9308,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
return true;
case "telehub":
if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
{
UUID invoice = messagePacket.MethodData.Invoice;
UUID SenderID = messagePacket.AgentData.AgentID;
UInt32 param1 = 0u;
string command = (string)Utils.BytesToString(messagePacket.ParamList[0].Parameter);
if (command != "info ui")
{
try
{
param1 = Convert.ToUInt32(Utils.BytesToString(messagePacket.ParamList[1].Parameter));
}
catch
{
}
}
EstateManageTelehub handlerEstateManageTelehub = OnEstateManageTelehub;
if (handlerEstateManageTelehub != null)
{
handlerEstateManageTelehub(this, invoice, SenderID, command, param1);
}
}
return true;
default:
m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket);
return true;
@@ -9285,8 +9347,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//lsrp.RequestData.ReportType; // 1 = colliders, 0 = scripts
//lsrp.RequestData.RequestFlags;
//lsrp.RequestData.Filter;
// return true;
}
private bool HandleRequestRegionInfo(IClientAPI sender, Packet Pack)
@@ -10462,6 +10522,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
return true;
}
private bool HandleGroupRoleMembersRequest(IClientAPI sender, Packet Pack)
{
GroupRoleMembersRequestPacket groupRoleMembersRequest =
@@ -11341,9 +11402,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// Send a response back to a client when it asks the asset server (via the region server) if it has
/// its appearance texture cached.
///
/// At the moment, we always reply that there is no cached texture.
/// </summary>
/// <remarks>
/// At the moment, we always reply that there is no cached texture.
/// </remarks>
/// <param name="simclient"></param>
/// <param name="packet"></param>
/// <returns></returns>
@@ -11353,7 +11415,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet;
AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
if (cachedtex.AgentData.SessionID != SessionId) return false;
if (cachedtex.AgentData.SessionID != SessionId)
return false;
// TODO: don't create new blocks if recycling an old packet
cachedresp.AgentData.AgentID = AgentId;
@@ -11751,6 +11814,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 50 && packet.Type == PacketType.ImprovedTerseObjectUpdate)
logPacket = false;
if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
logPacket = false;
if (logPacket)
m_log.DebugFormat(
"[CLIENT]: PACKET OUT to {0} ({1}) in {2} - {3}",
@@ -11808,6 +11874,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (DebugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation))
logPacket = false;
if (DebugPacketLevel <= 25 && packet.Type == PacketType.RequestObjectPropertiesFamily)
logPacket = false;
if (logPacket)
m_log.DebugFormat(
"[CLIENT]: PACKET IN from {0} ({1}) in {2} - {3}",
@@ -12051,6 +12120,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
requestID = new UUID(transferRequest.TransferInfo.Params, 80);
}
else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimEstate)
{
requestID = taskID;
}
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);

View File

@@ -39,6 +39,9 @@ using log4net;
namespace OpenSim.Region.ClientStack.LindenUDP
{
/// <summary>
/// This class handles UDP texture requests.
/// </summary>
public class LLImageManager
{
private sealed class J2KImageComparer : IComparer<J2KImage>
@@ -52,18 +55,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_shuttingdown;
private AssetBase m_missingImage;
private LLClientView m_client; //Client we're assigned to
private IAssetService m_assetCache; //Asset Cache
private IJ2KDecoder m_j2kDecodeModule; //Our J2K module
private IAssetService m_assetCache;
private IJ2KDecoder m_j2kDecodeModule;
/// <summary>
/// Priority queue for determining which image to send first.
/// </summary>
private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer());
/// <summary>
/// Used to control thread access to the priority queue.
/// </summary>
private object m_syncRoot = new object();
public LLClientView Client { get { return m_client; } }
/// <summary>
/// Client served by this image manager
/// </summary>
public IClientAPI Client { get; private set; }
public AssetBase MissingImage { get { return m_missingImage; } }
public LLImageManager(LLClientView client, IAssetService pAssetCache, IJ2KDecoder pJ2kDecodeModule)
public LLImageManager(IClientAPI client, IAssetService pAssetCache, IJ2KDecoder pJ2kDecodeModule)
{
m_client = client;
Client = client;
m_assetCache = pAssetCache;
if (pAssetCache != null)
@@ -81,7 +95,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <param name="newRequest"></param>
public void EnqueueReq(TextureRequestArgs newRequest)
{
//Make sure we're not shutting down..
if (!m_shuttingdown)
{
J2KImage imgrequest;
@@ -96,19 +109,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
//m_log.Debug("[TEX]: (CAN) ID=" + newRequest.RequestedAssetID);
try
try
{
lock (m_syncRoot)
m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
m_priorityQueue.Delete(imgrequest.PriorityQueueHandle);
}
catch (Exception) { }
}
else
{
//m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}",
// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority);
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Received duplicate of existing request for {0}, start packet {1} from {2}",
// newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
//Check the packet sequence to make sure this isn't older than
// m_log.DebugFormat("[TEX]: (UPD) ID={0}: D={1}, S={2}, P={3}",
// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority);
//Check the packet sequence to make sure this isn't older than
//one we've already received
if (newRequest.requestSequence > imgrequest.LastSequence)
{
@@ -123,11 +140,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//Update the requested priority
imgrequest.Priority = newRequest.Priority;
UpdateImageInQueue(imgrequest);
//Run an update
imgrequest.RunUpdate();
// J2KImage imgrequest2 = new J2KImage(this);
// imgrequest2.J2KDecoder = m_j2kDecodeModule;
// imgrequest2.AssetService = m_assetCache;
// imgrequest2.AgentID = m_client.AgentId;
// imgrequest2.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>();
// imgrequest2.DiscardLevel = newRequest.DiscardLevel;
// imgrequest2.StartPacket = Math.Max(1, newRequest.PacketNumber);
// imgrequest2.Priority = newRequest.Priority;
// imgrequest2.TextureID = newRequest.RequestedAssetID;
// imgrequest2.Priority = newRequest.Priority;
//
// //Add this download to the priority queue
// AddImageToQueue(imgrequest2);
//
// imgrequest2.RunUpdate();
}
// else
// {
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Ignoring duplicate of existing request for {0} (sequence {1}) from {2} as its request sequence {3} is not greater",
// newRequest.RequestedAssetID, imgrequest.LastSequence, m_client.Name, newRequest.requestSequence);
// }
}
}
else
@@ -139,14 +179,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
else
{
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Received request for {0}, start packet {1} from {2}",
// newRequest.RequestedAssetID, newRequest.PacketNumber, m_client.Name);
//m_log.DebugFormat("[TEX]: (NEW) ID={0}: D={1}, S={2}, P={3}",
// newRequest.RequestedAssetID, newRequest.DiscardLevel, newRequest.PacketNumber, newRequest.Priority);
imgrequest = new J2KImage(this);
imgrequest.J2KDecoder = m_j2kDecodeModule;
imgrequest.AssetService = m_assetCache;
imgrequest.AgentID = m_client.AgentId;
imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>();
imgrequest.AgentID = Client.AgentId;
imgrequest.InventoryAccessModule = Client.Scene.RequestModuleInterface<IInventoryAccessModule>();
imgrequest.DiscardLevel = newRequest.DiscardLevel;
imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber);
imgrequest.Priority = newRequest.Priority;
@@ -156,7 +200,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
//Add this download to the priority queue
AddImageToQueue(imgrequest);
//Run an update
imgrequest.RunUpdate();
}
}
@@ -173,12 +216,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// If null was returned, the texture priority queue is currently empty
if (image == null)
return false;
break;
if (image.IsDecoded)
{
int sent;
bool imageDone = image.SendPackets(m_client, packetsToSend - packetsSent, out sent);
bool imageDone = image.SendPackets(Client, packetsToSend - packetsSent, out sent);
packetsSent += sent;
// If the send is complete, destroy any knowledge of this transfer
@@ -191,10 +234,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// written. Undecoded textures should not be going into the priority
// queue, because a high priority undecoded texture will clog up the
// pipeline for a client
return true;
// m_log.DebugFormat(
// "[LL IMAGE MANAGER]: Exiting image queue processing early on encountering undecoded image {0}",
// image.TextureID);
break;
}
}
// if (packetsSent != 0)
// m_log.DebugFormat("[LL IMAGE MANAGER]: Processed {0} packets from image queue", packetsSent);
return m_priorityQueue.Count > 0;
}
@@ -206,9 +256,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_shuttingdown = true;
}
/// <summary>
/// Clear the image queue.
/// </summary>
/// <returns>The number of requests cleared.</returns>
public int ClearImageQueue()
{
int requestsDeleted;
lock (m_priorityQueue)
{
requestsDeleted = m_priorityQueue.Count;
// Surprisingly, there doesn't seem to be a clear method at this time.
while (!m_priorityQueue.IsEmpty)
m_priorityQueue.DeleteMax();
}
return requestsDeleted;
}
/// <summary>
/// Returns an array containing all the images in the queue.
/// </summary>
/// <returns></returns>
public J2KImage[] GetImages()
{
lock (m_priorityQueue)
return m_priorityQueue.ToArray();
}
#region Priority Queue Helpers
J2KImage GetHighestPriorityImage()
private J2KImage GetHighestPriorityImage()
{
J2KImage image = null;
@@ -216,34 +296,50 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (m_priorityQueue.Count > 0)
{
try { image = m_priorityQueue.FindMax(); }
try
{
image = m_priorityQueue.FindMax();
}
catch (Exception) { }
}
}
return image;
}
void AddImageToQueue(J2KImage image)
private void AddImageToQueue(J2KImage image)
{
image.PriorityQueueHandle = null;
lock (m_syncRoot)
try { m_priorityQueue.Add(ref image.PriorityQueueHandle, image); }
{
try
{
m_priorityQueue.Add(ref image.PriorityQueueHandle, image);
}
catch (Exception) { }
}
}
void RemoveImageFromQueue(J2KImage image)
{
lock (m_syncRoot)
try { m_priorityQueue.Delete(image.PriorityQueueHandle); }
catch (Exception) { }
}
void UpdateImageInQueue(J2KImage image)
private void RemoveImageFromQueue(J2KImage image)
{
lock (m_syncRoot)
{
try { m_priorityQueue.Replace(image.PriorityQueueHandle, image); }
try
{
m_priorityQueue.Delete(image.PriorityQueueHandle);
}
catch (Exception) { }
}
}
private void UpdateImageInQueue(J2KImage image)
{
lock (m_syncRoot)
{
try
{
m_priorityQueue.Replace(image.PriorityQueueHandle, image);
}
catch (Exception)
{
image.PriorityQueueHandle = null;
@@ -254,4 +350,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion Priority Queue Helpers
}
}
}

View File

@@ -492,6 +492,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if ((Environment.TickCount & Int32.MaxValue) - udpClient.TickLastPacketReceived > 1000 * 60)
{
m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
StatsManager.SimExtraStats.AddAbnormalClientThreadTermination();
RemoveClient(udpClient);
return;

View File

@@ -0,0 +1,160 @@
/*
* 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 System.IO;
using System.Net;
using System.Reflection;
using log4net.Config;
using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
using OpenSim.Region.CoreModules.Agent.TextureSender;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
namespace OpenSim.Region.ClientStack.LindenUDP.Tests
{
[TestFixture]
public class LLImageManagerTests
{
private AssetBase m_testImageAsset;
private Scene scene;
private LLImageManager llim;
private TestClient tc;
[TestFixtureSetUp]
public void FixtureInit()
{
using (
Stream resource
= GetType().Assembly.GetManifestResourceStream(
"OpenSim.Region.ClientStack.LindenUDP.Tests.Resources.4-tile2.jp2"))
{
using (BinaryReader br = new BinaryReader(resource))
{
m_testImageAsset
= new AssetBase(
TestHelpers.ParseTail(0x1),
"Test Image",
(sbyte)AssetType.Texture,
TestHelpers.ParseTail(0x2).ToString());
m_testImageAsset.Data = br.ReadBytes(99999999);
}
}
}
[SetUp]
public void SetUp()
{
UUID userId = TestHelpers.ParseTail(0x3);
J2KDecoderModule j2kdm = new J2KDecoderModule();
scene = SceneHelpers.SetupScene();
SceneHelpers.SetupSceneModules(scene, j2kdm);
tc = new TestClient(SceneHelpers.GenerateAgentData(userId), scene);
llim = new LLImageManager(tc, scene.AssetService, j2kdm);
}
[Test]
public void TestSendImage()
{
TestHelpers.InMethod();
// XmlConfigurator.Configure();
scene.AssetService.Store(m_testImageAsset);
TextureRequestArgs args = new TextureRequestArgs();
args.RequestedAssetID = m_testImageAsset.FullID;
args.DiscardLevel = 0;
args.PacketNumber = 1;
args.Priority = 5;
args.requestSequence = 1;
llim.EnqueueReq(args);
llim.ProcessImageQueue(20);
Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(1));
}
[Test]
public void TestDiscardImage()
{
TestHelpers.InMethod();
// XmlConfigurator.Configure();
scene.AssetService.Store(m_testImageAsset);
TextureRequestArgs args = new TextureRequestArgs();
args.RequestedAssetID = m_testImageAsset.FullID;
args.DiscardLevel = 0;
args.PacketNumber = 1;
args.Priority = 5;
args.requestSequence = 1;
llim.EnqueueReq(args);
// Now create a discard request
TextureRequestArgs discardArgs = new TextureRequestArgs();
discardArgs.RequestedAssetID = m_testImageAsset.FullID;
discardArgs.DiscardLevel = -1;
discardArgs.PacketNumber = 1;
discardArgs.Priority = 0;
discardArgs.requestSequence = 2;
llim.EnqueueReq(discardArgs);
llim.ProcessImageQueue(20);
Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
}
[Test]
public void TestMissingImage()
{
TestHelpers.InMethod();
// XmlConfigurator.Configure();
TextureRequestArgs args = new TextureRequestArgs();
args.RequestedAssetID = m_testImageAsset.FullID;
args.DiscardLevel = 0;
args.PacketNumber = 1;
args.Priority = 5;
args.requestSequence = 1;
llim.EnqueueReq(args);
llim.ProcessImageQueue(20);
Assert.That(tc.SentImageDataPackets.Count, Is.EqualTo(0));
Assert.That(tc.SentImageNotInDatabasePackets.Count, Is.EqualTo(1));
}
}
}

View File

@@ -246,7 +246,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
if (mm != null)
{
if (!mm.UploadCovered(remoteClient, mm.UploadCharge))
if (!mm.UploadCovered(remoteClient.AgentId, mm.UploadCharge))
{
remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
return;

View File

@@ -103,6 +103,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
// If it's cached, return the cached results
if (m_decodedCache.TryGetValue(assetID, out result))
{
// m_log.DebugFormat(
// "[J2KDecoderModule]: Returning existing cached {0} layers j2k decode for {1}",
// result.Length, assetID);
callback(assetID, result);
}
else
@@ -129,18 +133,20 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
// Do Decode!
if (decode)
DoJ2KDecode(assetID, j2kData);
Decode(assetID, j2kData);
}
}
/// <summary>
/// Provides a synchronous decode so that caller can be assured that this executes before the next line
/// </summary>
/// <param name="assetID"></param>
/// <param name="j2kData"></param>
public void Decode(UUID assetID, byte[] j2kData)
public bool Decode(UUID assetID, byte[] j2kData)
{
DoJ2KDecode(assetID, j2kData);
OpenJPEG.J2KLayerInfo[] layers;
int components;
return Decode(assetID, j2kData, out layers, out components);
}
public bool Decode(UUID assetID, byte[] j2kData, out OpenJPEG.J2KLayerInfo[] layers, out int components)
{
return DoJ2KDecode(assetID, j2kData, out layers, out components);
}
#endregion IJ2KDecoder
@@ -150,11 +156,21 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
/// </summary>
/// <param name="assetID">UUID of Asset</param>
/// <param name="j2kData">JPEG2000 data</param>
private void DoJ2KDecode(UUID assetID, byte[] j2kData)
/// <param name="layers">layer data</param>
/// <param name="components">number of components</param>
/// <returns>true if decode was successful. false otherwise.</returns>
private bool DoJ2KDecode(UUID assetID, byte[] j2kData, out OpenJPEG.J2KLayerInfo[] layers, out int components)
{
// m_log.DebugFormat(
// "[J2KDecoderModule]: Doing J2K decoding of {0} bytes for asset {1}", j2kData.Length, assetID);
bool decodedSuccessfully = true;
//int DecodeTime = 0;
//DecodeTime = Environment.TickCount;
OpenJPEG.J2KLayerInfo[] layers;
// We don't get this from CSJ2K. Is it relevant?
components = 0;
if (!TryLoadCacheForAsset(assetID, out layers))
{
@@ -189,14 +205,15 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
catch (Exception ex)
{
m_log.Warn("[J2KDecoderModule]: CSJ2K threw an exception decoding texture " + assetID + ": " + ex.Message);
decodedSuccessfully = false;
}
}
else
{
int components;
if (!OpenJPEG.DecodeLayerBoundaries(j2kData, out layers, out components))
{
m_log.Warn("[J2KDecoderModule]: OpenJPEG failed to decode texture " + assetID);
decodedSuccessfully = false;
}
}
@@ -205,6 +222,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
m_log.Warn("[J2KDecoderModule]: Failed to decode layer data for texture " + assetID + ", guessing sane defaults");
// Layer decoding completely failed. Guess at sane defaults for the layer boundaries
layers = CreateDefaultLayers(j2kData.Length);
decodedSuccessfully = false;
}
// Cache Decoded layers
@@ -224,6 +242,8 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
m_notifyList.Remove(assetID);
}
}
return decodedSuccessfully;
}
private OpenJPEG.J2KLayerInfo[] CreateDefaultLayers(int j2kLength)

View File

@@ -39,6 +39,7 @@ using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
@@ -116,6 +117,40 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0}", sp.Name);
XmlDocument doc = new XmlDocument();
string stateData = String.Empty;
IAttachmentsService attServ = m_scene.RequestModuleInterface<IAttachmentsService>();
if (attServ != null)
{
m_log.DebugFormat("[ATTACHMENT]: Loading attachment data from attachment service");
stateData = attServ.Get(sp.UUID.ToString());
if (stateData != String.Empty)
{
try
{
doc.LoadXml(stateData);
}
catch { }
}
}
Dictionary<UUID, string> itemData = new Dictionary<UUID, string>();
XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
if (nodes.Count > 0)
{
foreach (XmlNode n in nodes)
{
XmlElement elem = (XmlElement)n;
string itemID = elem.GetAttribute("ItemID");
string xml = elem.InnerXml;
itemData[new UUID(itemID)] = xml;
}
}
List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
foreach (AvatarAttachment attach in attachments)
{
@@ -135,12 +170,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
try
{
string xmlData;
XmlDocument d = null;
UUID asset;
if (itemData.TryGetValue(attach.ItemID, out xmlData))
{
d = new XmlDocument();
d.LoadXml(xmlData);
m_log.InfoFormat("[ATTACHMENT]: Found saved state for item {0}, loading it", attach.ItemID);
}
// If we're an NPC then skip all the item checks and manipulations since we don't have an
// inventory right now.
if (sp.PresenceType == PresenceType.Npc)
RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p, null);
else
RezSingleAttachmentFromInventory(sp, attach.ItemID, p);
RezSingleAttachmentFromInventory(sp, attach.ItemID, p, true, d);
}
catch (Exception e)
{
@@ -149,7 +194,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
}
public void SaveChangedAttachments(IScenePresence sp)
public void SaveChangedAttachments(IScenePresence sp, bool saveAllScripted)
{
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Saving changed attachments for {0}", sp.Name);
@@ -158,13 +203,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
foreach (SceneObjectGroup grp in sp.GetAttachments())
{
// if (grp.HasGroupChanged) // Resizer scripts?
// {
grp.IsAttachment = false;
grp.AbsolutePosition = grp.RootPart.AttachedPos;
UpdateKnownItem(sp, grp);
grp.IsAttachment = true;
// }
grp.IsAttachment = false;
grp.AbsolutePosition = grp.RootPart.AttachedPos;
UpdateKnownItem(sp, grp, saveAllScripted);
grp.IsAttachment = true;
}
}
@@ -466,9 +508,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
/// </remarks>
/// <param name="sp"></param>
/// <param name="grp"></param>
private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp)
private void UpdateKnownItem(IScenePresence sp, SceneObjectGroup grp, bool saveAllScripted)
{
if (grp.HasGroupChanged || grp.ContainsScripts())
// Saving attachments for NPCs messes them up for the real owner!
INPCModule module = m_scene.RequestModuleInterface<INPCModule>();
if (module != null)
{
if (module.IsNPC(sp.UUID, m_scene))
return;
}
if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts()))
{
m_log.DebugFormat(
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
@@ -501,6 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (sp.ControllingClient != null)
sp.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
}
grp.HasGroupChanged = false; // Prevent it being saved over and over
}
else
{
@@ -694,7 +745,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
group.IsAttachment = false;
group.AbsolutePosition = group.RootPart.AttachedPos;
UpdateKnownItem(sp, group);
UpdateKnownItem(sp, group, true);
m_scene.DeleteSceneObject(group, false);
return;

View File

@@ -26,16 +26,15 @@
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using System.Text;
using System.Timers;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using System.Threading;
using System.Timers;
using System.Collections.Generic;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
@@ -45,6 +44,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const string BAKED_TEXTURES_REPORT_FORMAT = "{0,-9} {1}";
private Scene m_scene = null;
private int m_savetime = 5; // seconds to wait before saving changed appearance
@@ -147,16 +149,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// Process the baked texture array
if (textureEntry != null)
{
m_log.InfoFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID);
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
m_log.InfoFormat("[AVFACTORY]: received texture update for {0}", sp.UUID);
Util.FireAndForget(delegate(object o) { ValidateBakedTextureCache(sp, false); });
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
if (!ValidateBakedTextureCache(sp))
RequestRebake(sp, true);
// This appears to be set only in the final stage of the appearance
// update transaction. In theory, we should be able to do an immediate
// appearance send and save here.
}
// save only if there were changes, send no matter what (doesn't hurt to send twice)
if (changed)
QueueAppearanceSave(sp.ControllingClient.AgentId);
@@ -245,18 +252,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
/// <summary>
/// Check for the existence of the baked texture assets.
/// </summary>
/// <param name="sp"></param>
public bool ValidateBakedTextureCache(IScenePresence sp)
{
return ValidateBakedTextureCache(sp, true);
}
/// <summary>
/// Queue up a request to send appearance, makes it possible to
/// accumulate changes without sending out each one separately.
/// Queue up a request to send appearance.
/// </summary>
/// <remarks>
/// Makes it possible to accumulate changes without sending out each one separately.
/// </remarks>
/// <param name="agentId"></param>
public void QueueAppearanceSend(UUID agentid)
{
// m_log.DebugFormat("[AVFACTORY]: Queue appearance send for {0}", agentid);
@@ -283,17 +284,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
}
#endregion
#region AvatarFactoryModule private methods
/// <summary>
/// Check for the existence of the baked texture assets. Request a rebake
/// unless checkonly is true.
/// </summary>
/// <param name="client"></param>
/// <param name="checkonly"></param>
private bool ValidateBakedTextureCache(IScenePresence sp, bool checkonly)
public bool ValidateBakedTextureCache(IScenePresence sp)
{
bool defonly = true; // are we only using default textures
@@ -321,20 +312,66 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
defonly = false; // found a non-default texture reference
if (m_scene.AssetService.Get(face.TextureID.ToString()) == null)
{
if (checkonly)
return false;
sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
}
return false;
}
m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0}", sp.UUID);
m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID);
// If we only found default textures, then the appearance is not cached
return (defonly ? false : true);
}
public int RequestRebake(IScenePresence sp, bool missingTexturesOnly)
{
int texturesRebaked = 0;
for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
{
int idx = AvatarAppearance.BAKE_INDICES[i];
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
// if there is no texture entry, skip it
if (face == null)
continue;
// m_log.DebugFormat(
// "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}",
// face.TextureID, idx, client.Name, client.AgentId);
// if the texture is one of the "defaults" then skip it
// this should probably be more intelligent (skirt texture doesnt matter
// if the avatar isnt wearing a skirt) but if any of the main baked
// textures is default then the rest should be as well
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
continue;
if (missingTexturesOnly)
{
if (m_scene.AssetService.Get(face.TextureID.ToString()) != null)
continue;
else
m_log.DebugFormat(
"[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.",
face.TextureID, idx, sp.Name);
}
else
{
m_log.DebugFormat(
"[AVFACTORY]: Requesting rebake of {0} ({1}) for {2}.",
face.TextureID, idx, sp.Name);
}
texturesRebaked++;
sp.ControllingClient.SendRebakeAvatarTextures(face.TextureID);
}
return texturesRebaked;
}
#endregion
#region AvatarFactoryModule private methods
private Dictionary<BakeType, Primitive.TextureEntryFace> GetBakedTextureFaces(ScenePresence sp)
{
if (sp.IsChildAgent)
@@ -404,10 +441,13 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
m_savequeue.Remove(avatarID);
}
}
}
if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
m_updateTimer.Stop();
// We must lock both queues here so that QueueAppearanceSave() or *Send() don't m_updateTimer.Start() on
// another thread inbetween the first count calls and m_updateTimer.Stop() on this thread.
lock (m_sendqueue)
if (m_savequeue.Count == 0 && m_sendqueue.Count == 0)
m_updateTimer.Stop();
}
}
private void SaveAppearance(UUID agentid)
@@ -553,5 +593,37 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
}
#endregion
public void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction outputAction)
{
outputAction("For {0} in {1}", sp.Name, m_scene.RegionInfo.RegionName);
outputAction(BAKED_TEXTURES_REPORT_FORMAT, "Bake Type", "UUID");
Dictionary<BakeType, Primitive.TextureEntryFace> bakedTextures = GetBakedTextureFaces(sp.UUID);
foreach (BakeType bt in bakedTextures.Keys)
{
string rawTextureID;
if (bakedTextures[bt] == null)
{
rawTextureID = "not set";
}
else
{
rawTextureID = bakedTextures[bt].TextureID.ToString();
if (m_scene.AssetService.Get(rawTextureID) == null)
rawTextureID += " (not found)";
else
rawTextureID += " (uploaded)";
}
outputAction(BAKED_TEXTURES_REPORT_FORMAT, bt, rawTextureID);
}
bool bakedTextureValid = m_scene.AvatarFactory.ValidateBakedTextureCache(sp);
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
}
}
}
}

View File

@@ -50,6 +50,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
IUserManagement m_uMan;
IUserManagement UserManagementModule
{
get
{
if (m_uMan == null)
m_uMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
return m_uMan;
}
}
#region ISharedRegionModule
public override string Name
{
@@ -369,9 +380,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
{
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
Boolean agentIsLocal = true;
if (UserManagementModule != null)
agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId);
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, client.AgentId);
if (account1 != null)
if (agentIsLocal)
return base.GetFriendsFromService(client);
FriendInfo[] finfos = new FriendInfo[0];
@@ -392,16 +405,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override bool StoreRights(UUID agentID, UUID friendID, int rights)
{
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
Boolean agentIsLocal = true;
Boolean friendIsLocal = true;
if (UserManagementModule != null)
{
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
}
// Are they both local users?
if (account1 != null && account2 != null)
if (agentIsLocal && friendIsLocal)
{
// local grid users
return base.StoreRights(agentID, friendID, rights);
}
if (account1 != null) // agent is local, friend is foreigner
if (agentIsLocal) // agent is local, friend is foreigner
{
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo finfo = GetFriend(finfos, friendID);
@@ -412,7 +431,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
if (account2 != null) // agent is foreigner, friend is local
if (friendIsLocal) // agent is foreigner, friend is local
{
string agentUUI = GetUUI(friendID, agentID);
if (agentUUI != string.Empty)
@@ -427,10 +446,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override void StoreBackwards(UUID friendID, UUID agentID)
{
UserAccount account1 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
UserAccount account2 = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
Boolean agentIsLocal = true;
Boolean friendIsLocal = true;
if (UserManagementModule != null)
{
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
}
// Are they both local users?
if (account1 != null && account2 != null)
if (agentIsLocal && friendIsLocal)
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -444,10 +469,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override void StoreFriendships(UUID agentID, UUID friendID)
{
UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, friendID);
Boolean agentIsLocal = true;
Boolean friendIsLocal = true;
if (UserManagementModule != null)
{
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
}
// Are they both local users?
if (agentAccount != null && friendAccount != null)
if (agentIsLocal && friendIsLocal)
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
@@ -484,7 +515,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Generate a random 8-character hex number that will sign this friendship
string secret = UUID.Random().ToString().Substring(0, 8);
if (agentAccount != null) // agent is local, 'friend' is foreigner
if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// This may happen when the agent returned home, in which case the friend is not there
// We need to look for its information in the friends list itself
@@ -520,7 +551,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
}
}
else if (friendAccount != null) // 'friend' is local, agent is foreigner
else if (friendIsLocal) // 'friend' is local, agent is foreigner
{
// store in the local friends service a reference to the foreign agent
FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
@@ -553,10 +584,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{
UserAccount agentAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, agentID);
UserAccount friendAccount = UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, exfriendID);
Boolean agentIsLocal = true;
Boolean friendIsLocal = true;
if (UserManagementModule != null)
{
agentIsLocal = UserManagementModule.IsLocalGridUser(agentID);
friendIsLocal = UserManagementModule.IsLocalGridUser(exfriendID);
}
// Are they both local users?
if (agentAccount != null && friendAccount != null)
if (agentIsLocal && friendIsLocal)
{
// local grid users
return base.DeleteFriendship(agentID, exfriendID);
@@ -566,7 +603,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
string agentUUI = string.Empty;
string friendUUI = string.Empty;
if (agentAccount != null) // agent is local, 'friend' is foreigner
if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// We need to look for its information in the friends list itself
FriendInfo[] finfos = GetFriends(agentID);
@@ -587,7 +624,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return true;
}
}
else if (friendAccount != null) // agent is foreigner, 'friend' is local
else if (friendIsLocal) // agent is foreigner, 'friend' is local
{
agentUUI = GetUUI(exfriendID, agentID);

View File

@@ -180,10 +180,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// m_log.DebugFormat("[HG INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
// Is the user a local user?
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, toAgentID);
string url = string.Empty;
bool foreigner = false;
if (account == null) // foreign user
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(toAgentID)) // foreign user
{
url = UserManagementModule.GetUserServerURL(toAgentID, "IMServerURI");
foreigner = true;

View File

@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Timers;
using log4net;
using Nini.Config;
using OpenMetaverse;
@@ -42,6 +43,10 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private static readonly ILog m_log = LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
private Timer m_logTimer = new Timer(10000);
private List<GridInstantMessage> m_logData = new List<GridInstantMessage>();
private string m_restUrl;
/// <value>
/// Is this module enabled?
/// </value>
@@ -61,9 +66,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
"InstantMessageModule", "InstantMessageModule") !=
"InstantMessageModule")
return;
m_restUrl = config.Configs["Messaging"].GetString("LogURL", String.Empty);
}
m_enabled = true;
m_logTimer.AutoReset = false;
m_logTimer.Elapsed += LogTimerElapsed;
}
public void AddRegion(Scene scene)
@@ -148,6 +156,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
{
byte dialog = im.dialog;
if (client != null && dialog == (byte)InstantMessageDialog.MessageFromAgent)
LogInstantMesssage(im);
if (dialog != (byte)InstantMessageDialog.MessageFromAgent
&& dialog != (byte)InstantMessageDialog.StartTyping
&& dialog != (byte)InstantMessageDialog.StopTyping
@@ -226,5 +237,35 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
//
OnInstantMessage(null, msg);
}
private void LogInstantMesssage(GridInstantMessage im)
{
if (m_logData.Count < 20)
{
// Restart the log write timer
m_logTimer.Stop();
}
if (!m_logTimer.Enabled)
m_logTimer.Start();
lock (m_logData)
{
m_logData.Add(im);
}
}
private void LogTimerElapsed(object source, ElapsedEventArgs e)
{
lock (m_logData)
{
if (m_restUrl != String.Empty && m_logData.Count > 0)
{
bool success = SynchronousRestObjectRequester.MakeRequest<List<GridInstantMessage>, bool>("POST", m_restUrl + "/LogMessages/", m_logData);
if (!success)
m_log.ErrorFormat("[INSTANT MESSAGE]: Failed to save log data");
}
m_logData.Clear();
}
}
}
}

View File

@@ -493,7 +493,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
}
else
{
sceneObjects.Add(SceneObjectSerializer.FromOriginalXmlFormat(xmlData));
SceneObjectGroup deserializedObject = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
if (deserializedObject != null)
sceneObjects.Add(deserializedObject);
}
foreach (SceneObjectGroup sog in sceneObjects)

View File

@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
int majorVersion, minorVersion;
if (options.ContainsKey("profile"))
if (options.ContainsKey("home"))
{
majorVersion = 1;
minorVersion = 2;

View File

@@ -122,12 +122,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
scene.AddCommand(
this, "save iar",
"save iar [--p|-profile=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [--v|-verbose]",
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-v|--verbose]",
"Save user inventory archive (IAR).",
"<first> is the user's first name." + Environment.NewLine
+ "<last> is the user's last name." + Environment.NewLine
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine
+ "-p|--profile=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
+ "-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
+ "-c|--creators preserves information about foreign creators." + Environment.NewLine
+ "-v|--verbose extra debug messages." + Environment.NewLine
+ "--noassets stops assets being saved to the IAR."
@@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
OptionSet ops = new OptionSet();
//ops.Add("v|version=", delegate(string v) { options["version"] = v; });
ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
ops.Add("h|home=", delegate(string v) { options["home"] = v; });
ops.Add("v|verbose", delegate(string v) { options["verbose"] = v; });
ops.Add("c|creators", delegate(string v) { options["creators"] = v; });
ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; });
@@ -408,13 +408,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (mainParams.Count < 6)
{
m_log.Error(
"[INVENTORY ARCHIVER]: usage is save iar [--p|-profile=<url>] [--noassets] <first name> <last name> <inventory path> <user password> [<save file path>]");
"[INVENTORY ARCHIVER]: usage is save iar [-h|--home=<url>] [--noassets] <first name> <last name> <inventory path> <user password> [<save file path>] [-c|--creators] [-v|--verbose]");
return;
}
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
if (options.ContainsKey("profile"))
m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -profile option if you want to produce a compatible IAR");
if (options.ContainsKey("home"))
m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR");
string firstName = mainParams[2];
string lastName = mainParams[3];

View File

@@ -43,7 +43,7 @@ using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Profile
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class BasicProfileModule : ISharedRegionModule
public class BasicProfileModule : IProfileModule, ISharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -57,6 +57,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
public void Initialise(IConfigSource config)
{
// This can be reduced later as the loader will determine
// whether we are needed
if (config.Configs["Profile"] != null)
{
if (config.Configs["Profile"].GetString("Module", string.Empty) != "BasicProfileModule")
@@ -65,14 +67,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
m_log.DebugFormat("[PROFILE MODULE]: Basic Profile Module enabled");
m_Enabled = true;
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
lock (m_Scenes)
{
if (!m_Scenes.Contains(scene))
@@ -80,6 +81,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
m_Scenes.Add(scene);
// Hook up events
scene.EventManager.OnNewClient += OnNewClient;
scene.RegisterModuleInterface<IProfileModule>(this);
}
}
}
@@ -116,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
public Type ReplaceableInterface
{
get { return null; }
get { return typeof(IProfileModule); }
}
#endregion
@@ -170,4 +172,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
}
}
}
}

View File

@@ -204,13 +204,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.ControllingClient.SendTeleportStart(teleportFlags);
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
sp.TeleportFlags = (TeleportFlags)teleportFlags;
sp.TeleportFlags = (Constants.TeleportFlags)teleportFlags;
sp.Teleport(position);
foreach (SceneObjectGroup grp in sp.GetAttachments())
{
if (grp.IsDeleted)
sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT);
}
}
else // Another region possibly in another simulator
@@ -695,9 +694,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
// distance to edge that will trigger crossing
// distance into new region to place avatar
const float enterDistance = 0.5f;
@@ -979,29 +975,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
pos = pos + (agent.Velocity);
pos = pos + agent.Velocity;
Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
agent.RemoveFromPhysicalScene();
SetInTransit(agent.UUID);
AgentData cAgent = new AgentData();
AgentData cAgent = new AgentData();
agent.CopyTo(cAgent);
cAgent.Position = pos;
if (isFlying)
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
"agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
// We don't need the callback anymnore
cAgent.CallbackURI = String.Empty;
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
{
// region doesn't take it
ReInstantiateScripts(agent);
agent.AddToPhysicalScene(isFlying);
ResetFromTransit(agent.UUID);
return agent;
}
// Next, let's close the child agent connections that are too far away.
agent.CloseChildAgents(neighbourx, neighboury);
//AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
agent.ControllingClient.RequestClientInfo();
@@ -1018,11 +1016,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
if (eq != null)
{
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
capsPath, agent.UUID, agent.ControllingClient.SessionId);
}
else
@@ -1030,32 +1028,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
capsPath);
}
if (!WaitForCallback(agent.UUID))
{
m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
ReInstantiateScripts(agent);
ResetFromTransit(agent.UUID);
// Yikes! We should just have a ref to scene here.
//agent.Scene.InformClientOfNeighbours(agent);
EnableChildAgents(agent);
return agent;
}
// SUCCESS!
agent.MakeChildAgent();
ResetFromTransit(agent.UUID);
// now we have a child agent in this region. Request all interesting data about other (root) agents
agent.SendOtherAgentsAvatarDataToMe();
agent.SendOtherAgentsAppearanceToMe();
// Backwards compatibility
// Backwards compatibility. Best effort
if (version == "Unknown" || version == string.Empty)
{
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
}
// Next, let's close the child agent connections that are too far away.
agent.CloseChildAgents(neighbourx, neighboury);
AgentHasMovedAway(agent, false);
@@ -1088,16 +1080,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
ScenePresence agent = icon.EndInvoke(iar);
// If the cross was successful, this agent is a child agent
if (agent.IsChildAgent)
agent.Reset();
else // Not successful
agent.RestoreInCurrentScene();
//// If the cross was successful, this agent is a child agent
//if (agent.IsChildAgent)
// agent.Reset();
//else // Not successful
// agent.RestoreInCurrentScene();
// In any case
agent.IsInTransit = false;
//m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
}
#endregion
@@ -1236,7 +1228,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero;
agent.startpos = new Vector3(128, 128, 70);
agent.startpos = sp.AbsolutePosition + CalculateOffset(sp, neighbour);
agent.child = true;
agent.Appearance = sp.Appearance;
if (currentAgentCircuit != null)
@@ -1329,6 +1321,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
Vector3 CalculateOffset(ScenePresence sp, GridRegion neighbour)
{
int rRegionX = (int)sp.Scene.RegionInfo.RegionLocX;
int rRegionY = (int)sp.Scene.RegionInfo.RegionLocY;
int tRegionX = neighbour.RegionLocX / (int)Constants.RegionSize;
int tRegionY = neighbour.RegionLocY / (int)Constants.RegionSize;
int shiftx = (rRegionX - tRegionX) * (int)Constants.RegionSize;
int shifty = (rRegionY - tRegionY) * (int)Constants.RegionSize;
return new Vector3(shiftx, shifty, 0f);
}
private void InformClientOfNeighbourCompleted(IAsyncResult iar)
{
InformClientOfNeighbourDelegate icon = (InformClientOfNeighbourDelegate)iar.AsyncState;
@@ -1723,9 +1726,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
uint x = 0, y = 0;
Utils.LongToUInts(newRegionHandle, out x, out y);
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent))
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
{
grp.RootPart.GroupPosition = oldGroupPosition;
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
// Need to turn off the physics flags, otherwise the object will continue to attempt to
// move out of the region creating an infinite loop of failed attempts to cross
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
// We are going to move the object back to the old position so long as the old position
// is in the region
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
grp.AbsolutePosition = oldGroupPosition;
grp.ScheduleGroupForFullUpdate();
}
}

View File

@@ -123,7 +123,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI);
if (real_destination != null)
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination serveruri -> {0}", real_destination.ServerURI);
else
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: GetHyperlinkRegion to Gatekeeper {0} failed", region.ServerURI);
return real_destination;
}
return region;
@@ -189,8 +192,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
// Let's find out if this is a foreign user or a local user
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, id);
if (account != null)
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
if (uMan != null && uMan.IsLocalGridUser(id))
{
// local grid user
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
@@ -228,8 +231,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
GridRegion homeGatekeeper = MakeRegion(aCircuit);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}:{5}",
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: teleporting user {0} {1} home to {2} via {3}:{4}",
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
return true;
@@ -315,8 +318,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
// Let's find out if this is a foreign user or a local user
IUserManagement uMan = m_aScene.RequestModuleInterface<IUserManagement>();
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId);
if (account != null)
if (uMan != null && uMan.IsLocalGridUser(obj.AgentId))
{
// local grid user
return;
@@ -349,6 +353,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
region.ExternalHostName = uri.Host;
region.HttpPort = (uint)uri.Port;
region.ServerURI = aCircuit.ServiceURLs["HomeURI"].ToString();
region.RegionName = string.Empty;
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
return region;

View File

@@ -55,16 +55,16 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
private Scene m_scene;
private string m_ProfileServerURI;
private string m_HomeURI;
#endregion
#region Constructor
public HGAssetMapper(Scene scene, string profileURL)
public HGAssetMapper(Scene scene, string homeURL)
{
m_scene = scene;
m_ProfileServerURI = profileURL;
m_HomeURI = homeURL;
}
#endregion
@@ -73,7 +73,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public AssetBase FetchAsset(string url, UUID assetID)
{
AssetBase asset = m_scene.AssetService.Get(url + "/" + assetID.ToString());
if (!url.EndsWith("/") && !url.EndsWith("="))
url = url + "/";
AssetBase asset = m_scene.AssetService.Get(url + assetID.ToString());
if (asset != null)
{
@@ -87,6 +90,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
if (asset != null)
{
if (!url.EndsWith("/") && !url.EndsWith("="))
url = url + "/";
// See long comment in AssetCache.AddAsset
if (!asset.Temporary || asset.Local)
{
@@ -99,7 +105,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
Copy(asset, asset1);
try
{
asset1.ID = url + "/" + asset.ID;
asset1.ID = url + asset.ID;
}
catch
{
@@ -144,7 +150,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
UUID.TryParse(meta.CreatorID, out uuid);
UserAccount creator = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
if (creator != null)
meta.CreatorID = m_ProfileServerURI + "/" + meta.CreatorID + ";" + creator.FirstName + " " + creator.LastName;
meta.CreatorID = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName;
}
}
@@ -187,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (!hasCreatorData && creator != null)
{
XmlElement creatorData = doc.CreateElement("CreatorData");
creatorData.InnerText = m_ProfileServerURI + "/" + creator.PrincipalID + ";" + creator.FirstName + " " + creator.LastName;
creatorData.InnerText = m_HomeURI + ";" + creator.FirstName + " " + creator.LastName;
sop.AppendChild(creatorData);
}
}

View File

@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
get { return m_assMapper; }
}
private string m_ProfileServerURI;
private string m_HomeURI;
private bool m_OutboundPermission;
private string m_ThisGatekeeper;
@@ -84,7 +84,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"];
if (thisModuleConfig != null)
{
m_ProfileServerURI = thisModuleConfig.GetString("ProfileServerURI", string.Empty);
// legacy configuration [obsolete]
m_HomeURI = thisModuleConfig.GetString("ProfileServerURI", string.Empty);
// preferred
m_HomeURI = thisModuleConfig.GetString("HomeURI", m_HomeURI);
m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true);
m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", string.Empty);
}
@@ -100,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return;
base.AddRegion(scene);
m_assMapper = new HGAssetMapper(scene, m_ProfileServerURI);
m_assMapper = new HGAssetMapper(scene, m_HomeURI);
scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
}
@@ -124,8 +127,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
protected override string GenerateLandmark(ScenePresence presence, out string prefix, out string suffix)
{
UserAccount account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, presence.UUID);
if (account == null)
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(presence.UUID))
prefix = "HG ";
else
prefix = string.Empty;
@@ -210,12 +212,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
public override bool IsForeignUser(UUID userID, out string assetServerURL)
{
assetServerURL = string.Empty;
UserAccount account = null;
if (m_Scene.UserAccountService != null)
account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
if (account == null) // foreign
{
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
{ // foreign
ScenePresence sp = null;
if (m_Scene.TryGetScenePresence(userID, out sp))
{

View File

@@ -367,6 +367,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition;
// Restore attachment data after trip through the sim
if (objectGroup.RootPart.AttachPoint > 0)
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
objectGroup.AbsolutePosition = inventoryStoredPosition;
// Make sure all bits but the ones we want are clear
@@ -476,8 +481,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
IClientAPI remoteClient)
{
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
// For the porposes of inventory, an object is modify if the prims
// are modify. This allows renaming an object that contains no
// mod items.
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
effectivePerms &= grp.GetEffectivePermissions(true);
{
uint groupPerms = grp.GetEffectivePermissions(true);
if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
groupPerms |= (uint)PermissionMask.Modify;
effectivePerms &= groupPerms;
}
effectivePerms |= (uint)PermissionMask.Move;
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
@@ -546,12 +560,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null;
userID = remoteClient.AgentId;
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
// action, remoteClient.Name, userID);
}
else
{
// All returns / deletes go to the object owner
//
userID = so.RootPart.OwnerID;
// m_log.DebugFormat(
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is object owner {1}",
// action, userID);
}
if (userID == UUID.Zero) // Can't proceed
@@ -637,14 +659,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
// Override and put into where it came from, if it came
// from anywhere in inventory
// from anywhere in inventory and the owner is taking it back.
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
if (so.RootPart.FromFolderID != UUID.Zero)
if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
{
InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID);
folder = m_Scene.InventoryService.GetFolder(f);
if (f != null)
folder = m_Scene.InventoryService.GetFolder(f);
}
}
@@ -683,12 +706,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return null;
}
item.Owner = remoteClient.AgentId;
return RezObject(
@@ -736,6 +753,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (e == null || attachment) // Single
{
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
if (!attachment)
{
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
}
objlist.Add(g);
veclist.Add(new Vector3(0, 0, 0));
@@ -765,6 +787,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (XmlNode n in groups)
{
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
objlist.Add(g);
XmlElement el = (XmlElement)n;
@@ -784,13 +808,42 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
int primcount = 0;
foreach (SceneObjectGroup g in objlist)
primcount += g.PrimCount;
if (!m_Scene.Permissions.CanRezObject(
primcount, remoteClient.AgentId, pos)
&& !attachment)
{
// The client operates in no fail mode. It will
// have already removed the item from the folder
// if it's no copy.
// Put it back if it's not an attachment
//
if (item != null)
{
if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!attachment))
remoteClient.SendBulkUpdateInventory(item);
}
return null;
}
if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment))
return null;
for (int i = 0; i < objlist.Count; i++)
{
group = objlist[i];
SceneObjectPart rootPart = group.RootPart;
// m_log.DebugFormat(
// "[InventoryAccessModule]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
// group.Name, group.LocalId, group.UUID,
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
// remoteClient.Name);
// Vector3 storedPosition = group.AbsolutePosition;
if (group.UUID == UUID.Zero)
{
@@ -854,47 +907,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
rootPart.ScheduleFullUpdate();
}
if ((rootPart.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0 || // Magic number
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{
//Need to kill the for sale here
rootPart.ObjectSaleType = 0;
rootPart.SalePrice = 10;
if (m_Scene.Permissions.PropagatePermissions())
{
foreach (SceneObjectPart part in group.Parts)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryOnePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
}
}
foreach (SceneObjectPart part in group.Parts)
{
part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner;
part.Inventory.ChangeInventoryOwner(item.Owner);
}
group.ApplyNextOwnerPermissions();
}
}
// m_log.DebugFormat(
// "[InventoryAccessModule]: Rezzed {0} {1} {2} for {3}",
// group.Name, group.LocalId, group.UUID, remoteClient.Name);
// m_log.DebugFormat(
// "[InventoryAccessModule]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
// group.Name, group.LocalId, group.UUID,
// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
// remoteClient.Name);
}
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
// TODO: Remove the magic number badness
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
if (item != null)
DoPostRezWhenFromItem(item, attachment);
@@ -934,25 +955,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
int primcount = 0;
foreach (SceneObjectGroup g in objlist)
primcount += g.PrimCount;
if (!m_Scene.Permissions.CanRezObject(
primcount, remoteClient.AgentId, pos)
&& !isAttachment)
{
// The client operates in no fail mode. It will
// have already removed the item from the folder
// if it's no copy.
// Put it back if it's not an attachment
//
if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment))
remoteClient.SendBulkUpdateInventory(item);
return false;
}
for (int i = 0; i < objlist.Count; i++)
{
SceneObjectGroup so = objlist[i];
@@ -968,14 +970,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
rootPart.Name = item.Name;
rootPart.Description = item.Description;
rootPart.ObjectSaleType = item.SaleType;
rootPart.SalePrice = item.SalePrice;
if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0)
{
rootPart.ObjectSaleType = item.SaleType;
rootPart.SalePrice = item.SalePrice;
}
}
rootPart.FromFolderID = item.Folder;
// Console.WriteLine("rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
if ((rootPart.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0)
(item.CurrentPermissions & 16) != 0 ||
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{
//Need to kill the for sale here
rootPart.ObjectSaleType = 0;
@@ -985,31 +994,43 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
foreach (SceneObjectPart part in so.Parts)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
}
part.GroupMask = 0; // DO NOT propagate here
part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner;
part.Inventory.ChangeInventoryOwner(item.Owner);
}
so.ApplyNextOwnerPermissions();
// In case the user has changed flags on a received item
// we have to apply those changes after the slam. Else we
// get a net loss of permissions
foreach (SceneObjectPart part in so.Parts)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
}
}
}
}
foreach (SceneObjectPart part in so.Parts)
else
{
part.FromUserInventoryItemID = fromUserInventoryItemId;
if ((part.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0)
foreach (SceneObjectPart part in so.Parts)
{
part.Inventory.ChangeInventoryOwner(item.Owner);
part.GroupMask = 0; // DO NOT propagate here
}
part.FromUserInventoryItemID = fromUserInventoryItemId;
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryOnePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
}
}
rootPart.TrimPermissions();

View File

@@ -322,66 +322,85 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
user.Id = uuid;
user.FirstName = first;
user.LastName = last;
// user.ProfileURL = we should initialize this to the default
AddUserInternal(user);
}
public void AddUser(UUID uuid, string first, string last, string profileURL)
public void AddUser(UUID uuid, string first, string last, string homeURL)
{
AddUser(uuid, profileURL + ";" + first + " " + last);
AddUser(uuid, homeURL + ";" + first + " " + last);
}
public void AddUser(UUID id, string creatorData)
public void AddUser (UUID id, string creatorData)
{
UserData oldUser;
//lock the whole block - prevent concurrent update
lock (m_UserCache)
{
if (m_UserCache.ContainsKey(id))
return;
}
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, craetorData {1}", id, creatorData);
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, id);
if (account != null)
{
AddUser(id, account.FirstName, account.LastName);
}
else
{
UserData user = new UserData();
user.Id = id;
if (creatorData != null && creatorData != string.Empty)
m_UserCache.TryGetValue (id, out oldUser);
if (oldUser != null)
{
//creatorData = <endpoint>;<name>
string[] parts = creatorData.Split(';');
if (parts.Length >= 1)
if (creatorData == null || creatorData == String.Empty)
{
user.HomeURL = parts[0];
try
{
Uri uri = new Uri(parts[0]);
user.LastName = "@" + uri.Authority;
}
catch (UriFormatException)
{
m_log.DebugFormat("[SCENE]: Unable to parse Uri {0}", parts[0]);
user.LastName = "@unknown";
}
//ignore updates without creator data
return;
}
if (parts.Length >= 2)
user.FirstName = parts[1].Replace(' ', '.');
//try update unknown users
//and creator's home URL's
if ((oldUser.FirstName == "Unknown" && !creatorData.Contains ("Unknown")) || (oldUser.HomeURL != null && !creatorData.StartsWith (oldUser.HomeURL)))
{
m_UserCache.Remove (id);
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Re-adding user with id {0}, creatorData [{1}] and old HomeURL {2}", id, creatorData,oldUser.HomeURL);
}
else
{
//we have already a valid user within the cache
return;
}
}
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
UserAccount account = m_Scenes [0].UserAccountService.GetUserAccount (m_Scenes [0].RegionInfo.ScopeID, id);
if (account != null)
{
AddUser (id, account.FirstName, account.LastName);
}
else
{
user.FirstName = "Unknown";
user.LastName = "User";
}
UserData user = new UserData ();
user.Id = id;
AddUserInternal(user);
if (creatorData != null && creatorData != string.Empty)
{
//creatorData = <endpoint>;<name>
string[] parts = creatorData.Split (';');
if (parts.Length >= 1)
{
user.HomeURL = parts [0];
try
{
Uri uri = new Uri (parts [0]);
user.LastName = "@" + uri.Authority;
}
catch (UriFormatException)
{
m_log.DebugFormat ("[SCENE]: Unable to parse Uri {0}", parts [0]);
user.LastName = "@unknown";
}
}
if (parts.Length >= 2)
user.FirstName = parts [1].Replace (' ', '.');
}
else
{
user.FirstName = "Unknown";
user.LastName = "User";
}
AddUserInternal (user);
}
}
}
@@ -395,35 +414,14 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
// user.Id, user.FirstName, user.LastName, user.HomeURL);
}
//public void AddUser(UUID uuid, string userData)
//{
// if (m_UserCache.ContainsKey(uuid))
// return;
public bool IsLocalGridUser(UUID uuid)
{
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid);
if (account == null || (account != null && !account.LocalToGrid))
return false;
// UserData user = new UserData();
// user.Id = uuid;
// // userData = <profile url>;<name>
// string[] parts = userData.Split(';');
// if (parts.Length >= 1)
// user.ProfileURL = parts[0].Trim();
// if (parts.Length >= 2)
// {
// string[] name = parts[1].Trim().Split(' ');
// if (name.Length >= 1)
// user.FirstName = name[0];
// if (name.Length >= 2)
// user.LastName = name[1];
// else
// user.LastName = "?";
// }
// lock (m_UserCache)
// m_UserCache.Add(uuid, user);
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}", user.Id, user.FirstName, user.LastName, user.ProfileURL);
//}
return true;
}
#endregion IUserManagement

View File

@@ -153,10 +153,18 @@ namespace OpenSim.Region.CoreModules.World.LightShare
public void SendProfileToClient(IClientAPI client, RegionLightShareData wl)
{
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
if (m_enableWindlight)
{
List<byte[]> param = compileWindlightSettings(wl);
client.SendGenericMessage("Windlight", param);
if (m_scene.RegionInfo.WindlightSettings.valid)
{
List<byte[]> param = compileWindlightSettings(wl);
client.SendGenericMessage("Windlight", param);
}
else
{
List<byte[]> param = new List<byte[]>();
client.SendGenericMessage("WindlightReset", param);
}
}
}
@@ -176,8 +184,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
private void EventManager_OnSaveNewWindlightProfile()
{
if (m_scene.RegionInfo.WindlightSettings.valid)
m_scene.ForEachRootClient(SendProfileToClient);
m_scene.ForEachRootClient(SendProfileToClient);
}
public void PostInitialise()

View File

@@ -29,6 +29,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Text;
using System.Threading;
@@ -111,21 +112,36 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
HttpWebRequest Request = (HttpWebRequest)sender;
if (Request.Headers.Get("NoVerifyCert") != null)
// If this is a web request we need to check the headers first
// We may want to ignore SSL
if (sender is HttpWebRequest)
{
HttpWebRequest Request = (HttpWebRequest)sender;
ServicePoint sp = Request.ServicePoint;
// We don't case about encryption, get out of here
if (Request.Headers.Get("NoVerifyCert") != null)
{
return true;
}
// If there was an upstream cert verification error, bail
if ((((int)sslPolicyErrors) & ~4) != 0)
return false;
// Check for policy and execute it if defined
if (ServicePointManager.CertificatePolicy != null)
{
return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0);
}
return true;
}
// If it's not HTTP, trust .NET to check it
if ((((int)sslPolicyErrors) & ~4) != 0)
return false;
if (ServicePointManager.CertificatePolicy != null)
{
ServicePoint sp = Request.ServicePoint;
return ServicePointManager.CertificatePolicy.CheckValidationResult (sp, certificate, Request, 0);
}
return true;
}
#region IHttpRequestModule Members
@@ -415,8 +431,21 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
}
Request.Timeout = HttpTimeout;
// execute the request
response = (HttpWebResponse) Request.GetResponse();
try
{
// execute the request
response = (HttpWebResponse) Request.GetResponse();
}
catch (WebException e)
{
if (e.Status != WebExceptionStatus.ProtocolError)
{
throw;
}
response = (HttpWebResponse)e.Response;
}
Status = (int)response.StatusCode;
Stream resStream = response.GetResponseStream();
@@ -473,7 +502,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
response.Close();
}
Status = (int)OSHttpStatusCode.SuccessOk;
_finished = true;
}

View File

@@ -132,6 +132,12 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void RegionLoaded(Scene scene)
{
IScriptModule[] scriptModules = scene.RequestModuleInterfaces<IScriptModule>();
foreach (IScriptModule scriptModule in scriptModules)
{
scriptModule.OnScriptRemoved += ScriptRemoved;
scriptModule.OnObjectRemoved += ObjectRemoved;
}
}
public void RemoveRegion(Scene scene)
@@ -289,6 +295,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
public void ScriptRemoved(UUID itemID)
{
// m_log.DebugFormat("[URL MODULE]: Removing script {0}", itemID);
lock (m_UrlMap)
{
List<string> removeURLs = new List<string>();

View File

@@ -382,23 +382,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
return result;
}
#region IHyperAssetService
public string GetUserAssetServer(UUID userID)
{
UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID);
if (account != null && account.ServiceURLs.ContainsKey("AssetServerURI") && account.ServiceURLs["AssetServerURI"] != null)
return account.ServiceURLs["AssetServerURI"].ToString();
return string.Empty;
}
public string GetSimAssetServer()
{
return m_LocalAssetServiceURI;
}
#endregion
}
}

View File

@@ -170,6 +170,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
public AssetBase GetCached(string id)
{
// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id);
if (m_Cache != null)
return m_Cache.Get(id);

View File

@@ -171,6 +171,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
{
return m_GridUserService.GetGridUserInfo(userID);
}
public GridUserInfo[] GetGridUserInfo(string[] userID)
{
return m_GridUserService.GetGridUserInfo(userID);
}
#endregion

View File

@@ -147,6 +147,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser
return m_RemoteConnector.GetGridUserInfo(userID);
}
public GridUserInfo[] GetGridUserInfo(string[] userID)
{
return m_RemoteConnector.GetGridUserInfo(userID);
}
#endregion
}

View File

@@ -1,223 +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 System.Collections.Generic;
using OpenMetaverse;
using Nini.Config;
using log4net;
using OpenSim.Framework;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{
public abstract class BaseInventoryConnector : IInventoryService
{
protected static InventoryCache m_cache;
private static bool m_Initialized;
protected virtual void Init(IConfigSource source)
{
if (!m_Initialized)
{
m_cache = new InventoryCache();
m_cache.Init(source, this);
m_Initialized = true;
}
}
/// <summary>
/// Create the entire inventory for a given user
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public abstract bool CreateUserInventory(UUID user);
/// <summary>
/// Gets the skeleton of the inventory -- folders only
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public abstract List<InventoryFolderBase> GetInventorySkeleton(UUID userId);
/// <summary>
/// Synchronous inventory fetch.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public abstract InventoryCollection GetUserInventory(UUID userID);
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
/// </summary>
/// <param name="userID"></param>
/// <param name="callback"></param>
public abstract void GetUserInventory(UUID userID, InventoryReceiptCallback callback);
/// <summary>
/// Retrieve the root inventory folder for the given user.
/// </summary>
/// <param name="userID"></param>
/// <returns>null if no root folder was found</returns>
public InventoryFolderBase GetRootFolder(UUID userID)
{
// Root folder is here as system type Folder.
return m_cache.GetFolderForType(userID, AssetType.Folder);
}
public abstract Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID);
/// <summary>
/// Gets the user folder for the given folder-type
/// </summary>
/// <param name="userID"></param>
/// <param name="type"></param>
/// <returns></returns>
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
{
return m_cache.GetFolderForType(userID, type);
}
/// <summary>
/// Gets everything (folders and items) inside a folder
/// </summary>
/// <param name="userId"></param>
/// <param name="folderID"></param>
/// <returns></returns>
public abstract InventoryCollection GetFolderContent(UUID userID, UUID folderID);
/// <summary>
/// Gets the items inside a folder
/// </summary>
/// <param name="userID"></param>
/// <param name="folderID"></param>
/// <returns></returns>
public abstract List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID);
/// <summary>
/// Add a new folder to the user's inventory
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully added</returns>
public abstract bool AddFolder(InventoryFolderBase folder);
/// <summary>
/// Update a folder in the user's inventory
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully updated</returns>
public abstract bool UpdateFolder(InventoryFolderBase folder);
/// <summary>
/// Move an inventory folder to a new location
/// </summary>
/// <param name="folder">A folder containing the details of the new location</param>
/// <returns>true if the folder was successfully moved</returns>
public abstract bool MoveFolder(InventoryFolderBase folder);
/// <summary>
/// Delete a list of inventory folders (from trash)
/// </summary>
public abstract bool DeleteFolders(UUID ownerID, List<UUID> folderIDs);
/// <summary>
/// Purge an inventory folder of all its items and subfolders.
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully purged</returns>
public abstract bool PurgeFolder(InventoryFolderBase folder);
/// <summary>
/// Add a new item to the user's inventory.
/// If the given item has to parent folder, it tries to find the most
/// suitable folder for it.
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully added</returns>
public bool AddItem(InventoryItemBase item)
{
if (item == null)
return false;
if (item.Folder == UUID.Zero)
{
InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
if (f != null)
item.Folder = f.ID;
else
{
f = GetRootFolder(item.Owner);
if (f != null)
item.Folder = f.ID;
else
return false;
}
}
return AddItemPlain(item);
}
protected abstract bool AddItemPlain(InventoryItemBase item);
/// <summary>
/// Update an item in the user's inventory
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully updated</returns>
public abstract bool UpdateItem(InventoryItemBase item);
public abstract bool MoveItems(UUID ownerID, List<InventoryItemBase> items);
/// <summary>
/// Delete an item from the user's inventory
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully deleted</returns>
public abstract bool DeleteItems(UUID ownerID, List<UUID> itemIDs);
public abstract InventoryItemBase GetItem(InventoryItemBase item);
public abstract InventoryFolderBase GetFolder(InventoryFolderBase folder);
/// <summary>
/// Does the given user have an inventory structure?
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public abstract bool HasInventoryForUser(UUID userID);
/// <summary>
/// Get the active gestures of the agent.
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
public abstract List<InventoryItemBase> GetActiveGestures(UUID userId);
public abstract int GetAssetPermissions(UUID userID, UUID assetID);
}
}

View File

@@ -218,9 +218,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
/// <param name="userID"></param>
private void CacheInventoryServiceURL(UUID userID)
{
if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null)
if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
{
// The user does not have a local account; let's cache its service URL
// The user is not local; let's cache its service URL
string inventoryURL = string.Empty;
ScenePresence sp = null;
foreach (Scene scene in m_Scenes)

View File

@@ -1,237 +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 System.Collections.Generic;
using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Scenes;
using OpenMetaverse;
using Nini.Config;
using log4net;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{
public class InventoryCache
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
protected BaseInventoryConnector m_Connector;
protected List<Scene> m_Scenes;
// The cache proper
protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;
// A cache of userIDs --> ServiceURLs, for HGBroker only
protected Dictionary<UUID, string> m_InventoryURLs =
new Dictionary<UUID, string>();
public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
{
m_Scenes = new List<Scene>();
m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>();
m_Connector = connector;
}
public virtual void AddRegion(Scene scene)
{
m_Scenes.Add(scene);
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
scene.EventManager.OnClientClosed += OnClientClosed;
}
public virtual void RemoveRegion(Scene scene)
{
if ((m_Scenes != null) && m_Scenes.Contains(scene))
{
m_Scenes.Remove(scene);
}
}
void OnMakeRootAgent(ScenePresence presence)
{
// Get system folders
// First check if they're here already
lock (m_InventoryCache)
{
if (m_InventoryCache.ContainsKey(presence.UUID))
{
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname);
return;
}
}
// If not, go get them and place them in the cache
Dictionary<AssetType, InventoryFolderBase> folders = CacheSystemFolders(presence.UUID);
CacheInventoryServiceURL(presence.Scene, presence.UUID);
m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);
}
void OnClientClosed(UUID clientID, Scene scene)
{
if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
{
ScenePresence sp = null;
foreach (Scene s in m_Scenes)
{
s.TryGetScenePresence(clientID, out sp);
if ((sp != null) && !sp.IsChildAgent && (s != scene))
{
m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
scene.RegionInfo.RegionName, clientID);
return;
}
}
m_log.DebugFormat(
"[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
scene.RegionInfo.RegionName, clientID);
DropCachedSystemFolders(clientID);
DropInventoryServiceURL(clientID);
}
}
/// <summary>
/// Cache a user's 'system' folders.
/// </summary>
/// <param name="userID"></param>
/// <returns>Folders cached</returns>
protected Dictionary<AssetType, InventoryFolderBase> CacheSystemFolders(UUID userID)
{
// If not, go get them and place them in the cache
Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(userID);
if (folders.Count > 0)
lock (m_InventoryCache)
m_InventoryCache.Add(userID, folders);
return folders;
}
/// <summary>
/// Drop a user's cached 'system' folders
/// </summary>
/// <param name="userID"></param>
protected void DropCachedSystemFolders(UUID userID)
{
// Drop system folders
lock (m_InventoryCache)
if (m_InventoryCache.ContainsKey(userID))
m_InventoryCache.Remove(userID);
}
/// <summary>
/// Get the system folder for a particular asset type
/// </summary>
/// <param name="userID"></param>
/// <param name="type"></param>
/// <returns></returns>
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
{
m_log.DebugFormat("[INVENTORY CACHE]: Getting folder for asset type {0} for user {1}", type, userID);
Dictionary<AssetType, InventoryFolderBase> folders = null;
lock (m_InventoryCache)
{
m_InventoryCache.TryGetValue(userID, out folders);
// In some situations (such as non-secured standalones), system folders can be requested without
// the user being logged in. So we need to try caching them here if we don't already have them.
if (null == folders)
CacheSystemFolders(userID);
m_InventoryCache.TryGetValue(userID, out folders);
}
if ((folders != null) && folders.ContainsKey(type))
{
m_log.DebugFormat(
"[INVENTORY CACHE]: Returning folder {0} as type {1} for {2}", folders[type], type, userID);
return folders[type];
}
m_log.WarnFormat("[INVENTORY CACHE]: Could not find folder for system type {0} for {1}", type, userID);
return null;
}
/// <summary>
/// Gets the user's inventory URL from its serviceURLs, if the user is foreign,
/// and sticks it in the cache
/// </summary>
/// <param name="userID"></param>
private void CacheInventoryServiceURL(Scene scene, UUID userID)
{
if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null)
{
// The user does not have a local account; let's cache its service URL
string inventoryURL = string.Empty;
ScenePresence sp = null;
scene.TryGetScenePresence(userID, out sp);
if (sp != null)
{
AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
{
inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
if (inventoryURL != null && inventoryURL != string.Empty)
{
inventoryURL = inventoryURL.Trim(new char[] { '/' });
m_InventoryURLs.Add(userID, inventoryURL);
}
}
}
}
}
private void DropInventoryServiceURL(UUID userID)
{
lock (m_InventoryURLs)
if (m_InventoryURLs.ContainsKey(userID))
m_InventoryURLs.Remove(userID);
}
public string GetInventoryServiceURL(UUID userID)
{
if (m_InventoryURLs.ContainsKey(userID))
return m_InventoryURLs[userID];
return null;
}
}
}

View File

@@ -116,6 +116,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_merge = merge;
m_skipAssets = skipAssets;
m_requestId = requestId;
// Zero can never be a valid user id
m_validUserUuids[UUID.Zero] = false;
}
public ArchiveReadRequest(Scene scene, Stream loadStream, bool merge, bool skipAssets, Guid requestId)
@@ -125,6 +128,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_merge = merge;
m_skipAssets = skipAssets;
m_requestId = requestId;
// Zero can never be a valid user id
m_validUserUuids[UUID.Zero] = false;
}
/// <summary>
@@ -386,16 +392,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
if (!m_validUserUuids.ContainsKey(uuid))
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, uuid);
if (account != null)
m_validUserUuids.Add(uuid, true);
else
m_validUserUuids.Add(uuid, false);
m_validUserUuids.Add(uuid, account != null);
}
if (m_validUserUuids[uuid])
return true;
else
return false;
return m_validUserUuids[uuid];
}
/// <summary>
@@ -422,6 +422,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
string extension = filename.Substring(i);
string uuid = filename.Remove(filename.Length - extension.Length);
if (m_scene.AssetService.GetMetadata(uuid) != null)
{
// m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid);
return true;
}
if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension))
{
sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension];

View File

@@ -282,10 +282,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// always (incorrectly) includes the Copy bit set in this case. But that's a mistake: the viewer
// does NOT show that the object has Everyone-Copy permissions, and doesn't allow it to be copied.
if (permissionClass != PermissionClass.Owner)
{
canTransfer |= (obj.EveryoneMask & (uint)PermissionMask.Copy) != 0;
}
bool partPermitted = true;
if (checkPermissions.Contains("C") && !canCopy)

View File

@@ -98,6 +98,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver
OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; });
options.Add("s|skip-assets", delegate (string v) { skipAssets = v != null; });
// Send a message to the region ready module
/* bluewall* Disable this for the time being
IRegionReadyModule rready = m_scene.RequestModuleInterface<IRegionReadyModule>();
if (rready != null)
{
rready.OarLoadingAlert("load");
}
*/
List<string> mainParams = options.Parse(cmdparams);
@@ -125,9 +135,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
Dictionary<string, object> options = new Dictionary<string, object>();
OptionSet ops = new OptionSet();
// ops.Add("v|version=", delegate(string v) { options["version"] = v; });
ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
// legacy argument [obsolete]
ops.Add("p|profile=", delegate(string v) { Console.WriteLine("\n WARNING: -profile option is obsolete and it will not work. Use -home instead.\n"); });
// preferred
ops.Add("h|home=", delegate(string v) { options["home"] = v; });
ops.Add("noassets", delegate(string v) { options["noassets"] = v != null; });
ops.Add("publish", v => options["wipe-owners"] = v != null);
ops.Add("perm=", delegate(string v) { options["checkPermissions"] = v; });
List<string> mainParams = ops.Parse(cmdparams);

View File

@@ -306,10 +306,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
protected AssetBase PostProcess(AssetBase asset)
{
if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("profile"))
if (asset.Type == (sbyte)AssetType.Object && asset.Data != null && m_options.ContainsKey("home"))
{
//m_log.DebugFormat("[ARCHIVER]: Rewriting object data for {0}", asset.ID);
string xml = ExternalRepresentationUtils.RewriteSOP(Utils.BytesToString(asset.Data), m_options["profile"].ToString(), m_userAccountService, m_scopeID);
string xml = ExternalRepresentationUtils.RewriteSOP(Utils.BytesToString(asset.Data), m_options["home"].ToString(), m_userAccountService, m_scopeID);
asset.Data = Utils.StringToBytes(xml);
}
return asset;

View File

@@ -248,9 +248,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Dictionary<string, Object> options = new Dictionary<string, Object>();
options.Add("noassets", true);
m_archiverModule.ArchiveRegion(archiveWriteStream, requestId, options);
//AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer;
//while (assetServer.HasWaitingRequests())
// assetServer.ProcessNextRequest();
// Don't wait for completion - with --noassets save oar happens synchronously
// Monitor.Wait(this, 60000);
@@ -344,7 +341,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
{
using (BinaryReader br = new BinaryReader(resource))
{
// FIXME: Use the inspector insteadthere are so many forums and lists already, though admittedly none of them are suitable for cross virtual-enivornemnt discussion
// FIXME: Use the inspector instead
soundData = br.ReadBytes(99999999);
UUID soundUuid = UUID.Parse("00000000-0000-0000-0000-000000000001");
string soundAssetFileName
@@ -409,6 +406,86 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod());
}
/// <summary>
/// Test loading an OpenSim Region Archive saved with the --publish option.
/// </summary>
[Test]
public void TestLoadPublishedOar()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
SceneObjectPart part1 = CreateSceneObjectPart1();
SceneObjectGroup sog1 = new SceneObjectGroup(part1);
m_scene.AddNewSceneObject(sog1, false);
SceneObjectPart part2 = CreateSceneObjectPart2();
AssetNotecard nc = new AssetNotecard();
nc.BodyText = "Hello World!";
nc.Encode();
UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000");
UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000");
AssetBase ncAsset
= AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero);
m_scene.AssetService.Store(ncAsset);
SceneObjectGroup sog2 = new SceneObjectGroup(part2);
TaskInventoryItem ncItem
= new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid };
part2.Inventory.AddInventoryItem(ncItem, true);
m_scene.AddNewSceneObject(sog2, false);
MemoryStream archiveWriteStream = new MemoryStream();
m_scene.EventManager.OnOarFileSaved += SaveCompleted;
Guid requestId = new Guid("00000000-0000-0000-0000-808080808080");
lock (this)
{
m_archiverModule.ArchiveRegion(
archiveWriteStream, requestId, new Dictionary<string, Object>() { { "wipe-owners", Boolean.TrueString } });
Monitor.Wait(this, 60000);
}
Assert.That(m_lastRequestId, Is.EqualTo(requestId));
byte[] archive = archiveWriteStream.ToArray();
MemoryStream archiveReadStream = new MemoryStream(archive);
{
UUID estateOwner = TestHelpers.ParseTail(0x4747);
UUID objectOwner = TestHelpers.ParseTail(0x15);
// Reload to new scene
ArchiverModule archiverModule = new ArchiverModule();
SerialiserModule serialiserModule = new SerialiserModule();
TerrainModule terrainModule = new TerrainModule();
TestScene scene2 = SceneHelpers.SetupScene();
SceneHelpers.SetupSceneModules(scene2, archiverModule, serialiserModule, terrainModule);
// Make sure there's a valid owner for the owner we saved (this should have been wiped if the code is
// behaving correctly
UserAccountHelpers.CreateUserWithInventory(scene2, objectOwner);
scene2.RegionInfo.EstateSettings.EstateOwner = estateOwner;
lock (this)
{
scene2.EventManager.OnOarFileLoaded += LoadCompleted;
archiverModule.DearchiveRegion(archiveReadStream);
}
Assert.That(m_lastErrorMessage, Is.Null);
SceneObjectGroup loadedSog = scene2.GetSceneObjectGroup(part1.Name);
Assert.That(loadedSog.OwnerID, Is.EqualTo(estateOwner));
Assert.That(loadedSog.LastOwnerID, Is.EqualTo(estateOwner));
}
}
/// <summary>
/// Test loading the region settings of an OpenSim Region Archive.
/// </summary>

View File

@@ -55,6 +55,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
protected EstateManagementCommands m_commands;
private EstateTerrainXferHandler TerrainUploader;
public TelehubManager m_Telehub;
public event ChangeDelegate OnRegionInfoChange;
public event ChangeDelegate OnEstateInfoChange;
@@ -70,7 +71,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
{
m_log.DebugFormat("[ESTATE]: Invoice is {0}", invoice.ToString());
uint sun = 0;
if (!Scene.RegionInfo.EstateSettings.UseGlobalTime)
@@ -88,6 +88,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
GetEstateFlags(),
sun,
Scene.RegionInfo.RegionSettings.Covenant,
(uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime,
Scene.RegionInfo.EstateSettings.AbuseEmail,
estateOwner);
}
@@ -256,6 +257,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>();
if (restartModule != null)
{
if (timeInSeconds == -1)
{
restartModule.AbortRestart("Restart aborted by region manager");
return;
}
List<int> times = new List<int>();
while (timeInSeconds > 0)
{
@@ -279,6 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
// remoteClient.Name, estateCovenantID);
Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID;
Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch();
Scene.RegionInfo.RegionSettings.Save();
TriggerRegionInfoChange();
}
@@ -615,6 +623,50 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
}
public void handleOnEstateManageTelehub (IClientAPI client, UUID invoice, UUID senderID, string cmd, uint param1)
{
uint ObjectLocalID;
SceneObjectPart part;
switch (cmd)
{
case "info ui":
break;
case "connect":
// Add the Telehub
part = Scene.GetSceneObjectPart((uint)param1);
if (part == null)
return;
SceneObjectGroup grp = part.ParentGroup;
m_Telehub.Connect(grp);
break;
case "delete":
// Disconnect Telehub
m_Telehub.Disconnect();
break;
case "spawnpoint add":
// Add SpawnPoint to the Telehub
part = Scene.GetSceneObjectPart((uint)param1);
if (part == null)
return;
m_Telehub.AddSpawnPoint(part.AbsolutePosition);
break;
case "spawnpoint remove":
// Remove SpawnPoint from Telehub
m_Telehub.RemoveSpawnPoint((int)param1);
break;
default:
break;
}
SendTelehubInfo(client);
}
private void SendSimulatorBlueBoxMessage(
IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message)
{
@@ -1085,7 +1137,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
Scene.RegisterModuleInterface<IEstateModule>(this);
Scene.EventManager.OnNewClient += EventManager_OnNewClient;
Scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
m_Telehub = new TelehubManager(scene);
m_commands = new EstateManagementCommands(this);
m_commands.Initialise();
}
@@ -1139,6 +1193,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
client.OnEstateRestartSimRequest += handleEstateRestartSimRequest;
client.OnEstateChangeCovenantRequest += handleChangeEstateCovenantRequest;
client.OnEstateChangeInfo += handleEstateChangeInfo;
client.OnEstateManageTelehub += handleOnEstateManageTelehub;
client.OnUpdateEstateAccessDeltaRequest += handleEstateAccessDeltaRequest;
client.OnSimulatorBlueBoxMessageRequest += SendSimulatorBlueBoxMessage;
client.OnEstateBlueBoxMessageRequest += SendEstateBlueBoxMessage;
@@ -1293,5 +1348,39 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (onmessage != null)
onmessage(Scene.RegionInfo.RegionID, fromID, fromName, message);
}
private void SendTelehubInfo(IClientAPI client)
{
RegionSettings settings =
this.Scene.RegionInfo.RegionSettings;
SceneObjectGroup telehub = null;
if (settings.TelehubObject != UUID.Zero &&
(telehub = Scene.GetSceneObjectGroup(settings.TelehubObject)) != null)
{
List<Vector3> spawnPoints = new List<Vector3>();
foreach (SpawnPoint sp in settings.SpawnPoints())
{
spawnPoints.Add(sp.GetLocation(Vector3.Zero, Quaternion.Identity));
}
client.SendTelehubInfo(settings.TelehubObject,
telehub.Name,
telehub.AbsolutePosition,
telehub.GroupRotation,
spawnPoints);
}
else
{
client.SendTelehubInfo(UUID.Zero,
String.Empty,
Vector3.Zero,
Quaternion.Identity,
new List<Vector3>());
}
}
}
}

View File

@@ -0,0 +1,95 @@
/*
* 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 System.Reflection;
using OpenMetaverse;
using System.Collections.Generic;
using OpenSim.Framework;
using OpenSim.Region.Framework.Scenes;
using log4net;
namespace OpenSim.Region.CoreModules.World.Estate
{
public class TelehubManager
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
Scene m_Scene;
public TelehubManager(Scene scene)
{
m_Scene = scene;
}
// Connect the Telehub
public void Connect(SceneObjectGroup grp)
{
m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints();
m_Scene.RegionInfo.RegionSettings.TelehubObject = grp.UUID;
m_Scene.RegionInfo.RegionSettings.Save();
}
// Disconnect the Telehub:
public void Disconnect()
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
return;
m_Scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
m_Scene.RegionInfo.RegionSettings.ClearSpawnPoints();
m_Scene.RegionInfo.RegionSettings.Save();
}
// Add a SpawnPoint to the Telehub
public void AddSpawnPoint(Vector3 point)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
return;
SceneObjectGroup grp = m_Scene.GetSceneObjectGroup(m_Scene.RegionInfo.RegionSettings.TelehubObject);
if (grp == null)
return;
SpawnPoint sp = new SpawnPoint();
sp.SetLocation(grp.AbsolutePosition, grp.GroupRotation, point);
m_Scene.RegionInfo.RegionSettings.AddSpawnPoint(sp);
m_Scene.RegionInfo.RegionSettings.Save();
}
// Remove a SpawnPoint from the Telehub
public void RemoveSpawnPoint(int spawnpoint)
{
if (m_Scene.RegionInfo.RegionSettings.TelehubObject == UUID.Zero)
return;
m_Scene.RegionInfo.RegionSettings.RemoveSpawnPoint(spawnpoint);
m_Scene.RegionInfo.RegionSettings.Save();
}
}
}

View File

@@ -205,6 +205,8 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
client.OnParcelEjectUser += ClientOnParcelEjectUser;
client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
EntityBase presenceEntity;
if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
@@ -506,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Land
public void ClientOnParcelAccessListUpdateRequest(UUID agentID,
uint flags, int landLocalID, UUID transactionID, int sequenceID,
int sections, List<ParcelManager.ParcelAccessEntry> entries,
int sections, List<LandAccessEntry> entries,
IClientAPI remote_client)
{
// Flags is the list to update, it can mean either the ban or
@@ -1750,191 +1752,37 @@ namespace OpenSim.Region.CoreModules.World.Land
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{
ScenePresence targetAvatar = null;
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
ScenePresence parcelManager = null;
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
//Just eject
if (flags == 0)
{
if (targetAvatar.UserLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze))
return;
Vector3 position = new Vector3(0, 0, 0);
List<ILandObject> allParcels = new List<ILandObject>();
allParcels = AllParcels();
if (allParcels.Count != 1)
{
foreach (ILandObject parcel in allParcels)
{
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
{
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
{
for (int x = 1; x <= Constants.RegionSize; x += 2)
{
for (int y = 1; y <= Constants.RegionSize; y += 2)
{
if (parcel.ContainsPoint(x, y))
{
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
targetAvatar.TeleportWithMomentum(position);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
}
}
}
}
}
Vector3 targetVector;
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
{
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
{
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
else
{
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
else
{
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
else
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
}
}
//Eject and ban
if (flags == 1)
{
if (targetAvatar.UserLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze))
return;
// Must have presences
if (!m_scene.TryGetScenePresence(target, out targetAvatar) ||
!m_scene.TryGetScenePresence(client.AgentId, out parcelManager))
return;
Vector3 position = new Vector3(0, 0, 0);
List<ILandObject> allParcels = new List<ILandObject>();
allParcels = AllParcels();
if (allParcels.Count != 1)
{
foreach (ILandObject parcel in allParcels)
{
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
{
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
{
for (int x = 1; x <= Constants.RegionSize; x += 2)
{
for (int y = 1; y <= Constants.RegionSize; y += 2)
{
if (parcel.ContainsPoint(x, y))
{
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
targetAvatar.TeleportWithMomentum(position);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
}
}
}
}
}
Vector3 targetVector;
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
{
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
{
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
else
{
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
else
{
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
else
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
}
// Cannot eject estate managers or gods
if (m_scene.Permissions.IsAdministrator(target))
return;
// Check if you even have permission to do this
ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) &&
!m_scene.Permissions.IsAdministrator(client.AgentId))
return;
Vector3 pos = m_scene.GetNearestAllowedPosition(targetAvatar, land);
targetAvatar.TeleportWithMomentum(pos);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
if ((flags & 1) != 0) // Ban TODO: Remove magic number
{
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Expires = 0; // Perm
land.LandData.ParcelAccessList.Add(entry);
}
}

View File

@@ -190,10 +190,11 @@ namespace OpenSim.Region.CoreModules.World.Land
else
{
// Normal Calculations
int parcelMax = (int)((double)(LandData.Area
* m_scene.RegionInfo.ObjectCapacity)
* m_scene.RegionInfo.RegionSettings.ObjectBonus)
/ 65536;
int parcelMax = (int)((long)LandData.Area
* (long)m_scene.RegionInfo.ObjectCapacity
* (long)m_scene.RegionInfo.RegionSettings.ObjectBonus
/ 65536L);
m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax);
return parcelMax;
}
}
@@ -207,9 +208,9 @@ namespace OpenSim.Region.CoreModules.World.Land
else
{
// Normal Calculations
int parcelMax = LandData.Area
* m_scene.RegionInfo.ObjectCapacity
/ 65536;
int parcelMax = (int)((long)LandData.Area
* (long)m_scene.RegionInfo.ObjectCapacity
/ 65536L);
return parcelMax;
}
}
@@ -223,8 +224,9 @@ namespace OpenSim.Region.CoreModules.World.Land
else
{
//Normal Calculations
int simMax = (int)(((float)LandData.SimwideArea / 65536.0f)
* (float)m_scene.RegionInfo.ObjectCapacity);
int simMax = (int)((long)LandData.SimwideArea
* (long)m_scene.RegionInfo.ObjectCapacity / 65536L);
// m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax);
return simMax;
}
}
@@ -465,21 +467,26 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsBannedFromLand(UUID avatar)
{
ExpireAccessList();
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
return false;
if (avatar == LandData.OwnerID)
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0)
{
if (LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
delegate(LandAccessEntry e)
{
if (e.AgentID == avatar && e.Flags == AccessList.Ban)
return true;
return false;
}) != -1 && LandData.OwnerID != avatar)
}) != -1)
{
return true;
}
@@ -489,21 +496,26 @@ namespace OpenSim.Region.CoreModules.World.Land
public bool IsRestrictedFromLand(UUID avatar)
{
ExpireAccessList();
if (m_scene.Permissions.IsAdministrator(avatar))
return false;
if (m_scene.RegionInfo.EstateSettings.IsEstateManager(avatar))
return false;
if (avatar == LandData.OwnerID)
return false;
if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0)
{
if (LandData.ParcelAccessList.FindIndex(
delegate(ParcelManager.ParcelAccessEntry e)
delegate(LandAccessEntry e)
{
if (e.AgentID == avatar && e.Flags == AccessList.Access)
return true;
return false;
}) == -1 && LandData.OwnerID != avatar)
}) == -1)
{
if (!HasGroupAccess(avatar))
{
@@ -568,19 +580,24 @@ namespace OpenSim.Region.CoreModules.World.Land
#region AccessList Functions
public List<UUID> CreateAccessListArrayByFlag(AccessList flag)
public List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag)
{
List<UUID> list = new List<UUID>();
foreach (ParcelManager.ParcelAccessEntry entry in LandData.ParcelAccessList)
ExpireAccessList();
List<LandAccessEntry> list = new List<LandAccessEntry>();
foreach (LandAccessEntry entry in LandData.ParcelAccessList)
{
if (entry.Flags == flag)
{
list.Add(entry.AgentID);
}
list.Add(entry);
}
if (list.Count == 0)
{
list.Add(UUID.Zero);
LandAccessEntry e = new LandAccessEntry();
e.AgentID = UUID.Zero;
e.Flags = 0;
e.Expires = 0;
list.Add(e);
}
return list;
@@ -592,20 +609,20 @@ namespace OpenSim.Region.CoreModules.World.Land
if (flags == (uint) AccessList.Access || flags == (uint) AccessList.Both)
{
List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Access);
remote_client.SendLandAccessListData(avatars,(uint) AccessList.Access,LandData.LocalID);
List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Access);
remote_client.SendLandAccessListData(accessEntries,(uint) AccessList.Access,LandData.LocalID);
}
if (flags == (uint) AccessList.Ban || flags == (uint) AccessList.Both)
{
List<UUID> avatars = CreateAccessListArrayByFlag(AccessList.Ban);
remote_client.SendLandAccessListData(avatars, (uint)AccessList.Ban, LandData.LocalID);
List<LandAccessEntry> accessEntries = CreateAccessListArrayByFlag(AccessList.Ban);
remote_client.SendLandAccessListData(accessEntries, (uint)AccessList.Ban, LandData.LocalID);
}
}
public void UpdateAccessList(uint flags, UUID transactionID,
int sequenceID, int sections,
List<ParcelManager.ParcelAccessEntry> entries,
List<LandAccessEntry> entries,
IClientAPI remote_client)
{
LandData newData = LandData.Copy();
@@ -615,16 +632,16 @@ namespace OpenSim.Region.CoreModules.World.Land
{
m_listTransactions[flags] = transactionID;
List<ParcelManager.ParcelAccessEntry> toRemove =
new List<ParcelManager.ParcelAccessEntry>();
List<LandAccessEntry> toRemove =
new List<LandAccessEntry>();
foreach (ParcelManager.ParcelAccessEntry entry in newData.ParcelAccessList)
foreach (LandAccessEntry entry in newData.ParcelAccessList)
{
if (entry.Flags == (AccessList)flags)
toRemove.Add(entry);
}
foreach (ParcelManager.ParcelAccessEntry entry in toRemove)
foreach (LandAccessEntry entry in toRemove)
{
newData.ParcelAccessList.Remove(entry);
}
@@ -639,13 +656,13 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
foreach (ParcelManager.ParcelAccessEntry entry in entries)
foreach (LandAccessEntry entry in entries)
{
ParcelManager.ParcelAccessEntry temp =
new ParcelManager.ParcelAccessEntry();
LandAccessEntry temp =
new LandAccessEntry();
temp.AgentID = entry.AgentID;
temp.Time = entry.Time;
temp.Expires = entry.Expires;
temp.Flags = (AccessList)flags;
newData.ParcelAccessList.Add(temp);
@@ -1151,7 +1168,32 @@ namespace OpenSim.Region.CoreModules.World.Land
LandData.MusicURL = url;
SendLandUpdateToAvatarsOverMe();
}
/// <summary>
/// Get the music url for this land parcel
/// </summary>
/// <returns>The music url.</returns>
public string GetMusicUrl()
{
return LandData.MusicURL;
}
#endregion
private void ExpireAccessList()
{
List<LandAccessEntry> delete = new List<LandAccessEntry>();
foreach (LandAccessEntry entry in LandData.ParcelAccessList)
{
if (entry.Expires != 0 && entry.Expires < Util.UnixTimeSinceEpoch())
delete.Add(entry);
}
foreach (LandAccessEntry entry in delete)
LandData.ParcelAccessList.Remove(entry);
if (delete.Count > 0)
m_scene.EventManager.TriggerLandObjectUpdated((uint)LandData.LocalID, this);
}
}
}

View File

@@ -0,0 +1,410 @@
/*
* 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 System.Collections.Generic;
using System.Reflection;
using System.Text;
using log4net;
using Mono.Addins;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Console;
using OpenSim.Framework.Statistics;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.World.Objects.Commands
{
/// <summary>
/// A module that holds commands for manipulating objects in the scene.
/// </summary>
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ObjectCommandsModule")]
public class ObjectCommandsModule : INonSharedRegionModule
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private ICommandConsole m_console;
public string Name { get { return "Object Commands Module"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source)
{
// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: INITIALIZED MODULE");
}
public void PostInitialise()
{
// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: POST INITIALIZED MODULE");
}
public void Close()
{
// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: CLOSED MODULE");
}
public void AddRegion(Scene scene)
{
// m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
m_scene = scene;
m_console = MainConsole.Instance;
m_console.Commands.AddCommand("region", false, "delete object owner",
"delete object owner <UUID>",
"Delete a scene object by owner", HandleDeleteObject);
m_console.Commands.AddCommand("region", false, "delete object creator",
"delete object creator <UUID>",
"Delete a scene object by creator", HandleDeleteObject);
m_console.Commands.AddCommand("region", false, "delete object uuid",
"delete object uuid <UUID>",
"Delete a scene object by uuid", HandleDeleteObject);
m_console.Commands.AddCommand("region", false, "delete object name",
"delete object name <name>",
"Delete a scene object by name", HandleDeleteObject);
m_console.Commands.AddCommand("region", false, "delete object outside",
"delete object outside",
"Delete all scene objects outside region boundaries", HandleDeleteObject);
m_console.Commands.AddCommand(
"region",
false,
"show object uuid",
"show object uuid <UUID>",
"Show details of a scene object with the given UUID", HandleShowObjectByUuid);
m_console.Commands.AddCommand(
"region",
false,
"show object name",
"show object name <name>",
"Show details of scene objects with the given name", HandleShowObjectByName);
m_console.Commands.AddCommand(
"region",
false,
"show part uuid",
"show part uuid <UUID>",
"Show details of a scene object parts with the given UUID", HandleShowPartByUuid);
m_console.Commands.AddCommand(
"region",
false,
"show part name",
"show part name <name>",
"Show details of scene object parts with the given name", HandleShowPartByName);
}
public void RemoveRegion(Scene scene)
{
// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName);
}
public void RegionLoaded(Scene scene)
{
// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
}
private void HandleShowObjectByUuid(string module, string[] cmd)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
if (cmd.Length < 4)
{
m_console.OutputFormat("Usage: show object uuid <uuid>");
return;
}
UUID objectUuid;
if (!UUID.TryParse(cmd[3], out objectUuid))
{
m_console.OutputFormat("{0} is not a valid uuid", cmd[3]);
return;
}
SceneObjectGroup so = m_scene.GetSceneObjectGroup(objectUuid);
if (so == null)
{
// m_console.OutputFormat("No part found with uuid {0}", objectUuid);
return;
}
StringBuilder sb = new StringBuilder();
AddSceneObjectReport(sb, so);
m_console.OutputFormat(sb.ToString());
}
private void HandleShowObjectByName(string module, string[] cmd)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
if (cmd.Length < 4)
{
m_console.OutputFormat("Usage: show object name <name>");
return;
}
string name = cmd[3];
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
m_scene.ForEachSOG(so => { if (so.Name == name) { sceneObjects.Add(so); }});
if (sceneObjects.Count == 0)
{
m_console.OutputFormat("No objects with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
return;
}
StringBuilder sb = new StringBuilder();
foreach (SceneObjectGroup so in sceneObjects)
{
AddSceneObjectReport(sb, so);
sb.Append("\n");
}
m_console.OutputFormat(sb.ToString());
}
private void HandleShowPartByUuid(string module, string[] cmd)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
if (cmd.Length < 4)
{
m_console.OutputFormat("Usage: show part uuid <uuid>");
return;
}
UUID objectUuid;
if (!UUID.TryParse(cmd[3], out objectUuid))
{
m_console.OutputFormat("{0} is not a valid uuid", cmd[3]);
return;
}
SceneObjectPart sop = m_scene.GetSceneObjectPart(objectUuid);
if (sop == null)
{
// m_console.OutputFormat("No part found with uuid {0}", objectUuid);
return;
}
StringBuilder sb = new StringBuilder();
AddScenePartReport(sb, sop);
m_console.OutputFormat(sb.ToString());
}
private void HandleShowPartByName(string module, string[] cmd)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
if (cmd.Length < 4)
{
m_console.OutputFormat("Usage: show part name <name>");
return;
}
string name = cmd[3];
List<SceneObjectPart> parts = new List<SceneObjectPart>();
m_scene.ForEachSOG(so => so.ForEachPart(sop => { if (sop.Name == name) { parts.Add(sop); } }));
if (parts.Count == 0)
{
m_console.OutputFormat("No parts with name {0} found in {1}", name, m_scene.RegionInfo.RegionName);
return;
}
StringBuilder sb = new StringBuilder();
foreach (SceneObjectPart part in parts)
{
AddScenePartReport(sb, part);
sb.Append("\n");
}
m_console.OutputFormat(sb.ToString());
}
private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so)
{
sb.AppendFormat("Name: {0}\n", so.Name);
sb.AppendFormat("Description: {0}\n", so.Description);
sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName);
sb.AppendFormat("Parts: {0}\n", so.PrimCount);
return sb;
}
private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop)
{
sb.AppendFormat("Name: {0}\n", sop.Name);
sb.AppendFormat("Description: {0}\n", sop.Description);
sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName);
sb.AppendFormat("Parent: {0}",
sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID));
sb.AppendFormat("Parts: {0}\n", !sop.IsRoot ? "1" : sop.ParentGroup.PrimCount.ToString());;
return sb;
}
private void HandleDeleteObject(string module, string[] cmd)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
if (cmd.Length < 3)
return;
string mode = cmd[2];
string o = "";
if (mode != "outside")
{
if (cmd.Length < 4)
return;
o = cmd[3];
}
List<SceneObjectGroup> deletes = new List<SceneObjectGroup>();
UUID match;
switch (mode)
{
case "owner":
if (!UUID.TryParse(o, out match))
return;
m_scene.ForEachSOG(delegate (SceneObjectGroup g)
{
if (g.OwnerID == match && !g.IsAttachment)
deletes.Add(g);
});
// if (deletes.Count == 0)
// m_console.OutputFormat("No objects were found with owner {0}", match);
break;
case "creator":
if (!UUID.TryParse(o, out match))
return;
m_scene.ForEachSOG(delegate (SceneObjectGroup g)
{
if (g.RootPart.CreatorID == match && !g.IsAttachment)
deletes.Add(g);
});
// if (deletes.Count == 0)
// m_console.OutputFormat("No objects were found with creator {0}", match);
break;
case "uuid":
if (!UUID.TryParse(o, out match))
return;
m_scene.ForEachSOG(delegate (SceneObjectGroup g)
{
if (g.UUID == match && !g.IsAttachment)
deletes.Add(g);
});
// if (deletes.Count == 0)
// m_console.OutputFormat("No objects were found with uuid {0}", match);
break;
case "name":
m_scene.ForEachSOG(delegate (SceneObjectGroup g)
{
if (g.RootPart.Name == o && !g.IsAttachment)
deletes.Add(g);
});
// if (deletes.Count == 0)
// m_console.OutputFormat("No objects were found with name {0}", o);
break;
case "outside":
m_scene.ForEachSOG(delegate (SceneObjectGroup g)
{
SceneObjectPart rootPart = g.RootPart;
bool delete = false;
if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0)
{
delete = true;
}
else
{
ILandObject parcel
= m_scene.LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y);
if (parcel == null || parcel.LandData.Name == "NO LAND")
delete = true;
}
if (delete && !g.IsAttachment && !deletes.Contains(g))
deletes.Add(g);
});
// if (deletes.Count == 0)
// m_console.OutputFormat("No objects were found outside region bounds");
break;
}
m_console.OutputFormat("Deleting {0} objects in {1}", deletes.Count, m_scene.RegionInfo.RegionName);
foreach (SceneObjectGroup g in deletes)
{
m_console.OutputFormat("Deleting object {0} {1}", g.UUID, g.Name);
m_scene.DeleteSceneObject(g, false);
}
}
}
}

View File

@@ -384,9 +384,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions
if (m_debugPermissions)
m_log.Debug("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
}
// Checks if the given group is active and if the user is a group member
// with the powers requested (powers = 0 for no powers check)
/// <summary>
/// Checks if the given group is active and if the user is a group member
/// with the powers requested (powers = 0 for no powers check)
/// </summary>
/// <param name="groupID"></param>
/// <param name="userID"></param>
/// <param name="powers"></param>
/// <returns></returns>
protected bool IsGroupMember(UUID groupID, UUID userID, ulong powers)
{
if (null == m_groupsModule)

View File

@@ -240,6 +240,9 @@ namespace OpenSim.Region.CoreModules.World.Region
if (m_DialogModule != null && message != String.Empty)
m_DialogModule.SendGeneralAlert(message);
}
if (m_MarkerPath != String.Empty)
File.Delete(Path.Combine(m_MarkerPath,
m_Scene.RegionInfo.RegionID.ToString()));
}
private void HandleRegionRestart(string module, string[] args)

View File

@@ -213,7 +213,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
UUID agentID, Caps caps)
{
//try
//{
//
//m_log.DebugFormat("[MAPLAYER]: path: {0}, param: {1}, agent:{2}",
// path, param, agentID.ToString());
@@ -263,7 +263,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
foreach (GridRegion r in regions)
{
MapBlockData block = new MapBlockData();
MapBlockFromGridRegion(block, r);
MapBlockFromGridRegion(block, r, 0);
mapBlocks.Add(block);
}
avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
@@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
/// <returns></returns>
public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq)
{
m_log.DebugFormat("[WORLD MAP]: MapLayer Request in region: {0}", m_scene.RegionInfo.RegionName);
// m_log.DebugFormat("[WORLD MAP]: MapLayer Request in region: {0}", m_scene.RegionInfo.RegionName);
LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
return mapResponse;
@@ -373,7 +373,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
public virtual void HandleMapItemRequest(IClientAPI remoteClient, uint flags,
uint EstateID, bool godlike, uint itemtype, ulong regionhandle)
{
// m_log.DebugFormat("[WORLD MAP]: Handle MapItem request {0} {1}", regionhandle, itemtype);
// m_log.DebugFormat("[WORLD MAP]: Handle MapItem request {0} {1}", regionhandle, itemtype);
lock (m_rootAgents)
{
@@ -429,7 +429,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
// ensures that the blockingqueue doesn't get borked if the GetAgents() timing changes.
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
}
} else if (itemtype == 7) // Service 7 (MAP_ITEM_LAND_FOR_SALE)
}
else if (itemtype == 7) // Service 7 (MAP_ITEM_LAND_FOR_SALE)
{
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
{
@@ -463,7 +464,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
mapitem.x = (uint)(xstart + x);
mapitem.y = (uint)(ystart + y);
// mapitem.z = (uint)m_scene.GetGroundHeight(x,y);
mapitem.id = UUID.Zero;
mapitem.id = parcel.GlobalID;
mapitem.name = parcel.Name;
mapitem.Extra = parcel.Area;
mapitem.Extra2 = parcel.SalePrice;
@@ -481,6 +482,34 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
}
}
else if (itemtype == 1) // Service 1 (MAP_ITEM_TELEHUB)
{
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
{
List<mapItemReply> mapitems = new List<mapItemReply>();
mapItemReply mapitem = new mapItemReply();
SceneObjectGroup sog = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
if (sog != null)
{
mapitem = new mapItemReply();
mapitem.x = (uint)(xstart + sog.AbsolutePosition.X);
mapitem.y = (uint)(ystart + sog.AbsolutePosition.Y);
mapitem.id = UUID.Zero;
mapitem.name = sog.Name;
mapitem.Extra = 0; // color (not used)
mapitem.Extra2 = 0; // 0 = telehub / 1 = infohub
mapitems.Add(mapitem);
remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags);
}
}
else
{
// Remote Map Item Request
RequestMapItems("",remoteClient.AgentId,flags,EstateID,godlike,itemtype,regionhandle);
}
}
}
private int nAsyncRequests = 0;
@@ -620,6 +649,28 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
av.ControllingClient.SendMapItemReply(returnitems.ToArray(), itemtype, mrs.flags);
}
// Service 1 (MAP_ITEM_TELEHUB)
itemtype = 1;
if (response.ContainsKey(itemtype.ToString()))
{
List<mapItemReply> returnitems = new List<mapItemReply>();
OSDArray itemarray = (OSDArray)response[itemtype.ToString()];
for (int i = 0; i < itemarray.Count; i++)
{
OSDMap mapitem = (OSDMap)itemarray[i];
mapItemReply mi = new mapItemReply();
mi.x = (uint)mapitem["X"].AsInteger();
mi.y = (uint)mapitem["Y"].AsInteger();
mi.id = mapitem["ID"].AsUUID();
mi.Extra = mapitem["Extra"].AsInteger();
mi.Extra2 = mapitem["Extra2"].AsInteger();
mi.name = mapitem["Name"].AsString();
returnitems.Add(mi);
}
av.ControllingClient.SendMapItemReply(returnitems.ToArray(), itemtype, mrs.flags);
}
}
}
}
@@ -904,8 +955,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
List<MapBlockData> response = new List<MapBlockData>();
// this should return one mapblock at most.
// (diva note: why?? in that case we should GetRegionByPosition)
// this should return one mapblock at most. It is triggered by a click
// on an unloaded square.
// But make sure: Look whether the one we requested is in there
List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
minX * (int)Constants.RegionSize,
@@ -922,7 +973,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
// found it => add it to response
MapBlockData block = new MapBlockData();
MapBlockFromGridRegion(block, r);
MapBlockFromGridRegion(block, r, flag);
response.Add(block);
break;
}
@@ -938,10 +989,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
block.Access = 254; // means 'simulator is offline'
response.Add(block);
}
if ((flag & 2) == 2) // V2 !!!
remoteClient.SendMapBlock(response, 2);
else
remoteClient.SendMapBlock(response, 0);
// The lower 16 bits are an unsigned int16
remoteClient.SendMapBlock(response, flag & 0xffff);
}
else
{
@@ -961,21 +1010,29 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
foreach (GridRegion r in regions)
{
MapBlockData block = new MapBlockData();
MapBlockFromGridRegion(block, r);
MapBlockFromGridRegion(block, r, flag);
mapBlocks.Add(block);
}
if ((flag & 2) == 2) // V2 !!!
remoteClient.SendMapBlock(mapBlocks, 2);
else
remoteClient.SendMapBlock(mapBlocks, 0);
remoteClient.SendMapBlock(mapBlocks, flag & 0xffff);
return mapBlocks;
}
protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r)
protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag)
{
block.Access = r.Access;
block.MapImageId = r.TerrainImage;
switch (flag & 0xffff)
{
case 0:
block.MapImageId = r.TerrainImage;
break;
case 2:
block.MapImageId = r.ParcelImage;
break;
default:
block.MapImageId = UUID.Zero;
break;
}
block.Name = r.RegionName;
block.X = (ushort)(r.RegionLocX / Constants.RegionSize);
block.Y = (ushort)(r.RegionLocY / Constants.RegionSize);
@@ -1109,7 +1166,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
foreach (GridRegion r in regions)
{
MapBlockData mapBlock = new MapBlockData();
MapBlockFromGridRegion(mapBlock, r);
MapBlockFromGridRegion(mapBlock, r, 0);
AssetBase texAsset = m_scene.AssetService.Get(mapBlock.MapImageId.ToString());
if (texAsset != null)
@@ -1240,7 +1297,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
responsemapdata["X"] = OSD.FromInteger((int)(xstart + x));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + y));
// responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y));
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
responsemapdata["ID"] = OSD.FromUUID(parcel.GlobalID);
responsemapdata["Name"] = OSD.FromString(parcel.Name);
responsemapdata["Extra"] = OSD.FromInteger(parcel.Area);
responsemapdata["Extra2"] = OSD.FromInteger(parcel.SalePrice);
@@ -1250,6 +1307,26 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
responsemap["7"] = responsearr;
}
if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero)
{
SceneObjectGroup sog = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
if (sog != null)
{
OSDArray responsearr = new OSDArray();
OSDMap responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sog.AbsolutePosition.X));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sog.AbsolutePosition.Y));
// responsemapdata["Z"] = OSD.FromInteger((int)m_scene.GetGroundHeight(x,y));
responsemapdata["ID"] = OSD.FromUUID(sog.UUID);
responsemapdata["Name"] = OSD.FromString(sog.Name);
responsemapdata["Extra"] = OSD.FromInteger(0); // color (unused)
responsemapdata["Extra2"] = OSD.FromInteger(0); // 0 = telehub / 1 = infohub
responsearr.Add(responsemapdata);
responsemap["1"] = responsearr;
}
}
return responsemap;
}
@@ -1268,9 +1345,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (data == null)
return;
byte[] overlay = GenerateOverlay();
m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE");
UUID terrainImageID = UUID.Random();
UUID parcelImageID = UUID.Zero;
AssetBase asset = new AssetBase(
terrainImageID,
@@ -1286,14 +1366,35 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID);
m_scene.AssetService.Store(asset);
if (overlay != null)
{
parcelImageID = UUID.Random();
AssetBase parcels = new AssetBase(
parcelImageID,
"parcelImage_" + m_scene.RegionInfo.RegionID.ToString(),
(sbyte)AssetType.Texture,
m_scene.RegionInfo.RegionID.ToString());
parcels.Data = overlay;
parcels.Description = m_scene.RegionInfo.RegionName;
parcels.Temporary = false;
parcels.Flags = AssetFlags.Maptile;
m_scene.AssetService.Store(parcels);
}
// Switch to the new one
UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
UUID lastTerrainImageID = m_scene.RegionInfo.RegionSettings.TerrainImageID;
UUID lastParcelImageID = m_scene.RegionInfo.RegionSettings.ParcelImageID;
m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID;
m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID;
m_scene.RegionInfo.RegionSettings.Save();
// Delete the old one
m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastMapRegionUUID);
m_scene.AssetService.Delete(lastMapRegionUUID.ToString());
// m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID);
m_scene.AssetService.Delete(lastTerrainImageID.ToString());
if (lastParcelImageID != UUID.Zero)
m_scene.AssetService.Delete(lastParcelImageID.ToString());
}
private void MakeRootAgent(ScenePresence avatar)
@@ -1339,6 +1440,92 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
}
private Byte[] GenerateOverlay()
{
Bitmap overlay = new Bitmap(256, 256);
bool[,] saleBitmap = new bool[64, 64];
for (int x = 0 ; x < 64 ; x++)
{
for (int y = 0 ; y < 64 ; y++)
saleBitmap[x, y] = false;
}
bool landForSale = false;
List<ILandObject> parcels = m_scene.LandChannel.AllParcels();
Color background = Color.FromArgb(0, 0, 0, 0);
SolidBrush transparent = new SolidBrush(background);
Graphics g = Graphics.FromImage(overlay);
g.FillRectangle(transparent, 0, 0, 255, 255);
SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9));
Pen grey = new Pen(Color.FromArgb(255, 92, 92, 92));
foreach (ILandObject land in parcels)
{
// m_log.DebugFormat("[WORLD MAP]: Parcel {0} flags {1}", land.LandData.Name, land.LandData.Flags);
if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0)
{
landForSale = true;
bool[,] landBitmap = land.GetLandBitmap();
for (int x = 0 ; x < 64 ; x++)
{
for (int y = 0 ; y < 64 ; y++)
{
if (landBitmap[x, y])
{
g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
if (x > 0)
{
if ((saleBitmap[x - 1, y] || landBitmap[x - 1, y]) == false)
g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4, 255 - (y * 4));
}
if (y > 0)
{
if ((saleBitmap[x, y-1] || landBitmap[x, y-1]) == false)
g.DrawLine(grey, x * 4, 255 - (y * 4), x * 4 + 3, 255 - (y * 4));
}
if (x < 63)
{
if ((saleBitmap[x + 1, y] || landBitmap[x + 1, y]) == false)
g.DrawLine(grey, x * 4 + 3, 252 - (y * 4), x * 4 + 3, 255 - (y * 4));
}
if (y < 63)
{
if ((saleBitmap[x, y + 1] || landBitmap[x, y + 1]) == false)
g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4 + 3, 252 - (y * 4));
}
}
}
}
saleBitmap = land.MergeLandBitmaps(saleBitmap, landBitmap);
}
}
if (!landForSale)
{
m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not geenrating overlay", m_scene.RegionInfo.RegionName);
return null;
}
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName);
try
{
return OpenJPEG.EncodeFromImage(overlay, true);
}
catch (Exception e)
{
m_log.DebugFormat("[WORLD MAP]: Error creating parcel overlay: " + e.ToString());
}
return null;
}
}
public struct MapRequestState

View File

@@ -67,7 +67,7 @@ namespace OpenSim.Region.DataSnapshot
public void OnRegisterCaps(UUID agentID, Caps caps)
{
m_log.Info("[DATASNAPSHOT]: Registering service discovery capability for " + agentID);
// m_log.InfoFormat("[DATASNAPSHOT]: Registering service discovery capability for {0}", agentID);
string capsBase = "/CAPS/" + caps.CapsObjectPath;
caps.RegisterHandler("PublicSnapshotDataInfo",
new RestStreamHandler("POST", capsBase + m_discoveryPath, OnDiscoveryAttempt));

View File

@@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// Save the attachments that have change on this presence.
/// </summary>
/// <param name="sp"></param>
void SaveChangedAttachments(IScenePresence sp);
void SaveChangedAttachments(IScenePresence sp, bool saveAllScripted);
/// <summary>
/// Delete all the presence's attachments from the scene

View File

@@ -31,9 +31,10 @@ using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
{
public delegate void ReportOutputAction(string format, params object[] args);
public interface IAvatarFactoryModule
{
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
/// <summary>
@@ -60,8 +61,41 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns>true if a valid agent was found, false otherwise</returns>
bool SaveBakedTextures(UUID agentId);
/// <summary>
/// Validate that OpenSim can find the baked textures need to display a given avatar
/// </summary>
/// <param name="client"></param>
/// <param name="checkonly"></param>
/// <returns>
/// true if all the baked textures referenced by the texture IDs exist or the appearance is only using default textures. false otherwise.
/// </returns>
bool ValidateBakedTextureCache(IScenePresence sp);
/// <summary>
/// Request a rebake of textures for an avatar.
/// </summary>
/// <remarks>
/// This will send the request to the viewer, since it's there that the rebake is done.
/// </remarks>
/// <param name="sp">Avatar to rebake.</param>
/// <param name="missingTexturesOnly">
/// If true, only request a rebake for the textures that are missing.
/// If false then we request a rebake of all textures for which we already have references.
/// </param>
/// <returns>
/// Number of rebake requests made. This will depend upon whether we've previously received texture IDs.
/// </returns>
int RequestRebake(IScenePresence sp, bool missingTexturesOnly);
void QueueAppearanceSend(UUID agentid);
void QueueAppearanceSave(UUID agentid);
/// <summary>
/// Get a report about the current state of a scene presence's baked appearance textures.
/// </summary>
/// <param name="sp"></param>
/// <param name="reportOutputAction"></param>
/// <returns></returns>
void WriteBakedTexturesReport(IScenePresence sp, ReportOutputAction reportOutputAction);
}
}

View File

@@ -35,6 +35,23 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IJ2KDecoder
{
void BeginDecode(UUID assetID, byte[] j2kData, DecodedCallback callback);
void Decode(UUID assetID, byte[] j2kData);
/// <summary>
/// Provides a synchronous decode so that caller can be assured that this executes before the next line
/// </summary>
/// <param name="assetID"></param>
/// <param name="j2kData"></param>
/// <returns>true if decode was successful. false otherwise.</returns>
bool Decode(UUID assetID, byte[] j2kData);
/// <summary>
/// Provides a synchronous decode so that caller can be assured that this executes before the next line
/// </summary>
/// <param name="assetID"></param>
/// <param name="j2kData"></param>
/// <param name="layers">layer data</param>
/// <param name="components">number of components</param>
/// <returns>true if decode was successful. false otherwise.</returns>
bool Decode(UUID assetID, byte[] j2kData, out OpenJPEG.J2KLayerInfo[] layers, out int components);
}
}

Some files were not shown because too many files have changed in this diff Show More