Compare commits

...

170 Commits

Author SHA1 Message Date
BlueWall
5632e4e002 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-29 20:34:11 -04:00
BlueWall
2fc935891c Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-29 07:28:00 -04:00
BlueWall
3857295b13 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-27 20:28:49 -04:00
BlueWall
3926c196df Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-27 17:22:05 -04:00
BlueWall
0d598450ad Add stub for llCastRay 2012-06-26 15:14:25 -04:00
BlueWall
4c28972294 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-25 20:15:07 -04:00
BlueWall
514a2107cc Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-23 04:32:58 -04:00
BlueWall
a8ce8709f2 Fix script "Running" behavior
Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057
2012-06-23 04:11:31 -04:00
BlueWall
4290ae59f4 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-23 03:32:58 -04:00
BlueWall
db71f1fd33 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-21 19:50:27 -04:00
BlueWall
2ae3e8cf39 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-20 10:20:38 -04:00
BlueWall
cc962a2275 Oops! putting back the entry for map urls 2012-06-16 07:24:27 -04:00
BlueWall
f870c6b490 Adjust Robust*.ini.examples V3 webprofile entries 2012-06-16 06:25:12 -04:00
BlueWall
fbcbac8aef Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-15 05:32:56 -04:00
BlueWall
6ded541b55 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-14 22:38:43 -04:00
BlueWall
ec05e93f85 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-14 22:05:27 -04:00
BlueWall
d7c5e240a5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-14 21:27:58 -04:00
BlueWall
491eccf882 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-12 22:33:53 -04:00
BlueWall
9e0377cd3d Add the updated OpenSimDefaults.ini for the prior timer_Interval patch. 2012-06-12 21:52:52 -04:00
BlueWall
8e2752a0f6 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-12 21:37:11 -04:00
BlueWall
04d132e78b Add variable timer configureation for the timer_Script
Added "timer_Interval" to the OpenSimDefaults.ini, leaving the default value set to 1200, as the previous default setting. The value represents seconds. To change the default, copy the entry to OpenSim.ini and multiply the number of minutes for the interval by 60.
2012-06-12 17:07:10 -04:00
BlueWall
bc0cfa4468 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-11 22:26:24 -04:00
BlueWall
466f0b096f Cleanup some commented code 2012-06-10 01:32:57 -04:00
BlueWall
e460663fec Add a note about securing web interface 2012-06-09 23:52:47 -04:00
BlueWall
f79168ae1a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-08 18:40:58 -04:00
BlueWall
95dc97c0c4 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-08 06:28:36 -04:00
Talun
94118f1180 Mantis 6044 Building master currently fails.
Add missing reference to System.Core

Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-06-07 11:09:07 -04:00
BlueWall
21f6572bf3 Make change to fix Windows builds 2012-06-07 10:15:40 -04:00
BlueWall
860cf767a1 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-07 06:48:48 -04:00
BlueWall
b699752fa9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-04 22:04:57 -04:00
BlueWall
2176bd18e3 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-04 20:00:39 -04:00
BlueWall
78a98b8a28 Add replaceable region modules to the "show modules" command 2012-06-04 17:22:46 -04:00
BlueWall
28e03792ae Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-04 14:33:02 -04:00
BlueWall
f88a26b861 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-06-01 06:58:26 -04:00
BlueWall
ab3fb19870 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 22:55:47 -04:00
BlueWall
6605d6cb44 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 22:29:15 -04:00
BlueWall
8ee746d404 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 22:16:02 -04:00
BlueWall
3b772e7a45 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 21:40:15 -04:00
BlueWall
d9b358886a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 21:31:00 -04:00
BlueWall
2602a48738 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-31 21:20:48 -04:00
BlueWall
904f60709f Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-29 13:58:07 -04:00
BlueWall
192db34c41 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-26 11:28:28 -04:00
BlueWall
36d8e6208a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 23:27:52 -04:00
BlueWall
c1467e7fe1 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 23:01:41 -04:00
BlueWall
d637b163d9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 21:59:17 -04:00
BlueWall
26c332f5f2 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 21:53:35 -04:00
BlueWall
bd5a298a2d Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 18:07:05 -04:00
BlueWall
5b3da481de Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-24 12:12:05 -04:00
BlueWall
14eef0a32b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-23 23:57:25 -04:00
BlueWall
367e6901a9 Merge branch 'master' of /home/opensim/src/OpenSim 2012-05-23 17:11:56 -04:00
BlueWall
8c841dc38b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-23 17:11:13 -04:00
BlueWall
b8a0a65435 Fix llGetSimulatorHostname to return configured hostname 2012-05-23 15:07:03 -04:00
BlueWall
e289006611 Adding main config to the plugin init 2012-05-23 14:37:26 -04:00
BlueWall
a73a5be0c5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-23 14:21:47 -04:00
BlueWall
a150d3d1e5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-21 21:03:55 -04:00
BlueWall
0464508a5b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-20 14:09:03 -04:00
BlueWall
13187aca91 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-18 20:49:29 -04:00
BlueWall
477b67e1e6 Further refinement on properties 2012-05-18 19:56:46 -04:00
BlueWall
c990cfe481 Cleanup + change properties to set fields with private set : Thanks Justin for the tip. 2012-05-18 19:32:26 -04:00
BlueWall
cf93f39b9f Provide Telehub setting to allow use of landmarks
Setting to allow use of landmarks to override telehub routing. Default is off.
2012-05-18 17:47:00 -04:00
BlueWall
9cb242e24d Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-18 12:35:21 -04:00
BlueWall
5d860d09a3 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-17 08:00:16 -04:00
BlueWall
8f0405bacc Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-16 21:08:01 -04:00
BlueWall
3e00395b37 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-16 15:42:07 -04:00
BlueWall
e9d1af46fa Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-14 22:39:03 -04:00
BlueWall
baff20f7c5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-14 22:33:00 -04:00
BlueWall
8e6276865b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-14 20:31:46 -04:00
BlueWall
6f54714eb0 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-13 17:22:09 -04:00
BlueWall
8ff97699e2 Add configurable SpawnPointRouting
Will use one of three selected methods to route avatar landing
	points when using Telehubs. The setting is in [Startup] using
        SpawnPointRouting = closest/random/sequence

	closest: The default setting. Routes avatar to the nearest SpawnPoint
	to the location.

	random: Picks random SpawnPoints to land the avatar.

	sequence: Follows a sequence to place the avatar on the next available
	SpawnPoint location
