Compare commits

..

223 Commits

Author SHA1 Message Date
Melanie
d1870d0c47 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2011-05-24 04:03:36 +01:00
Melanie
3612ce4888 Merge branch 'master' into careminster-presence-refactor 2011-05-24 04:03:08 +01:00
Melanie
61d4291da5 Create a method to force the script engine to save state from outside 2011-05-24 03:17:12 +01:00
Melanie
4b088dca69 Merge branch 'master' into careminster-presence-refactor 2011-05-24 03:11:51 +01:00
Melanie
62e0c96036 Allow disabling the legacy backup mechanism to avoid the object clone if
backup is not used.
2011-05-24 03:37:25 +02:00
Melanie
d5841e07c2 Create a method to force the script engine to save state from outside 2011-05-24 02:40:59 +02:00
Melanie
178d541dca Add an event for an orderly region shutdown that fires once per region before
the SceneGraph is torn down.
2011-05-24 01:19:48 +01:00
Melanie
8b42f824d3 Add an event for an orderly region shutdown that fires once per region before
the SceneGraph is torn down.
2011-05-24 00:53:28 +02:00
Melanie
b9fb7cdf9f Merge branch 'master' into careminster-presence-refactor 2011-05-23 03:39:20 +01:00
Melanie
24c00acedc Fix Mantis #4429: Allow llGiveInventory to work across sim borders. 2011-05-23 02:52:28 +01:00
Melanie
9c1f799582 Implement llGodLikeRezObject and llGetUsedMemory 2011-05-22 21:01:31 +02:00
BlueWall
dc95e38e42 Add stubs for unimplemented lsl functions 2011-05-22 14:59:18 -04:00
Melanie
89705b19c7 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2011-05-22 20:00:59 +02:00
Melanie
be1996f121 Merge branch 'master' into careminster-presence-refactor 2011-05-22 20:23:25 +01:00
Justin Clark-Casey (justincc)
bb9b317f15 Get rid of OpenSim.Tests.Common.Setup subpackage in favour of just OpenSim.Tests.Common instead 2011-05-21 01:05:20 +01:00
Justin Clark-Casey (justincc)
4073f10133 rename test helpers enclosing package from Setup to Helpers 2011-05-21 00:51:34 +01:00
Justin Clark-Casey (justincc)
94553d4753 rename UserInventoryTestsUtils -> UserInventoryHelpers for consistency 2011-05-21 00:48:01 +01:00
Justin Clark-Casey (justincc)
156cc1418b test helper rename for consistency 2011-05-21 00:44:58 +01:00
Justin Clark-Casey (justincc)
d7e5b76d73 refactor: rename AddSceneObjectItem to AddSceneObject 2011-05-21 00:39:42 +01:00
Justin Clark-Casey (justincc)
084059319c refactor: move scene object item creation code into TaskInventoryHelpers 2011-05-21 00:37:20 +01:00
Justin Clark-Casey (justincc)
9103fe84d5 move test task inventory notecard item creation into a new TastInventoryHelpers class 2011-05-21 00:25:58 +01:00
Justin Clark-Casey (justincc)
0050bb438c refactor: use SceneSetupHelpers.CreateSceneObject() 2011-05-21 00:15:22 +01:00
Justin Clark-Casey (justincc)
534ee52a12 rename UserProfileTestUtils to UserAccountHelpers to be consistent with other test helper names 2011-05-21 00:11:52 +01:00
Justin Clark-Casey (justincc)
3fed61a5d5 refactor: in TaskInventoryTests, use UserProfileTestUtils.CreateUserWithInvetory() 2011-05-21 00:07:24 +01:00
Justin Clark-Casey (justincc)
bc43cef581 minor: remove mono compiler warning 2011-05-21 00:05:00 +01:00
Justin Clark-Casey (justincc)
90567a9eaa refactor Scene.RezObject() to use AddNewSceneObject() rather than copy/pasting code with small differences 2011-05-21 00:02:53 +01:00
Justin Clark-Casey (justincc)
f2095ea279 refactor TestRezObjectFromInventoryItem() 2011-05-20 23:45:39 +01:00
Justin Clark-Casey (justincc)
4b0fc4faef implement Scene.GetSceneObjectGroup(string name) to match the equivalent GetSOP method 2011-05-20 23:41:14 +01:00
Justin Clark-Casey (justincc)
91a9f30b16 implement Scene.GetSceneObjectGroup(UUID fullID) using existing index 2011-05-20 23:34:34 +01:00
Justin Clark-Casey (justincc)
7ed419217f add test for rezzing an object from a prim item 2011-05-20 23:22:27 +01:00
Melanie
e62d1cc480 Merge branch 'master' into careminster-presence-refactor 2011-05-20 22:38:05 +01:00
Melanie
fdbcd2fbf9 Add a missing virtual keyword 2011-05-20 23:27:16 +02:00
Melanie
8a46484a59 Make public interface methods in MySQLSimulation data virtual so the CM
data layer can inherit from it
2011-05-20 23:17:46 +02:00
Justin Clark-Casey (justincc)
9fc29e1595 Implement llGetLinKNumberOfSides().
Based on code in http://opensimulator.org/mantis/view.php?id=5489  Thanks onesong.
2011-05-20 20:19:32 +01:00
Justin Clark-Casey (justincc)
6e7b588235 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-20 20:06:51 +01:00
Kim King
a2c19847b4 ScriptEngine/Shared: Fix bug 5473 (v2). 2011-05-20 20:00:55 +01:00
BlueWall
584bce36ac Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-19 01:35:11 -04:00
BlueWall
926a100652 Add stub for llGetLinkNumberOfSides(integer link) 2011-05-19 01:34:11 -04:00
Justin Clark-Casey (justincc)
bdd7849094 Allow item links to be deleted even when other deletes and purges are disabled.
If these links are not deleted, then they will build up in the player's inventory until they can no longer log in.
Accidental deletion of links due to bugs or other causes is potentially inconvenient but on a par with items being
accidentally moved.  When a link is deleted, the target of the link is never touched.
This is a general solution that accounts for the use of links anywhere in the user's inventory.
2011-05-19 00:51:14 +01:00
Tom
74dd619575 If a response cannot be obtained (the script has no handler) return a more friendly 500 error instead of crashing out with a null reference and letting the connection hang 2011-05-17 19:12:37 -07:00
Tom
1f17960e67 Also fix the locking of url.requests and tidy the locks in general 2011-05-17 18:56:55 -07:00
Tom
3d49f5bf57 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2011-05-17 18:44:54 -07:00
Tom
e847d1d83f Lock m_requestMap properly to prevent some nasty access errors and the resulting downward spiral 2011-05-17 18:44:07 -07:00
Justin Clark-Casey (justincc)
6dcc87b1ad Accidentally committed too early
Revert "Allow item links to be deleted even when other deletes and purges are disabled."