2012-05-13 17:11:44 -04:00
BlueWall
a4d75e37cf Formatting fix 2012-05-13 13:20:35 -04:00
BlueWall
d3a88263cb Fix indexer to spawnpoints 2012-05-13 13:19:42 -04:00
BlueWall
2b5e05fad8 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-11 09:46:51 -04:00
BlueWall
668912be6f Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-09 09:10:10 -04:00
BlueWall
293a2873b4 Correction: add dll to end of file name in exmapl configurations 2012-05-08 09:53:28 -04:00
BlueWall
ed2afb8454 Update Robust configuration examples for IntegrationService 2012-05-08 08:57:58 -04:00
BlueWall
800fae41c7 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-08 07:52:54 -04:00
BlueWall
c36714a9bd Update version for plugins since required updates 2012-05-04 21:34:56 -04:00
BlueWall
90a4d965d9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-04 18:55:44 -04:00
BlueWall
08cf05a586 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-03 15:45:26 -04:00
BlueWall
6f4afd8601 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-01 20:14:06 -04:00
BlueWall
8dda6e9ea1 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-05-01 14:57:23 -04:00
BlueWall
8ef85f2a38 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-27 19:51:48 -04:00
BlueWall
9784b6fa75 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-27 16:22:13 -04:00
BlueWall
515b7eabbd Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-27 15:41:53 -04:00
BlueWall
d00df295d6 Converting more functions to new style for REST/Console 2012-04-27 15:41:21 -04:00
BlueWall
1c60ecf3ed Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-27 13:24:09 -04:00
BlueWall
0bf3f597fe Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-27 12:50:31 -04:00
BlueWall
02cc1ed91a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-26 22:23:36 -04:00
BlueWall
def8012ec1 Changing more methods to work with console and rest 2012-04-26 22:12:10 -04:00
BlueWall
b5db5d7a57 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-26 18:17:19 -04:00
BlueWall
d76df3df79 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-25 14:39:11 -04:00
BlueWall
a153a3cf3b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-25 13:43:48 -04:00
BlueWall
cca3c5f66e Fromatting output, cleanup 2012-04-25 10:50:33 -04:00
BlueWall
6fd803f24f Some more handlers added/converted 2012-04-25 10:05:41 -04:00
BlueWall
32a70fb7e9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-25 08:47:17 -04:00
BlueWall
38c0927707 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 23:24:51 -04:00
BlueWall
de4327bfd5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 20:39:46 -04:00
BlueWall
bf0b0c9ad5 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 19:35:59 -04:00
BlueWall
578ec6cc26 Add OAuth support lib to provide authentication for endpoints 2012-04-24 19:26:44 -04:00
BlueWall
c0b2e64a90 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 18:16:06 -04:00
BlueWall
3dc88c55a9 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 16:00:37 -04:00
BlueWall
4d78837a3a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 15:20:21 -04:00
BlueWall
3750f329d1 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-24 02:29:43 -04:00
BlueWall
40828910e7 Plugin manager generic result for use by command line or rest interface 2012-04-24 02:27:23 -04:00
Talun
3c03418e06 Mantis 5977 Corrections to llRegionSayTo
Signed-off-by: BlueWall <jamesh@bluewallgroup.com>
2012-04-23 07:16:59 -04:00
BlueWall
6a69c3ac04 Filling in some more web handlers 2012-04-22 22:47:29 -04:00
BlueWall
e8909703ae Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-22 19:34:52 -04:00
BlueWall
3e546ebbc5 Adding framework to handle web requests for plugin management 2012-04-22 19:31:51 -04:00
BlueWall
bd0dfc1d6d Make sorted lists for selecting plugins for operations 2012-04-21 17:51:44 -04:00
BlueWall
05b369965e Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-20 22:45:56 -04:00
BlueWall
e76fa4c5aa Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-20 21:58:37 -04:00
BlueWall
027d313703 Cleanup and formatting 2012-04-20 21:52:02 -04:00
BlueWall
9b1741da0d Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-20 21:32:26 -04:00
BlueWall
2122748af1 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-20 19:21:48 -04:00
BlueWall
040412857c Undo the disposable 2012-04-20 14:13:32 -04:00
BlueWall
70808d6d54 Making plugins disposable 2012-04-20 13:16:44 -04:00
BlueWall
083dd0c17c A little bit of clean up 2012-04-20 09:58:24 -04:00
BlueWall
b6f6f05e1a Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-20 08:00:44 -04:00
BlueWall
3d6f9f9cec Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-18 20:02:48 -04:00
BlueWall
28f0bf7f08 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-18 15:22:03 -04:00
BlueWall
0f96b9f41b Merge branch 'integration' of /home/opensim/var/repo/opensim 2012-04-13 20:48:50 -04:00
BlueWall
f3f85c3106 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-13 20:45:58 -04:00
BlueWall
7bcd6a6842 Merge branch 'integration' of /home/opensim/var/repo/opensim into integration 2012-04-13 20:15:56 -04:00
BlueWall
30fff0e78e Load new ini after writing to ensure proper settings 2012-04-13 20:12:27 -04:00
BlueWall
9babd79a66 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-12 21:45:41 -04:00
BlueWall
ffc1f6a656 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-12 21:37:13 -04:00
BlueWall
e0c4f8ed76 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-11 23:34:54 -04:00
BlueWall
a57ec18fb5 Add a development mode
Pluggin development needs the pluggin to be directly loaded so the running program may be stopped for inspection and modifications. This is controlled by a configuration switch in the Robust.ini
2012-04-11 23:24:17 -04:00
BlueWall
0a949a20ca Send the service so the pluggin can load other assemblies 2012-04-11 09:19:16 -04:00
BlueWall
bb3aa1440d Tell git to remove these files (moved)
These are now living in lib32/lib64 directories.
2012-04-11 06:24:56 -04:00
BlueWall
1d4bee454e Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-10 19:19:00 -04:00
BlueWall
d95e6ca0c6 More work on install/loading/unloading
Moved troublesome openjpeg libs - testing to see if opensim region can run with the change
2012-04-10 19:01:22 -04:00
BlueWall
3e6043bb47 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-10 14:38:18 -04:00
BlueWall
679533f632 Work on loading new addins 2012-04-10 14:36:24 -04:00
BlueWall
a798b98f85 More work on dynamic loading/unloading 2012-04-10 00:20:55 -04:00
BlueWall
0838c5288f Add method for plugin teardown/unloading 2012-04-09 21:59:21 -04:00
BlueWall
35fa8b454d Working on run-time init
Working on build-up and tear-down for loading/unloading pluggins
2012-04-09 17:53:55 -04:00
BlueWall
4b278c64d6 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-09 17:50:57 -04:00
BlueWall
27845de7ea Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-08 20:58:56 -04:00
BlueWall
fb18476032 More work on comands
Getting this framed up. Will make generic returns so as to interface with external web service to manage plugins.
2012-04-08 20:25:28 -04:00
BlueWall
74776c4ee0 More command work
Start working toward using list entry numbers to select instead of the plugin id
2012-04-08 20:09:54 -04:00
BlueWall
952ad59c1f Work on commands 2012-04-08 17:38:44 -04:00
BlueWall
c066f528ef Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-07 23:44:25 -04:00
BlueWall
0591a85787 More work on commands 2012-04-07 23:39:15 -04:00
BlueWall
7a686ef124 Some work on web interface
Adding some web handlers to manage plugins. Returns json for integration into external processing.
2012-04-07 14:52:02 -04:00
BlueWall
931c28888b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-07 14:22:14 -04:00
BlueWall
d4a6ed3d98 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-06 23:56:08 -04:00
BlueWall
b8eafc6280 More work on commands
Install is working now
2012-04-06 22:22:55 -04:00
BlueWall
5509d981d4 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-06 20:11:58 -04:00
BlueWall
4f4ca1625f Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-06 19:24:14 -04:00
BlueWall
90a2296983 Have some commands working
Still rough, but making some progress.
2012-04-06 19:22:34 -04:00
BlueWall
1aab096a83 Start filling out commands 2012-04-05 23:48:25 -04:00
BlueWall
de1d213117 Adding command skeleton 2012-04-05 13:55:04 -04:00
BlueWall
f494e6b086 Working on plugin manager 2012-04-05 12:25:24 -04:00
BlueWall
2d9971ea93 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-05 08:34:03 -04:00
BlueWall
f266e19243 automatic creation of ini form repository 2012-04-04 20:01:23 -04:00
BlueWall
e4a69297f6 Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-04 20:00:47 -04:00
BlueWall
4fa5fa5e08 Remove some old work + add to config/init 2012-04-04 15:07:19 -04:00
BlueWall
d2cd39d0d8 Adding configuration management to plugins 2012-04-04 14:15:52 -04:00
BlueWall
a4cb9639cc Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-04 09:26:29 -04:00
BlueWall
639c6bdd62 Add a delay to let regions load before calling PostInit
Something is letting PostInit fire before the regions are loaded. This small delay "fixes" it. Will continue to look for a way to make sure they are loaded first.
2012-04-03 14:50:26 -04:00
BlueWall
b3ecf935cd Update mono-addins 2012-04-02 22:50:13 -04:00
BlueWall
4c5b3adb96 Do some work on the plugin registry locations and configuration manager 2012-04-02 17:06:31 -04:00
BlueWall
335d167ead Added some logging 2012-04-02 00:48:36 -04:00
BlueWall
36daea4480 Added some utilities and copyright/license 2012-04-01 23:15:38 -04:00
BlueWall
5c92aa262a Pass server up to IntegrationService to allow pluggins to register their handlers 2012-04-01 15:58:26 -04:00
BlueWall
445caca18b Merge branch 'master' of /home/opensim/var/repo/opensim 2012-04-01 11:10:21 -04:00
BlueWall
4b90dcfb73 Missed these files 2012-04-01 11:05:05 -04:00
BlueWall
ade1acc9d4 Making IntegrationService pluggable
First steps to making a pluggable IntegrationService.
2012-04-01 09:38:59 -04:00
BlueWall
e8eb9b7e84 Add Integration Service
Adding an integration service to provide base services at endpoints for external application integration. So far, landtool.php is converted to use the IntegrationService. Others will follow to provide coverage for the base helperuri applications needed in OpenSim.
2012-03-31 17:57:58 -04:00
29 changed files with 1983 additions and 6 deletions

View File

@@ -125,7 +125,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
if (changed)
regionsToLoad[i].EstateSettings.Save();
regionsToLoad[i].EstateSettings.Save();
if (scene != null)
{
@@ -136,7 +136,11 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
}
}
}
//[TODO]: Temporary fix for an issue after the mono-addis upgrade
// PostInilise can fire before the region is loaded, so need to
// track down the cause of that
Thread.Sleep(300);
m_openSim.ModuleLoader.PostInitialise();
m_openSim.ModuleLoader.ClearCache();
}

View File

@@ -49,6 +49,7 @@ namespace OpenSim.Data
bool Store(PresenceData data);
PresenceData Get(UUID sessionID);
PresenceData Verify(UUID s_sessionID);
void LogoutRegionAgents(UUID regionID);
bool ReportAgent(UUID sessionID, UUID regionID);
PresenceData[] Get(string field, string data);

View File

@@ -61,6 +61,17 @@ namespace OpenSim.Data.MSSQL
return ret[0];
}
public PresenceData Verify(UUID s_sessionID)
{
PresenceData[] ret = Get("SecureSessionID",
s_sessionID.ToString());
if (ret.Length == 0)
return null;
return ret[0];
}
public void LogoutRegionAgents(UUID regionID)
{
using (SqlConnection conn = new SqlConnection(m_ConnectionString))

View File

@@ -61,6 +61,17 @@ namespace OpenSim.Data.MySQL
return ret[0];
}
public PresenceData Verify(UUID s_sessionID)
{
PresenceData[] ret = Get("SecureSessionID",
s_sessionID.ToString());
if (ret.Length == 0)
return null;
return ret[0];
}
public void LogoutRegionAgents(UUID regionID)
{
using (MySqlCommand cmd = new MySqlCommand())
@@ -96,4 +107,4 @@ namespace OpenSim.Data.MySQL
return true;
}
}
}
}

View File

@@ -79,6 +79,19 @@ namespace OpenSim.Data.Null
return null;
}
public PresenceData Verify(UUID s_sessionID)
{
if (Instance != this)
return Instance.Verify(s_sessionID);
if (m_presenceData.ContainsKey(s_sessionID))
{
return m_presenceData[s_sessionID];
}
return null;
}
public void LogoutRegionAgents(UUID regionID)
{
if (Instance != this)

View File

@@ -193,6 +193,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
return m_PresenceService.GetAgents(userIDs);
}
public PresenceInfo VerifyAgent(UUID s_sessionID)
{
return m_PresenceService.VerifyAgent(s_sessionID);
}
#endregion
}

View File

@@ -153,6 +153,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
return m_RemoteConnector.GetAgents(userIDs);
}
public PresenceInfo VerifyAgent(UUID sessionID)
{
return m_RemoteConnector.VerifyAgent(sessionID);
}
#endregion
}

View File

@@ -35,6 +35,7 @@ using System.Collections.Generic;
using log4net;
using OpenSim.Framework;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
namespace OpenSim.Server.Base
{
@@ -333,5 +334,36 @@ namespace OpenSim.Server.Base
return ret;
}
public static bool ParseStringToOSDMap(string input, out OSDMap map)
{
try
{
map = null;
OSD tmpbuff = null;
try
{
tmpbuff = OSDParser.DeserializeJson(input);
}
catch
{
m_log.DebugFormat("[ServerUtils]: Parse Caught Error Deserializei {0} ", input);
return false;
}
if (tmpbuff.Type == OSDType.Map)
{
map = (OSDMap)tmpbuff;
return true;
}
else
return false;
}
catch (NullReferenceException e)
{
m_log.ErrorFormat("[ServerUtils]: exception on ParseStringToJson {0}", e.Message);
map = null;
return false;
}
}
}
}

View File