This reverts commit 491279f99a.
2011-05-18 00:23:35 +01:00
Justin Clark-Casey (justincc)
c562b9ef19 correct small mistake in "delete object name <name>" usage summary 2011-05-18 00:22:09 +01:00
Justin Clark-Casey (justincc)
491279f99a Allow item links to be deleted even when other deletes and purges are disabled.
If these links are not deleted, then they will build up in the player's inventory until they can no longer log in.
Accidental deletion of links due to bugs or other causes is potentially inconvenient but on a par with items being
accidentally moved.  When a link is deleted, the target of the link is never touched.
This is a general solution that accounts for the use of links anywhere in the user's inventory.
2011-05-17 22:31:16 +01:00
Melanie
f9203ca7e0 Add a message packing library to binary-pack AgentCircuitData for faster
teleporting
2011-05-17 22:38:45 +02:00
Justin Clark-Casey (justincc)
784f70f704 don't throw a null reference if an inventory link target doesn't exist when we're inspecting in order to send the required inventory folders 2011-05-17 02:25:05 +01:00
Justin Clark-Casey (justincc)
467d7060ca Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-17 01:58:51 +01:00
Justin Clark-Casey (justincc)
4232b1a89b convert tabs to spaces 2011-05-17 01:57:18 +01:00
Kim King
901448a8eb Fixup documentation for AutoBackupModule. 2011-05-17 01:55:54 +01:00
Melanie
6bac16fd88 Fix up handling of the estate dialog to prevent duplication of ban list names.
Allow more than 61 names in ban list without crashing the viewer.
2011-05-15 14:55:36 +02:00
Diva Canto
a2f034c554 Changed yet more Warns to Debugs. 2011-05-14 13:36:55 -07:00
Diva Canto
be6feff331 Also changed a couple of messages in WebUtil from Wanr/Info to Debug. 2011-05-14 13:09:59 -07:00
Melanie
37a7b87862 Merge branch 'master' into careminster-presence-refactor 2011-05-14 21:09:52 +01:00
Diva Canto
082a9ecd31 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-14 12:57:34 -07:00
Diva Canto
a3aa839d75 Stop spamming Nebadon's console when assets aren't found in the asset server. 2011-05-14 12:56:50 -07:00
Melanie
344815ab79 Globally throttle script channel 0 comms to 5/s with 10s burst to prevent lag
griefing attacks
2011-05-14 17:24:59 +02:00
Melanie
d773d89145 Plug a hole that allows selling a copy of no copy objects when using hacked god mode to fool the viewer into thinking it can set that sale type 2011-05-14 17:24:22 +02:00
Melanie
c4fad3d887 Fix up a linking issue 2011-05-14 09:13:31 +02:00
Justin Clark-Casey (justincc)
e3b8d42bbc refactor: improve PrimLimitsModule to call ILandObject.GetSimulatorMaxPrimCount() rather than use copy/pasted code 2011-05-14 02:51:29 +01:00
Justin Clark-Casey (justincc)
340e3ccf16 refactor: remove thisObject argument from ILandObject.Get*MaxPrimCount() instance methods since it didn't make sense to use anything other than the instance themselves. 2011-05-14 02:42:47 +01:00
Justin Clark-Casey (justincc)
bef1ffa7db simplify code in llGetParcelMaxPrims() to use existing code in LandObject rather than duping the algo 2011-05-14 02:34:46 +01:00
Justin Clark-Casey (justincc)
1d86079141 Correct llGetParcelMaxPrims() to use the same calculation as used elsewhere instead of the old 0.22 prims/meter squared fudge factor.
Thanks to tglion for this.
2011-05-14 01:26:04 +01:00
Justin Clark-Casey (justincc)
26ce1d27d0 Minor doc change to see if this provokes a good panda build 2011-05-14 01:07:06 +01:00
Oren Hurvitz
64d868fb64 When loading an OAR that doesn't have parcels, create a default parcel 2011-05-14 00:41:32 +01:00
SignpostMarv Martin
cb6cd3714e The get_grid_info REST call now encodes XML Entities 2011-05-14 00:31:54 +01:00
Makopoppo
7a54638b57 Swapped the two restart command descriptions each other 2011-05-14 00:25:31 +01:00
Justin Clark-Casey (justincc)
5573fcfa93 Fix adding/removing/replacing outfits in viewer 2
To get this to work, I had to disable the dupe link check I put in a couple of commits ago.
When the viewer adds wearables to an existing outfit, it first requests deletes of all the existing links before creating a new set.
Since these messages are async, the creates were being received before the deletes had a chance to complete, resulting in missing current outfit links.
However, the dupe check shouldn't be as important now that broken links have been fixed - it was the broken links that were causing the client to create dupes.
Tested on kokua 0.1.0 WIP and SL 2.6.3.  I now have no problems managing outfits on my standalone.
2011-05-14 00:10:27 +01:00
Melanie
75d4956ee5 Merge branch 'master' into careminster-presence-refactor 2011-05-13 12:05:46 +01:00
Melanie
59d8588ae1 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2011-05-13 12:03:16 +01:00
Melanie
eceedba23b Fix the cert validation handler so that it will not block other parts of
the server doing ssl successfully.
2011-05-13 12:02:49 +01:00
Diva Canto
e39dec6f37 Hopefully this fixes offline messages. The problem was: the server is not setting the ContentLength of the response. That comes up to OpenSim as ContentLength=-1, which made the existing test fail. 2011-05-12 20:48:24 -07:00
Diva Canto
1cc70df3b4 One more thing printed out. #OfflineIM 2011-05-12 20:20:08 -07:00
Diva Canto
84f2a779b2 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-12 19:57:15 -07:00
Diva Canto
301321c853 Instrument the heck out of offline messages. THIS IS VERY VERBOSE. 2011-05-12 19:56:59 -07:00
Justin Clark-Casey (justincc)
5f9edd195c Fix broken inventory links on viewer 2.
It appears that if the viewer requests a folder containing links, we must also send the folders that contain the link targets first.
This was tested with Kokua 0.1.0 WIP though I predict it will also work with other viewer 2s
2011-05-13 03:24:19 +01:00
Diva Canto
691283c44e One more debug message for offline IMs. 2011-05-12 19:10:44 -07:00
Diva Canto
9e310a0c0f Sequencing the using and try clauses as they were before, but this shows that that obsolete function is not catching 404's as it should... 2011-05-12 18:53:22 -07:00
Diva Canto
42bfab84b8 Bummer, can't print the data I wanted to see. Printing just the context. 2011-05-12 18:47:14 -07:00
Diva Canto
f54a36bd59 Tracking a problem with offline IMs coming in as null list. 2011-05-12 17:34:26 -07:00
Diva Canto
e9e4c009b4 This makes compression of fatpacks actually work. Previously they always failed. See comment in WebUtil. 2011-05-11 20:44:03 -07:00
Justin Clark-Casey (justincc)
9988bff9e3 Add a smidgen of method doc about the fact that item links reuse the asset id item slot 2011-05-12 03:18:53 +01:00
Justin Clark-Casey (justincc)
ac12ace6f1 Prevent viewer 2 from creating a duplicate outfit inventory links.
I believe this is safe since there is a 1-1 correspondence between link item and worn item (i.e. you can't be wearing the same item at two spots simultaneously in one outfit).
This should stop lots of duplicate links being created when viewer 2 is used.
However, this doesn't prevent broken inventory links, which I believe is timing related since the effect is not consistent (e.g. keep relogging and the viewer should end up seeing them correctly) .  I think we actually see this problem on viewer 1 as well.
It might be easier just to implement the Fetch*2 inventory caps which are documented at http://wiki.secondlife.com/wiki/Inventory_API.  WebFetch* has been deprecated by Linden Lab since viewer 2.5.1 and according to the sl wiki, "has numerous bugs".
2011-05-12 02:46:13 +01:00
Diva Canto
7fa2489a6e Revert "Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs."
This reverts commit 5548f83750.
2011-05-11 13:15:27 -07:00
Diva Canto
af2e12d2b4 One more debug message. Don't use this unless your name is nebadon. 2011-05-11 10:43:50 -07:00
Diva Canto
5548f83750 Functional improvement: close the stream. Non-functional: add debug messages to find out why updates are getting an error. WARNING: MASSIVE CONSOLE SPAM ON TPs. 2011-05-11 10:21:42 -07:00
Diva Canto
47735468d2 Somewhat reverting the last commit. The viewer ignores 255's on tiles that were previously on, so we need to send 254 (offline) explicitly. Also removing the +/-4 for HGMap, because it makes the map flicker. 2011-05-10 09:02:25 -07:00
Diva Canto
e1a4a8d857 Changed the Access flag on HGMap to 255 (does not exist) and clarified the other value 254 too. Meanings taken from libomv. 2011-05-09 18:28:16 -07:00
Diva Canto
7e2b35bbb3 Fixes gray tiles around +/-4 when user clicks on an empty tile. Affects regions above 4096 primarily. 2011-05-09 11:35:41 -07:00
Melanie
1bd949614a Merge branch 'master' into careminster-presence-refactor 2011-05-09 18:37:35 +01:00
Diva Canto
8a5f6dc7a5 Fixes gray tiles on map search for viewers 1. 2011-05-09 10:25:42 -07:00
Diva Canto
c0a69bfaab The map is seriously broken. This doesn't fix it, but at least provides one more piece of data that seems to be required -- agent flags, which seem to be different in Viewer 2. WARNING: changes IClientAPI. 2011-05-08 22:50:04 -07:00
Melanie
fbfed0ae9b Merge branch 'master' into careminster-presence-refactor 2011-05-09 03:21:15 +01:00
Melanie
fd66903f74 Convert the prim count module into a permissionsmodule 2011-05-09 03:16:01 +01:00
E. Allen Soard
527b4e7c7e Incremental - Just did some cleanup of comments and class name change to clean up from using BareBonesNonShared as a template. 2011-05-09 03:14:54 +01:00
E. Allen Soard
279ed08de1 Incremental patch to add config options to enable/disable the prim limits module to OpenSim.ini. EnforcePrimLimits is set to false by default to emulate the current behavior. 2011-05-09 03:14:48 +01:00
E. Allen Soard
65d595597d Adds an optional module to enforce prim limits on a given parcel Takes into account acculmitive prim allowance when multiple parcels are owned by the same avatar on the same region. Does not handle prims that are moved by a script or account for temporary objects at the time of creation. other wise handles all tested cases including: Creating a new object from the build menu Moving an object from another parcel duplicating an object via shift move rezing an object from a script 2011-05-09 03:14:41 +01:00
Melanie
9daad86717 Convert the prim count module into a permissionsmodule 2011-05-09 02:47:40 +02:00
E. Allen Soard
f644c0346b Incremental - Just did some cleanup of comments and class name change to clean up from using BareBonesNonShared as a template. 2011-05-09 02:35:57 +02:00
E. Allen Soard
939026d874 Incremental patch to add config options to enable/disable the prim limits module to OpenSim.ini. EnforcePrimLimits is set to false by default to emulate the current behavior. 2011-05-09 02:35:32 +02:00
E. Allen Soard
d3c3feb6b1 Adds an optional module to enforce prim limits on a given parcel Takes into account acculmitive prim allowance when multiple parcels are owned by the same avatar on the same region. Does not handle prims that are moved by a script or account for temporary objects at the time of creation. other wise handles all tested cases including: Creating a new object from the build menu Moving an object from another parcel duplicating an object via shift move rezing an object from a script 2011-05-09 02:35:04 +02:00
Melanie
2b88d8f93f Add commands to delete objects by name, UUID, creator or owner 2011-05-09 01:28:23 +01:00
Diva Canto
00f10c900a Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-08 16:51:41 -07:00
Diva Canto
3a5e841b0b Fix content-type to be application/x-www-form-urlencoded 2011-05-08 16:51:04 -07:00
Diva Canto
a650c74d23 Comment verbose debug message in GetTexture 2011-05-08 16:50:36 -07:00
Melanie
c164be1ee5 Fix bans so the region owner and estate managers can't be banned by renters 2011-05-09 01:12:21 +02:00
Melanie
d511c1e355 Merge branch 'master' into careminster-presence-refactor 2011-05-09 01:28:53 +01:00
Melanie
73a9ebc21e Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2011-05-09 01:00:35 +02:00
Melanie
66a5906548 Merge branch 'master' into careminster-presence-refactor 2011-05-09 01:04:55 +01:00
Melanie
dbf623a3d2 Add commands to delete objects by name, UUID, creator or owner 2011-05-09 00:59:32 +02:00
Melanie
7cc5286f2d Merge branch 'master' into careminster-presence-refactor 2011-05-08 23:53:07 +01:00
Melanie
c8b9558039 Also compress the actual fatpacks 2011-05-08 23:52:31 +01:00
Melanie
ade09d0fa1 Also compress the actual fatpacks 2011-05-08 23:23:33 +02:00
Melanie
784e8afaa8 Merge branch 'master' into careminster-presence-refactor 2011-05-08 22:06:14 +01:00
Melanie
e345f03895 Remove a spammy debug I left in. Disable TP cancel button at the point
of no return.
2011-05-08 22:05:33 +01:00
Melanie
1fbf4c8300 Remove a spammy debug I left in. Disable TP cancel button at the point
of no return.
2011-05-08 21:36:51 +02:00
Melanie
b451cc1ebb Merge branch 'master' into careminster-presence-refactor 2011-05-08 20:23:06 +01:00
Melanie
1be67914fa Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2011-05-08 20:20:40 +01:00
Melanie
9688db2f68 Enable compressed (gzip) fatpack transfers. 2011-05-08 20:20:00 +01:00
Melanie
763666e2d6 Enable compressed (gzip) fatpack transfers. 2011-05-08 19:50:35 +02:00
Diva Canto
25809caaeb Mantis #5472 2011-05-08 09:28:15 -07:00
BlueWall
d40e4562f2 Add missing configs for ssl in Robust.HG.ini 2011-05-07 18:54:21 -04:00
Diva Canto
72fb0d5b93 Mantis #5470 -- add forgotten MSSQL's GridUserStore. Thank you MrMonkE 2011-05-07 14:56:59 -07:00
Justin Clark-Casey (justincc)
d4fcba08af Add module with "appearance show" command.
At the moment, this command just asks the AvatarFactory to perform the existing baked texture check for each avatar in the simulator and returns "OK" or "corrupt".
This is for debugging purposes
2011-05-07 01:06:55 +01:00
Diva Canto
737add1683 Removed SimpleRegionInfo, which was obsolete and not used anywhere. 2011-05-06 17:02:46 -07:00
dahlia
eaa33cf478 adjust avatar terse update packet filter distance error threshold based on avatar speed 2011-05-06 16:56:54 -07:00
Justin Clark-Casey (justincc)
b140aef87a refactor: simplify ConfigSettings 2011-05-06 22:51:36 +01:00
Justin Clark-Casey (justincc)
04ecd748d9 remove further mono compiler warnings 2011-05-06 22:47:41 +01:00
Justin Clark-Casey (justincc)
3d095e84d6 minor: remove mono compiler warnings 2011-05-06 22:45:03 +01:00
Justin Clark-Casey (justincc)
f5ec332474 remove obsolete [StandAlone] config section parsing, none of which was actually used since being superseded by the connector architecture in 0.7 2011-05-06 22:41:07 +01:00
Justin Clark-Casey (justincc)
913e6b70c6 minor: slightly shorten "show digest" printing code 2011-05-06 22:13:56 +01:00
Justin Clark-Casey (justincc)
621279e498 on asset "show digest" command, print out the asset type name (e.g. texture) as well as its number 2011-05-06 22:04:26 +01:00
Justin Clark-Casey (justincc)
9ff94a3a44 Say which filename an asset has been dumped to on a successful dump 2011-05-06 21:58:41 +01:00
Justin Clark-Casey (justincc)
2ef8e03773 Change command help text for "show capabilities" to "show caps", as this is the actual command that has to be typed on the console.
Thanks to makopoppo for the patch - http://opensimulator.org/mantis/view.php?id=5467
2011-05-06 21:21:02 +01:00
Justin Clark-Casey (justincc)
7c3e8a106b Merge branch 'master' of https://github.com/allquixotic/opensim-autobackup 2011-05-06 20:51:55 +01:00
Diva Canto
74e981e796 One more bug fix concerning library items that weren't being copied to user's inventory. Also commented verbose debug message. 2011-05-06 09:56:27 -07:00
Diva Canto
50c0069f7d Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-06 09:09:13 -07:00
Diva Canto
eafc01cf8f Bug fix: iars under Library weren't being loaded. 2011-05-06 09:08:24 -07:00
BlueWall
68bb0f81e2 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2011-05-05 20:07:19 -04:00
Justin Clark-Casey (justincc)
fd44540c02 add descriptive explanations for region restart functionality 2011-05-06 01:06:28 +01:00
BlueWall
e4e95706d5 Add support for llRequestSecureURL() if ssl is enabled 2011-05-05 19:57:10 -04:00
BlueWall
8ca7938753 Adding ssl support
Adding ssl support for "Out of Band" applications such as the remote
	admin module or Robust services
2011-05-05 19:56:54 -04:00
Justin Clark-Casey (justincc)
8755a48cde fix command display for debugging 'emergency-monitoring' 2011-05-06 00:34:04 +01:00
Justin Clark-Casey (justincc)
46baadbb65 remove the NDesk.Options using since didn't end up needing it 2011-05-06 00:22:19 +01:00
Justin Clark-Casey (justincc)
bc49a0bc5d Add "dump asset" command to the asset service for debugging purposes.
This command dumps the asset with the given id to a file with the same name.
2011-05-06 00:09:08 +01:00
Melanie
5591abf9d1 Allow attachments to track the user's camera 2011-05-05 15:10:59 +02:00
Melanie
e7e88c4db1 Merge branch 'master' into careminster-presence-refactor 2011-05-05 13:28:15 +01:00
Melanie
1bdac6ed19 Fix up nant linux build break 2011-05-05 13:27:44 +01:00
Melanie
f5bb6edd85 Squish a warning 2011-05-05 13:01:46 +01:00
Melanie
4f588ad7ba Fix up some paths in prebuild 2011-05-05 12:52:31 +01:00
Melanie
3149e6e851 Fix up some paths in prebuild 2011-05-05 12:13:56 +01:00
Melanie
4beb0c9b9b Merge branch 'master' into careminster-presence-refactor 2011-05-05 09:49:10 +01:00
Diva Canto
e8944d6c31 Test m_Enabled on RemoveRegion. 2011-05-04 20:40:25 -07:00
Diva Canto
6d34932775 Merge branch 'master' into caps 2011-05-04 20:30:33 -07:00
Melanie
6008ffe943 Merge branch 'master' into careminster-presence-refactor 2011-05-05 00:34:48 +01:00
Diva Canto
6c503e75ac Put the previous state back in the attachments in case the agent transfer fails. 2011-05-04 12:04:35 -07:00
Diva Canto
df7dacd004 Fixes mantis #5461. 2011-05-04 11:34:18 -07:00
Diva Canto
a0f3b23065 Merge branch 'master' into caps 2011-05-04 07:31:32 -07:00
dahlia
4c59d57596 use getters instead of member variables in velocity network filter code and add some more descriptive comments. 2011-05-04 03:29:06 -07:00
dahlia
13ab00e45a adjust terse avatar update filtering to send updates when distance traveled does not match expected distance, rather than at a fixed time period. this should smooth avatar motion somewhat when moving in a straight line and velocity is constant. 2011-05-03 19:47:50 -07:00
Melanie
3f7050173d Attempt to make teleports more reliable. This may break redirection on login 2011-05-03 22:33:53 +02:00
Melanie
61263e2ce3 Some private changes to the prioritizer: 30m steps instead of 10 and disable
the broken frontback math. Much better user experience.
2011-05-03 16:58:39 +02:00
Melanie
aa73f99de6 Revert the CM prioritizer to the core version 2011-05-03 16:44:45 +01:00
Melanie
af55eda16b Merge branch 'master' into careminster-presence-refactor 2011-05-03 14:26:18 +01:00
Diva Canto
98b84802e4 Changed the defaults, so that it behaves exactly is it has been behaving (no WebFetch cap by default). 2011-05-02 20:19:36 -07:00
Diva Canto
ac9697edbe Fixed: EventQueueGet and other caps were being wrongly deregistered. Also CapabilitiesModule was being instantiated twice (damn Mono.Addins). 2011-05-02 19:45:47 -07:00
Diva Canto
6b52c1d6cd Fix the GetTexture path to /CAPS/GetTexture for now until we have real capabilities. 2011-05-02 16:16:10 -07:00
Diva Canto
883f21dd02 WebFetchInventoryDescendents working. Tested with robust. 2011-05-02 14:33:34 -07:00
Diva Canto
2d403d5b18 Merge branch 'master' into caps 2011-05-02 11:56:51 -07:00
Diva Canto
aba9ffdbd0 Refactored the GetMesh module into a handler and a module, to be the same as GetTexture. 2011-05-02 11:56:40 -07:00
Diva Canto
f7d3720126 Increased timeout for fat UpdateAgent to 200secs. Nebadon's 3800-prim alien avatar takes 6secs to transfer between sims on the same machine... 2011-05-02 09:20:08 -07:00
Diva Canto
51d0b8b4e9 Oops, forgot this one. 2011-05-02 09:06:21 -07:00
Diva Canto
8cc547c277 Turns out that it's a bad idea to let Agent position updates linger for a long time on certain versions of mono. It's better to abort them if they take too long. So timeout is now an argument. Currently: 20secs for CreateAgent, 100secs for UpdateAgent (fat), 10 secs for UpdateAgent (Position); all of these divided by 4, for ReadWrite, as Mic had before. 2011-05-02 09:04:34 -07:00
Diva Canto
10180760b7 Works! 2011-05-02 08:48:55 -07:00
Sean McNamara
0995fedcac AutoBackupModule: Implement per-region settings in Regions.ini. 2011-05-02 04:32:31 -04:00
Sean McNamara
fffd42f5cb Merge git://opensimulator.org/git/opensim 2011-05-02 02:23:18 -04:00
Sean McNamara
2aab033aaa First pass at fixing justincc's feedback v2 ( http://opensimulator.org/mantis/view.php?id=5440 )
Fixing everything here (I think) except the per-region config. That's next.
2011-05-02 02:20:50 -04:00
Diva Canto
2d21052fa3 Start to drill down on GetTexture. Read the config and do different things. 2011-05-01 19:09:08 -07:00
Diva Canto
f79400e94c Broke down Caps.cs into a generic Caps object that simply registers/unregisters capabilities and a specific bunch of capability implementations in Linden space called BunchOfCaps.
Renamed a few methods that were misnomers.
Compiles but doesn't work.
2011-05-01 18:22:53 -07:00
Diva Canto
275046cf02 Change GetTextureModule.cs to conform to the new IRegion module interface. NOTHING OF THIS WORKS. Compiles. 2011-05-01 12:03:00 -07:00
Diva Canto
126d2adeba Move CapabilitiesModule back to CoreModules. This one belongs there. 2011-05-01 12:02:07 -07:00
Diva Canto
f10666c7ba How this might look like from a configuration perspective. Changes OpenSimDefaults.ini. 2011-05-01 10:07:54 -07:00
Diva Canto
8cc9d22b89 Merge branch 'master' into caps 2011-05-01 09:31:26 -07:00
Diva Canto
bbe41c75e1 Fixed confusing OSDMap that comes as the response of QueryAccess in the case it fails. 2011-05-01 09:30:23 -07:00
Diva Canto
f0bf64b6de Merge branch 'master' into caps 2011-05-01 09:11:16 -07:00
Diva Canto
6b2b036387 Added OpenSim.Capabilities.Handlers. For the moment it has only the GetTexture handler. The region module in Linden space uses it. WARNING: nothing of this works yet, it just compiles. 2011-05-01 09:08:18 -07:00
Diva Canto
d4323dd753 Increased Timeout to 30 secs. 2011-04-30 18:08:48 -07:00
Diva Canto
91a604d4b6 Removed XXX Debug. Increased ReadWriteTimeout on ServiceOSDRequest, because it was _way_ too low and is probably making writes abort in the middle. 2011-04-30 17:40:21 -07:00
Diva Canto
56df746133 XXX DEBUGGING! 2011-04-30 16:53:43 -07:00
Diva Canto
00e94b0ba8 Check for RegionID instead of RegionHandle. Other minor tweaks 2011-04-30 16:53:11 -07:00
Diva Canto
e3c27d8527 Nope, that didn't feel right. Moving all those modules to Linden space. 2011-04-30 13:24:25 -07:00
Diva Canto
c062138dad Moved several cap-based-service-providing modules from where they were into a newly created CoreModules/Caps. Not all. 2011-04-30 12:23:40 -07:00
Diva Canto
3e79842312 Renamed OpenSim.Framework.Capabilities.dll to OpenSim.Capabilities.dll 2011-04-30 11:03:22 -07:00
Diva Canto
d8ee0cbe1c First stab at cleaning up Caps. Compiles. Untested. 2011-04-30 09:24:15 -07:00
Sean McNamara
587aa91e36 Merge git://opensimulator.org/git/opensim 2011-04-26 11:45:38 -04:00
Sean McNamara
c82c7e6ed9 Wait for OnOarFileSaved event callback before executing script
We want to execute the (optional) user script after I/O is done on the oar.
I wasn't aware that ArchiveRegion is asynchronous -- now I am.
Should fully resolve comment 0018290 at
http://opensimulator.org/mantis/view.php?id=5440
2011-04-26 11:42:06 -04:00
Sean McNamara
d287e0ac68 Merge git://opensimulator.org/git/opensim 2011-04-23 18:33:08 -04:00
Sean McNamara
440d54a521 AutoBackup: Removed unneeded imports. 2011-04-23 18:32:08 -04:00
Sean McNamara
082fad6dd2 Fix most issues raised by justincc: http://opensimulator.org/mantis/view.php?id=5440 2011-04-23 18:29:13 -04:00
Sean McNamara
049bce4d00 Fixup the global defaults config parsing code. 2011-04-12 01:14:21 -04:00
Sean McNamara
95a6ee0a37 Fix NREs harder. 2011-04-11 13:20:46 -04:00
Sean McNamara
4ad05fb01d Fix some NREs on certain paths. 2011-04-11 13:12:26 -04:00
Sean McNamara
4974a1ce69 AutoBackup: Support region-independent settings too. 2011-04-11 12:34:26 -04:00
Sean McNamara
9c0f3c73b1 Merge git://opensimulator.org/git/opensim 2011-04-10 18:28:54 -04:00
Sean McNamara
60989521a6 Merge git://opensimulator.org/git/opensim 2011-02-28 15:08:35 -05:00
Sean McNamara
b3c42e952f Fix small bug with remove region; update settings docs.
Our impl of IRegionModuleBase.RemoveRegion didn't remove the scene from the states map.
2011-02-28 11:54:07 -05:00
Sean McNamara
018645f9f8 First pass at busy heuristics. Compile-tested only. 2011-02-28 11:45:50 -05:00
Sean McNamara
a01c44e74d Be smarter about stopping timers. Cleanup formatting.
Use a boolean flag to tell timers that fire after IRegionModuleBase.Close() is called that they should not execute.
Also, I used MonoDevelop's auto-formatting feature to format the code uniformly. No guarantee about variable names though.
2011-02-28 11:04:54 -05:00
Sean McNamara
34b6904939 First working commit of AutoBackupModule.
It seems to do something! Heuristics are still TODO, but this is alpha 1.
2011-02-26 22:09:19 -05:00
Sean McNamara
d3511ca592 Start the timer. (Could it be that simple?) 2011-02-25 09:03:11 -05:00
Sean McNamara
cb049aa15f s/True/true 2011-02-25 08:58:42 -05:00
Sean McNamara
bb1f03abc6 Make timer auto-respawn. 2011-02-25 08:57:48 -05:00
Sean McNamara
7fa8ed0c47 Config works, but timer isn't firing. Hmm. 2011-02-25 08:48:02 -05:00
Sean McNamara
2da9bb3ca2 Try to fix config one more time.
Note that the way we specify settings has changed significantly here.
2011-02-25 08:31:10 -05:00
Sean McNamara
c2658c2f14 More relevant console messages, and maybe fix config problem 2011-02-19 23:14:43 -05:00
Sean McNamara
7eac0af559 Fix an actual bug in the timer interval calculation (minutes -> msec) 2011-02-19 23:07:54 -05:00
Sean McNamara
e5c08a553c More debug messages 2011-02-19 22:55:32 -05:00
Sean McNamara
3c9bf5c476 Fix config source stuff harder (debug console prints only; no fix yet) 2011-02-19 22:47:05 -05:00
Sean McNamara
06a4810d21 Fix config source by taking it from Initialize 2011-02-19 22:29:45 -05:00
Sean McNamara
99e8260282 Add [Modules] option for unconditionally disabling entire module globally (for easy configuration) 2011-02-19 22:08:19 -05:00
Sean McNamara
dfa63ff031 Let GetNextFile do all the string-building work for SEQUENTIAL. 2011-02-19 20:15:38 -05:00
Sean McNamara
85654f82a5 First cut of AutoBackupModule; only compile-tested so far 2011-02-19 12:25:04 -05:00
184 changed files with 5711 additions and 2658 deletions

View File

@@ -0,0 +1,176 @@
/*
* 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.IO;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
// using OpenSim.Region.Framework.Interfaces;
namespace OpenSim.Framework.Capabilities
{
/// <summary>
/// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that
/// we can popup a message on the user's client if the inventory service has permanently failed). But I didn't want
/// to just pass the whole Scene into CAPS.
/// </summary>
public delegate IClientAPI GetClientDelegate(UUID agentID);
public class Caps
{
// private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_httpListenerHostName;
private uint m_httpListenPort;
/// <summary>
/// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester.
/// </summary>
private string m_capsObjectPath;
public string CapsObjectPath { get { return m_capsObjectPath; } }
private CapsHandlers m_capsHandlers;
private Dictionary<string, string> m_externalCapsHandlers;
private IHttpServer m_httpListener;
private UUID m_agentID;
private string m_regionName;
public UUID AgentID
{
get { return m_agentID; }
}
public string RegionName
{
get { return m_regionName; }
}
public string HostName
{
get { return m_httpListenerHostName; }
}
public uint Port
{
get { return m_httpListenPort; }
}
public IHttpServer HttpListener
{
get { return m_httpListener; }
}
public bool SSLCaps
{
get { return m_httpListener.UseSSL; }
}
public string SSLCommonName
{
get { return m_httpListener.SSLCommonName; }
}
public CapsHandlers CapsHandlers
{
get { return m_capsHandlers; }
}
public Dictionary<string, string> ExternalCapsHandlers
{
get { return m_externalCapsHandlers; }
}
public Caps(IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
UUID agent, string regionName)
{
m_capsObjectPath = capsPath;
m_httpListener = httpServer;
m_httpListenerHostName = httpListen;
m_httpListenPort = httpPort;
if (httpServer != null && httpServer.UseSSL)
{
m_httpListenPort = httpServer.SSLPort;
httpListen = httpServer.SSLCommonName;
httpPort = httpServer.SSLPort;
}
m_agentID = agent;
m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL);
m_externalCapsHandlers = new Dictionary<string, string>();
m_regionName = regionName;
}
/// <summary>
/// Register a handler. This allows modules to register handlers.
/// </summary>
/// <param name="capName"></param>
/// <param name="handler"></param>
public void RegisterHandler(string capName, IRequestHandler handler)
{
m_capsHandlers[capName] = handler;
//m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
}
/// <summary>
/// Register an external handler. The service for this capability is somewhere else
/// given by the URL.
/// </summary>
/// <param name="capsName"></param>
/// <param name="url"></param>
public void RegisterHandler(string capsName, string url)
{
m_externalCapsHandlers.Add(capsName, url);
}
/// <summary>
/// Remove all CAPS service handlers.
///
/// </summary>
/// <param name="httpListener"></param>
/// <param name="path"></param>
/// <param name="restMethod"></param>
public void DeregisterHandlers()
{
if (m_capsHandlers != null)
{
foreach (string capsName in m_capsHandlers.Caps)
{
m_capsHandlers.Remove(capsName);
}
}
}
}
}

View File

@@ -31,7 +31,6 @@ using System.Collections.Specialized;
using System.Reflection;
using System.IO;
using System.Web;
using Mono.Addins;
using log4net;
using Nini.Config;
using OpenMetaverse;
@@ -39,90 +38,23 @@ using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
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;
namespace OpenSim.Region.CoreModules.Avatar.Assets
namespace OpenSim.Capabilities.Handlers
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class GetMeshModule : INonSharedRegionModule
public class GetMeshHandler
{
// private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IAssetService m_assetService;
private bool m_enabled = true;
#region IRegionModuleBase Members
public Type ReplaceableInterface
public GetMeshHandler(IAssetService assService)
{
get { return null; }
m_assetService = assService;
}
public void Initialise(IConfigSource source)
{
IConfig meshConfig = source.Configs["Mesh"];
if (meshConfig == null)
return;
m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
}
public void AddRegion(Scene pScene)
{
m_scene = pScene;
}
public void RemoveRegion(Scene scene)
{
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public void RegionLoaded(Scene scene)
{
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
#endregion
#region IRegionModule Members
public void Close() { }
public string Name { get { return "GetMeshModule"; } }
public void RegisterCaps(UUID agentID, Caps caps)
{
if(!m_enabled)
return;
UUID capID = UUID.Random();
// m_log.Info("[GETMESH]: /CAPS/" + capID);
caps.RegisterHandler("GetMesh",
new RestHTTPHandler("GET", "/CAPS/" + capID,
delegate(Hashtable m_dhttpMethod)
{
return ProcessGetMesh(m_dhttpMethod, agentID, caps);
}));
}
#endregion
public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
{

View File

@@ -0,0 +1,78 @@
/*
* 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 Nini.Config;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Server.Handlers.Base;
using OpenSim.Framework.Servers;
using OpenMetaverse;
namespace OpenSim.Capabilities.Handlers
{
public class GetMeshServerConnector : ServiceConnector
{
private IAssetService m_AssetService;
private string m_ConfigName = "CapsService";
public GetMeshServerConnector(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 assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
delegate(Hashtable m_dhttpMethod)
{
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null);
});
server.AddStreamHandler(reqHandler);
}
}
}

View File

@@ -42,39 +42,16 @@ using OpenSim.Framework;
using OpenSim.Framework.Servers;
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;
namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
namespace OpenSim.Capabilities.Handlers
{
#region Stream Handler
public delegate byte[] StreamHandlerCallback(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse);
public class StreamHandler : BaseStreamHandler
{
StreamHandlerCallback m_callback;
public StreamHandler(string httpMethod, string path, StreamHandlerCallback callback)
: base(httpMethod, path)
{
m_callback = callback;
}
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
return m_callback(path, request, httpRequest, httpResponse);
}
}
#endregion Stream Handler
public class GetTextureModule : IRegionModule
public class GetTextureHandler : BaseStreamHandler
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IAssetService m_assetService;
public const string DefaultFormat = "x-j2c";
@@ -82,44 +59,22 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
// TODO: Change this to a config option
const string REDIRECT_URL = null;
#region IRegionModule Members
public void Initialise(Scene pScene, IConfigSource pSource)
public GetTextureHandler(string path, IAssetService assService) :
base("GET", path)
{
m_scene = pScene;
m_assetService = assService;
}
public void PostInitialise()
public override byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public void Close() { }
public string Name { get { return "GetTextureModule"; } }
public bool IsSharedModule { get { return false; } }
public void RegisterCaps(UUID agentID, Caps caps)
{
UUID capID = UUID.Random();
// m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
}
#endregion
private byte[] ProcessGetTexture(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
//m_log.DebugFormat("[GETTEXTURE]: called in {0}", m_scene.RegionInfo.RegionName);
// Try to parse the texture ID from the request URL
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
string textureStr = query.GetOne("texture_id");
string format = query.GetOne("format");
//m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr);
if (m_assetService == null)
{
m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service");

View File

@@ -0,0 +1,69 @@
/*
* 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 GetTextureServerConnector : ServiceConnector
{
private IAssetService m_AssetService;
private string m_ConfigName = "CapsService";
public GetTextureServerConnector(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 assetService = serverConfig.GetString("AssetService", String.Empty);
if (assetService == String.Empty)
throw new Exception("No AssetService in config file");
Object[] args = new Object[] { config };
m_AssetService =
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService));
}
}
}

View File

@@ -0,0 +1,299 @@
/*
* 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;
namespace OpenSim.Capabilities.Handlers
{
public class WebFetchInvDescHandler
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IInventoryService m_InventoryService;
private ILibraryService m_LibraryService;
private object m_fetchLock = new Object();
public WebFetchInvDescHandler(IInventoryService invService, ILibraryService libService)
{
m_InventoryService = invService;
m_LibraryService = libService;
}
public string FetchInventoryDescendentsRequest(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
// nasty temporary hack here, the linden client falsely
// identifies the uuid 00000000-0000-0000-0000-000000000000
// as a string which breaks us
//
// correctly mark it as a uuid
//
request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>");
// another hack <integer>1</integer> results in a
// System.ArgumentException: Object type System.Int32 cannot
// be converted to target type: System.Boolean
//
request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>");
request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>");
Hashtable hash = new Hashtable();
try
{
hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
}
catch (LLSD.LLSDParseException pe)
{
m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message);
m_log.Error("Request: " + request.ToString());
}
ArrayList foldersrequested = (ArrayList)hash["folders"];
string response = "";
lock (m_fetchLock)
{
for (int i = 0; i < foldersrequested.Count; i++)
{
string inventoryitemstr = "";
Hashtable inventoryhash = (Hashtable)foldersrequested[i];
LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
try
{
LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest);
}
catch (Exception e)
{
m_log.Debug("[CAPS]: caught exception doing OSD deserialize" + e);
}
LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest);
inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", "");
inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", "");
response += inventoryitemstr;
}
if (response.Length == 0)
{
// Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
// Therefore, I'm concluding that the client only has so many threads available to do requests
// and when a thread stalls.. is stays stalled.
// Therefore we need to return something valid
response = "<llsd><map><key>folders</key><array /></map></llsd>";
}
else
{
response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>";
}
//m_log.DebugFormat("[CAPS]: Replying to CAPS fetch inventory request with following xml");
//m_log.Debug("[CAPS] "+response);
}
return response;
}
/// <summary>
/// Construct an LLSD reply packet to a CAPS inventory request
/// </summary>
/// <param name="invFetch"></param>
/// <returns></returns>
private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch)
{
LLSDInventoryDescendents reply = new LLSDInventoryDescendents();
LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents();
contents.agent_id = invFetch.owner_id;
contents.owner_id = invFetch.owner_id;
contents.folder_id = invFetch.folder_id;
reply.folders.Array.Add(contents);
InventoryCollection inv = new InventoryCollection();
inv.Folders = new List<InventoryFolderBase>();
inv.Items = new List<InventoryItemBase>();
int version = 0;
inv = Fetch(invFetch.owner_id, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version);
if (inv.Folders != null)
{
foreach (InventoryFolderBase invFolder in inv.Folders)
{
contents.categories.Array.Add(ConvertInventoryFolder(invFolder));
}
}
if (inv.Items != null)
{
foreach (InventoryItemBase invItem in inv.Items)
{
contents.items.Array.Add(ConvertInventoryItem(invItem));
}
}
contents.descendents = contents.items.Array.Count + contents.categories.Array.Count;
contents.version = version;
return reply;
}
public InventoryCollection Fetch(UUID agentID, UUID folderID, UUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder, out int version)
{
m_log.DebugFormat(
"[WEBFETCHINVENTORYDESCENDANTS]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
fetchFolders, fetchItems, folderID, agentID);
version = 0;
InventoryFolderImpl fold;
if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner)
if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
{
InventoryCollection ret = new InventoryCollection();
ret.Folders = new List<InventoryFolderBase>();
ret.Items = fold.RequestListOfItems();
return ret;
}
InventoryCollection contents = new InventoryCollection();
if (folderID != UUID.Zero)
{
contents = m_InventoryService.GetFolderContent(agentID, folderID);
InventoryFolderBase containingFolder = new InventoryFolderBase();
containingFolder.ID = folderID;
containingFolder.Owner = agentID;
containingFolder = m_InventoryService.GetFolder(containingFolder);
if (containingFolder != null)
version = containingFolder.Version;
}
else
{
// Lost itemsm don't really need a version
version = 1;
}
return contents;
}
/// <summary>
/// Convert an internal inventory folder object into an LLSD object.
/// </summary>
/// <param name="invFolder"></param>
/// <returns></returns>
private LLSDInventoryFolder ConvertInventoryFolder(InventoryFolderBase invFolder)
{
LLSDInventoryFolder llsdFolder = new LLSDInventoryFolder();
llsdFolder.folder_id = invFolder.ID;
llsdFolder.parent_id = invFolder.ParentID;
llsdFolder.name = invFolder.Name;
if (invFolder.Type < 0 || invFolder.Type >= TaskInventoryItem.Types.Length)
llsdFolder.type = "-1";
else
llsdFolder.type = TaskInventoryItem.Types[invFolder.Type];
llsdFolder.preferred_type = "-1";
return llsdFolder;
}
/// <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
{
// TODO reevaluate after upgrade to libomv >= r2566. Probably should use UtilsConversions.
llsdItem.type = TaskInventoryItem.Types[invItem.AssetType];
llsdItem.inv_type = TaskInventoryItem.InvTypes[invItem.InvType];
}
catch (Exception e)
{
m_log.ErrorFormat("[CAPS]: 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,76 @@
/*
* 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 WebFetchInvDescServerConnector : ServiceConnector
{
private IInventoryService m_InventoryService;
private ILibraryService m_LibraryService;
private string m_ConfigName = "CapsService";
public WebFetchInvDescServerConnector(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));
string libService = serverConfig.GetString("LibraryService", String.Empty);
m_LibraryService =
ServerUtils.LoadPlugin<ILibraryService>(libService, args);
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest);
server.AddStreamHandler(reqHandler);
}
}
}

View File

@@ -74,9 +74,38 @@ namespace OpenSim.Data
bool StoreFolder(XInventoryFolder folder);
bool StoreItem(XInventoryItem item);
/// <summary>
/// Delete folders where field == val
/// </summary>
/// <param name="field"></param>
/// <param name="val"></param>
/// <returns>true if the delete was successful, false if it was not</returns>
bool DeleteFolders(string field, string val);
/// <summary>
/// Delete folders where field1 == val1, field2 == val2...
/// </summary>
/// <param name="fields"></param>
/// <param name="vals"></param>
/// <returns>true if the delete was successful, false if it was not</returns>
bool DeleteFolders(string[] fields, string[] vals);
/// <summary>
/// Delete items where field == val
/// </summary>
/// <param name="field"></param>
/// <param name="val"></param>
/// <returns>true if the delete was successful, false if it was not</returns>
bool DeleteItems(string field, string val);
/// <summary>
/// Delete items where field1 == val1, field2 == val2...
/// </summary>
/// <param name="fields"></param>
/// <param name="vals"></param>
/// <returns>true if the delete was successful, false if it was not</returns>
bool DeleteItems(string[] fields, string[] vals);
bool MoveItem(string id, string newParent);
XInventoryItem[] GetActiveGestures(UUID principalID);
int GetAssetPermissions(UUID principalID, UUID assetID);

View File

@@ -335,24 +335,35 @@ namespace OpenSim.Data.MSSQL
}
}
public virtual bool Delete(string field, string val)
public virtual bool Delete(string field, string key)
{
return Delete(new string[] { field }, new string[] { key });
}
public virtual bool Delete(string[] fields, string[] keys)
{
if (fields.Length != keys.Length)
return false;
List<string> terms = new List<string>();
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
using (SqlCommand cmd = new SqlCommand())
{
string deleteCommand = String.Format("DELETE FROM {0} WHERE [{1}] = @{1}", m_Realm, field);
cmd.CommandText = deleteCommand;
cmd.Parameters.Add(m_database.CreateParameter(field, val));
cmd.Connection = conn;
conn.Open();
if (cmd.ExecuteNonQuery() > 0)
for (int i = 0; i < fields.Length; i++)
{
//m_log.Warn("[MSSQLGenericTable]: " + deleteCommand);
return true;
cmd.Parameters.Add(m_database.CreateParameter(fields[i], keys[i]));
terms.Add("[" + fields[i] + "] = @" + fields[i]);
}
return false;
string where = String.Join(" AND ", terms.ToArray());
string query = String.Format("DELETE * FROM {0} WHERE {1}", m_Realm, where);
cmd.Connection = conn;
cmd.CommandText = query;
conn.Open();
return cmd.ExecuteNonQuery() > 0;
}
}
}

View File

@@ -79,11 +79,21 @@ namespace OpenSim.Data.MSSQL
return m_Folders.Delete(field, val);
}
public bool DeleteFolders(string[] fields, string[] vals)
{
return m_Folders.Delete(fields, vals);
}
public bool DeleteItems(string field, string val)
{
return m_Items.Delete(field, val);
}
public bool DeleteItems(string[] fields, string[] vals)
{
return m_Items.Delete(fields, vals);
}
public bool MoveItem(string id, string newParent)
{
return m_Items.MoveItem(id, newParent);

View File

@@ -0,0 +1,19 @@
:VERSION 1 # --------------------------
BEGIN TRANSACTION
CREATE TABLE "GridUser" (
"UserID" VARCHAR(255) NOT NULL,
"HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
"HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
"HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
"LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
"LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
"LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
"Online" CHAR(5) NOT NULL DEFAULT 'false',
"Login" CHAR(16) NOT NULL DEFAULT '0',
"Logout" CHAR(16) NOT NULL DEFAULT '0',
PRIMARY KEY ("UserID")
)
COMMIT

View File

@@ -43,7 +43,7 @@ namespace OpenSim.Data.MySQL
public class MySQLAvatarData : MySQLGenericTableHandler<AvatarBaseData>,
IAvatarData
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public MySQLAvatarData(string connectionString, string realm) :
base(connectionString, realm, "Avatar")

View File

@@ -48,7 +48,7 @@ namespace OpenSim.Data.MySQL
private string m_connectionString;
private long m_waitTimeout;
private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond;
private long m_lastConnectionUse;
// private long m_lastConnectionUse;
private FieldInfo[] m_Fields;
private Dictionary<string, FieldInfo> m_FieldMap =
@@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL
}
}
m_lastConnectionUse = DateTime.Now.Ticks;
// m_lastConnectionUse = DateTime.Now.Ticks;
m_log.DebugFormat(
"[REGION DB]: Connection wait timeout {0} seconds",

View File

@@ -39,7 +39,7 @@ namespace OpenSim.Data.MySQL
{
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, FieldInfo> m_Fields =
new Dictionary<string, FieldInfo>();
@@ -264,18 +264,33 @@ namespace OpenSim.Data.MySQL
}
}
public virtual bool Delete(string field, string val)
public virtual bool Delete(string field, string key)
{
return Delete(new string[] { field }, new string[] { key });
}
public virtual bool Delete(string[] fields, string[] keys)
{
if (fields.Length != keys.Length)
return false;
List<string> terms = new List<string>();
using (MySqlCommand cmd = new MySqlCommand())
{
for (int i = 0 ; i < fields.Length ; i++)
{
cmd.Parameters.AddWithValue(fields[i], keys[i]);
terms.Add("`" + fields[i] + "` = ?" + fields[i]);
}
cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field);
cmd.Parameters.AddWithValue(field, val);
string where = String.Join(" and ", terms.ToArray());
if (ExecuteNonQuery(cmd) > 0)
return true;
string query = String.Format("delete from {0} where {1}", m_Realm, where);
return false;
cmd.CommandText = query;
return ExecuteNonQuery(cmd) > 0;
}
}
}

View File

@@ -43,7 +43,7 @@ namespace OpenSim.Data.MySQL
public class MySQLPresenceData : MySQLGenericTableHandler<PresenceData>,
IPresenceData
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public MySQLPresenceData(string connectionString, string realm) :
base(connectionString, realm, "Presence")

View File

@@ -66,7 +66,7 @@ namespace OpenSim.Data.MySQL
Initialise(connectionString);
}
public void Initialise(string connectionString)
public virtual void Initialise(string connectionString)
{
m_connectionString = connectionString;
@@ -130,7 +130,7 @@ namespace OpenSim.Data.MySQL
public void Dispose() {}
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID)
{
uint flags = obj.RootPart.GetEffectiveObjectFlags();
@@ -258,7 +258,7 @@ namespace OpenSim.Data.MySQL
}
}
public void RemoveObject(UUID obj, UUID regionUUID)
public virtual void RemoveObject(UUID obj, UUID regionUUID)
{
// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
@@ -407,7 +407,7 @@ namespace OpenSim.Data.MySQL
}
}
public List<SceneObjectGroup> LoadObjects(UUID regionID)
public virtual List<SceneObjectGroup> LoadObjects(UUID regionID)
{
const int ROWS_PER_QUERY = 5000;
@@ -576,7 +576,7 @@ namespace OpenSim.Data.MySQL
}
}
public void StoreTerrain(double[,] ter, UUID regionID)
public virtual void StoreTerrain(double[,] ter, UUID regionID)
{
m_log.Info("[REGION DB]: Storing terrain");
@@ -605,7 +605,7 @@ namespace OpenSim.Data.MySQL
}
}
public double[,] LoadTerrain(UUID regionID)
public virtual double[,] LoadTerrain(UUID regionID)
{
double[,] terrain = null;
@@ -655,7 +655,7 @@ namespace OpenSim.Data.MySQL
return terrain;
}
public void RemoveLandObject(UUID globalID)
public virtual void RemoveLandObject(UUID globalID)
{
lock (m_dbLock)
{
@@ -674,7 +674,7 @@ namespace OpenSim.Data.MySQL
}
}
public void StoreLandObject(ILandObject parcel)
public virtual void StoreLandObject(ILandObject parcel)
{
lock (m_dbLock)
{
@@ -731,7 +731,7 @@ namespace OpenSim.Data.MySQL
}
}
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
public virtual RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
{
RegionLightShareData nWP = new RegionLightShareData();
nWP.OnSave += StoreRegionWindlightSettings;
@@ -828,7 +828,7 @@ namespace OpenSim.Data.MySQL
return nWP;
}
public RegionSettings LoadRegionSettings(UUID regionUUID)
public virtual RegionSettings LoadRegionSettings(UUID regionUUID)
{
RegionSettings rs = null;
@@ -866,7 +866,7 @@ namespace OpenSim.Data.MySQL
return rs;
}
public void StoreRegionWindlightSettings(RegionLightShareData wl)
public virtual void StoreRegionWindlightSettings(RegionLightShareData wl)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
@@ -969,7 +969,7 @@ namespace OpenSim.Data.MySQL
}
}
public void RemoveRegionWindlightSettings(UUID regionID)
public virtual void RemoveRegionWindlightSettings(UUID regionID)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
@@ -984,7 +984,7 @@ namespace OpenSim.Data.MySQL
}
}
public void StoreRegionSettings(RegionSettings rs)
public virtual void StoreRegionSettings(RegionSettings rs)
{
lock (m_dbLock)
{
@@ -1036,7 +1036,7 @@ namespace OpenSim.Data.MySQL
}
}
public List<LandData> LoadLandObjects(UUID regionUUID)
public virtual List<LandData> LoadLandObjects(UUID regionUUID)
{
List<LandData> landData = new List<LandData>();
@@ -1802,7 +1802,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml());
}
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
public virtual void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
{
lock (m_dbLock)
{

View File

@@ -85,11 +85,21 @@ namespace OpenSim.Data.MySQL
return m_Folders.Delete(field, val);
}
public bool DeleteFolders(string[] fields, string[] vals)
{
return m_Folders.Delete(fields, vals);
}
public bool DeleteItems(string field, string val)
{
return m_Items.Delete(field, val);
}
public bool DeleteItems(string[] fields, string[] vals)
{
return m_Items.Delete(fields, vals);
}
public bool MoveItem(string id, string newParent)
{
return m_Items.MoveItem(id, newParent);
@@ -189,7 +199,7 @@ namespace OpenSim.Data.MySQL
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
catch (Exception)
{
return false;
}

View File

@@ -33,7 +33,7 @@ using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using log4net;
#if CSharpSqlite
using Community.CsharpSqlite.Sqlite;
#else
@@ -49,7 +49,6 @@ namespace OpenSim.Data.SQLite
private string m_Realm;
private List<string> m_ColumnNames;
private int m_LastExpire;
private string m_connectionString;
protected static SqliteConnection m_Connection;
private static bool m_initialized = false;
@@ -58,7 +57,6 @@ namespace OpenSim.Data.SQLite
: base(connectionString)
{
m_Realm = realm;
m_connectionString = connectionString;
if (!m_initialized)
{

View File

@@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite
public class SQLiteAvatarData : SQLiteGenericTableHandler<AvatarBaseData>,
IAvatarData
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public SQLiteAvatarData(string connectionString, string realm) :
base(connectionString, realm, "Avatar")

View File

@@ -258,17 +258,33 @@ namespace OpenSim.Data.SQLite
return false;
}
public bool Delete(string field, string val)
public virtual bool Delete(string field, string key)
{
return Delete(new string[] { field }, new string[] { key });
}
public bool Delete(string[] fields, string[] keys)
{
if (fields.Length != keys.Length)
return false;
List<string> terms = new List<string>();
SqliteCommand cmd = new SqliteCommand();
cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field);
cmd.Parameters.Add(new SqliteParameter(field, val));
for (int i = 0 ; i < fields.Length ; i++)
{
cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i]));
terms.Add("`" + fields[i] + "` = :" + fields[i]);
}
if (ExecuteNonQuery(cmd, m_Connection) > 0)
return true;
string where = String.Join(" and ", terms.ToArray());
return false;
string query = String.Format("delete * from {0} where {1}", m_Realm, where);
cmd.CommandText = query;
return ExecuteNonQuery(cmd, m_Connection) > 0;
}
}
}

View File

@@ -91,11 +91,21 @@ namespace OpenSim.Data.SQLite
return m_Folders.Delete(field, val);
}
public bool DeleteFolders(string[] fields, string[] vals)
{
return m_Folders.Delete(fields, vals);
}
public bool DeleteItems(string field, string val)
{
return m_Items.Delete(field, val);
}
public bool DeleteItems(string[] fields, string[] vals)
{
return m_Items.Delete(fields, vals);
}
public bool MoveItem(string id, string newParent)
{
return m_Items.MoveItem(id, newParent);

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@
using OpenMetaverse;
namespace OpenSim.Framework.Capabilities
namespace OpenSim.Framework
{
/// <summary>
/// Capabilities utility methods

View File

@@ -460,9 +460,9 @@ namespace OpenSim.Framework
{
info["state"] = OSD.FromString(AttachmentObjectStates[i++]);
}
catch (IndexOutOfRangeException e)
catch (IndexOutOfRangeException)
{
m_log.WarnFormat("[CHILD AGENT DATA]: scrtips list is shorter than object list.");
m_log.WarnFormat("[CHILD AGENT DATA]: scripts list is shorter than object list.");
}
attObjs.Add(info);

View File

@@ -29,113 +29,13 @@ namespace OpenSim.Framework
{
public class ConfigSettings
{
private string m_physicsEngine;
public string PhysicsEngine
{
get { return m_physicsEngine; }
set { m_physicsEngine = value; }
}
private string m_meshEngineName;
public string MeshEngineName
{
get { return m_meshEngineName; }
set { m_meshEngineName = value; }
}
private bool m_see_into_region_from_neighbor;
public bool See_into_region_from_neighbor
{
get { return m_see_into_region_from_neighbor; }
set { m_see_into_region_from_neighbor = value; }
}
private string m_storageDll;
public string StorageDll
{
get { return m_storageDll; }
set { m_storageDll = value; }
}
private string m_clientstackDll;
public string ClientstackDll
{
get { return m_clientstackDll; }
set { m_clientstackDll = value; }
}
private bool m_physicalPrim;
public bool PhysicalPrim
{
get { return m_physicalPrim; }
set { m_physicalPrim = value; }
}
private bool m_standaloneAuthenticate = false;
public bool StandaloneAuthenticate
{
get { return m_standaloneAuthenticate; }
set { m_standaloneAuthenticate = value; }
}
private string m_standaloneWelcomeMessage = null;
public string StandaloneWelcomeMessage
{
get { return m_standaloneWelcomeMessage; }
set { m_standaloneWelcomeMessage = value; }
}
private string m_standaloneInventoryPlugin;
public string StandaloneInventoryPlugin
{
get { return m_standaloneInventoryPlugin; }
set { m_standaloneInventoryPlugin = value; }
}
private string m_standaloneUserPlugin;
public string StandaloneUserPlugin
{
get { return m_standaloneUserPlugin; }
set { m_standaloneUserPlugin = value; }
}
private string m_standaloneInventorySource;
public string StandaloneInventorySource
{
get { return m_standaloneInventorySource; }
set { m_standaloneInventorySource = value; }
}
private string m_standaloneUserSource;
public string StandaloneUserSource
{
get { return m_standaloneUserSource; }
set { m_standaloneUserSource = value; }
}
protected string m_librariesXMLFile;
public string LibrariesXMLFile
{
get
{
return m_librariesXMLFile;
}
set
{
m_librariesXMLFile = value;
}
}
public string PhysicsEngine { get; set; }
public string MeshEngineName { get; set; }
public bool See_into_region_from_neighbor { get; set; }
public string StorageDll { get; set; }
public string ClientstackDll { get; set; }
public bool PhysicalPrim { get; set; }
public string LibrariesXMLFile { get; set; }
public const uint DefaultAssetServerHttpPort = 8003;
public const uint DefaultRegionHttpPort = 9000;
@@ -146,4 +46,4 @@ namespace OpenSim.Framework
public const uint DefaultGridServerHttpPort = 8003;
public const uint DefaultInventoryServerHttpPort = 8003;
}
}
}

View File

@@ -77,7 +77,7 @@ namespace OpenSim.Framework
public delegate void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag);
public delegate void RequestMapName(IClientAPI remoteClient, string mapName);
public delegate void RequestMapName(IClientAPI remoteClient, string mapName, uint flags);
public delegate void TeleportLocationRequest(
IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags);

View File

@@ -35,8 +35,8 @@ namespace OpenSim.Framework
public interface ILandObject
{
int GetParcelMaxPrimCount(ILandObject thisObject);
int GetSimulatorMaxPrimCount(ILandObject thisObject);
int GetParcelMaxPrimCount();
int GetSimulatorMaxPrimCount();
int GetPrimsFree();
LandData LandData { get; set; }

View File

@@ -52,6 +52,11 @@ namespace OpenSim.Framework
return GetHttpServer(port,null);
}
public static void AddHttpServer(BaseHttpServer server)
{
m_Servers.Add(server.Port, server);
}
public static IHttpServer GetHttpServer(uint port, IPAddress ipaddr)
{
if (port == 0)

View File

@@ -49,6 +49,12 @@ namespace OpenSim.Framework
public string HttpSSLCN = "";
public uint httpSSLPort = 9001;
// "Out of band" managemnt https
public bool ssl_listener = false;
public uint https_port = 0;
public string cert_path = String.Empty;
public string cert_pass = String.Empty;
public string MessagingURL = String.Empty;
public NetworkServersInfo()
@@ -86,6 +92,15 @@ namespace OpenSim.Framework
secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty);
// "Out of band management https"
ssl_listener = config.Configs["Network"].GetBoolean("https_listener",false);
if( ssl_listener)
{
cert_path = config.Configs["Network"].GetString("cert_path",String.Empty);
cert_pass = config.Configs["Network"].GetString("cert_pass",String.Empty);
https_port = (uint)config.Configs["Network"].GetInt("https_port", 0);
}
}
}
}

View File

@@ -38,7 +38,7 @@ namespace OpenSim.Framework
{
public class PriorityQueue
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public delegate bool UpdatePriorityHandler(ref uint priority, ISceneEntity entity);

View File

@@ -97,251 +97,6 @@ namespace OpenSim.Framework
}
[Serializable]
public class SimpleRegionInfo
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The port by which http communication occurs with the region (most noticeably, CAPS communication)
/// </summary>
public uint HttpPort
{
get { return m_httpPort; }
set { m_httpPort = value; }
}
protected uint m_httpPort;
/// <summary>
/// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
/// </summary>
public string ServerURI
{
get {
if ( m_serverURI != string.Empty ) {
return m_serverURI;
} else {
return "http://" + m_externalHostName + ":" + m_httpPort + "/";
}
}
set {
if ( value.EndsWith("/") ) {
m_serverURI = value;
} else {
m_serverURI = value + '/';
}
}
}
protected string m_serverURI;
public string RegionName
{
get { return m_regionName; }
set { m_regionName = value; }
}
protected string m_regionName = String.Empty;
protected bool Allow_Alternate_Ports;
public bool m_allow_alternate_ports;
protected string m_externalHostName;
protected IPEndPoint m_internalEndPoint;
protected uint? m_regionLocX;
protected uint? m_regionLocY;
protected uint m_remotingPort;
public UUID RegionID = UUID.Zero;
public string RemotingAddress;
public UUID ScopeID = UUID.Zero;
public SimpleRegionInfo()
{
m_serverURI = string.Empty;
}
public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
m_internalEndPoint = internalEndPoint;
m_externalHostName = externalUri;
m_serverURI = string.Empty;
}
public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
{
m_regionLocX = regionLocX;
m_regionLocY = regionLocY;
m_externalHostName = externalUri;
m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
m_serverURI = string.Empty;
}
public SimpleRegionInfo(RegionInfo ConvertFrom)
{
m_regionName = ConvertFrom.RegionName;
m_regionLocX = ConvertFrom.RegionLocX;
m_regionLocY = ConvertFrom.RegionLocY;
m_internalEndPoint = ConvertFrom.InternalEndPoint;
m_externalHostName = ConvertFrom.ExternalHostName;
m_remotingPort = ConvertFrom.RemotingPort;
m_httpPort = ConvertFrom.HttpPort;
m_allow_alternate_ports = ConvertFrom.m_allow_alternate_ports;
RemotingAddress = ConvertFrom.RemotingAddress;
RegionID = UUID.Zero;
ServerURI = ConvertFrom.ServerURI;
}
public uint RemotingPort
{
get { return m_remotingPort; }
set { m_remotingPort = value; }
}
/// <value>
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
///
/// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
/// </value>
public IPEndPoint ExternalEndPoint
{
get
{
// Old one defaults to IPv6
//return new IPEndPoint(Dns.GetHostAddresses(m_externalHostName)[0], m_internalEndPoint.Port);
IPAddress ia = null;
// If it is already an IP, don't resolve it - just return directly
if (IPAddress.TryParse(m_externalHostName, out ia))
return new IPEndPoint(ia, m_internalEndPoint.Port);
// Reset for next check
ia = null;
try
{
foreach (IPAddress Adr in Dns.GetHostAddresses(m_externalHostName))
{
if (ia == null)
ia = Adr;
if (Adr.AddressFamily == AddressFamily.InterNetwork)
{
ia = Adr;
break;
}
}
}
catch (SocketException e)
{
throw new Exception(
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
e + "' attached to this exception", e);
}
return new IPEndPoint(ia, m_internalEndPoint.Port);
}
set { m_externalHostName = value.ToString(); }
}
public string ExternalHostName
{
get { return m_externalHostName; }
set { m_externalHostName = value; }
}
public IPEndPoint InternalEndPoint
{
get { return m_internalEndPoint; }
set { m_internalEndPoint = value; }
}
public uint RegionLocX
{
get { return m_regionLocX.Value; }
set { m_regionLocX = value; }
}
public uint RegionLocY
{
get { return m_regionLocY.Value; }
set { m_regionLocY = value; }
}
public ulong RegionHandle
{
get { return Util.UIntsToLong((RegionLocX * (uint) Constants.RegionSize), (RegionLocY * (uint) Constants.RegionSize)); }
}
public int getInternalEndPointPort()
{
return m_internalEndPoint.Port;
}
public Dictionary<string, object> ToKeyValuePairs()
{
Dictionary<string, object> kvp = new Dictionary<string, object>();
kvp["uuid"] = RegionID.ToString();
kvp["locX"] = RegionLocX.ToString();
kvp["locY"] = RegionLocY.ToString();
kvp["external_ip_address"] = ExternalEndPoint.Address.ToString();
kvp["external_port"] = ExternalEndPoint.Port.ToString();
kvp["external_host_name"] = ExternalHostName;
kvp["http_port"] = HttpPort.ToString();
kvp["internal_ip_address"] = InternalEndPoint.Address.ToString();
kvp["internal_port"] = InternalEndPoint.Port.ToString();
kvp["alternate_ports"] = m_allow_alternate_ports.ToString();
kvp["server_uri"] = ServerURI;
return kvp;
}
public SimpleRegionInfo(Dictionary<string, object> kvp)
{
if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null))
{
int port = 0;
Int32.TryParse((string)kvp["external_port"], out port);
IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port);
ExternalEndPoint = ep;
}
else
ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
if (kvp["external_host_name"] != null)
ExternalHostName = (string)kvp["external_host_name"];
if (kvp["http_port"] != null)
{
UInt32 port = 0;
UInt32.TryParse((string)kvp["http_port"], out port);
HttpPort = port;
}
if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null))
{
int port = 0;
Int32.TryParse((string)kvp["internal_port"], out port);
IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port);
InternalEndPoint = ep;
}
else
InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
if (kvp["alternate_ports"] != null)
{
bool alts = false;
Boolean.TryParse((string)kvp["alternate_ports"], out alts);
m_allow_alternate_ports = alts;
}
if (kvp["server_uri"] != null)
ServerURI = (string)kvp["server_uri"];
}
}
public class RegionInfo
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@@ -32,6 +32,7 @@ using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Reflection;
using System.Globalization;
using System.Text;
@@ -72,6 +73,7 @@ namespace OpenSim.Framework.Servers.HttpServer
protected uint m_port;
protected uint m_sslport;
protected bool m_ssl;
private X509Certificate2 m_cert;
protected bool m_firstcaps = true;
protected string m_SSLCommonName = "";
@@ -123,6 +125,14 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
public BaseHttpServer(uint port, bool ssl, string CPath, string CPass) : this (port, ssl)
{
if (m_ssl)
{
m_cert = new X509Certificate2(CPath, CPass);
}
}
/// <summary>
/// Add a stream handler to the http server. If the handler already exists, then nothing happens.
/// </summary>
@@ -1500,11 +1510,25 @@ namespace OpenSim.Framework.Servers.HttpServer
internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response)
{
//m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
int responsecode = (int)responsedata["int_response_code"];
string responseString = (string)responsedata["str_response_string"];
string contentType = (string)responsedata["content_type"];
int responsecode;
string responseString;
string contentType;
if (responsedata == null)
{
responsecode = 500;
responseString = "No response could be obtained";
contentType = "text/plain";
responsedata = new Hashtable();
}
else
{
//m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
responsecode = (int)responsedata["int_response_code"];
responseString = (string)responsedata["str_response_string"];
contentType = (string)responsedata["content_type"];
}
if (responsedata.ContainsKey("error_status_text"))
{
@@ -1683,6 +1707,7 @@ namespace OpenSim.Framework.Servers.HttpServer
try
{
//m_httpListener = new HttpListener();
NotSocketErrors = 0;
if (!m_ssl)
{
@@ -1702,6 +1727,9 @@ namespace OpenSim.Framework.Servers.HttpServer
{
//m_httpListener.Prefixes.Add("https://+:" + (m_sslport) + "/");
//m_httpListener.Prefixes.Add("http://+:" + m_port + "/");
m_httpListener2 = CoolHTTPListener.Create(IPAddress.Any, (int)m_port, m_cert);
m_httpListener2.ExceptionThrown += httpServerException;
m_httpListener2.LogWriter = httpserverlog;
}
m_httpListener2.RequestReceived += OnRequest;

View File

@@ -33,7 +33,6 @@ using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
using Animation = OpenSim.Framework.Animation;
namespace OpenSim.Framework.Tests

View File

@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Net;
using System.Net.Security;
using System.Reflection;
@@ -140,27 +141,32 @@ namespace OpenSim.Framework
/// PUT JSON-encoded data to a web service that returns LLSD or
/// JSON data
/// </summary>
public static OSDMap PutToService(string url, OSDMap data)
public static OSDMap PutToServiceCompressed(string url, OSDMap data, int timeout)
{
return ServiceOSDRequest(url,data,"PUT", 20000);
return ServiceOSDRequest(url,data, "PUT", timeout, true);
}
public static OSDMap PostToService(string url, OSDMap data)
public static OSDMap PutToService(string url, OSDMap data, int timeout)
{
return PostToService(url, data, 20000);
return ServiceOSDRequest(url,data, "PUT", timeout, false);
}
public static OSDMap PostToService(string url, OSDMap data, int timeout)
{
return ServiceOSDRequest(url,data,"POST", timeout);
return ServiceOSDRequest(url, data, "POST", timeout, false);
}
public static OSDMap GetFromService(string url)
public static OSDMap PostToServiceCompressed(string url, OSDMap data, int timeout)
{
return ServiceOSDRequest(url,null,"GET", 20000);
return ServiceOSDRequest(url, data, "POST", timeout, true);
}
public static OSDMap GetFromService(string url, int timeout)
{
return ServiceOSDRequest(url, null, "GET", timeout, false);
}
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
{
int reqnum = m_requestNumber++;
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
@@ -182,13 +188,34 @@ namespace OpenSim.Framework
// If there is some input, write it into the request
if (data != null)
{
string strBuffer = OSDParser.SerializeJsonString(data);
string strBuffer = OSDParser.SerializeJsonString(data);
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
request.ContentType = "application/json";
request.ContentLength = buffer.Length; //Count bytes to send
using (Stream requestStream = request.GetRequestStream())
requestStream.Write(buffer, 0, buffer.Length); //Send it
if (compressed)
{
request.ContentType = "application/x-gzip";
using (MemoryStream ms = new MemoryStream())
{
using (GZipStream comp = new GZipStream(ms, CompressionMode.Compress))
{
comp.Write(buffer, 0, buffer.Length);
// We need to close the gzip stream before we write it anywhere
// because apparently something important related to gzip compression
// gets written on the strteam upon Dispose()
}
byte[] buf = ms.ToArray();
request.ContentLength = buf.Length; //Count bytes to send
using (Stream requestStream = request.GetRequestStream())
requestStream.Write(buf, 0, (int)buf.Length);
}
}
else
{
request.ContentType = "application/json";
request.ContentLength = buffer.Length; //Count bytes to send
using (Stream requestStream = request.GetRequestStream())
requestStream.Write(buffer, 0, buffer.Length); //Send it
}
}
// capture how much time was spent writing, this may seem silly
@@ -224,11 +251,11 @@ namespace OpenSim.Framework
// This just dumps a warning for any operation that takes more than 100 ms
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
if (tickdiff > LongCallTime)
m_log.InfoFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
m_log.DebugFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
reqnum,url,method,tickdiff,tickdata);
}
m_log.WarnFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
return ErrorResponseMap(errorMessage);
}
@@ -814,7 +841,7 @@ namespace OpenSim.Framework
{
if ((verb == "POST") || (verb == "PUT"))
{
request.ContentType = "text/www-form-urlencoded";
request.ContentType = "application/x-www-form-urlencoded";
int length = 0;
using (StreamWriter writer = new StreamWriter(buffer))
@@ -891,6 +918,10 @@ namespace OpenSim.Framework
public class SynchronousRestObjectRequester
{
private static readonly ILog m_log =
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
@@ -941,8 +972,9 @@ namespace OpenSim.Framework
requestStream = request.GetRequestStream();
requestStream.Write(buffer.ToArray(), 0, length);
}
catch (Exception)
catch (Exception e)
{
m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
return deserial;
}
finally
@@ -954,21 +986,33 @@ namespace OpenSim.Framework
try
{
using (WebResponse resp = request.GetResponse())
using (HttpWebResponse resp = (HttpWebResponse)request.GetResponse())
{
if (resp.ContentLength > 0)
if (resp.StatusCode == HttpStatusCode.NotFound)
return deserial;
if (resp.ContentLength != 0)
{
Stream respStream = resp.GetResponseStream();
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
deserial = (TResponse)deserializer.Deserialize(respStream);
respStream.Close();
}
else
m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
}
}
catch (System.InvalidOperationException)
{
// This is what happens when there is invalid XML
m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
}
catch (Exception e)
{
m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
}
return deserial;
}
}

View File

@@ -372,21 +372,7 @@ namespace OpenSim
= startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
}
IConfig standaloneConfig = m_config.Source.Configs["StandAlone"];
if (standaloneConfig != null)
{
m_configSettings.StandaloneAuthenticate = standaloneConfig.GetBoolean("accounts_authenticate", true);
m_configSettings.StandaloneWelcomeMessage = standaloneConfig.GetString("welcome_message");
m_configSettings.StandaloneInventoryPlugin = standaloneConfig.GetString("inventory_plugin");
m_configSettings.StandaloneInventorySource = standaloneConfig.GetString("inventory_source");
m_configSettings.StandaloneUserPlugin = standaloneConfig.GetString("userDatabase_plugin");
m_configSettings.StandaloneUserSource = standaloneConfig.GetString("user_source");
m_configSettings.LibrariesXMLFile = standaloneConfig.GetString("LibrariesXMLFile");
}
m_networkServersInfo.loadFromConfiguration(m_config.Source);
}
}
}
}

View File

@@ -0,0 +1,938 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using OpenMetaverse;
using Nini.Config;
using log4net;
using OpenSim.Framework;
using OpenSim.Framework.Capabilities;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.ClientStack.Linden
{
public delegate void UpLoadedAsset(
string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
byte[] data, string inventoryType, string assetType);
public delegate void UploadedBakedTexture(UUID assetID, byte[] data);
public delegate UUID UpdateItem(UUID itemID, byte[] data);
public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors);
public delegate void NewInventoryItem(UUID userID, InventoryItemBase item);
public delegate void NewAsset(AssetBase asset);
public delegate UUID ItemUpdatedCallback(UUID userID, UUID itemID, byte[] data);
public delegate ArrayList TaskScriptUpdatedCallback(UUID userID, UUID itemID, UUID primID,
bool isScriptRunning, byte[] data);
public delegate InventoryCollection FetchInventoryDescendentsCAPS(UUID agentID, UUID folderID, UUID ownerID,
bool fetchFolders, bool fetchItems, int sortOrder, out int version);
/// <summary>
/// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that
/// we can popup a message on the user's client if the inventory service has permanently failed). But I didn't want
/// to just pass the whole Scene into CAPS.
/// </summary>
public delegate IClientAPI GetClientDelegate(UUID agentID);
public class BunchOfCaps
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_Scene;
private Caps m_HostCapsObj;
private static readonly string m_requestPath = "0000/";
// private static readonly string m_mapLayerPath = "0001/";
private static readonly string m_newInventory = "0002/";
//private static readonly string m_requestTexture = "0003/";
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_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
// These are callbacks which will be setup by the scene so that we can update scene data when we
// receive capability calls
public NewInventoryItem AddNewInventoryItem = null;
public NewAsset AddNewAsset = null;
public ItemUpdatedCallback ItemUpdatedCall = null;
public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null;
public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
public GetClientDelegate GetClient = null;
private bool m_persistBakedTextures = false;
private IAssetService m_assetService;
private bool m_dumpAssetsToFile;
private string m_regionName;
public BunchOfCaps(Scene scene, Caps caps)
{
m_Scene = scene;
m_HostCapsObj = caps;
IConfigSource config = m_Scene.Config;
if (config != null)
{
IConfig sconfig = config.Configs["Startup"];
if (sconfig != null)
m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
}
m_assetService = m_Scene.AssetService;
m_regionName = m_Scene.RegionInfo.RegionName;
RegisterHandlers();
AddNewInventoryItem = m_Scene.AddUploadedInventoryItem;
ItemUpdatedCall = m_Scene.CapsUpdateInventoryItemAsset;
TaskScriptUpdatedCall = m_Scene.CapsUpdateTaskInventoryScriptAsset;
CAPSFetchInventoryDescendents = m_Scene.HandleFetchInventoryDescendentsCAPS;
GetClient = m_Scene.SceneContents.GetControllingClient;
}
/// <summary>
/// Register a bunch of CAPS http service handlers
/// </summary>
public void RegisterHandlers()
{
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
RegisterRegionServiceHandlers(capsBase);
RegisterInventoryServiceHandlers(capsBase);
}
public void RegisterRegionServiceHandlers(string capsBase)
{
try
{
// the root of all evil
m_HostCapsObj.RegisterHandler("SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest));
m_log.DebugFormat(
"[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
//m_capsHandlers["MapLayer"] =
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
// capsBase + m_mapLayerPath,
// GetMapLayer);
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
m_HostCapsObj.RegisterHandler("UploadBakedTexture", new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture));
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
}
public void RegisterInventoryServiceHandlers(string capsBase)
{
try
{
// I don't think this one works...
m_HostCapsObj.RegisterHandler("NewFileAgentInventory", new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST",
capsBase + m_newInventory,
NewAgentInventoryRequest));
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory);
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
// As of RC 1.22.9 of the Linden client this is
// supported
//m_capsHandlers["WebFetchInventoryDescendents"] =new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryDescendentsRequest);
// justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and
// subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires
// enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service,
// but when I went on the Linden grid, the
// simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead,
// the 1.19.1.4 client appeared to be happily flowing inventory data over UDP
//
// This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid
// we will be
// able to get the data we need to implement the necessary part of the protocol to fix the issue above.
// m_capsHandlers["FetchInventoryDescendents"] =
// new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest);
// m_capsHandlers["FetchInventoryDescendents"] =
// new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST",
// capsBase + m_fetchInventory,
// FetchInventory));
// m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST",
// capsBase + m_requestTexture,
// RequestTexture);
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
}
/// <summary>
/// Construct a client response detailing all the capabilities this server can provide.
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <param name="httpRequest">HTTP request header object</param>
/// <param name="httpResponse">HTTP response header object</param>
/// <returns></returns>
public string SeedCapRequest(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
{
m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
return string.Empty;
}
Hashtable caps = m_HostCapsObj.CapsHandlers.CapsDetails;
// Add the external too
foreach (KeyValuePair<string, string> kvp in m_HostCapsObj.ExternalCapsHandlers)
caps[kvp.Key] = kvp.Value;
string result = LLSDHelpers.SerialiseLLSDReply(caps);
//m_log.DebugFormat("[CAPS] CapsRequest {0}", result);
return result;
}
/// <summary>
/// Called by the script task update handler. Provides a URL to which the client can upload a new asset.
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <param name="httpRequest">HTTP request header object</param>
/// <param name="httpResponse">HTTP response header object</param>
/// <returns></returns>
public string ScriptTaskInventory(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
try
{
m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
//m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
LLSDHelpers.DeserialiseOSDMap(hash, llsdUpdateRequest);
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
TaskInventoryScriptUpdater uploader =
new TaskInventoryScriptUpdater(
llsdUpdateRequest.item_id,
llsdUpdateRequest.task_id,
llsdUpdateRequest.is_script_running,
capsBase + uploaderPath,
m_HostCapsObj.HttpListener,
m_dumpAssetsToFile);
uploader.OnUpLoad += TaskScriptUpdated;
m_HostCapsObj.HttpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
string protocol = "http://";
if (m_HostCapsObj.SSLCaps)
protocol = "https://";
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
uploaderPath;
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload";
// m_log.InfoFormat("[CAPS]: " +
// "ScriptTaskInventory response: {0}",
// LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
return null;
}
/// <summary>
/// Called when new asset data for an agent inventory item update has been uploaded.
/// </summary>
/// <param name="itemID">Item to update</param>
/// <param name="primID">Prim containing item to update</param>
/// <param name="isScriptRunning">Signals whether the script to update is currently running</param>
/// <param name="data">New asset data</param>
public void TaskScriptUpdated(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors)
{
if (TaskScriptUpdatedCall != null)
{
ArrayList e = TaskScriptUpdatedCall(m_HostCapsObj.AgentID, itemID, primID, isScriptRunning, data);
foreach (Object item in e)
errors.Add(item);
}
}
public string UploadBakedTexture(string request, string path,
string param, OSHttpRequest httpRequest,
OSHttpResponse httpResponse)
{
try
{
// m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
// m_regionName);
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
BakedTextureUploader uploader =
new BakedTextureUploader(capsBase + uploaderPath, m_HostCapsObj.HttpListener);
uploader.OnUpLoad += BakedTextureUploaded;
m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath,
uploader.uploaderCaps));
string protocol = "http://";
if (m_HostCapsObj.SSLCaps)
protocol = "https://";
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" +
m_HostCapsObj.Port.ToString() + capsBase + uploaderPath;
LLSDAssetUploadResponse uploadResponse =
new LLSDAssetUploadResponse();
uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload";
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
return null;
}
public void BakedTextureUploaded(UUID assetID, byte[] data)
{
// m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
AssetBase asset;
asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString());
asset.Data = data;
asset.Temporary = true;
asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are
m_assetService.Store(asset);
}
/// <summary>
/// Called when new asset data for an agent inventory item update has been uploaded.
/// </summary>
/// <param name="itemID">Item to update</param>
/// <param name="data">New asset data</param>
/// <returns></returns>
public UUID ItemUpdated(UUID itemID, byte[] data)
{
if (ItemUpdatedCall != null)
{
return ItemUpdatedCall(m_HostCapsObj.AgentID, itemID, data);
}
return UUID.Zero;
}
/// <summary>
///
/// </summary>
/// <param name="llsdRequest"></param>
/// <returns></returns>
public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest)
{
//m_log.Debug("[CAPS]: NewAgentInventoryRequest Request is: " + llsdRequest.ToString());
//m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type + " , " + llsdRequest.asset_type);
if (llsdRequest.asset_type == "texture" ||
llsdRequest.asset_type == "animation" ||
llsdRequest.asset_type == "sound")
{
IClientAPI client = null;
IScene scene = null;
if (GetClient != null)
{
client = GetClient(m_HostCapsObj.AgentID);
scene = client.Scene;
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
if (mm != null)
{
if (!mm.UploadCovered(client, mm.UploadCharge))
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
errorResponse.uploader = "";
errorResponse.state = "error";
return errorResponse;
}
}
}
}
string assetName = llsdRequest.name;
string assetDes = llsdRequest.description;
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
UUID newAsset = UUID.Random();
UUID newInvItem = UUID.Random();
UUID parentFolder = llsdRequest.folder_id;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
AssetUploader uploader =
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
string protocol = "http://";
if (m_HostCapsObj.SSLCaps)
protocol = "https://";
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
uploaderPath;
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload";
uploader.OnUpLoad += UploadCompleteHandler;
return uploadResponse;
}
/// <summary>
///
/// </summary>
/// <param name="assetID"></param>
/// <param name="inventoryItem"></param>
/// <param name="data"></param>
public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID,
UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
string assetType)
{
sbyte assType = 0;
sbyte inType = 0;
if (inventoryType == "sound")
{
inType = 1;
assType = 1;
}
else if (inventoryType == "animation")
{
inType = 19;
assType = 20;
}
else if (inventoryType == "wearable")
{
inType = 18;
switch (assetType)
{
case "bodypart":
assType = 13;
break;
case "clothing":
assType = 5;
break;
}
}
AssetBase asset;
asset = new AssetBase(assetID, assetName, assType, m_HostCapsObj.AgentID.ToString());
asset.Data = data;
if (AddNewAsset != null)
AddNewAsset(asset);
else if (m_assetService != null)
m_assetService.Store(asset);
InventoryItemBase item = new InventoryItemBase();
item.Owner = m_HostCapsObj.AgentID;
item.CreatorId = m_HostCapsObj.AgentID.ToString();
item.CreatorData = String.Empty;
item.ID = inventoryItem;
item.AssetID = asset.FullID;
item.Description = assetDescription;
item.Name = assetName;
item.AssetType = assType;
item.InvType = inType;
item.Folder = parentFolder;
item.CurrentPermissions = (uint)PermissionMask.All;
item.BasePermissions = (uint)PermissionMask.All;
item.EveryOnePermissions = 0;
item.NextPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer);
item.CreationDate = Util.UnixTimeSinceEpoch();
if (AddNewInventoryItem != null)
{
AddNewInventoryItem(m_HostCapsObj.AgentID, item);
}
}
/// <summary>
///
/// </summary>
/// <param name="mapReq"></param>
/// <returns></returns>
public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq)
{
m_log.Debug("[CAPS]: MapLayer Request in region: " + m_regionName);
LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse();
mapResponse.LayerData.Array.Add(GetOSDMapLayerResponse());
return mapResponse;
}
/// <summary>
///
/// </summary>
/// <returns></returns>
protected static OSDMapLayer GetOSDMapLayerResponse()
{
OSDMapLayer mapLayer = new OSDMapLayer();
mapLayer.Right = 5000;
mapLayer.Top = 5000;
mapLayer.ImageID = new UUID("00000000-0000-1111-9999-000000000006");
return mapLayer;
}
/// <summary>
///
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string RequestTexture(string request, string path, string param)
{
m_log.Debug("texture request " + request);
// Needs implementing (added to remove compiler warning)
return String.Empty;
}
/// <summary>
/// Called by the notecard update handler. Provides a URL to which the client can upload a new asset.
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string NoteCardAgentInventory(string request, string path, string param,
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
{
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName + "\n" + request);
//m_log.Debug("[CAPS]: NoteCardAgentInventory Request is: " + request);
//OpenMetaverse.StructuredData.OSDMap hash = (OpenMetaverse.StructuredData.OSDMap)OpenMetaverse.StructuredData.LLSDParser.DeserializeBinary(Utils.StringToBytes(request));
Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
LLSDItemUpdate llsdRequest = new LLSDItemUpdate();
LLSDHelpers.DeserialiseOSDMap(hash, llsdRequest);
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
ItemUpdater uploader =
new ItemUpdater(llsdRequest.item_id, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
uploader.OnUpLoad += ItemUpdated;
m_HostCapsObj.HttpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
string protocol = "http://";
if (m_HostCapsObj.SSLCaps)
protocol = "https://";
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" + m_HostCapsObj.Port.ToString() + capsBase +
uploaderPath;
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload";
// m_log.InfoFormat("[CAPS]: " +
// "NoteCardAgentInventory response: {0}",
// LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
}
}
public class AssetUploader
{
public event UpLoadedAsset OnUpLoad;
private UpLoadedAsset handlerUpLoad = null;
private string uploaderPath = String.Empty;
private UUID newAssetID;
private UUID inventoryItemID;
private UUID parentFolder;
private IHttpServer httpListener;
private bool m_dumpAssetsToFile;
private string m_assetName = String.Empty;
private string m_assetDes = String.Empty;
private string m_invType = String.Empty;
private string m_assetType = String.Empty;
public AssetUploader(string assetName, string description, UUID assetID, UUID inventoryItem,
UUID parentFolderID, string invType, string assetType, string path,
IHttpServer httpServer, bool dumpAssetsToFile)
{
m_assetName = assetName;
m_assetDes = description;
newAssetID = assetID;
inventoryItemID = inventoryItem;
uploaderPath = path;
httpListener = httpServer;
parentFolder = parentFolderID;
m_assetType = assetType;
m_invType = invType;
m_dumpAssetsToFile = dumpAssetsToFile;
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string uploaderCaps(byte[] data, string path, string param)
{
UUID inv = inventoryItemID;
string res = String.Empty;
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
uploadComplete.new_asset = newAssetID.ToString();
uploadComplete.new_inventory_item = inv;
uploadComplete.state = "complete";
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
httpListener.RemoveStreamHandler("POST", uploaderPath);
// TODO: probably make this a better set of extensions here
string extension = ".jp2";
if (m_invType != "image")
{
extension = ".dat";
}
if (m_dumpAssetsToFile)
{
SaveAssetToFile(m_assetName + extension, data);
}
handlerUpLoad = OnUpLoad;
if (handlerUpLoad != null)
{
handlerUpLoad(m_assetName, m_assetDes, newAssetID, inv, parentFolder, data, m_invType, m_assetType);
}
return res;
}
///Left this in and commented in case there are unforseen issues
//private void SaveAssetToFile(string filename, byte[] data)
//{
// FileStream fs = File.Create(filename);
// BinaryWriter bw = new BinaryWriter(fs);
// bw.Write(data);
// bw.Close();
// fs.Close();
//}
private static void SaveAssetToFile(string filename, byte[] data)
{
string assetPath = "UserAssets";
if (!Directory.Exists(assetPath))
{
Directory.CreateDirectory(assetPath);
}
FileStream fs = File.Create(Path.Combine(assetPath, Util.safeFileName(filename)));
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(data);
bw.Close();
fs.Close();
}
}
/// <summary>
/// This class is a callback invoked when a client sends asset data to
/// an agent inventory notecard update url
/// </summary>
public class ItemUpdater
{
public event UpdateItem OnUpLoad;
private UpdateItem handlerUpdateItem = null;
private string uploaderPath = String.Empty;
private UUID inventoryItemID;
private IHttpServer httpListener;
private bool m_dumpAssetToFile;
public ItemUpdater(UUID inventoryItem, string path, IHttpServer httpServer, bool dumpAssetToFile)
{
m_dumpAssetToFile = dumpAssetToFile;
inventoryItemID = inventoryItem;
uploaderPath = path;
httpListener = httpServer;
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string uploaderCaps(byte[] data, string path, string param)
{
UUID inv = inventoryItemID;
string res = String.Empty;
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
UUID assetID = UUID.Zero;
handlerUpdateItem = OnUpLoad;
if (handlerUpdateItem != null)
{
assetID = handlerUpdateItem(inv, data);
}
uploadComplete.new_asset = assetID.ToString();
uploadComplete.new_inventory_item = inv;
uploadComplete.state = "complete";
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
httpListener.RemoveStreamHandler("POST", uploaderPath);
if (m_dumpAssetToFile)
{
SaveAssetToFile("updateditem" + Util.RandomClass.Next(1, 1000) + ".dat", data);
}
return res;
}
///Left this in and commented in case there are unforseen issues
//private void SaveAssetToFile(string filename, byte[] data)
//{
// FileStream fs = File.Create(filename);
// BinaryWriter bw = new BinaryWriter(fs);
// bw.Write(data);
// bw.Close();
// fs.Close();
//}
private static void SaveAssetToFile(string filename, byte[] data)
{
string assetPath = "UserAssets";
if (!Directory.Exists(assetPath))
{
Directory.CreateDirectory(assetPath);
}
FileStream fs = File.Create(Path.Combine(assetPath, filename));
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(data);
bw.Close();
fs.Close();
}
}
/// <summary>
/// This class is a callback invoked when a client sends asset data to
/// a task inventory script update url
/// </summary>
public class TaskInventoryScriptUpdater
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public event UpdateTaskScript OnUpLoad;
private UpdateTaskScript handlerUpdateTaskScript = null;
private string uploaderPath = String.Empty;
private UUID inventoryItemID;
private UUID primID;
private bool isScriptRunning;
private IHttpServer httpListener;
private bool m_dumpAssetToFile;
public TaskInventoryScriptUpdater(UUID inventoryItemID, UUID primID, int isScriptRunning,
string path, IHttpServer httpServer, bool dumpAssetToFile)
{
m_dumpAssetToFile = dumpAssetToFile;
this.inventoryItemID = inventoryItemID;
this.primID = primID;
// This comes in over the packet as an integer, but actually appears to be treated as a bool
this.isScriptRunning = (0 == isScriptRunning ? false : true);
uploaderPath = path;
httpListener = httpServer;
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string uploaderCaps(byte[] data, string path, string param)
{
try
{
// m_log.InfoFormat("[CAPS]: " +
// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}",
// data, path, param));
string res = String.Empty;
LLSDTaskScriptUploadComplete uploadComplete = new LLSDTaskScriptUploadComplete();
ArrayList errors = new ArrayList();
handlerUpdateTaskScript = OnUpLoad;
if (handlerUpdateTaskScript != null)
{
handlerUpdateTaskScript(inventoryItemID, primID, isScriptRunning, data, ref errors);
}
uploadComplete.new_asset = inventoryItemID;
uploadComplete.compiled = errors.Count > 0 ? false : true;
uploadComplete.state = "complete";
uploadComplete.errors = new OSDArray();
uploadComplete.errors.Array = errors;
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
httpListener.RemoveStreamHandler("POST", uploaderPath);
if (m_dumpAssetToFile)
{
SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data);
}
// m_log.InfoFormat("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res);
return res;
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
// XXX Maybe this should be some meaningful error packet
return null;
}
///Left this in and commented in case there are unforseen issues
//private void SaveAssetToFile(string filename, byte[] data)
//{
// FileStream fs = File.Create(filename);
// BinaryWriter bw = new BinaryWriter(fs);
// bw.Write(data);
// bw.Close();
// fs.Close();
//}
private static void SaveAssetToFile(string filename, byte[] data)
{
string assetPath = "UserAssets";
if (!Directory.Exists(assetPath))
{
Directory.CreateDirectory(assetPath);
}
FileStream fs = File.Create(Path.Combine(assetPath, filename));
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(data);
bw.Close();
fs.Close();
}
}
public class BakedTextureUploader
{
public event UploadedBakedTexture OnUpLoad;
private UploadedBakedTexture handlerUpLoad = null;
private string uploaderPath = String.Empty;
private UUID newAssetID;
private IHttpServer httpListener;
public BakedTextureUploader(string path, IHttpServer httpServer)
{
newAssetID = UUID.Random();
uploaderPath = path;
httpListener = httpServer;
// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string uploaderCaps(byte[] data, string path, string param)
{
handlerUpLoad = OnUpLoad;
if (handlerUpLoad != null)
{
Util.FireAndForget(delegate(object o) { handlerUpLoad(newAssetID, data); });
}
string res = String.Empty;
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
uploadComplete.new_asset = newAssetID.ToString();
uploadComplete.new_inventory_item = UUID.Zero;
uploadComplete.state = "complete";
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
httpListener.RemoveStreamHandler("POST", uploaderPath);
// m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
return res;
}
}
}

View File

@@ -0,0 +1,91 @@
/*
* 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 log4net;
using Nini.Config;
using OpenMetaverse;
using Mono.Addins;
using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using Caps = OpenSim.Framework.Capabilities.Caps;
[assembly: Addin("LindenCaps", "0.1")]
[assembly: AddinDependency("OpenSim", "0.5")]
namespace OpenSim.Region.ClientStack.Linden
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class BunchOfCapsModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_Scene;
#region INonSharedRegionModule
public string Name { get { return "BunchOfCapsModule"; } }
public Type ReplaceableInterface { get { return null; } }
public void Initialise(IConfigSource source)
{
}
public void Close() { }
public void AddRegion(Scene scene)
{
m_Scene = scene;
m_Scene.EventManager.OnRegisterCaps += OnRegisterCaps;
}
public void RemoveRegion(Scene scene)
{
}
public void RegionLoaded(Scene scene)
{
}
public void PostInitialise() { }
#endregion
private void OnRegisterCaps(UUID agentID, Caps caps)
{
new BunchOfCaps(m_Scene, caps);
}
}
}

View File

@@ -33,6 +33,7 @@ using System.Reflection;
using System.Threading;
using log4net;
using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenMetaverse.Messages.Linden;
using OpenMetaverse.Packets;
@@ -45,7 +46,7 @@ using OpenSim.Region.Framework.Scenes;
using BlockingLLSDQueue = OpenSim.Framework.BlockingQueue<OpenMetaverse.StructuredData.OSD>;
using Caps=OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.CoreModules.Framework.EventQueue
namespace OpenSim.Region.ClientStack.Linden
{
public struct QueueItem
{
@@ -53,6 +54,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
public OSDMap body;
}
//[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class EventQueueGetModule : IEventQueue, IRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -270,9 +272,9 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
public void OnRegisterCaps(UUID agentID, Caps caps)
{
// Register an event queue for the client
//m_log.DebugFormat(
// "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
// "[EVENTQUEUE]: OnRegisterCaps: agentID {0} caps {1} region {2}",
// agentID, caps, m_scene.RegionInfo.RegionName);
// Let's instantiate a Queue for this agent right now
@@ -315,7 +317,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
{
return ProcessQueue(m_dhttpMethod, agentID, caps);
}));
// This will persist this beyond the expiry of the caps handlers
MainServer.Instance.AddPollServiceHTTPHandler(
capsBase + EventQueueGetUUID.ToString() + "/", EventQueuePoll, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
@@ -520,7 +522,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
}
if (AvatarID != UUID.Zero)
{
return ProcessQueue(request, AvatarID, m_scene.CapsModule.GetCapsHandlerForUser(AvatarID));
return ProcessQueue(request, AvatarID, m_scene.CapsModule.GetCapsForUser(AvatarID));
}
else
{
@@ -715,5 +717,15 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
OSD item = EventQueueHelper.PlacesQuery(groupUpdate);
Enqueue(item, avatarID);
}
public OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono)
{
return EventQueueHelper.ScriptRunningReplyEvent(objectID, itemID, running, mono);
}
public OSD BuildEvent(string eventName, OSD eventBody)
{
return EventQueueHelper.BuildEvent(eventName, eventBody);
}
}
}

View File

@@ -32,7 +32,7 @@ using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenMetaverse.Messages.Linden;
namespace OpenSim.Region.CoreModules.Framework.EventQueue
namespace OpenSim.Region.ClientStack.Linden
{
public class EventQueueHelper
{
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
// return result;
// }
public static OSD buildEvent(string eventName, OSD eventBody)
public static OSD BuildEvent(string eventName, OSD eventBody)
{
OSDMap llsdEvent = new OSDMap(2);
llsdEvent.Add("message", new OSDString(eventName));
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("SimulatorInfo", arr);
return buildEvent("EnableSimulator", llsdBody);
return BuildEvent("EnableSimulator", llsdBody);
}
public static OSD DisableSimulator(ulong handle)
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
OSDMap llsdBody = new OSDMap(0);
//llsdBody.Add("SimulatorInfo", arr);
return buildEvent("DisableSimulator", llsdBody);
return BuildEvent("DisableSimulator", llsdBody);
}
public static OSD CrossRegion(ulong handle, Vector3 pos, Vector3 lookAt,
@@ -144,7 +144,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
llsdBody.Add("AgentData", agentDataArr);
llsdBody.Add("RegionData", regionDataArr);
return buildEvent("CrossedRegion", llsdBody);
return BuildEvent("CrossedRegion", llsdBody);
}
public static OSD TeleportFinishEvent(
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
OSDMap body = new OSDMap();
body.Add("Info", infoArr);
return buildEvent("TeleportFinish", body);
return BuildEvent("TeleportFinish", body);
}
public static OSD ScriptRunningReplyEvent(UUID objectID, UUID itemID, bool running, bool mono)
@@ -184,7 +184,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
OSDMap body = new OSDMap();
body.Add("Script", scriptArr);
return buildEvent("ScriptRunningReply", body);
return BuildEvent("ScriptRunningReply", body);
}
public static OSD EstablishAgentCommunication(UUID agentID, string simIpAndPort, string seedcap)
@@ -194,12 +194,12 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
body.Add("sim-ip-and-port", new OSDString(simIpAndPort));
body.Add("seed-capability", new OSDString(seedcap));
return buildEvent("EstablishAgentCommunication", body);
return BuildEvent("EstablishAgentCommunication", body);
}
public static OSD KeepAliveEvent()
{
return buildEvent("FAKEEVENT", new OSDMap());
return BuildEvent("FAKEEVENT", new OSDMap());
}
public static OSD AgentParams(UUID agentID, bool checkEstate, int godLevel, bool limitedToEstate)

View File

@@ -0,0 +1,139 @@
/*
* 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.Specialized;
using System.Reflection;
using System.IO;
using System.Web;
using Mono.Addins;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Capabilities.Handlers;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
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;
namespace OpenSim.Region.ClientStack.Linden
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class GetMeshModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IAssetService m_AssetService;
private bool m_Enabled = true;
private string m_URL;
#region IRegionModuleBase Members
public Type ReplaceableInterface
{
get { return null; }
}
public void Initialise(IConfigSource source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_URL = config.GetString("Cap_GetMesh", string.Empty);
// Cap doesn't exist
if (m_URL != string.Empty)
m_Enabled = true;
}
public void AddRegion(Scene pScene)
{
if (!m_Enabled)
return;
m_scene = pScene;
}
public void RemoveRegion(Scene scene)
{
if (!m_Enabled)
return;
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public void RegionLoaded(Scene scene)
{
if (!m_Enabled)
return;
m_AssetService = m_scene.RequestModuleInterface<IAssetService>();
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public void Close() { }
public string Name { get { return "GetMeshModule"; } }
#endregion
public void RegisterCaps(UUID agentID, Caps caps)
{
UUID capID = UUID.Random();
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
if (m_URL == "localhost")
{
m_log.InfoFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
delegate(Hashtable m_dhttpMethod)
{
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null);
});
caps.RegisterHandler("GetMesh", reqHandler);
}
else
{
m_log.InfoFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetMesh", m_URL);
}
}
}
}

View File

@@ -0,0 +1,142 @@
/*
* 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.Specialized;
using System.Drawing;
using System.Drawing.Imaging;
using System.Reflection;
using System.IO;
using System.Web;
using log4net;
using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenMetaverse.Imaging;
using OpenSim.Framework;
using OpenSim.Framework.Servers;
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
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class GetTextureModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IAssetService m_assetService;
private bool m_Enabled = false;
// TODO: Change this to a config option
const string REDIRECT_URL = null;
private string m_URL;
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_URL = config.GetString("Cap_GetTexture", string.Empty);
// Cap doesn't exist
if (m_URL != string.Empty)
m_Enabled = true;
}
public void AddRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene = s;
}
public void RemoveRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public void RegionLoaded(Scene s)
{
if (!m_Enabled)
return;
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public void PostInitialise()
{
}
public void Close() { }
public string Name { get { return "GetTextureModule"; } }
public Type ReplaceableInterface
{
get { return null; }
}
#endregion
public void RegisterCaps(UUID agentID, Caps caps)
{
UUID capID = UUID.Random();
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
if (m_URL == "localhost")
{
m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
}
else
{
m_log.InfoFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("GetTexture", m_URL);
}
}
}
}

View File

@@ -45,7 +45,7 @@ using OpenSim.Services.Interfaces;
using Caps = OpenSim.Framework.Capabilities.Caps;
using OpenSim.Framework.Capabilities;
namespace OpenSim.Region.CoreModules.Avatar.Assets
namespace OpenSim.Region.ClientStack.Linden
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule
@@ -171,8 +171,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Assets
UUID parentFolder = llsdRequest.folder_id;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000") + "/";
Caps.AssetUploader uploader =
new Caps.AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
AssetUploader uploader =
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile);
MainServer.Instance.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));

View File

@@ -39,7 +39,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using Caps=OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
namespace OpenSim.Region.ClientStack.Linden
{
public class ObjectAdd : IRegionModule
{

View File

@@ -49,7 +49,7 @@ using OSDMap = OpenMetaverse.StructuredData.OSDMap;
using OpenSim.Framework.Capabilities;
using ExtraParamType = OpenMetaverse.ExtraParamType;
namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
namespace OpenSim.Region.ClientStack.Linden
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class UploadObjectAssetModule : INonSharedRegionModule

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;
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
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class WebFetchInvDescModule : INonSharedRegionModule
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
private IInventoryService m_InventoryService;
private ILibraryService m_LibraryService;
private bool m_Enabled = false;
private string m_URL;
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
{
IConfig config = source.Configs["ClientStack.LindenCaps"];
if (config == null)
return;
m_URL = config.GetString("Cap_WebFetchInventoryDescendents", string.Empty);
// Cap doesn't exist
if (m_URL != string.Empty)
m_Enabled = true;
}
public void AddRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene = s;
}
public void RemoveRegion(Scene s)
{
if (!m_Enabled)
return;
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
m_scene = null;
}
public void RegionLoaded(Scene s)
{
if (!m_Enabled)
return;
m_InventoryService = m_scene.InventoryService; ;
m_LibraryService = m_scene.LibraryService;
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
}
public void PostInitialise()
{
}
public void Close() { }
public string Name { get { return "WebFetchInvDescModule"; } }
public Type ReplaceableInterface
{
get { return null; }
}
#endregion
public void RegisterCaps(UUID agentID, Caps caps)
{
UUID capID = UUID.Random();
//caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
if (m_URL == "localhost")
{
m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/" + UUID.Random(), webFetchHandler.FetchInventoryDescendentsRequest);
caps.RegisterHandler("WebFetchInventoryDescendents", reqHandler);
}
else
{
m_log.InfoFormat("[WEBFETCHINVENTORYDESCENDANTS]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
caps.RegisterHandler("WebFetchInventoryDescendents", m_URL);
}
}
}
}

View File

@@ -1370,7 +1370,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendMapBlock(List<MapBlockData> mapBlocks, uint flag)
{
MapBlockData[] mapBlocks2 = mapBlocks.ToArray();
int maxsend = 10;
@@ -1631,14 +1630,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
currentPacket.ItemData[itemsSent % MAX_ITEMS_PER_PACKET] = CreateItemDataBlock(items[itemsSent++]);
else
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID);
OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
currentPacket = null;
}
}
if (currentPacket != null)
{
// m_log.DebugFormat(
// "[LLCLIENTVIEW]: Sending inventory folder details packet to {0} for folder {1}", Name, folderID);
OutPacket(currentPacket, ThrottleOutPacketType.Asset, false);
}
}
private InventoryDescendentsPacket.FolderDataBlock CreateFolderDataBlock(InventoryFolderBase folder)
@@ -4368,37 +4372,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (bl[i].BannedUserID == UUID.Zero)
continue;
BannedUsers.Add(bl[i].BannedUserID);
if (BannedUsers.Count >= 50 || (i == (bl.Length - 1) && BannedUsers.Count > 0))
{
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
packet.AgentData.TransactionID = UUID.Random();
packet.AgentData.AgentID = AgentId;
packet.AgentData.SessionID = SessionId;
packet.MethodData.Invoice = invoice;
packet.MethodData.Method = Utils.StringToBytes("setaccess");
EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
int j;
for (j = 0; j < (6 + BannedUsers.Count); j++)
{
returnblock[j] = new EstateOwnerMessagePacket.ParamListBlock();
}
j = 0;
returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
foreach (UUID banned in BannedUsers)
{
returnblock[j].Parameter = banned.GetBytes(); j++;
}
packet.ParamList = returnblock;
packet.Header.Reliable = true;
OutPacket(packet, ThrottleOutPacketType.Task);
BannedUsers.Clear();
}
}
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
packet.AgentData.TransactionID = UUID.Random();
packet.AgentData.AgentID = AgentId;
packet.AgentData.SessionID = SessionId;
packet.MethodData.Invoice = invoice;
packet.MethodData.Method = Utils.StringToBytes("setaccess");
EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
for (int i = 0; i < (6 + BannedUsers.Count); i++)
{
returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
}
int j = 0;
returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++;
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
foreach (UUID banned in BannedUsers)
{
returnblock[j].Parameter = banned.GetBytes(); j++;
}
packet.ParamList = returnblock;
packet.Header.Reliable = false;
OutPacket(packet, ThrottleOutPacketType.Task);
}
public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
@@ -6038,7 +6049,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AvatarWearingArgs wearingArgs = new AvatarWearingArgs();
for (int i = 0; i < nowWearing.WearableData.Length; i++)
{
m_log.DebugFormat("[XXX]: Wearable type {0} item {1}", nowWearing.WearableData[i].WearableType, nowWearing.WearableData[i].ItemID);
//m_log.DebugFormat("[XXX]: Wearable type {0} item {1}", nowWearing.WearableData[i].WearableType, nowWearing.WearableData[i].ItemID);
AvatarWearingArgs.Wearable wearable =
new AvatarWearingArgs.Wearable(nowWearing.WearableData[i].ItemID,
nowWearing.WearableData[i].WearableType);
@@ -8320,13 +8331,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true;
}
#endregion
string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
map.NameData.Name.Length - 1);
RequestMapName handlerMapNameRequest = OnMapNameRequest;
if (handlerMapNameRequest != null)
{
handlerMapNameRequest(this, mapName);
handlerMapNameRequest(this, mapName, map.AgentData.Flags);
}
return true;
}

View File

@@ -96,6 +96,22 @@ namespace OpenSim.Region.ClientStack
MainServer.Instance = m_httpServer;
// "OOB" Server
if (m_networkServersInfo.ssl_listener)
{
BaseHttpServer server = null;
server = new BaseHttpServer(
m_networkServersInfo.https_port, m_networkServersInfo.ssl_listener, m_networkServersInfo.cert_path,
m_networkServersInfo.cert_pass);
// Add the server to m_Servers
if(server != null)
{
m_log.InfoFormat("[REGION SERVER]: Starting HTTPS server on port {0}", server.Port);
MainServer.AddHttpServer(server);
server.Start();
}
}
base.StartupSpecific();
}

View File

@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
}
if (m_scene == null)
m_scene = scene;
m_scene = scene;
}
public void PostInitialise()
@@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// one and we're done otherwise, ask for a rebake
if (checkonly) return false;
m_log.InfoFormat("[AVFACTORY] missing baked texture {0}, request rebake",face.TextureID);
m_log.InfoFormat("[AVFACTORY]: missing baked texture {0}, requesting rebake",face.TextureID);
client.SendRebakeAvatarTextures(face.TextureID);
}
}
m_log.DebugFormat("[AVFACTORY]: complete texture check for {0}", client.AgentId);
m_log.DebugFormat("[AVFACTORY]: completed texture check for {0}", client.AgentId);
// If we only found default textures, then the appearance is not cached
return (defonly ? false : true);

View File

@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
{
@@ -104,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
MemoryStream archiveWriteStream = new MemoryStream();

View File

@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
{
@@ -72,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "password");
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
InventoryItemBase coaItem
@@ -138,7 +137,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string userLastName = "Stirrup";
string userPassword = "troll";
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, userId, userPassword);
// Create asset
UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040");
@@ -229,7 +228,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "meowfood");
m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "meowfood", m_iarStream);
InventoryItemBase foundItem1
@@ -261,8 +260,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire");
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "meowfood");
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL2, "hampshire");
m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
InventoryItemBase foundItem1
@@ -294,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UserProfileTestUtils.CreateUserWithInventory(m_scene, m_uaMT, "password");
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaMT, "password");
m_archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "password", m_iarStream);
InventoryItemBase foundItem1

View File

@@ -44,7 +44,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
{
@@ -71,7 +70,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string userLastName = "Stirrup";
string userPassword = "troll";
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, userPassword);
// Create asset
SceneObjectGroup object1;
@@ -184,8 +183,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "meowfood");
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "meowfood");
UserAccountHelpers.CreateUserWithInventory(scene, m_uaLL1, "hampshire");
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/", "meowfood", m_iarStream);
InventoryItemBase foundItem1
@@ -194,7 +193,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
// Now try loading to a root child folder
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA");
UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xA");
MemoryStream archiveReadStream = new MemoryStream(m_iarStream.ToArray());
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xA", "meowfood", archiveReadStream);
@@ -203,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2");
// Now try loading to a more deeply nested folder
UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC");
UserInventoryHelpers.CreateInventoryFolder(scene.InventoryService, m_uaMT.PrincipalID, "xB/xC");
archiveReadStream = new MemoryStream(archiveReadStream.ToArray());
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "xB/xC", "meowfood", archiveReadStream);
@@ -226,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
Scene scene = SceneSetupHelpers.SetupScene();
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
UserProfileTestUtils.CreateUserWithInventory(scene, m_uaMT, "password");
UserAccountHelpers.CreateUserWithInventory(scene, m_uaMT, "password");
archiverModule.DearchiveInventory(m_uaMT.FirstName, m_uaMT.LastName, "/Objects", "password", m_iarStream);
InventoryItemBase foundItem1
@@ -255,7 +254,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string userFirstName = "Jock";
string userLastName = "Stirrup";
UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020");
UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood");
UserAccountHelpers.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood");
// Create asset
SceneObjectGroup object1;
@@ -328,7 +327,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>();
HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>();
@@ -395,13 +394,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
//log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
string folder2Name = "b";
InventoryFolderBase folder1
= UserInventoryTestUtils.CreateInventoryFolder(
= UserInventoryHelpers.CreateInventoryFolder(
scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());
@@ -446,13 +445,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure();
Scene scene = SceneSetupHelpers.SetupScene();
UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene);
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene);
string folder1ExistingName = "a";
string folder2Name = "b";
InventoryFolderBase folder1
= UserInventoryTestUtils.CreateInventoryFolder(
= UserInventoryHelpers.CreateInventoryFolder(
scene.InventoryService, ua1.PrincipalID, folder1ExistingName);
string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random());

View File

@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Console;
@@ -38,8 +39,9 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using Caps=OpenSim.Framework.Capabilities.Caps;
namespace OpenSim.Region.CoreModules.Agent.Capabilities
namespace OpenSim.Region.CoreModules.Framework
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -49,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
/// <summary>
/// Each agent has its own capabilities handler.
/// </summary>
protected Dictionary<UUID, Caps> m_capsHandlers = new Dictionary<UUID, Caps>();
protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>();
protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>();
protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds
@@ -64,8 +66,8 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
m_scene = scene;
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
"show capabilities",
"Shows all registered capabilities", CapabilitiesCommand);
"show caps",
"Shows all registered capabilities", CapabilitiesCommand);
}
public void RegionLoaded(Scene scene)
@@ -93,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
get { return null; }
}
public void AddCapsHandler(UUID agentId)
public void CreateCaps(UUID agentId)
{
int flags = m_scene.GetUserFlags(agentId);
if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags))
@@ -101,12 +103,12 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
String capsObjectPath = GetCapsPath(agentId);
if (m_capsHandlers.ContainsKey(agentId))
if (m_capsObjects.ContainsKey(agentId))
{
Caps oldCaps = m_capsHandlers[agentId];
Caps oldCaps = m_capsObjects[agentId];
m_log.DebugFormat(
"[CAPS]: Reregistering caps for agent {0}. Old caps path {1}, new caps path {2}. ",
"[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ",
agentId, oldCaps.CapsObjectPath, capsObjectPath);
// This should not happen. The caller code is confused. We need to fix that.
// CAPs can never be reregistered, or the client will be confused.
@@ -114,39 +116,29 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
//return;
}
Caps caps
= new Caps(m_scene,
m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
Caps caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
(MainServer.Instance == null) ? 0: MainServer.Instance.Port,
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
capsObjectPath, agentId, m_scene.RegionInfo.RegionName);
caps.RegisterHandlers();
m_capsObjects[agentId] = caps;
m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps);
caps.AddNewInventoryItem = m_scene.AddUploadedInventoryItem;
caps.ItemUpdatedCall = m_scene.CapsUpdateInventoryItemAsset;
caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset;
caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS;
caps.GetClient = m_scene.SceneContents.GetControllingClient;
m_capsHandlers[agentId] = caps;
}
public void RemoveCapsHandler(UUID agentId)
public void RemoveCaps(UUID agentId)
{
if (childrenSeeds.ContainsKey(agentId))
{
childrenSeeds.Remove(agentId);
}
lock (m_capsHandlers)
lock (m_capsObjects)
{
if (m_capsHandlers.ContainsKey(agentId))
if (m_capsObjects.ContainsKey(agentId))
{
m_capsHandlers[agentId].DeregisterHandlers();
m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsHandlers[agentId]);
m_capsHandlers.Remove(agentId);
m_capsObjects[agentId].DeregisterHandlers();
m_scene.EventManager.TriggerOnDeregisterCaps(agentId, m_capsObjects[agentId]);
m_capsObjects.Remove(agentId);
}
else
{
@@ -157,20 +149,20 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
}
}
public Caps GetCapsHandlerForUser(UUID agentId)
public Caps GetCapsForUser(UUID agentId)
{
lock (m_capsHandlers)
lock (m_capsObjects)
{
if (m_capsHandlers.ContainsKey(agentId))
if (m_capsObjects.ContainsKey(agentId))
{
return m_capsHandlers[agentId];
return m_capsObjects[agentId];
}
}
return null;
}
public void NewUserConnection(AgentCircuitData agent)
public void SetAgentCapsSeeds(AgentCircuitData agent)
{
capsPaths[agent.AgentID] = agent.CapsPath;
childrenSeeds[agent.AgentID]
@@ -240,7 +232,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
System.Text.StringBuilder caps = new System.Text.StringBuilder();
caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName);
foreach (KeyValuePair<UUID, Caps> kvp in m_capsHandlers)
foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects)
{
caps.AppendFormat("** User {0}:\n", kvp.Key);
for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); )
@@ -248,6 +240,8 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
Uri uri = new Uri(kvp2.Value.ToString());
caps.AppendFormat(" {0} = {1}\n", kvp2.Key, uri.PathAndQuery);
}
foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers)
caps.AppendFormat(" {0} = {1}\n", kvp3.Key, kvp3.Value);
}
MainConsole.Instance.Output(caps.ToString());

View File

@@ -396,6 +396,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
sp.ControllingClient.SendTeleportProgress(teleportFlags | (uint)TeleportFlags.DisableCancel, "sending_dest");
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID);
@@ -910,6 +912,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
{
// region doesn't take it
ReInstantiateScripts(agent);
ResetFromTransit(agent.UUID);
return agent;
}
@@ -1785,11 +1788,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected void ReInstantiateScripts(ScenePresence sp)
{
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
int i = 0;
if (sp.InTransitScriptStates.Count > 0)
{
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
sog.ResumeScripts();
});
sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
{
if (i < sp.InTransitScriptStates.Count)
{
sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
sog.ResumeScripts();
}
else
m_log.ErrorFormat("[ENTITY TRANSFER MODULE]: InTransitScriptStates.Count={0} smaller than Attachments.Count={1}", sp.InTransitScriptStates.Count, sp.Attachments.Count);
});
sp.InTransitScriptStates.Clear();
}
}
#endregion

View File

@@ -594,9 +594,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
}
// This is a hook to do some per-asset post-processing for subclasses that need that
if (remoteClient != null)
ExportAsset(remoteClient.AgentId, assetID);
return assetID;
}
protected virtual void ExportAsset(UUID agentID, UUID assetID)
{
// nothing to do here
}
/// <summary>
/// Rez an object into the scene from the user's inventory
@@ -1025,9 +1034,5 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
#endregion
protected virtual void ExportAsset(UUID agentID, UUID assetID)
{
}
}
}

View File

@@ -45,7 +45,6 @@ using OpenSim.Region.Framework.Scenes.Serialization;
using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common;
using OpenSim.Tests.Common.Mock;
using OpenSim.Tests.Common.Setup;
namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
{
@@ -73,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
string userFirstName = "Jock";
string userLastName = "Stirrup";
string userPassword = "troll";
UserProfileTestUtils.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);
UserAccountHelpers.CreateUserWithInventory(m_scene, userFirstName, userLastName, m_userId, userPassword);
AgentCircuitData acd = new AgentCircuitData();
acd.AgentID = m_userId;

View File

@@ -62,8 +62,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
{
List<MapBlockData> mapBlocks = new List<MapBlockData>();
List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
(minX - 4) * (int)Constants.RegionSize, (maxX + 4) * (int)Constants.RegionSize,
(minY - 4) * (int)Constants.RegionSize, (maxY + 4) * (int)Constants.RegionSize);
minX * (int)Constants.RegionSize, maxX * (int)Constants.RegionSize,
minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize);
foreach (GridRegion r in regions)
{
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
FillInMap(mapBlocks, minX, minY, maxX, maxY);
//
remoteClient.SendMapBlock(mapBlocks, flag);
remoteClient.SendMapBlock(mapBlocks, 0);
}
@@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
mblock.X = (ushort)x;
mblock.Y = (ushort)y;
mblock.Name = "";
mblock.Access = 254; // not here???
mblock.Access = 254; // means 'simulator is offline'. We need this because the viewer ignores 255's
mblock.MapImageId = UUID.Zero;
mapBlocks.Add(mblock);
}

View File

@@ -575,7 +575,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
string derezAvatarPath = "/agent/" + AvatarRezCapUUID + "/rez_avatar/derez";
// Get a reference to the user's cap so we can pull out the Caps Object Path
Caps userCap
= homeScene.CapsModule.GetCapsHandlerForUser(agentData.AgentID);
= homeScene.CapsModule.GetCapsForUser(agentData.AgentID);
string rezHttpProtocol = "http://";
string regionCapsHttpProtocol = "http://";
@@ -700,7 +700,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
{
// Get a referenceokay - to their Cap object so we can pull out the capobjectroot
Caps userCap
= homeScene.CapsModule.GetCapsHandlerForUser(userData.AgentID);
= homeScene.CapsModule.GetCapsForUser(userData.AgentID);
//Update the circuit data in the region so this user is authorized
homeScene.UpdateCircuitData(userData);

View File

@@ -17,7 +17,6 @@
<RegionModule id="PrimCountModule" type="OpenSim.Region.CoreModules.World.Land.PrimCountModule" />
<RegionModule id="ExportSerialisationModule" type="OpenSim.Region.CoreModules.World.Serialiser.SerialiserModule" />
<RegionModule id="ArchiverModule" type="OpenSim.Region.CoreModules.World.Archiver.ArchiverModule" />
<RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capabilities.CapabilitiesModule" />
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
<RegionModule id="WorldMapModule" type="OpenSim.Region.CoreModules.World.WorldMap.WorldMapModule" />
<RegionModule id="Warp3DImageModule" type="OpenSim.Region.CoreModules.World.Warp3DMap.Warp3DImageModule" />

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