@@ -0,0 +1,66 @@
/*
* 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 OpenSim.Framework;
namespace OpenSim.Server.Handlers.Integration
{
public class IntegrationServiceConnector : ServiceConnector
{
private IIntegrationService m_IntegrationService;
private string m_ConfigName = "IntegrationService";
public IntegrationServiceConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
IConfig serverConfig = config.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
string service = serverConfig.GetString("LocalServiceModule",
String.Empty);
if (service == String.Empty)
throw new Exception("No LocalServiceModule in config file");
Object[] args = new Object[] { config, server };
m_IntegrationService = ServerUtils.LoadPlugin<IIntegrationService>(service, args);
server.AddStreamHandler(new IntegrationServerHandler(m_IntegrationService));
}
}
}

View File

@@ -0,0 +1,234 @@
/*
* 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 OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using log4net;
using System;
using System.Reflection;
using System.IO;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
namespace OpenSim.Server.Handlers.Integration
{
public class IntegrationServerHandler : BaseStreamHandler
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IIntegrationService m_IntegrationService;
public IntegrationServerHandler(IIntegrationService service) :
base("POST", "/integration")
{
m_IntegrationService = service;
}
public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
{
StreamReader sr = new StreamReader(requestData);
string body = sr.ReadToEnd();
sr.Close();
body = body.Trim();
try
{
OSDMap request = null;
if (ServerUtils.ParseStringToOSDMap(body, out request) == false)
{
return FailureResult();
}
if (!request.ContainsKey("command"))
{
return FailureResult("Error, no command defined!");
}
string command = request["command"].AsString();
switch (command)
{
case "list_plugins":
return HandleListPlugins(request);
case "list_available":
return HandleListAvailablePlugins(request);
case "show_info":
return HandlePluginInfo(request);
case "install_plugin":
return HandleInstallPlugin(request);
case "uninstall_plugin":
return HandleUnInstallPlugin(request);
case "enable_plugin":
return HandleEnablePlugin (request);
case "disable_plugin":
return HandleDisblePlugin(request);
case "plugin_info":
return HandlePluginInfo(request);
case "list_repos":
return HandleListRepositories (request);
case "add_repo":
return HandleAddRepository(request);
case "remove_repo":
return HandleRemoveRepository(request);
case "enable_repo":
return HandleEnablePlugin(request);
case "disable_repo":
return HandleDisableRepository(request);
default:
m_log.DebugFormat(
"[INTEGRATION HANDLER]: unknown method {0} request {1}",
command.Length,
command
);
return FailureResult ("IntegrationHandler: Unrecognized method requested!");
}
}
catch (Exception e)
{
m_log.DebugFormat("[INTEGRATION HANDLER]: Exception {0}", e);
}
return FailureResult();
}
#region web handlers
// List installed plugins
private byte[] HandleListPlugins(OSDMap request)
{
return m_IntegrationService.HandleWebListPlugins(request);
}
// Show plugin info
private byte[] HandlePluginInfo(OSDMap request)
{
return m_IntegrationService.HandleWebPluginInfo(request);
}
// Enable plugin
private byte[] HandleEnablePlugin(OSDMap request)
{
return m_IntegrationService.HandleWebEnablePlugin(request);
}
// Disable plugin
private byte[] HandleDisblePlugin(OSDMap request)
{
return m_IntegrationService.HandleWebDisablePlugin(request);
}
// Install plugin
public byte[] HandleInstallPlugin(OSDMap request)
{
return m_IntegrationService.HandleWebInstallPlugin(request);
}
// Uninstall plugin
public byte[] HandleUnInstallPlugin(OSDMap request)
{
return m_IntegrationService.HandleWebUnInstallPlugin(request);
}
// List available plugins
public byte[] HandleListAvailablePlugins(OSDMap request)
{
return m_IntegrationService.HandleWebListAvailablePlugins(request);
}
// List repositories
public byte[] HandleListRepositories(OSDMap request)
{
return m_IntegrationService.HandleWebListRepositories(request);
}
// Add repository
public byte[] HandleAddRepository(OSDMap request)
{
return m_IntegrationService.HandleWebAddRepository(request);
}
// Remove repository
public byte[] HandleRemoveRepository(OSDMap request)
{
return m_IntegrationService.HandleWebRemoveRepositroy(request);
}
// Enable repository
public byte[] HandleEnableRepository(OSDMap request)
{
return m_IntegrationService.HandleEnableRepository(request);
}
// Disable repository
public byte[] HandleDisableRepository(OSDMap request)
{
return m_IntegrationService.HandleWebDisableRepository(request);
}
#endregion web handlers
#region utility
// These are in IntegrationUtils.cs for plugins
private byte[] FailureResult()
{
return FailureResult(String.Empty);
}
private byte[] FailureResult(string msg)
{
OSDMap doc = new OSDMap(2);
doc["Result"] = OSD.FromString("Failure");
doc["Message"] = OSD.FromString(msg);
return DocToBytes(doc);
}
private byte[] DocToBytes(OSDMap doc)
{
return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(doc));
}
#endregion utility
}
}

View File

@@ -41,6 +41,7 @@ using OpenSim.Services.Interfaces;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
namespace OpenSim.Server.Handlers.Presence
{
@@ -244,7 +245,6 @@ namespace OpenSim.Server.Handlers.Presence
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}
private byte[] SuccessResult()
{

View File

@@ -371,6 +371,49 @@ namespace OpenSim.Services.Connectors
return rinfos.ToArray();
}
public PresenceInfo VerifyAgent(UUID s_sessionID)
{
Dictionary<string, object> sendData = new Dictionary<string, object>();
//sendData["SCOPEID"] = scopeID.ToString();
sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();
sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString();
sendData["METHOD"] = "verifyagent";
sendData["SecureSessionID"] = s_sessionID.ToString();
string reply = string.Empty;
string reqString = ServerUtils.BuildQueryString(sendData);
string uri = m_ServerURI + "/presence";
// m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
try
{
reply = SynchronousRestFormsRequester.MakeRequest("POST",
uri,
reqString);
if (reply == null || (reply != null && reply == string.Empty))
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: VerifyAgent received null or empty reply");
return null;
}
}
catch (Exception e)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
}
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
PresenceInfo pinfo = null;
if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null))
{
if (replyData["result"] is Dictionary<string, object>)
{
pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]);
}
}
return pinfo;
}
#endregion

View File

@@ -260,6 +260,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
return null;
}
public PresenceInfo VerifyAgent(UUID s_sessionID)
{
// Not implemented
return null;
}
public bool LoggedOut(string userID, UUID sessionID, UUID regionID, Vector3 lastPosition, Vector3 lastLookAt)
{
// m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Logging out user " + userID);

View File

@@ -0,0 +1,445 @@
/*
* 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 System.Linq;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework;
using OpenSim.Framework.Servers.HttpServer;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
using Nini.Config;
using log4net;
using Mono.Addins;
using Ux = OpenSim.Services.IntegrationService.IUtils;
namespace OpenSim.Services.IntegrationService
{
public class IntegrationService : IntegrationServiceBase, IIntegrationService
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public IntegrationService(IConfigSource config, IHttpServer server)
: base(config, server)
{
m_log.DebugFormat("[INTEGRATION SERVICE]: Loaded");
// Add commands to the console
if (MainConsole.Instance != null)
{
AddConsoleCommands();
}
}
// Our console commands
private void AddConsoleCommands()
{
MainConsole.Instance.Commands.AddCommand("Integration", true,
"install", "install \"plugin name\"", "Install plugin from repository",
HandleConsoleInstallPlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"uninstall", "uninstall \"plugin name\"", "Remove plugin from repository",
HandleConsoleUnInstallPlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"check installed", "check installed \"plugin name=\"","Check installed plugin",
HandleConsoleCheckInstalledPlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"list installed", "list installed \"plugin name=\"","List install plugins",
HandleConsoleListInstalledPlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"list available", "list available \"plugin name=\"","List available plugins",
HandleConsoleListAvailablePlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"list updates", "list updates","List availble updates",
HandleConsoleListUpdates);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"update", "update \"plugin name=\"","Update the plugin",
HandleConsoleUpdatePlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"add repo", "add repo \"url\"","Add repository",
HandleConsoleAddRepo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"get repo", "get repo \"url\"", "Sync with a registered repository",
HandleConsoleGetRepo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"remove repo", "remove repo \"[url | index]\"","Remove registered repository",
HandleConsoleRemoveRepo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"enable repo", "enable repo \"[url | index]\"","Enable registered repository",
HandleConsoleEnableRepo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"disable repo", "disable repo \"[url | index]\"","Disable registered repository",
HandleConsoleDisableRepo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"list repos", "list repos","List registered repositories",
HandleConsoleListRepos);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"show info", "show info \"plugin name\"","Show detailed information for plugin",
HandleConsoleShowAddinInfo);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"disable plugin", "disable plugin \"plugin name\"","disable the plugin",
HandleConsoleDisablePlugin);
MainConsole.Instance.Commands.AddCommand("Integration", true,
"enable plugin", "enable plugin \"plugin name\"","enable the plugin",
HandleConsoleEnablePlugin);
}
#region console handlers
// Handle our console commands
//
// Install plugin from registered repository
/// <summary>
/// Handles the console install plugin command. Attempts to install the selected plugin
/// and
/// </summary>
/// <param name='module'>
/// Module.
/// </param>
/// <param name='cmd'>
/// Cmd.
/// </param>
private void HandleConsoleInstallPlugin(string module, string[] cmd)
{
Dictionary<string, object> result = new Dictionary<string, object>();
if (cmd.Length == 2)
{
int ndx = Convert.ToInt16(cmd[1]);
if (m_PluginManager.InstallPlugin(ndx, out result) == true)
{
ArrayList s = new ArrayList();
s.AddRange(result.Keys);
s.Sort();
var list = result.Keys.ToList();
list.Sort();
foreach (var k in list)
{
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
bool enabled = (bool)plugin["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}",
k,
enabled == true ? "[ ]" : "[X]",
plugin["name"], plugin["version"]);
}
}
}
return;
}
// Remove installed plugin
private void HandleConsoleUnInstallPlugin(string module, string[] cmd)
{
if (cmd.Length == 2)
{
int ndx = Convert.ToInt16(cmd[1]);
m_PluginManager.UnInstall(ndx);
}
return;
}
// Check installed plugins **not working
private void HandleConsoleCheckInstalledPlugin(string module, string[] cmd)
{
MainConsole.Instance.Output(m_PluginManager.CheckInstalled());
return;
}
// List installed plugins
private void HandleConsoleListInstalledPlugin(string module, string[] cmd)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListInstalledAddins(out result);
ArrayList s = new ArrayList();
s.AddRange(result.Keys);
s.Sort();
var list = result.Keys.ToList();
list.Sort();
foreach (var k in list)
{
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
bool enabled = (bool)plugin["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}",
k,
enabled == true ? "[ ]" : "[X]",
plugin["name"], plugin["version"]);
}
return;
}
// List available plugins on registered repositories
private void HandleConsoleListAvailablePlugin(string module, string[] cmd)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListAvailable(out result);
var list = result.Keys.ToList();
list.Sort();
foreach (var k in list)
{
// name, version, repository
Dictionary<string, object> plugin = (Dictionary<string, object>)result[k];
MainConsole.Instance.OutputFormat("{0}) {1} rev. {2} {3}",
k,
plugin["name"],
plugin["version"],
plugin["repository"]);
}
return;
}
// List available updates **not ready
private void HandleConsoleListUpdates(string module, string[] cmd)
{
m_PluginManager.ListUpdates();
return;
}
// Update plugin **not ready
private void HandleConsoleUpdatePlugin(string module, string[] cmd)
{
MainConsole.Instance.Output(m_PluginManager.Update());
return;
}
// Register repository
private void HandleConsoleAddRepo(string module, string[] cmd)
{
if ( cmd.Length == 3)
{
m_PluginManager.AddRepository(cmd[2]);
}
return;
}
// Get repository status **not working
private void HandleConsoleGetRepo(string module, string[] cmd)
{
m_PluginManager.GetRepository();
return;
}
// Remove registered repository
private void HandleConsoleRemoveRepo(string module, string[] cmd)
{
if (cmd.Length == 3)
m_PluginManager.RemoveRepository(cmd);
return;
}
// Enable repository
private void HandleConsoleEnableRepo(string module, string[] cmd)
{
m_PluginManager.EnableRepository(cmd);
return;
}
// Disable repository
private void HandleConsoleDisableRepo(string module, string[] cmd)
{
m_PluginManager.DisableRepository(cmd);
return;
}
// List repositories
private void HandleConsoleListRepos(string module, string[] cmd)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListRepositories(out result);
var list = result.Keys.ToList();
list.Sort();
foreach (var k in list)
{
Dictionary<string, object> repo = (Dictionary<string, object>)result[k];
bool enabled = (bool)repo["enabled"];
MainConsole.Instance.OutputFormat("{0}) {1} {2}",
k,
enabled == true ? "[ ]" : "[X]",
repo["name"], repo["url"]);
}
return;
}
// Show description information
private void HandleConsoleShowAddinInfo(string module, string[] cmd)
{
if (cmd.Length >= 3)
{
Dictionary<string, object> result = new Dictionary<string, object>();
int ndx = Convert.ToInt16(cmd[2]);
m_PluginManager.AddinInfo(ndx, out result);
MainConsole.Instance.OutputFormat("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}",
result["name"],
result["url"],
result["file_name"],
result["author"],
result["category"],
result["description"]);
return;
}
}
// Disable plugin
private void HandleConsoleDisablePlugin(string module, string[] cmd)
{
m_PluginManager.DisablePlugin(cmd);
return;
}
// Enable plugin
private void HandleConsoleEnablePlugin(string module, string[] cmd)
{
m_PluginManager.EnablePlugin(cmd);
return;
}
#endregion
#region IIntegrationService implementation
// Will hold back on implementing things here that can actually make changes
// Need to secure it first
public byte[] HandleWebListRepositories(OSDMap request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListRepositories(out result);
string json = LitJson.JsonMapper.ToJson(result);
return Ux.DocToBytes(json);
}
public byte[] HandleWebAddRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebRemoveRepositroy (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleEnableRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebDisableRepository (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebListPlugins(OSDMap request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListInstalledAddins(out result);
string json = LitJson.JsonMapper.ToJson(result);
return Ux.DocToBytes(json);
}
public byte[] HandleWebPluginInfo(OSDMap request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
if(!String.IsNullOrEmpty(request["index"].ToString()))
{
int ndx = Convert.ToInt16(request["index"].ToString());
m_PluginManager.AddinInfo(ndx, out result);
string json = LitJson.JsonMapper.ToJson(result);
return Ux.DocToBytes(json);
}
else
{
return Ux.FailureResult("No index supplied");
}
}
public byte[] HandleWebListAvailablePlugins(OSDMap request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
m_PluginManager.ListAvailable(out result);
string json = LitJson.JsonMapper.ToJson(result);
return Ux.DocToBytes(json);
}
public byte[] HandleWebInstallPlugin(OSDMap request)
{
Dictionary<string, object> result = new Dictionary<string, object>();
int ndx = Convert.ToInt16(request["index"].ToString());
if (m_PluginManager.InstallPlugin(ndx, out result) == true)
{
string json = LitJson.JsonMapper.ToJson(result);
return Ux.DocToBytes(json);
}
else
{
return Ux.FailureResult("No index supplied");
}
}
public byte[] HandleWebUnInstallPlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebEnablePlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
public byte[] HandleWebDisablePlugin (OSDMap request)
{
return Ux.FailureResult("Not Implemented");
}
#endregion
}
}

View File

@@ -0,0 +1,257 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Base;
using OpenSim.Framework.Servers.HttpServer;
using System.Reflection;
using Nini.Config;
using OpenSim.Framework;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using Mono.Addins;
using log4net;
using Ux = OpenSim.Services.IntegrationService.IUtils;
[assembly:AddinRoot ("IntegrationService", "2.1")]
namespace OpenSim.Services.IntegrationService
{
[TypeExtensionPoint (Path="/OpenSim/IntegrationService", Name="IntegrationService")]
public interface IntegrationPlugin
{
void Init(IConfigSource MainConfig, IConfigSource PluginConfig, IHttpServer server, ServiceBase service);
void Unload();
string PluginName { get; }
string ConfigName { get; }
string DefaultConfig { get; }
}
// Hide the nasty stuff in here, let the IntegrationService be clean for
// our command and request handlers
public class IntegrationServiceBase : ServiceBase
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_ConfigName = "IntegrationService";
protected IHttpServer m_Server;
protected string m_IntegrationConfig;
protected PluginManager m_PluginManager;
AddinManager am;
protected IConfig m_IntegrationServerConfig;
protected string m_IntegrationConfigLoc;
IConfigSource m_ConfigSource;
public IntegrationServiceBase(IConfigSource config, IHttpServer server)
: base(config)
{
m_ConfigSource = config;
m_Server = server;
IConfig serverConfig = m_ConfigSource.Configs[m_ConfigName];
if (serverConfig == null)
throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
m_IntegrationConfigLoc = serverConfig.GetString("IntegrationConfig", String.Empty);
AddinRegistry registry ;
bool DEVELOPMENT = serverConfig.GetBoolean("DevelopmentMode", false);
// Are we developing plugins? We will load them now.
// This will allow debugging of the modules and will
// use the runtime directory for the registry. Will not
// be able to use the repo/registry commands ...
if (DEVELOPMENT == true)
{
AddinManager.Initialize (".");
registry = new AddinRegistry(".", ".");
registry.Update ();
AddinManager.AddinLoaded += on_addinloaded_;
AddinManager.AddinLoadError += on_addinloaderror_;
AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded;
AddinManager.AddinEngine.ExtensionChanged += HandleAddinManagerAddinEngineExtensionChanged;
registry.Update ();
foreach (IntegrationPlugin cmd in AddinManager.GetExtensionObjects("/OpenSim/IntegrationService"))
{
m_log.DebugFormat("[INTEGRATION SERVICE]: Processing _Addin {0}", cmd.PluginName);
LoadingPlugin(cmd);
}
Addin[] addins = registry.GetAddins();
foreach (Addin addin in addins)
{
if (addin.Description.Category == "IntegrationPlugin")
{
m_log.DebugFormat("[INTEGRATION SERVICE]: Processing O Addin {0}", addin.Name);
addin.Enabled = true;
registry.EnableAddin(addin.Id);
registry.Update();
AddinManager.AddinEngine.LoadAddin(null, addin.Id);
}
}
}
else
{
// defaults to the ./bin directory
string RegistryLocation = serverConfig.GetString("PluginRegistryLocation", ".");
registry = new AddinRegistry(RegistryLocation, ".");
m_PluginManager = new PluginManager(registry);
// Deal with files only for now - will add url/environment later
m_IntegrationConfigLoc = serverConfig.GetString("IntegrationConfig", String.Empty);
if(String.IsNullOrEmpty(m_IntegrationConfigLoc))
m_log.Error("[INTEGRATION SERVICE]: No IntegrationConfig defined in the Robust.ini");
m_IntegrationServerConfig = m_ConfigSource.Configs["IntegrationService"];
if (m_IntegrationServerConfig == null)
{
throw new Exception("[INTEGRATION SERVICE]: Missing configuration");
return;
}
AddinManager.Initialize (RegistryLocation);
AddinManager.Registry.Update ();
AddinManager.AddinLoaded += on_addinloaded_;
AddinManager.AddinLoadError += on_addinloaderror_;
AddinManager.AddinUnloaded += HandleAddinManagerAddinUnloaded;
AddinManager.AddExtensionNodeHandler ("/OpenSim/IntegrationService", OnExtensionChanged);
}
}
#region addin event handlers
void HandleAddinManagerAddinEngineExtensionChanged (object sender, ExtensionEventArgs args)
{
MainConsole.Instance.Output(String.Format ("Plugin Extension Change Path:{0}", args.Path));
}
private IConfigSource GetConfig(string configName)
{
return new IniConfigSource();
}
void HandleAddinManagerAddinUnloaded (object sender, AddinEventArgs args)
{
MainConsole.Instance.Output("Plugin Unloaded");
}
private void on_addinloaderror_(object sender, AddinErrorEventArgs args)
{
if (args.Exception == null)
m_log.Error ("[INTEGRATION SERVICE]: Plugin Error: "
+ args.Message);
else
m_log.Error ("[INTEGRATION SERVICE]: Plugin Error: "
+ args.Exception.Message + "\n"
+ args.Exception.StackTrace);
}
// This is our init
// We can do build-up and tear-down of our plugin
void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
{
IntegrationPlugin ip = (IntegrationPlugin) args.ExtensionObject;
m_log.Info ("[INTEGRATION SERVICE]: Plugin Change");
switch (args.Change)
{
// Build up
case ExtensionChange.Add:
m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Added {0}", ip.PluginName);
LoadingPlugin(ip);
return;
// Tear down
case ExtensionChange.Remove:
m_log.DebugFormat("[INTEGRATION SERVICE]: Plugin Remove {0}", ip.PluginName);
UnLoadingPlugin(ip);
return;
}
}
private void on_addinloaded_(object sender, AddinEventArgs args)
{
m_log.Info ("[INTEGRATION SERVICE]: Plugin Loaded: " + args.AddinId);
}
#endregion addin-event handlers
private void LoadingPlugin(IntegrationPlugin plugin)
{
string ConfigPath = String.Format("{0}/(1)", m_IntegrationConfigLoc,plugin.ConfigName);
IConfigSource PlugConfig = Ux.GetConfigSource(m_IntegrationConfigLoc, plugin.ConfigName);
// We maintain a configuration per-plugin to enhance modularity
// If ConfigSource is null, we will get the default from the repo
// and write it to our directory
// Fetch the starter ini
if (PlugConfig == null)
{
m_log.DebugFormat("[INTEGRATION SERVICE]: Fetching starter config for {0} from {1}", plugin.PluginName, plugin.DefaultConfig);
// Send the default data service
IConfig DataService = m_ConfigSource.Configs["DatabaseService"];
m_log.DebugFormat("[INTEGRATION SERVICE]: Writing initial config to {0}", plugin.ConfigName);
IniConfigSource source = new IniConfigSource();
IConfig Init = source.AddConfig("DatabaseService");
Init.Set("StorageProvider",(string)DataService.GetString("StorageProvider"));
Init.Set("ConnectionString", String.Format ("\"{0}\"",DataService.GetString("ConnectionString")));
PlugConfig = Ux.LoadInitialConfig(plugin.DefaultConfig);
source.Merge(PlugConfig);
source.Save(Path.Combine(m_IntegrationConfigLoc, plugin.ConfigName));
PlugConfig = Ux.GetConfigSource(m_IntegrationConfigLoc, plugin.ConfigName);
}
m_log.DebugFormat("[INTEGRATION SERVICE]: ****** In Loading Plugin {0}", plugin.PluginName);
plugin.Init(m_ConfigSource, PlugConfig, m_Server, this);
}
private void UnLoadingPlugin(IntegrationPlugin plugin)
{
try
{
plugin.Unload();
}
catch(Exception e)
{
// Getting some "Error Object reference not set to an instance of an object"
// when the plugins are unloaded. This keeps things quiet for now
// m_log.DebugFormat("[INTEGRATION SERVICE]: Error {0}", e.Message);
}
}
}
}

View File

@@ -0,0 +1,157 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Reflection;
using System.Text;
using System.Xml;
using log4net;
using Nini.Config;
using OpenMetaverse.StructuredData;
namespace OpenSim.Services.IntegrationService
{
public static class IUtils
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region web utils
public static bool ParseStringToOSDMap(string input, out OSDMap json)
{
try
{
json = null;
OSD tmpbuff = null;
try
{
tmpbuff = OSDParser.DeserializeJson(input.ToString());
}
catch
{
return false;
}
if (tmpbuff.Type == OSDType.Map)
{
json = (OSDMap)tmpbuff;
return true;
} else
return false;
}
catch (NullReferenceException e)
{
m_log.ErrorFormat("[IUtil]: exception on ParseStringToJson {0}", e.Message);
json = null;
return false;
}
}
public static byte[] FailureResult()
{
return FailureResult(String.Empty);
}
public static byte[] FailureResult(string msg)
{
OSDMap doc = new OSDMap(2);
doc["Result"] = OSD.FromString("Failure");
doc["Message"] = OSD.FromString(msg);
return DocToBytes(doc);
}
public static byte[] ResponseMessage(string message)
{
OSDMap doc = new OSDMap(2);
doc["Result"] = OSD.FromString("Success");
doc["Message"] = OSD.FromString(message);
return DocToBytes(doc);
}
public static byte[] DocToBytes(OSDMap doc)
{
return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(doc));
}
public static byte[] DocToBytes(string json)
{
return Encoding.UTF8.GetBytes(json);
}
#endregion web utils
#region config utils
public static IConfigSource GetConfigSource(string IniPath, string IniName)
{
string configFilePath = Path.GetFullPath(
Path.Combine(IniPath, IniName));
if (File.Exists(configFilePath))
{
IConfigSource config = new IniConfigSource(configFilePath);
return config;
}
else
{
return null;
}
}
public static IConfigSource LoadInitialConfig(string url)
{
IConfigSource source = new XmlConfigSource();
m_log.InfoFormat("[CONFIG]: {0} is a http:// URI, fetching ...", url);
// The ini file path is a http URI
// Try to read it
try
{
XmlReader r = XmlReader.Create(url);
IConfigSource cs = new XmlConfigSource(r);
source.Merge(cs);
}
catch (Exception e)
{
m_log.FatalFormat("[CONFIG]: Exception reading config from URI {0}\n" + e.ToString(), url);
Environment.Exit(1);
}
return source;
}
#endregion config utils
public static T LoadPlugin<T>(string dllName, Object[] args) where T:class
{
return OpenSim.Server.Base.ServerUtils.LoadPlugin<T>(dllName, args);
}
}
}

View File

@@ -0,0 +1,547 @@
/*
* 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.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Mono.Addins;
using Mono.Addins.Setup;
using Mono.Addins.Description;
using OpenSim.Framework;
using Ux = OpenSim.Services.IntegrationService.IUtils;
namespace OpenSim.Services.IntegrationService
{
// This will maintain the plugin repositories and plugins
public class PluginManager : SetupService
{
protected AddinRegistry m_Registry;
/// <summary>
/// Initializes a new instance of the <see cref="OpenSim.Services.IntegrationService.PluginManager"/> class.
/// </summary>
/// <param name='r'>
/// R.
/// </param>
internal PluginManager( AddinRegistry r): base (r)
{
m_Registry = r;
m_Registry.Update();
}
/// <summary>
/// Installs the plugin.
/// </summary>
/// <returns>
/// The plugin.
/// </returns>
/// <param name='args'>
/// Arguments.
/// </param>
public bool InstallPlugin(int ndx, out Dictionary<string, object> result)
{
Dictionary<string, object> res = new Dictionary<string, object>();
PackageCollection pack = new PackageCollection();
PackageCollection toUninstall;
DependencyCollection unresolved;
IProgressStatus ps = new ConsoleProgressStatus(false);
AddinRepositoryEntry[] available = GetSortedAvailbleAddins();
if (ndx > (available.Length - 1))
{
MainConsole.Instance.Output("Selection out of range");
result = res;
return false;
}
AddinRepositoryEntry aentry = available[ndx];
Package p = Package.FromRepository(aentry);
pack.Add(p);
ResolveDependencies(ps, pack, out toUninstall, out unresolved);
// Attempt to install the plugin disabled
if (Install(ps, pack) == true)
{
m_Registry.Update(ps);
Addin addin = m_Registry.GetAddin(aentry.Addin.Id);
m_Registry.DisableAddin(addin.Id);
addin.Enabled = false;
ListInstalledAddins(out res);
result = res;
return true;
}
else
{
result = res;
return false;
}
}
// Remove plugin
/// <summary>
/// Uns the install.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void UnInstall(int ndx)
{
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
if (ndx > (addins.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
Addin addin = addins[ndx];
MainConsole.Instance.OutputFormat("Uninstalling plugin {0}", addin.Id);
AddinManager.Registry.DisableAddin(addin.Id);
addin.Enabled = false;
IProgressStatus ps = new ConsoleProgressStatus(false);
Uninstall(ps, addin.Id);
return;
}
/// <summary>
/// Checks the installed.
/// </summary>
/// <returns>
/// The installed.
/// </returns>
public string CheckInstalled()
{
return "CheckInstall";
}
/// <summary>
/// Lists the installed addins.
/// </summary>
/// <param name='result'>
/// Result.
/// </param>
public void ListInstalledAddins(out Dictionary<string, object> result)
{
Dictionary<string, object> res = new Dictionary<string, object>();
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
int count = 0;
foreach (Addin addin in addins)
{
Dictionary<string, object> r = new Dictionary<string, object>();
r["enabled"] = addin.Enabled == true ? true : false;
r["name"] = addin.LocalId;
r["version"] = addin.Version;
res.Add(count.ToString(), r);
count++;
}
result = res;
return;
}
// List compatible plugins in registered repositories
/// <summary>
/// Lists the available.
/// </summary>
/// <param name='result'>
/// Result.
/// </param>
public void ListAvailable(out Dictionary<string, object> result)
{
Dictionary<string, object> res = new Dictionary<string, object>();
AddinRepositoryEntry[] addins = GetSortedAvailbleAddins();
int count = 0;
foreach (AddinRepositoryEntry addin in addins)
{
Dictionary<string, object> r = new Dictionary<string, object>();
r["name"] = addin.Addin.Name;
r["version"] = addin.Addin.Version;
r["repository"] = addin.RepositoryName;
res.Add(count.ToString(), r);
count++;
}
result = res;
return;
}
// List available updates ** 1
/// <summary>
/// Lists the updates.
/// </summary>
public void ListUpdates()
{
IProgressStatus ps = new ConsoleProgressStatus(true);
Console.WriteLine ("Looking for updates...");
Repositories.UpdateAllRepositories (ps);
Console.WriteLine ("Available add-in updates:");
bool found = false;
AddinRepositoryEntry[] entries = Repositories.GetAvailableUpdates();
foreach (AddinRepositoryEntry entry in entries)
{
Console.WriteLine(String.Format("{0}",entry.Addin.Id));
}
}
// Sync to repositories
/// <summary>
/// Update this instance.
/// </summary>
public string Update()
{
IProgressStatus ps = new ConsoleProgressStatus(true);
Repositories.UpdateAllRepositories (ps);
return "Update";
}
// Register a repository
/// <summary>
/// Register a repository with our server.
/// </summary>
/// <returns>
/// result of the action
/// </returns>
/// <param name='repo'>
/// The URL of the repository we want to add
/// </param>
public bool AddRepository(string repo)
{
Repositories.RegisterRepository(null, repo, true);
return true;
}
/// <summary>
/// Gets the repository.
/// </summary>
public void GetRepository()
{
Repositories.UpdateAllRepositories(new ConsoleProgressStatus(false));
}
// Remove a repository from the list
/// <summary>
/// Removes the repository.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void RemoveRepository(string[] args)
{
AddinRepository[] reps = Repositories.GetRepositories();
Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title));
if (reps.Length == 0)
{
MainConsole.Instance.Output("No repositories have been registered.");
return;
}
int n = Convert.ToInt16(args[2]);
if (n > (reps.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
AddinRepository rep = reps[n];
Repositories.RemoveRepository (rep.Url);
return;
}
// Enable repository
/// <summary>
/// Enables the repository.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void EnableRepository(string[] args)
{
AddinRepository[] reps = Repositories.GetRepositories();
Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title));
if (reps.Length == 0)
{
MainConsole.Instance.Output("No repositories have been registered.");
return;
}
int n = Convert.ToInt16(args[2]);
if (n > (reps.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
AddinRepository rep = reps[n];
Repositories.SetRepositoryEnabled(rep.Url, true);
return;
}
// Disable a repository
/// <summary>
/// Disables the repository.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void DisableRepository(string[] args)
{
AddinRepository[] reps = Repositories.GetRepositories();
Array.Sort (reps, (r1,r2) => r1.Title.CompareTo(r2.Title));
if (reps.Length == 0)
{
MainConsole.Instance.Output("No repositories have been registered.");
return;
}
int n = Convert.ToInt16(args[2]);
if (n > (reps.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
AddinRepository rep = reps[n];
Repositories.SetRepositoryEnabled(rep.Url, false);
return;
}
// List registered repositories
/// <summary>
/// Lists the repositories.
/// </summary>
/// <param name='result'>
/// Result.
/// </param>
public void ListRepositories(out Dictionary<string, object> result)
{
Dictionary<string, object> res = new Dictionary<string, object>();
result = res;
AddinRepository[] reps = GetSortedAddinRepo();
if (reps.Length == 0)
{
MainConsole.Instance.Output("No repositories have been registered.");
return;
}
int count = 0;
foreach (AddinRepository rep in reps)
{
Dictionary<string, object> r = new Dictionary<string, object>();
r["enabled"] = rep.Enabled == true ? true : false;
r["name"] = rep.Name;
r["url"] = rep.Url;
res.Add(count.ToString(), r);
count++;
}
return;
}
/// <summary>
/// Updates the registry.
/// </summary>
public void UpdateRegistry()
{
m_Registry.Update();
}
// Show plugin info
/// <summary>
/// Addins the info.
/// </summary>
/// <returns>
/// The info.
/// </returns>
/// <param name='args'>
/// Arguments.
/// </param>
public bool AddinInfo(int ndx, out Dictionary<string, object> result)
{
Dictionary<string, object> res = new Dictionary<string, object>();
result = res;
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
if (ndx > (addins.Length - 1))
{
MainConsole.Instance.Output("Selection out of range");
return false;
}
// author category description
Addin addin = addins[ndx];
res["author"] = addin.Description.Author;
res["category"] = addin.Description.Category;
res["description"] = addin.Description.Description;
res["name"] = addin.Name;
res["url"] = addin.Description.Url;
res["file_name"] = addin.Description.FileName;
result = res;
return true;
}
// Disable a plugin
/// <summary>
/// Disables the plugin.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void DisablePlugin(string[] args)
{
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
int n = Convert.ToInt16(args[2]);
if (n > (addins.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
Addin addin = addins[n];
AddinManager.Registry.DisableAddin(addin.Id);
addin.Enabled = false;
return;
}
// Enable plugin
/// <summary>
/// Enables the plugin.
/// </summary>
/// <param name='args'>
/// Arguments.
/// </param>
public void EnablePlugin(string[] args)
{
Addin[] addins = GetSortedAddinList("IntegrationPlugin");
int n = Convert.ToInt16(args[2]);
if (n > (addins.Length -1))
{
MainConsole.Instance.Output("Selection out of range");
return;
}
Addin addin = addins[n];
addin.Enabled = true;
AddinManager.Registry.EnableAddin(addin.Id);
// AddinManager.Registry.Update();
if(m_Registry.IsAddinEnabled(addin.Id))
{
ConsoleProgressStatus ps = new ConsoleProgressStatus(false);
if (!AddinManager.AddinEngine.IsAddinLoaded(addin.Id))
{
AddinManager.Registry.Rebuild(ps);
AddinManager.AddinEngine.LoadAddin(ps, addin.Id);
}
}
else
{
MainConsole.Instance.OutputFormat("Not Enabled in this domain {0}", addin.Name);
}
return;
}
#region Util
private void Testing()
{
Addin[] list = Registry.GetAddins();
var addins = list.Where( a => a.Description.Category == "IntegrationPlugin");
foreach (Addin addin in addins)
{
MainConsole.Instance.OutputFormat("Addin {0}", addin.Name);
}
}
// These will let us deal with numbered lists instead
// of needing to type in the full ids
private AddinRepositoryEntry[] GetSortedAvailbleAddins()
{
ArrayList list = new ArrayList();
list.AddRange(Repositories.GetAvailableAddins());
AddinRepositoryEntry[] addins = list.ToArray(typeof(AddinRepositoryEntry)) as AddinRepositoryEntry[];
Array.Sort(addins,(r1,r2) => r1.Addin.Id.CompareTo(r2.Addin.Id));
return addins;
}
private AddinRepository[] GetSortedAddinRepo()
{
ArrayList list = new ArrayList();
list.AddRange(Repositories.GetRepositories());
AddinRepository[] repos = list.ToArray(typeof(AddinRepository)) as AddinRepository[];
Array.Sort (repos,(r1,r2) => r1.Name.CompareTo(r2.Name));
return repos;
}
private Addin[] GetSortedAddinList(string category)
{
ArrayList list = new ArrayList();
list.AddRange(m_Registry.GetAddins());
ArrayList xlist = new ArrayList();
foreach (Addin addin in list)
{
if (addin.Description.Category == category)
xlist.Add(addin);
}
Addin[] addins = xlist.ToArray(typeof(Addin)) as Addin[];
Array.Sort(addins,(r1,r2) => r1.Id.CompareTo(r2.Id));
return addins;
}
#endregion Util
#region Notes
// ** 1 Not working
#endregion Notes
}
}

View File

@@ -0,0 +1,55 @@
/*
* 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 OpenMetaverse;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
namespace OpenSim.Services.Interfaces
{
public interface IIntegrationService
{
#region Web handlers
byte[] HandleWebListRepositories(OSDMap request);
byte[] HandleWebAddRepository(OSDMap request);
byte[] HandleWebRemoveRepositroy(OSDMap request);
byte[] HandleEnableRepository(OSDMap request);
byte[] HandleWebDisableRepository(OSDMap request);
byte[] HandleWebListPlugins(OSDMap request);
byte[] HandleWebPluginInfo(OSDMap request);
byte[] HandleWebListAvailablePlugins(OSDMap request);
byte[] HandleWebInstallPlugin(OSDMap request);
byte[] HandleWebUnInstallPlugin(OSDMap request);
byte[] HandleWebEnablePlugin(OSDMap request);
byte[] HandleWebDisablePlugin(OSDMap request);
#endregion
}
}

View File

@@ -68,6 +68,7 @@ namespace OpenSim.Services.Interfaces
bool ReportAgent(UUID sessionID, UUID regionID);
PresenceInfo GetAgent(UUID sessionID);
PresenceInfo VerifyAgent(UUID s_sessionID);
PresenceInfo[] GetAgents(string[] userIDs);
}
}

View File

@@ -158,5 +158,19 @@ namespace OpenSim.Services.PresenceService
return info.ToArray();
}
public PresenceInfo VerifyAgent(UUID s_sessionID)
{
PresenceInfo ret = new PresenceInfo();
PresenceData data = m_Database.Verify(s_sessionID);
if (data == null)
return null;
ret.UserID = data.UserID;
ret.RegionID = data.RegionID;
return ret;
}
}
}

BIN
bin/DevDefined.OAuth.dll Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -21,7 +21,7 @@
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
; *
[Startup]
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector,8002/OpenSim.Server.Handlers.dll:HGFriendsServerConnector,8002/OpenSim.Server.Handlers.dll:InstantMessageServerConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector"
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector,8002/OpenSim.Server.Handlers.dll:HGFriendsServerConnector,8002/OpenSim.Server.Handlers.dll:InstantMessageServerConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector,8002/OpenSim.Server.Handlers.dll:IntegrationServiceConnector"
; * This is common for all services, it's the network setup for the entire
; * server instance, if none is specified above
@@ -460,3 +460,18 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
;; This applies to the core groups module (Flotsam) only.
; ForwardOfflineGroupMessages = true
[IntegrationService]
LocalServiceModule = "OpenSim.Services.IntegrationService.dll:IntegrationService"
;; Location for plugin management data, default is "."
PluginRegistryLocation="/home/opensim/var/run/addin/Integration"
;;
;; Each plugin uses it's own ini (for now these are files only)
;; The initial files are supplied by the plugin when it is installed
;; and this is the location for the directory for these.
IntegrationConfig = "/home/opensim/etc/Integration"
GridService = "OpenSim.Services.GridService.dll:GridService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"

View File

@@ -13,7 +13,7 @@
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
; *
[Startup]
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector"
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8003/OpenSim.Server.Handlers.dll:MapAddServiceConnector,8002/OpenSim.Server.Handlers.dll:MapGetServiceConnector,8002/OpenSim.Server.Handlers.dll:IntegrationServiceConnector"
; * This is common for all services, it's the network setup for the entire
; * server instance, if none is specified above
@@ -327,3 +327,19 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; password help: optional: page providing password assistance for users of your grid
;password = http://127.0.0.1/password
[IntegrationService]
LocalServiceModule = "OpenSim.Services.IntegrationService.dll:IntegrationService"
;; Location for plugin management data, default is "."
PluginRegistryLocation="/home/opensim/var/run/addin/Integration"
;;
;; Each plugin uses it's own ini (for now these are files only)
;; The initial files are supplied by the plugin when it is installed
;; and this is the location for the directory for these.
IntegrationConfig = "/home/opensim/etc/Integration"
GridService = "OpenSim.Services.GridService.dll:GridService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"

Binary file not shown.

Binary file not shown.

View File

@@ -788,6 +788,7 @@
<Reference name="System.Xml"/>
<Reference name="System.Web"/>
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
<Reference name="OpenMetaverse" path="../../../bin/"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
@@ -1151,6 +1152,44 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Services.IntegrationService" path="OpenSim/Services/IntegrationService" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Core"/>
<Reference name="System.Xml"/>
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
<Reference name="OpenMetaverse" path="../../../bin/"/>
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Services.Interfaces"/>
<Reference name="OpenSim.Services.Base"/>
<Reference name="OpenSim.Services.Connectors"/>
<Reference name="OpenSim.Data"/>
<Reference name="OpenSim.Server.Base"/>
<Reference name="Nini" path="../../../bin/"/>
<Reference name="log4net" path="../../../bin/"/>
<Reference name="Mono.Addins" path="../../../bin/"/>
<Reference name="Mono.Addins.Setup" path="../../../bin/"/>
<Reference name="Mono.Addins" path="../../../bin/"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Services.InventoryService" path="OpenSim/Services/InventoryService" type="Library">
<Configuration name="Debug">
<Options>