Compare commits

...

665 Commits

Author SHA1 Message Date
Diva Canto
ba233008cd Changed GetUserInfo so that the exposure of user account details is ruled by a configuration variable. It's on by default. 2014-07-06 16:02:04 -07:00
Diva Canto
108978be1e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-07-06 15:17:27 -07:00
Blake Bourque
63b5c11b9c Lookup username given key(uuid) XML-RPC 2014-07-06 15:14:55 -07:00
Justin Clark-Casey (justincc)
219d273418 Add experimental "show grid size" robust console command.
This will show an approximate grid size that doesn't count regions that are hyperlinks
Not particularly trustworthy since it will still count regions that are not active but were not deregistered (deliberately or due to simulator crash or similar)
2014-07-05 00:50:33 +01:00
Diva Canto
bb9071e5f0 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-07-04 16:28:58 -07:00
Diva Canto
869191a51d Small change to my previous commit: not so aggressive on the trigger, please. 2014-07-04 16:28:37 -07:00
Justin Clark-Casey (justincc)
b019fd5a95 Show region size column in simulator version of "show regions" console command 2014-07-05 00:20:39 +01:00
Justin Clark-Casey (justincc)
82a5d00bc8 Adjust "show regions" and "show region" robust service console output to show size
"show regions" drops the owner id column but is till present in "show region"
"show regions" name column expanded to allow for longer hg regions (probably still too short, may eventually have to truncate rather than taking up huge screen space)
2014-07-05 00:15:35 +01:00
Diva Canto
dac8703949 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-07-04 15:56:32 -07:00
Diva Canto
78c155cd12 Instrument the UDP path of creating assets so that it triggers an asset post for users with different asset servers 2014-07-04 15:56:09 -07:00
Justin Clark-Casey (justincc)
4b73268cbd minor: put standard 'category' in brackets at front of log messages from previous commit 3d70db4a 2014-07-04 23:48:37 +01:00
Latif Khalifa
3d70db4a58 When uploading mesh objects with textures also create inventory items for uploaded textures.
This implements:
http://opensimulator.org/mantis/view.php?id=7250
2014-07-04 23:40:09 +01:00
AliciaRaven
6e0e35cd66 Include option to remove auto backup files older than given number of days. New property created to specify how many days to keep files for. Off by default, also made sure only oar files will be removed. 2014-07-04 23:32:13 +01:00
Justin Clark-Casey (justincc)
20b47fce07 Still log (but this time with warning rather than an exception) if we regenerate a new child caps seed for a region where we already have one.
I think it's still useful to know this to show up any errors early, but it's reasonable to still carry on rather than throw an exception.
Follow on from Diva's commit 9643792
2014-07-04 22:59:10 +01:00
Diva Canto
82b875317b On logout, delay the removal of AgentCircuitData until the very end, because that data structure contains important information about the agent that may be needed by modules. 2014-07-04 14:36:11 -07:00
Diva Canto
60ad72357e This fixes the bug related to rebooting neighboring varregions while avatars are logged in; the avies would not see the region anymore until they relogged. Same problem as before: inconsistent calculation of scope. 2014-07-04 11:45:30 -07:00
Diva Canto
d99c8e68a7 It turns out that child agent management has had a bug for a while: there was an inconsistency in the scope between opening and closing child agents in neighboring regions. For opening (in EnableChildAgents), the region's DrawDistance was being used; for closing (in IsOUtsideView) , the viewer's (SP) DrawDistance was being used. This fixes this inconsistency, therefore eliminating bugs observed in TPs between, at least, neighboring varregions. 2014-07-04 10:13:53 -07:00
Diva Canto
d0782c2bc0 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-07-03 20:09:38 -07:00
Diva Canto
9643792b34 Avoid an exception in creating child agents some times. 2014-07-03 20:09:16 -07:00
Justin Clark-Casey (justincc)
4ba396b81c Temporarily disable new regression test TestLifecycle() until I have a chance to fix it
This was working for me locally because it was still picking up all my *.ini config files, which jenkins won't have in its test env
2014-07-03 00:30:42 +01:00
Justin Clark-Casey (justincc)
c3923a1aa6 Re-enabled TestLifecycle regression test logging so I can get some idea of why it's failing on jenkins but not locally 2014-07-03 00:01:47 +01:00
Justin Clark-Casey (justincc)
889194db63 Actually call Close() for shared region modules when the simulator is being shutdown.
Adds regression test for this case.
2014-07-02 23:49:25 +01:00
Justin Clark-Casey (justincc)
fe6dab7f13 minor: Change default max phys prim size in code to match OpenSimDefaults.ini 2014-06-28 00:20:09 +01:00
Justin Clark-Casey (justincc)
cd031d129a minor: change allow script crossings default in code to true in order to match OpenSimDefaults.ini 2014-06-28 00:18:00 +01:00
dahlia
9d2789aff8 add LSL constant PRIM_ALPHA_MODE 2014-06-27 16:06:03 -07:00
Vegaslon
abf85b7f19 Bulletsim: Create AvatarTerminalVelocity to BulletSim like what ODE and SL has. Before this falling from really high caused the avatar to fall faster then the veiwer can handle and cause camera issues. 2014-06-27 23:34:34 +01:00
dahlia
a93799d03b add LSL constants PRIM_SPECULAR and PRIM_NORMAL 2014-06-23 20:06:22 -07:00
Diva Canto
ca2379ee83 Bug fix in map teleports in varregions. The cherry was missing from the ice-cream Sunday: the packet itself was hardcoding the size of the region... 2014-06-21 15:38:38 -07:00
Robert Adams
481b7c71c3 BulletSim: add some locking for collision lists to prevent collsions
from locking up when running BulletSim on a separate thread.
2014-06-20 21:42:08 -07:00
Aleric Inglewood
c90b986d8b Improved line map heuristics.
If the C# column can't be found in the positionMap (but the line can),
use the map immediately after it while correcting for the offset,
unless that results in an LSL position before the previous LSL position
in the positionMap.

The idea behind this heuristic is that in most, if not all cases C#
consumes more characters than LSL (for example LSL_Types.LSLInteger
instead of just 'integer').

Thus if the distance between the columns of two markers differ in
the C# and LSL file, the distance in the C# file will be larger.
Moreover, we can assume that every time this happens we will have
a marker at the beginning of the longer 'keyword', because those
keywords were generated by us in the first place.

For example:

C#:     LSL_Types.LSLInteger f2(LSL_Types.LSLString s)
        ^                       ^
        1                       2

will always have markers at the beginning of the long keywords
'LSL_Types.LSLInteger' and 'LSL_Types.LSLString'.
If an error is generated in between (for example at the beginning
of the function name 'f2') then the correct position is found
by using an offset relative to 2 rather than 1.

Note that a case where this isn't working correctly is
when the user adds extra spaces. For example:

LSL:   integer f2(    string s)

would still use the start of 'string' as reference and
then go backwards 3 characters only because the corresponding
C# still looks like

C#:     LSL_Types.LSLInteger f2(LSL_Types.LSLString s)
                             ^  ^
			     only 3 chars difference

and the reported error at 'f2' would be here:

LSL:   integer f2(    string s)
                   ^

This can only be fixed by generating a mapping for 'f2' itself, or
generating a mapping whenever the amount of spaces is changed.
2014-06-19 23:52:51 +01:00
Aleric Inglewood
3fe9c7c49d Fix looking up line number and colum when there is no exact match.
When a compile error reports a colum/error that is not an exact
match in the positionMap dictionary, the last position in the
map with a line number and position before the reported error
should be returned.

The old code had the following problems:
1) It returns l,c - which are line and column of the C# file, not LSL.
2) It doesn't set l to 'line' when the map has an entry with 'line'.
3) It sorts the map without taking columns into account, which may
   result in a random order of the columns. With my mono implementation
   the columns were reversed in order.

For example, if the map contains the following lines:

99,5,49,10
100,30,50,10
100,40,1,0
101,5,51,10

and a translation of 100,35 was requested,
then the old code would compare '100' with the keys in
the first column - setting l to that key while it is
smaller. Hence, l is set to 99.
Then it finds the key 100 and doesn't update l.
Because of the reversed sort order, it first compares
the column 35 with 40, finding that it is smaller
and therefore it stops; returning 99,1 instead of finding
the correct 100,30 entry and returning 50,10.

This patch causes 50,10 to be returned.

The remaining problems after this patch are:
1) The sorting might not be necessary at all.
2) The is code duplication (I fixed both instances,
   but really there should be no code duplication
   imho).
2014-06-19 23:52:51 +01:00
Robert Adams
4651cd1f50 BulletSim: stop processing linkset child when it is discovered that the
child doesn't have a physical shape. Another attempt at fixing Mantis 7191.
2014-06-18 23:01:39 -07:00
Robert Adams
f348928590 BulletSim: more tweeks to AliciaRaven's flying mods. Added parameters
AvatarFlyingGroundMargin and AvatarFlyingGroundUpForce set to 5.0 and
2.0 respectively which seems to give about the same action as in SL.
Also moved force addition to before the velocity to force computation
so the upward velocity is properly applied to the avatar mass.
2014-06-18 22:39:28 -07:00
Justin Clark-Casey (justincc)
3cbdf3bfe0 refactor: Simplify compilation result tests by factoring out common code. 2014-06-18 23:04:31 +01:00
Justin Clark-Casey (justincc)
7b2f125fb6 In compiler regression tests, setup and teardown structures for each test to avoid any possibility of inter-test inter-ference 2014-06-18 22:46:54 +01:00
Justin Clark-Casey (justincc)
a0d6705fe6 Fix issue with LSL jumps screwing up the C# compiler error -> LSL code position map and leading to invalid error line numbers/columns
This is because jump statement generation was mistakenly inserting its own line without updating the csharp positions in CSCodeGenerator.
This is Aleric Inglewood's patch in http://opensimulator.org/mantis/view.php?id=7195 but applied to opensim itself rather than the defunct code generation in opensim-libs.  Thanks!
This patch also adds a regression test for this case from myself.
2014-06-18 22:24:36 +01:00
AliciaRaven
db0c41501c Fix previous commit to ignore water height and allow flying underwater (swimming)
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-06-17 23:06:49 -04:00
AliciaRaven
ff892b5bcf Add upward force to flight when close to the ground. Prevents current belly flop to the floor when flying with bullet physics and acts more like ODE and SL flight.
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-06-17 21:47:36 -04:00
Justin Clark-Casey (justincc)
5450b1b024 Change assembly versions to 0.8.1 2014-06-17 18:37:15 +01:00
Justin Clark-Casey (justincc)
602587b8d5 Update dev version to 0.8.1 2014-06-17 18:32:26 +01:00
Justin Clark-Casey (justincc)
b59812b4e3 If MaterialsModule unexpected sees a part with DefaultTexture of null, log this with a warning. 2014-06-16 22:20:30 +01:00
Justin Clark-Casey (justincc)
4374ce9fbf If processing a queued request fails up to the top of the stack, log the exception and move to the next request rather than terminate the simulator. 2014-06-16 22:11:34 +01:00
Justin Clark-Casey (justincc)
696df33e5c In materials module, if a texture entry somehow has no default entry then don't try to extract materials data rather than throw an exception 2014-06-16 21:47:34 +01:00
Diva Canto
c5f7184d1b Behavior change: only local users can set home in any parcel of a grid. Setting it for foreign users does not make sense, since cntrl+shift+H always teleports them back to their original grid. 2014-06-15 16:29:25 -07:00
Diva Canto
dcd8e74584 Manual change as per patch in mantis #7212. (the patch failed to apply, but the fix was good) Thanks FreakyTech. 2014-06-15 07:26:27 -07:00
Robert Adams
7f0adfd203 Add [Startup]LogShowStatsSeconds=n parameter which controls the interval
that simulator statistics is output to the console. Setting to zero turns
stats logging off.
2014-06-13 21:27:07 -07:00
Justin Clark-Casey (justincc)
31096fb1fe Add rc3 flavour option 2014-06-10 20:19:19 +01:00
Diva Canto
807fb8339b Revert "Let HG users be gods too, if they have local permission to be so."
HG gods are not safe at this point. It's better to disallow this until
they can be made safe.

This reverts commit e86c765be3.
2014-06-09 22:00:10 -07:00
Diva Canto
e86c765be3 Let HG users be gods too, if they have local permission to be so. 2014-06-09 21:46:24 -07:00
Diva Canto
c915791824 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-06-08 12:18:49 -07:00
Diva Canto
7f45ac72e1 Don't try to package null invites. 2014-06-08 12:18:26 -07:00
Robert Adams
8956cdc55f Add [Terrain]SendTerrainUpdatesByViewDistance=false to OpenSimDefaults.ini
so people can find the setting.
2014-06-08 09:50:31 -07:00
Robert Adams
3552cfb1a5 BulletSim: fix exceptions while rebuilding linksets with mesh children.
This should get around the exception reported in Mantis 7191 and 7204
by checking for the unbuilt child and rebuilding the linkset the next tick.
A warning message is output when this rebuild happens and this message is
clamped to 10 times in case there is a problem with a loop.
2014-06-08 09:03:38 -07:00
Michael Cerquoni
0dc14b5f35 fix the comment section of max_distance setting to reflect default value 2014-06-06 22:29:04 -04:00
Diva Canto
74cda2ad78 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-06-06 14:51:05 -07:00
Diva Canto
2766b37d8b Missed this ini change in previous commit 2014-06-06 14:50:38 -07:00
Michael Cerquoni
b913f1c8ab bump default teleport limit to 65535 regions 2014-06-06 16:59:13 -04:00
Diva Canto
fe779128b0 Added simulation version compatibility check so that agents coming from 0.7.6 to a varregion running in 0.8 and above will be denied teleport, rather than be allowed and crash the viewer. 2014-06-06 11:04:53 -07:00
Diva Canto
90de9df3e8 Better comment regarding SizeX and SizeY 2014-06-05 20:31:31 -07:00
Diva Canto
733763c4e2 Amend to previous commit -- write down the problematic Profile server URL. 2014-06-05 20:06:01 -07:00
Diva Canto
5bb95a8a55 May fix mantis #7133 2014-06-05 18:59:30 -07:00
Diva Canto
30cde52634 Updated Regions.ini.example to include var regions configs. 2014-06-05 16:51:08 -07:00
Michael Cerquoni
278530bf04 add Alicia Raven to Contributors list, thanks for the patch! 2014-06-04 22:04:09 -04:00
AliciaRaven
c1bdd22274 Fix AutoBackupModule and include option to skip saving assets.
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-06-04 22:01:55 -04:00
Diva Canto
f8fe4dee8f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-06-02 08:46:00 -07:00
Diva Canto
77913eb679 Added a ResetLand method to RemoteAdmin, whereby all land is reset with the given parameters. 2014-06-02 08:45:39 -07:00
Robert Adams
0aa0dad478 Send multiple terrain patches per terrain update packet if terrain
draw distance optimization is enabled. Makes terrain editting a lot
snappier.
2014-06-01 19:23:49 -07:00
Diva Canto
3aa99b9a7f Fixes a permissions bug where a user with group powers to always rez was not being given permission to rez on group land. 2014-06-01 16:45:37 -07:00
Diva Canto
14a31c3e9b Correct minor bug regarding packing of estate bans 2014-06-01 12:01:49 -07:00
Diva Canto
94d0ae0d91 This may fix mantis #7200, but I am unable to test because I don't have any old viewers around anymore. 2014-06-01 10:18:53 -07:00
Diva Canto
0eaca7aafb Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-06-01 10:06:59 -07:00
Diva Canto
2ff9ea3f80 Fixed a few things pertaining to interfacing with the estate service. Specifically, StoreEstateSettings was not being used anywhere; instead EstatSetting.Save was being called, but that method is a trigger to the DB-layer code directly, which, besides being wrong, was making it impossible to replace the service with a remote connector.
Also added more packing/unpacking code.
2014-06-01 10:06:26 -07:00
Robert Adams
a2ea844494 Move the generation of the multi-resolution map tiles off the main
region creation thread. For varregions or simulators with many regions,
this will speed up simulator startup and elimiate some thread timeout
warnings.
2014-05-31 14:21:39 -07:00
Robert Adams
0300ec45eb Modifications to debugging printouts. No functional changes. 2014-05-31 12:19:51 -07:00
Robert Adams
22dade6463 varregion: More tweeking to only sending patches within avatar draw distance.
Still has problems with child avatars.
2014-05-31 12:19:50 -07:00
Robert Adams
db5a42ffac varregion: send terrain patches from where the avatar outward if the parameter
[Terrain]SendTerrainUpdatesByViewDistance=true.
This tracks which patches have been sent to each client and outputs the
patches as the avatar moves.
2014-05-31 12:19:49 -07:00
Diva Canto
eaf595c008 Fix a bug where estate not found would result in a dummy estate record with erroneous information.
Also, added conversion of EstateSettings from/to key-value pairs in preparation for robust net work connectors.
2014-05-31 11:40:54 -07:00
Diva Canto
d6f9f690e5 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-31 08:22:56 -07:00
Diva Canto
02a53665c9 Added missing reference 2014-05-31 08:22:36 -07:00
Justin Clark-Casey (justincc)
bf5320eb26 minor: rename velocidyDiff -> velocityDiff 2014-05-30 22:21:13 +01:00
Justin Clark-Casey (justincc)
3c992b028c minor: Add some commented out logging to ScenePresence.SendTerseUpdateToAllClients() which is extremely helpful when investigating presence update triggers. 2014-05-30 22:18:07 +01:00
Justin Clark-Casey (justincc)
a755c57b44 Fix issue with BulletSim avatar level flight jitter by commenting out RawVelocity update threshold for now in BSCharacter.UpdateProperties().
For some reason as yet unidentified (feedback?) a threshold above 0.4 here causes the RawVelocity to move between a lower and upper bound rather than remaining constant.
The RawVelocity increased until it triggered the threshold update, at which point it started to decrease until it again triggered the threshhold update.
This delta-v was enough to exceed the checks in ScenePresence.SendTerseUpdateToAllClients() and produce jittery avatar flight because of the fluctuating velocity.
With a threshold of 0.4 (or 0, as with ODE), the RawVelocity remains constant in BulletSim and so avatar flight becomes mostly smooth - remaining occasional glitches appear to be a result of errors in distance extraploation.
There are no obvious problems with commenting out the threshold.
Misterblue, if this is wrong or I've missed some subtlety here, please feel free to revert and/or correct.
The same considerations may or may not apply to object velocity updates.
2014-05-30 22:12:23 +01:00
dahlia
9ced61fbc2 Add a 0 parameter overload for RestClient.Request() for use when no auth is required. This preserves API compatibility for external modules using this function. 2014-05-30 13:47:19 -07:00
Diva Canto
0eede1467f Moved these two estate-related interfaces to the projects where they belong. 2014-05-30 13:11:46 -07:00
Justin Clark-Casey (justincc)
35c7fb2038 minor: Comment out log line in Groups V2 GroupsServicePostHandler for now which logs every request it receives. 2014-05-30 19:45:05 +01:00
Justin Clark-Casey (justincc)
8656b5e948 Fix bug where setting a parcel in a varregion for sale would make sale bitmap generation in WorldMapModule throw an exception on next startup.
This commit replaces the hardcoded region sizes in WorldMapModule.GenerateOverlay() with numbers pulled from m_scene.RegionInfo
2014-05-30 19:40:10 +01:00
BlueWall
1efaf0c85c Add some info about xbuild command line switches to clean and select between producing Debug or Release binaries 2014-05-30 11:56:05 -04:00
Justin Clark-Casey (justincc)
27597463da Change Assembly verson of OpenSim.Data.PGSQL.dll to 0.8.0.* to match all other assembly versions 2014-05-27 23:40:29 +01:00
Justin Clark-Casey (justincc)
c32ccfb520 minor: Comment out 2 error level debugging message in authentication code 2014-05-27 23:18:33 +01:00
Justin Clark-Casey (justincc)
9ca86664bb Make RegionReady login disabled during initialization message a console messages instead of a warning message.
Same justification as earlier commit 996a6c2.  These are not warnings but should still be visible to the user at any log level.
2014-05-27 23:15:50 +01:00
Justin Clark-Casey (justincc)
464d31b70b Stop appending redundant newline to console messages in Robust and pCampbot configs
This is to fix an issue since recent commit fbcb763 where these are no longer removed automatically.
OpenSim.*.config was already not appending these newlines
2014-05-27 20:44:00 +01:00
Justin Clark-Casey (justincc)
5622cf68aa In compiler tests, remove the ResolveEventHandlers after test exit 2014-05-27 18:47:42 +01:00
Justin Clark-Casey (justincc)
394ec508f6 Make CompilerTest add same AssemblyResolver as XEngine to see if this solves the issue with different AppDomain BaseDirectory in local and Jenkins test runs 2014-05-27 18:37:16 +01:00
Justin Clark-Casey (justincc)
bcaacb4e41 Temporarily print regression TestCastAndConcatString() script compile errors out to console to get a handle on what's going wrong.
Does not fail for me locally and I failed to notice this test was failing on Jenkins.
2014-05-27 18:19:08 +01:00
Justin Clark-Casey (justincc)
d131c57978 Update regression TestInventoryDescendentsFetch() to account for recent commit 1fa3a6f
This was hidden in continuous integration because of another regression test issue.
2014-05-27 18:14:36 +01:00
Diva Canto
987c56984d Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-27 10:13:43 -07:00
Diva Canto
e19c830a6c Fixes a bug where map search results pertaining to varregions would only send the SW-most corner of the varregions; the other areas, when clicked, would result a blue circle, meaning that the viewer didn't know about those areas. This is still not quite right, as all the areas appear to be in the same coordinates, but it's good enough for now. 2014-05-27 10:13:24 -07:00
Robert Adams
fab0389cb1 BulletSim: add locking of PhysObjects while processing simulation
step updates and collisions. This is an attempt to fix a crash reported
by Justin when doing high velocity teleports.
2014-05-26 20:29:45 -07:00
Diva Canto
d2877b9cd4 Don't report NPC presences. 2014-05-26 10:28:31 -07:00
Diva Canto
b778bd9423 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-26 08:14:34 -07:00
Diva Canto
449548d7a4 Adds an optional redirect URL to the asset server handler for when assets are not found locally. 2014-05-26 08:13:49 -07:00
Oren Hurvitz
33cc847c4a When saving an OAR in "Publish" mode, also discard Group information 2014-05-26 15:33:13 +01:00
Oren Hurvitz
5aeaa7fcdd Prevent login to a region if the Telehub or Landing Point are in a banned parcel 2014-05-25 15:37:28 +01:00
Oren Hurvitz
e68867c9b6 When taking an object into inventory, set the inventory item's "Next Owner" permissions according to the permissions of the items in the object 2014-05-25 15:35:00 +01:00
Oren Hurvitz
1fa3a6f1bd When creating a new user, create the folders "Current Outfit", "Favorites", and the standard subfolders of "Calling Cards".
(If we don't create them now then they'll be created later by the viewer, but why wait.)
2014-05-25 15:34:49 +01:00
Diva Canto
ff9da24465 Added HTTP Authentication also to Groups and offline IM. 2014-05-23 17:31:39 -07:00
Diva Canto
227685bea4 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-23 16:20:04 -07:00
Diva Canto
20f20895cf Adds optional HTTP Basic Authentication to Robust service connectors. 2014-05-23 16:19:43 -07:00
Justin Clark-Casey (justincc)
9bae636ff0 Fix issues where reported LSL compiler error line numbers do not match the script.
This is probably due to changes in the layout of the generated script preamble (using statements etc, ) in c8afc852 (Jan 17 2013).
Re-enabled existing regression test that exercises at least one case of this.
2014-05-24 00:12:23 +01:00
Justin Clark-Casey (justincc)
cf95b65c10 Get regression test TestUseUndeclaredVariable() functional again, though not yet enabled.
This reveals the position map problems and will make the fix (and subsequent continual checking) easier.
2014-05-23 22:29:47 +01:00
Justin Clark-Casey (justincc)
250ea09328 Reactivate regression test TestCastAndConcatString() in CompilerTests. 2014-05-23 22:12:49 +01:00
Justin Clark-Casey (justincc)
b3a496d6f2 Add mikemig to contributors 2014-05-23 21:13:37 +01:00
Justin Clark-Casey (justincc)
f55e153636 Compile the regex that extract categories for colourization just once rather than on every single log.
Compiling every time is unnecessary since Regex is thread-safe.
2014-05-23 21:09:48 +01:00
Justin Clark-Casey (justincc)
fbcb76383d Allow console output to be multiline by making colourization regex RegexOptions.SingleLine 2014-05-23 20:57:50 +01:00
Justin Clark-Casey (justincc)
72c67c5091 Fix possible infinite recursion in MessageTransferModule.SendGridInstantMessageViaXMLRPCAsync() whilst preserving retry lookup behaviour.
This is based on heavily mikemig's original patch in http://opensimulator.org/mantis/view.php?id=7149
but instead of exiting after the first IM delivery failure to presence information retrieved from the presence service
it will retry the lookup until the result matches the previous lookup.
This is to deal with the case where the agent is sent an IM whilst they are teleporting.
2014-05-23 20:14:49 +01:00
Justin Clark-Casey (justincc)
5015b0b485 If one is sitting on a child with an unset camera-eye and so using one set in a root prim, the focus should remain on the root prim.
Matches behaviour just tested on the Linden grid.
2014-05-23 01:55:05 +01:00
Justin Clark-Casey (justincc)
c78a8271c4 Add any camera at compensation for sat upon child prims to any existing camera-at value, rather than replace. 2014-05-23 01:38:05 +01:00
Justin Clark-Casey (justincc)
fbed245596 Compensate camera-at and camera-eye for child prim rotation when sitting on child prim with camera-eye set 2014-05-23 01:34:02 +01:00
Justin Clark-Casey (justincc)
174df94172 If a script calls llSetCameraAtOffset() or llSetCameraEyeOffset() on a child prim and the root prim has no corresponding value set, then also set the root prim.
This matches behaviour just tested on the Linden Lab grid.
2014-05-22 23:58:28 +01:00
Justin Clark-Casey (justincc)
3fbaef9275 If the root prim has a camera-at or camera-eye setting and a sat upon child prim does not, use the root prim offsets.
This matches behaviour just tested on the Linden Lab grid.
2014-05-22 23:52:28 +01:00
Justin Clark-Casey (justincc)
16bf38e1ab Fix issue where llSetCameraAtOffset() and llSetCameraEyeOffset() in non-root prims moved camera/focus to wrong position.
For non-root prim, eye offsets now need to be made relative to root prim if either camera-at or camera-eye are set.
Probably a regression since November 2013 when all sits were made relative to root prim to match viewer expections (and fix other bugs).
Addresses http://opensimulator.org/mantis/view.php?id=7176
2014-05-22 23:39:22 +01:00
Justin Clark-Casey (justincc)
f8b8241239 Add regression test for north-south chat across neighbour regions. 2014-05-22 20:28:26 +01:00
Justin Clark-Casey (justincc)
bffc9ad184 Extend regression TestInterRegionChatDistanceEastWest() to test out of range chat 2014-05-22 20:04:32 +01:00
Justin Clark-Casey (justincc)
15b50ae737 Extend regression TestInterRegionChatDistanceEastWest() to test in range chat both ways. 2014-05-22 19:55:34 +01:00
Justin Clark-Casey (justincc)
65a135f4d3 Simplify regression TestInterRegionChatDistanceEastWest() by making the child presence connection directly rather than routing through TestClient.
This code isn't relevant to this test and is already exercised by other tests.
2014-05-22 19:47:33 +01:00
Justin Clark-Casey (justincc)
1b156b7fe8 Add regression test for in-range chat between neighbouring regions from east to west. 2014-05-22 19:18:24 +01:00
Diva Canto
b7c7293c7a Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-22 10:16:19 -07:00
Diva Canto
f7b2aa0f49 Fixed a problem with detaching attachments in situations where the user's asset server is not the same as the simulator's asset server. Unfortunately this still continues to be wasteful -- new assets are created every time an attachment is detached, but the process of storing the new asset goes through the InventoryAccess module, which does all sorts of checks regarding the users' inventory. 2014-05-22 10:16:01 -07:00
AliciaRaven
04aa13a086 Fix mantis 6973. Prevent BOM being prefixed to message XML which was causing an exception when the service tried to read the data later on.
Signed-off-by: Oren Hurvitz <orenh@kitely.com>
2014-05-22 13:16:14 +01:00
Oren Hurvitz
251b93d97e Store the Teleport Flags in the Circuit. This doesn't seem to be necessary, because everything has worked so far, but it's the right thing to do. 2014-05-22 13:16:06 +01:00
Oren Hurvitz
a1b291c889 Allow map searches for regions that contain the characters "!+|"
These characters are used as placeholders for other characters: ": /". But we should search first for the exact string the user entered, and only if that fails then replace the characters and search again.
2014-05-21 07:39:23 +01:00
Justin Clark-Casey (justincc)
5b433e101d minor: Comment out currently unused log setup in TerrainCompressor 2014-05-20 23:59:08 +01:00
Justin Clark-Casey (justincc)
d93275745b minor: Remove some unused fields in ScenePresence 2014-05-20 23:57:03 +01:00
Justin Clark-Casey (justincc)
32070fa5f4 minor: remove compiler warning in SceneObjectPartInventory 2014-05-20 23:54:49 +01:00
Justin Clark-Casey (justincc)
9479f64778 Fix issue where avatar and script chat could sometimes be heard from anywhere in neighbouring regions.
This was due to a silent uint overflow in ScenePresence.UpdateChildAgent() corrupting child agent positions
when the child agent was in a region with a greater x or y map co-ord than the root agent region
Probably introduced in beeec1c.
This still will not function properly with very high region map co-ords (in the millions) but other parts of the code don't handle this properly anyway.
Looks to address http://opensimulator.org/mantis/view.php?id=7163
2014-05-20 23:52:07 +01:00
Justin Clark-Casey (justincc)
5ec3429843 On verbose groups messaging logging, count all operations in reported time when sending group messages, not just those after get group members and get presence status, as applicable 2014-05-19 23:01:48 +01:00
Justin Clark-Casey (justincc)
77a331fce3 Add DebugMessagingEnabled = false to OpenSim.ini.example for consistency. Slightly simplify config comments. 2014-05-19 23:00:04 +01:00
Justin Clark-Casey (justincc)
b46be88db6 Split verbose groups messaging logging into its own setting separate from that of the groups module.
This is to allow us to get useful information on messaging without being overwhelmed by the rest of groups debug.
Enabled with [Groups] DebugMessagingEnabled = true in config (default false)
Or "debug groups messaging verbose true|false on the console" (similar to existing groups setting).
Done for both xmlrpc and V2 groups.
2014-05-19 22:45:17 +01:00
Justin Clark-Casey (justincc)
3a6f312484 Fix recent regression from 77e7bbc where an attachment on a received group notice with XmlRpcGroups messaging did not appear in the user's inventory.
This was because the "session ID" when the message template was copied was always replaced with the group ID, whereas a notice requires this to be the notice ID.
Instead just copy the "session ID" as is - other callers already have this set properly so replacing with group ID was redundant anyway.
Relates to http://opensimulator.org/mantis/view.php?id=7037
2014-05-19 22:06:41 +01:00
Oren Hurvitz
47b84875fd Tell QueryAccess explicitly whether the user is coming in via Teleport or Cross, because the permission checks are different.
Previously we used a heuristic of checking if the entry position is 0 to differentiate between Teleport and Cross, but that doesn't work anymore since we've started providing the precise entry position for cross, too. That's required in order to ensure that the user is allowed to enter the parcel that he's walking into.
2014-05-19 11:19:11 +01:00
Oren Hurvitz
78733b979f Log the user when an inventory operation is blocked because the item/folder isn't in the Suitcase 2014-05-19 11:12:53 +01:00
Oren Hurvitz
dd30a29ba0 Return more specific error messages if an attempt to enter a region fails due to permissions (in QueryAccess and IsAuthorizedForRegion) 2014-05-19 11:11:30 +01:00
Oren Hurvitz
882af7195c Better error-handling and logging in case User Profile requests fail 2014-05-19 11:11:06 +01:00
Oren Hurvitz
96e5836b50 When can't rez, show only one error message; not two. And show more specific error messages. 2014-05-19 10:54:27 +01:00
Diva Canto
ab1472e5b7 Don't trigger ItemUploaded when no item has been uploaded. 2014-05-18 23:01:55 -07:00
Diva Canto
922f76a3a7 Don't fetch assets from the server when doing simple inventory operations like copy-paste items in inventory. 2014-05-18 07:49:01 -07:00
Robert Adams
0be9e3b079 BulletSim: adjust avatar step up parameters to better walk up small
staircases. This change is required because of the change in the
avatar default shape from the capsule to the rectangle.
2014-05-17 20:11:22 -07:00
Justin Clark-Casey (justincc)
4a74c4533c minor: eliminate now unnecessary string.Format in postgresql RetrieveGroups method 2014-05-15 22:51:47 +01:00
Justin Clark-Casey (justincc)
d2c738fc09 Don't warn on not seeing [Groups] Robust section for core groups as this does not contain any mandatory parameters and won't be present on older installations. 2014-05-15 22:48:05 +01:00
Justin Clark-Casey (justincc)
6dc1b113d0 Escape find string in PgSQL core groups plugin 2014-05-15 22:45:01 +01:00
Justin Clark-Casey (justincc)
d32d25634d Escape find string in MySQL core groups plugin 2014-05-15 22:09:37 +01:00
Justin Clark-Casey (justincc)
7c12dfe185 On ScenePresence.MakeChildAgent(), reset the m_originRegionID as this is currently being used as a flag to orchestrate destination simulator threads on teleport.
If not reset, it's possible that teleports back and forth between simulators may not restart scripts in attachments.
2014-05-14 22:08:06 +01:00
Justin Clark-Casey (justincc)
2f7539a25b Remove a race where the client's SP.CompleteMovement() thread could attempt to restart attachment scripts before the source simulator's SP.UpdateAgent() thread had added them.
This commit changes the order of code so that attachments are re-added before the CompleteMovement() thread is released.
Relates to http://opensimulator.org/mantis/view.php?id=7148
2014-05-14 21:49:29 +01:00
Justin Clark-Casey (justincc)
0c0ee95bd8 minor: Clean up and make consistent some log file messages in EstateManagementModule relating to RAW file uploading. 2014-05-14 19:22:55 +01:00
Justin Clark-Casey (justincc)
c23d37a509 Fix recent asset request timeout issue by commenting out (for now) the m_maxAssetRequestConcurrency mistakenly passed in as a timeout to SynchronousRestObjectRequester.MakeRequest()
For a long time, possibly forever, the m_maxAssetRequestConcurrency was mistakenly passed in as a 30 ms timeout rather than as a concurrent connection limiter.
This didn't come to light until the timeout was actually used in recent commit faf9ba53
Since this hasn't been operational for a long time and in release candidate phase, commenting it out for now though will need to revisit this.
Relates to http://opensimulator.org/mantis/view.php?id=7165
2014-05-14 00:11:07 +01:00
Justin Clark-Casey (justincc)
4569c595bf Fix behaviour change in recent commit bbc1dc6 so that SynchronousRestObjectRequester.MakeRequest() calls with no timeout specified use the default HttpWebRequest timeout as previously.
I mistakenly thought that that default request timeout was inifite rather than 100 seconds, restoring previously behaviour.
As per http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.timeout%28v=vs.100%29.aspx
Relates to http://opensimulator.org/mantis/view.php?id=7165
2014-05-13 22:21:20 +01:00
Justin Clark-Casey (justincc)
484aa72ff8 minor: Add some method doc to IMessageTransferModule 2014-05-12 23:49:37 +01:00
Justin Clark-Casey (justincc)
8ad29fc5c8 Make offline IM delivery to URL (pre recent Addons code) have a 10 second rather than infinite timeout.
This both signals a problem with the URL and eventually frees the thread, rather than hanging indefinitely with no information.
2014-05-12 23:42:47 +01:00
Justin Clark-Casey (justincc)
87e2668529 For XmlRpcGroups (Flotsam) module, when MessageOnlineUsersOnly = true, handle notices to offline users directly as known undeliverable messages rather than discarding or attempting delivery.
Offline notices can still be controlled with the [Messaging] ForwardOfflineGroupMessages setting.
Looks to address more of http://opensimulator.org/mantis/view.php?id=7037
Only for Flotsam now for testing, but if approach works should be possible with core offline notices as well.
2014-05-12 23:38:48 +01:00
Justin Clark-Casey (justincc)
515d373a8e Add send group notice regression test for when MessageOnlineUsersOnly=true 2014-05-12 22:54:54 +01:00
Justin Clark-Casey (justincc)
bbc1dc6bce Replace existing 0 timeout in internal overloaded SynchronousRestObjectRequester.MakeRequest() methods with proper Timeout.Infinite (-1) instead.
Triggered by recent faf9ba53 though this was wrong in the code before, it's just that we didn't actually try to set the timeout given.
2014-05-12 22:37:07 +01:00
Justin Clark-Casey (justincc)
8457044b2f Eliminate subsequently unused scene finding in UndeliveredMessage() method of xmlrpc and core offline IM modules 2014-05-12 22:23:24 +01:00
Justin Clark-Casey (justincc)
19d8f05584 minor: eliminate unused UUID in xmlrpc GroupsMessagingModule.ProcessMessageFromGroupSession() 2014-05-12 22:15:01 +01:00
Justin Clark-Casey (justincc)
7db4336f1c minor: Add method doc to SynchronousRestObjectRequester.MakeRequest() methods 2014-05-12 22:05:02 +01:00
Justin Clark-Casey (justincc)
faf9ba53fc In SynchronousRestObjectRequester.MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections) actually set timeout on WebRequest if given.
Previously, we were doing nothing with this parameter.
No effect on current code since none of the 6 callers attempt to use the timeout.
2014-05-12 19:20:00 +01:00
Oren Hurvitz
bf8f64e40e Fixed error if a user didn't have a "Current Outfit" folder in their suitcase.
This fixes http://opensimulator.org/mantis/view.php?id=7161
2014-05-12 08:54:31 +03:00
Diva Canto
73891c7fd3 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-09 11:06:33 -07:00
Diva Canto
667a272cce This little sucker had evaded my attention forever. As a consequence some assets associated with foreign users were being missed. 2014-05-09 11:06:03 -07:00
Justin Clark-Casey (justincc)
f41809e07d minor: Capitalize Hypergrid help category like others 2014-05-08 22:39:52 +01:00
Diva Canto
afb938e579 Fix test breakage 2014-05-08 11:30:45 -07:00
Diva Canto
a31393ba0b Make the URL for texture redirects match the path of the resource that we use in OpenSim. 2014-05-08 11:18:17 -07:00
Diva Canto
a845c1a893 Finished implementing redirects in GetTexture. 2014-05-07 19:38:33 -07:00
Diva Canto
093705efd1 Delete extraneous console message in the Configger. 2014-05-07 17:19:57 -07:00
Diva Canto
f4cba27105 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-07 17:00:12 -07:00
Diva Canto
3db9b847bf Allow Tools.Configger to take -inifile as argument 2014-05-07 16:59:11 -07:00
Justin Clark-Casey (justincc)
2b33677402 Add GridUserService service config to [UserAccountService] in Robust[.HG].ini.example so that home can be set for new users rather than always warning that it can't be set.
Code already exists to do this but forgot to put entry into config files a long time ago.
Thanks to AliciaRaven for the spot.
Relates to http://opensimulator.org/mantis/view.php?id=7155
2014-05-07 23:32:02 +01:00
Justin Clark-Casey (justincc)
812f5e124d Remove duplicate HypergridLinker entry from [GridService] in Robust.HG.ini.example 2014-05-07 18:39:56 +01:00
Justin Clark-Casey (justincc)
2fbafc7465 Add Matt Lehmann to contributors 2014-05-06 22:37:26 +01:00
Justin Clark-Casey (justincc)
e44450cce1 Revert "fix infinite recursion loop in SendGridInstantMessageViaXMLRPCAsync()"
There is a problem here with infinite recursion, but this patch loses the 'hunting' behaviour where the code will attempt multiple lookups if the avatar is teleporting rapidly around different simulators.
This patch only does a single lookup before giving up.

This reverts commit cecb446e0e.
2014-05-06 19:53:35 +01:00
Dev Random
78015bbbdc Console commands for Estate Mgmt 2014-05-06 18:55:42 +01:00
Matt Lehmann
9e83b43009 new version of patch to add default-user switch new version :qw :wq updated version of default user switch for load oar :q :q 2014-05-06 18:48:59 +01:00
Matt Lehmann
8b3c2f7d0c updated version of default user switch for load oar :q :q 2014-05-06 18:48:42 +01:00
Kunta Kinte
cecb446e0e fix infinite recursion loop in SendGridInstantMessageViaXMLRPCAsync() 2014-05-06 17:52:32 +01:00
Vegaslon
0faba7dc33 Fix avatars going to corner of region when they are sitting on a child prim and the prim is deleted. 2014-05-06 17:41:13 +01:00
Vegaslon
e245638f24 Change llUnSit to be able to unsit any avatar that is currently sat on the object, not just avatars sitting on the sittarget in the object containing the script. or when the object is owned by the parcel, land group or estate owner. 2014-05-06 17:35:34 +01:00
Talun
c9742c826d Mantis 7146 The lsl function llGetMassMKS is not implemented
This patch implements llGetMassMKS as it is described in the wiki
http://wiki.secondlife.com/wiki/LlGetMassMKS
2014-05-06 17:31:21 +01:00
Justin Clark-Casey (justincc)
539165e6bd minor: Change configuration text in config files to reflect the existing situation of BulletSim as the default physics engine. 2014-05-06 17:28:21 +01:00
Justin Clark-Casey (justincc)
95eeb4dde8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-05-06 17:22:47 +01:00
Oren Hurvitz
ef262799ca Better error handling in AssetServerPostHandler. Invalid XML causes an InvalidOperationException, not an XmlException 2014-05-06 09:43:07 +03:00
Oren Hurvitz
614b9e14c4 When moving an item from a prim to a user's inventory, don't delete the item from the prim until it was successfully copied to the user 2014-05-06 07:28:46 +01:00
Oren Hurvitz
eb79c882ea Show more meaningful error messages when failed to move an item from a prim to a user's inventory.
Also, actually show the error to the user in more cases. (Previously, sometimes the operation failed without telling the user anything.)
2014-05-06 07:28:45 +01:00
Oren Hurvitz
1e5cff32fc Show more meaningful error messages when failed to give an item to another user 2014-05-06 07:28:44 +01:00
Oren Hurvitz
df49196e17 Log whenever an inventory operation is blocked because the item/folder isn't in the Suitcase 2014-05-06 07:28:43 +01:00
Oren Hurvitz
0fe08c8799 - When sending the "My Suitcase" folder to the client, always claim it has Folder Type 8. (Previously we had used Folder Type -1 in one place, and LLClientView didn't even bother changing Folder Type 100 to anything else.) 2014-05-06 07:16:37 +01:00
Oren Hurvitz
7862d1e20d Added range-checking for the parameters to PRIM_POINT_LIGHT (used in llSetLinkPrimitiveParamsFast() ) 2014-05-06 07:14:58 +01:00
Diva Canto
13b2ac1425 Makes it possible to support grids in which all the simulators share all central services of a Robust server EXCEPT assets. In other words, grids where the simulators' assets are kept in one DB and the users' inventory assets
are kept on another. When users rez items from inventory or take objects from world, an HG-like asset copy takes place between the 2 servers, the world asset server and the user's asset server. This makes the simulators independent of the central asset server.

Note that this an advanced configuration and requires some security strengthening coming up.
2014-05-04 20:54:42 -07:00
Diva Canto
7f570636f8 Please note: older simulators (0.7.6) still send the info about gzip in ContentType 2014-05-04 11:41:52 -07:00
Diva Canto
5a10da3ee8 Added a optional key between the group remote connectors, sim and service. This allows for more secure group services, to be used by collections of mutually-trusting grids. 2014-05-03 17:13:53 -07:00
Justin Clark-Casey (justincc)
53b72ab4b8 minor: Comment out Cacheitems debug log lines for now 2014-05-02 13:31:58 +01:00
Talun
3a2c099169 Mantis 7144 missing ATTACH_AVATAR_CENTER constant
This patch adds ATTACH_AVATAR_CENTER and ATTACH_NECK
2014-05-01 23:20:31 +01:00
Justin Clark-Casey (justincc)
c31d93cb6f Fix issue where only one of multiple attachments on the same attachpoint for NPCs would be seen by other viewers.
It appears that at least Singularity 1.8.5 (but probably others) rely on attachment FromItemIDs being different to display more than one.
This commit resolves this by generating random IDs instead of always using UUID.Zero for NPCs.
Resolves http://opensimulator.org/mantis/view.php?id=7110
2014-05-01 22:24:21 +01:00
Justin Clark-Casey (justincc)
f0411dc128 minor: Use Vector2.Zero constant and only set in condition branch where it was missing in TryParseConsole2DVector(). xbuild still compiles. 2014-04-30 21:50:18 +01:00
Melanie
7c121a2acc Change XEngine to call StateChange rather than RemoveScript on state changes 2014-04-30 20:56:49 +01:00
Melanie
f0eeb47262 Add the "StateChange" function to the async comand manager to differentiate
between state changes and script exit/reset.
2014-04-30 20:54:34 +01:00
BlueWall
44f533d95a Assign value to 'vector' to fix building under xbuild and Monodevelop 2014-04-30 15:45:00 -04:00
Justin Clark-Casey (justincc)
7bb673a854 minor: Correct mistake in terrain flip error message from previous commit 5d01a1f 2014-04-30 19:41:11 +01:00
Justin Clark-Casey (justincc)
5d01a1ff4d minor: Print output in response to terrain console commands on the console rather than in the log. 2014-04-30 19:24:17 +01:00
Justin Clark-Casey (justincc)
253110293a Add "terrain show" console command which outputs terrain height for a given region co-ordinate.
For debug purposes.
2014-04-30 18:04:47 +01:00
Justin Clark-Casey (justincc)
5fc61942e0 minor: convert back some tabs to spaces that got into ScenePresence via recent patch bc969a6b 2014-04-29 20:15:29 +01:00
Justin Clark-Casey (justincc)
d4eee213a9 Restore terrain height and flying adjustments that were eliminated from non-megaregion paths in ScenePresence.MoveToTarget() by recent patch bc969a6b 2014-04-29 20:05:08 +01:00
Justin Clark-Casey (justincc)
2dbc18054e Add regression test for NPC movement on a variable region.
Extends basic physics to allow av movement on a varregion (basic physics is only really useful for regression test purposes).
2014-04-29 19:29:16 +01:00
Oren Hurvitz
88f7a833dc Improved HTTP logging 2014-04-29 07:59:17 +01:00
Oren Hurvitz
06e4fcd260 Fixed the UpdateAgentInformation CAP: the viewer expects the simulator to echo back the maturity that it sent
Without this change, attempts to change the maturity rating in the viewer's Preferences don't work.
2014-04-29 07:59:10 +01:00
Robert Adams
df89e15290 BulletSim: non-functional changes to debugging statements and formatting. 2014-04-28 18:36:50 -07:00
Robert Adams
63aea3a5f2 BUlletSim: move safeynet ground plane to lower altitude. Define new BulletSim
parameter 'TerrainGroundPlane' which defaults to -500.

BulletSim had assumed altitudes never went negative but that is not true. The
ground plane is just a safety net so things wouldn't fall to infinity.
2014-04-28 11:08:47 -07:00
Oren Hurvitz
cb8c3ba023 Removed dependency on Linq in OpenProfileClient 2014-04-28 16:41:02 +01:00
Justin Clark-Casey (justincc)
2e216aa056 Add missing [Test] decorator to actually get the basic scene creation test from 2227f51b to run 2014-04-25 23:35:20 +01:00
Justin Clark-Casey (justincc)
9664273df6 Add basic regression test for creating a var region 2014-04-25 23:34:30 +01:00
Justin Clark-Casey (justincc)
2227f51b29 Add basic sanity regression test for creating a scene. 2014-04-25 23:16:07 +01:00
Justin Clark-Casey (justincc)
38acda9f29 Add regression test for terrain fill at two digit height and max ll height. 2014-04-25 23:01:24 +01:00
Justin Clark-Casey (justincc)
904baa6da6 Fix issue where terrain height values > 327 caused chaotic spiked terrain.
Per http://wiki.secondlife.com/wiki/Tips_for_Creating_Heightfields_and_Details_on_Terrain_RAW_Files#Notes_for_Creating_Height_Field_Maps_for_Second_Life
terrain heights up to 508 are possible on the LL grid (and were available on previous releases of OpenSimulator).
The obvious way to allow both this and equivalent -z values, is to rewiden the internal terrain height storage from short to int.
The memory tradeoff is most noticeable on the maximum 8192x8192 var region (equiv to 1024 normal regions), where it adds 128mb to resident use (128k on a normal region)
This is still better than the double used in previous releases.
This does not affect physics or data storage since they already use float and double respectively.
This may not be the final solution if we actually want to sacrifice -z, >327 or something else.
Relates to http://opensimulator.org/mantis/view.php?id=7076
2014-04-25 22:56:25 +01:00
Melanie
a108fcac95 Restore overload mode accidentally disabled in a prior commit. Add a new
config option, LogOverloads, to log when a thread pool overload occurs.
This option defaults to "True" because the logging data is useful for
diagnosing threading issues.
2014-04-25 21:34:29 +01:00
Melanie
2572ed9ed9 Adjust permissions to work hand in hand with what the viewer believes they are.
This fixes the issue of "Show in Search" seeming resetting at random.
2014-04-25 00:35:53 +01:00
Diva Canto
cf54df3ecf Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-04-24 14:12:04 -07:00
Diva Canto
1d9a9e6004 Fixes a long-standing bug related to god-mode change ownership of objects permissive, where the permissions of the children prims' inventory items were not changed. As a consequence, we couldn't control some of the objects imported via HG and OARs even in god mode. 2014-04-24 14:11:42 -07:00
Oren Hurvitz
0d898d8d8a Revert "When linking a Hypergrid region, set the region's flags on the in-memory GridRegion immediately."
This reverts commit 463d0b2f8f.
2014-04-24 19:08:50 +03:00
Oren Hurvitz
463d0b2f8f When linking a Hypergrid region, set the region's flags on the in-memory GridRegion immediately.
(When using llTeleportAgent() this *specific* object is used for the teleport, so it should have the correct flags.)
2014-04-24 16:58:16 +01:00
Oren Hurvitz
bc06db3df4 - Created a standard function to send XML-RPC requests, which logs them like we do for other types of HTTP activity.
- Changed OpenProfileClient to use the new XML-RPC sending function
- Improved logging in WebUtil
2014-04-24 15:58:43 +01:00
Oren Hurvitz
e8a2eff2e8 Changed how UserProfile performs a fallback call using the OpenProfile API, because now JsonRpcRequest() returns an error result instead of throwing an exception 2014-04-24 15:58:43 +01:00
Oren Hurvitz
d62f0bc35d Refactored: moved OpenProfileClient to a location where it can be used by both the Simulators and Robust 2014-04-24 15:58:42 +01:00
Oren Hurvitz
d15a3b10a3 When sending JSON-RPC calls (for UserProfile), use WebUtil instead of constructing the HTTP requests manually. This allows the calls to be logged when using "debug http all 6". 2014-04-24 15:58:41 +01:00
Oren Hurvitz
6efc203ce8 Fixed: hypergrid-linking stopped accepting the following format: "http://grid.example.com" (without a region name)
Fixes http://opensimulator.org/mantis/view.php?id=7128
2014-04-24 06:19:57 +01:00
Oren Hurvitz
d1865c526d Removed unused CsharpSqlite DLLs 2014-04-24 06:19:49 +01:00
Melanie
98c1940820 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2014-04-24 01:48:05 +01:00
Melanie
5dc0298f83 Apply logging flag to a spammy message that may have been overlooked.
No one needs to see every thread launch.....
2014-04-24 01:44:11 +01:00
Dev Random
7180690a14 Show Group name when land is group-owned 2014-04-23 23:29:17 +01:00
Michael Cerquoni
0b743045ef Add Dev Random to CONTRIBUTORS.txt, thanks for the patches! 2014-04-23 17:51:26 -04:00
Justin Clark-Casey (justincc)
5092cbd77e minor: Remove unused System.Linq reference and use ParcelFlags.None instead of 0 from previous commit cb1f28 2014-04-23 19:55:51 +01:00
Dev Random
cb1f2886cd Prevent sending Land Properties for unprivileged users 2014-04-23 19:50:59 +01:00
Justin Clark-Casey (justincc)
7a5699224e Fix regression test break on previous commit 328bc3b 2014-04-23 19:46:58 +01:00
Justin Clark-Casey (justincc)
328bc3b76e Adjust avatar sit positioning on a target to pretty much exactly match that of the LL grid.
This uses an offset of 0.05 on the up vector of the sit orientation, after extensive analysis on
http://opensimulator.org/mantis/view.php?id=7096 and https://wiki.secondlife.com/wiki/Talk:LlSitTarget
This supersedes the previous adjustment in 5b73b9c4 which had been wrongly applied.
The maximum change is about 0.1 with a maximum height avatar.
This patch is all Aleric's work - I am applying manually in order to add these additional notes
2014-04-23 19:19:09 +01:00
Oren Hurvitz
b01e73cf27 Dynamic textures shouldn't be saved in the assets service (only in the simulator cache) 2014-04-23 14:42:40 +01:00
Oren Hurvitz
7eb12f96ec Hypergrid: don't send Local assets to other grids
This commit also contains other changes, but they're all just for clarity. The only actual behavior change is to avoid Posting local assets.
2014-04-23 16:42:23 +03:00
Oren Hurvitz
2506b3d89e Removed references to Community.CsharpSqlite*.dll. This eliminates some warnings, and SQLite still works. 2014-04-23 14:38:41 +01:00
Oren Hurvitz
018832522c Removed GetUserInventory(). It wasn't being used, and was creating warnings because it's Obsolete. 2014-04-23 14:38:33 +01:00
Oren Hurvitz
ca78c8326e Eliminated 'Obsolete' warning: don't call do-nothing function SetPreviousAppearance() 2014-04-23 14:38:04 +01:00
Oren Hurvitz
998d7009a6 Eliminated many warnings 2014-04-23 16:37:36 +03:00
Oren Hurvitz
617bc4710a Workaround for SRAS: if Store Asset returns 'null' then assume the asset already exists, and this isn't an error 2014-04-23 14:19:24 +01:00
Oren Hurvitz
2c9859314f Changed table 'im_offline' to use UTF8 characters. This fixes a problem with Offline IM V2 (only relevant to MySQL).
This fixes http://opensimulator.org/mantis/view.php?id=7123

Users that use MySQL should change their MySQL configuration to support UTF8. In the config file /etc/my.cnf (Linux) or my.ini (Windows), add these settings:

   [mysqld]
   character-set-server=utf8

   [client]
   default-character-set=utf8

And then restart MySQL (on Linux: "sudo service mysqld restart").
2014-04-23 16:18:28 +03:00
Melanie
eb5bfd14fa Reverting test change to cause another email 2014-04-23 12:49:28 +01:00
Melanie
85f4357ce6 Test commit to trigger a mailing list update 2014-04-23 12:44:43 +01:00
Oren Hurvitz
a893fd90cd Fixed KeyframeMotion to work with very slow movement.
Previously, if the movement speed was below 0.05/sec then it didn't work correctly.

Fixes http://opensimulator.org/mantis/view.php?id=7117
2014-04-22 10:19:11 +01:00
Oren Hurvitz
93a9ed2a6d Changed the maximum asset name and description lengths to constants. Also, pre-truncate the description of dynamic textures. 2014-04-22 12:18:54 +03:00
Oren Hurvitz
4cac87d9f4 Fixed: when a user logged-in, sometimes he didn't get notified of the Online status of friends, so they continued to appear Offline.
This happened because these notifications (the UDP packets) can only be sent to Root Agents. But the notifications were done in OnClientLogin(), at which point the client is still a Child Agent. Since a FireAndForget is used, it became a race condition as to whether the packets would be sent before or after the client became a Root Agent.

To fix this, we now only send the notifications once the client becomes a Root Agent for the first time.
2014-04-21 16:56:49 +01:00
Oren Hurvitz
538ff31b28 Better error handling when retrieving offline IMs 2014-04-21 16:56:26 +01:00
Oren Hurvitz
06db136fbc Removed an attempt to set a user's presence to "Region 0" when they HG teleport to another grid.
a) This shouldn't have been done because at that point the user is still logged-in to the current grid. b) It's not necessary because the user will soon be logged-out completely. c) And it didn't even work because the MySQL database layer prevents setting the region to 0.
2014-04-21 16:56:14 +01:00
Oren Hurvitz
acc2c42a79 Better logging in PresenceService, to help diagnose presence problems. 2014-04-21 18:55:53 +03:00
Robert Adams
b065c02661 Add 'lillith_xue' to list of CONTRIBUTORS.TXT
Removed references to 'Intel' as the contributors are no independent.
2014-04-21 06:00:55 -07:00
lillith_xue
bc969a6b46 Possible solution for #7120 and #7051
Signed-off-by: Robert Adams <misterblue@misterblue.com>
2014-04-21 05:58:29 -07:00
Oren Hurvitz
3f76f72137 Better error-handling when storing assets: recognize that 'null' is an error value 2014-04-20 06:23:38 +01:00
Oren Hurvitz
52f8669169 Stopped setting the Service URL "GatekeeperURI" on users' accounts. It isn't actually used. 2014-04-20 06:23:37 +01:00
Oren Hurvitz
853c0fccc8 Fixed: when any avatar changed his Active Group, it was set as the active group for *all* the avatars in the scene (not permanently) 2014-04-20 06:23:37 +01:00
Oren Hurvitz
090f9bcece Fixed: once a user has rezzed an object, they could then duplicate it as much as they wanted even if the parcel's permissions had since been changed to disallow rezzing 2014-04-20 06:23:36 +01:00
Oren Hurvitz
3185db7f94 Fixed: if a user belonged to the parcel's group then he was allowed to rez object in the parcel even if the flag "Create Objects by Group" was disabled 2014-04-20 06:23:36 +01:00
Oren Hurvitz
a780e01a54 Fixed: the parcel flag "Allow Scripts from Group" should only check if the parcel has a Group set; it doesn't have to be *deeded* to the group
Also some cleanup of the use of Group ID's (with no change to functionality).
2014-04-20 06:23:35 +01:00
BlueWall
63fd027494 Catch empty url error 2014-04-19 22:25:21 -04:00
Oren Hurvitz
b3ebec184f In teleports, when sending the Source region, set its ServerURI to the Gatekeeper URI (which is used with Regions); not the Home URI (which is used with Users) 2014-04-13 12:58:37 +03:00
Oren Hurvitz
e1dd228f18 Better error checking when creating hyperlinks: a) Reject invalid strings; b) Default port is 80, not 0
The change of default port may fix http://opensimulator.org/mantis/view.php?id=7108 , where a user was able to create a Hyperlink to OSGrid from inside OSGrid.
2014-04-13 09:54:56 +01:00
Robert Adams
c8914d22eb BulletSim: reduce the terrain collison margin to be the same as other
objects in the world.

This was originally changed in an attempt to make vehicles work better
but the effect was not that large and it causes avatars to float
above the terrain.
2014-04-12 17:37:57 -07:00
Melanie
574a11558d Refactor: Rename GetOtherSetting to GetSetting and make SetOtherSetting private 2014-04-12 17:32:16 +01:00
Melanie
5d964a6424 Remove the old XML format parsing. Now additional region params can just be
added as they are already exposed through an API when using Nini. That will
remove the need to always edit RegioInfo just to add a region based setting.
2014-04-12 16:58:07 +01:00
Dev Random
18b91fdbe9 Tweak to PrimLimits and add missing Regions.ini example
Signed-off-by: Melanie <melanie@t-data.com>
2014-04-12 14:40:34 +01:00
Dev Random
f0998a9222 Add per-user checking to PrimLimitsModule
Signed-off-by: Melanie <melanie@t-data.com>
2014-04-12 09:28:29 +01:00
Justin Clark-Casey (justincc)
7c148d9b2f minor: use constants instead of magic numbers in llRequestAgentData() where possible 2014-04-11 00:52:28 +01:00
Justin Clark-Casey (justincc)
de0ab04d00 Actually add the llRequestAgentData() test class for commit 530c86 2014-04-11 00:36:50 +01:00
Justin Clark-Casey (justincc)
530c86335d Fix the presence info caching used in llRequestAgentData(), which was completely inoperative.
This means the presence info may be out of date by up to 20 seconds, but this avoids scripts potentially triggering constants requests to user accout and presence info services.
Relates to http://opensimulator.org/mantis/view.php?id=7088 though I fixed in a different way.
Adds regression test for this case.
2014-04-11 00:29:06 +01:00
Robert Adams
562a3cb338 BulletSim: small tweek to avatar height reduce feet embedded into prims.
This adjustment makes a default, shoeless avatar stand properly on a prim
for the various heights (0% to 100% in the appearance adjustment).
2014-04-10 06:53:36 -07:00
Snoopy Pfeffer
32ad66c274 Allows to sell objects on a parcel of land together with that parcel of land. The objects that are sold together with the parcel of land need to fulfill the following preconditions: owned by the current parcel owner, not set to a group, transferrable. This feature does not work for group owned parcels or land bought by a group. 2014-04-10 11:47:46 +02:00
Oren Hurvitz
c725ad1577 Fixed: when teleporting between grids, the avatar name wasn't always updated.
When an avatar is in their home grid, their name appears as "First Last". In other grids the name appears as "First.Last @grid.example.com". However, viewers have a bug and they don't always show the new name. We use a trick (changing the Group Title briefly) in order to make the viewers show the new name. This is only done after a Hypergrid teleport.
2014-04-09 15:00:54 +01:00
Oren Hurvitz
06e0528d0b In teleports, pass the source region to the destination (similar to an HTTP referrer) 2014-04-09 09:22:20 +01:00
Oren Hurvitz
cf1686335f Log when the presence service logs-out all the users in a region 2014-04-09 06:06:52 +01:00
Oren Hurvitz
af406748a2 Improved error messages when a teleport fails. The viewer's dialog already says "Teleport failed", so adding "Teleport refused" is redundant. 2014-04-08 08:11:30 +01:00
Oren Hurvitz
e00f1a0410 Allow invalidating the users cache 2014-04-08 08:11:29 +01:00
Diva Canto
86105a1533 Better (amend to previous commit) 2014-04-07 19:51:26 -07:00
Diva Canto
c0fd09b445 Avoid calling HELO service on malformed URLs. This is in response to an exception reported by danbanner. 2014-04-07 19:41:25 -07:00
Oren Hurvitz
85d51e57a9 When sending QueryAccess to a region, also send the user's Home URI 2014-04-07 07:32:36 +01:00
Oren Hurvitz
55cc8044cb Refactored: use Scene.GetAgentHomeURI() to get the Home URI of a user 2014-04-07 07:26:44 +01:00
Oren Hurvitz
f3508649f5 Fixed: during a teleport we always sent the error "The teleport destination could not be found" to the client. This happened on both success and failure.
On successful teleports this error wasn't actually shown to the user. But on failed teleports this error could hide the true cause of the failure. For example, attempting to use a Landmark that's more than 4095 regions away would result in two warnings appearing in the viewer: "Region too far" and "Destination could not be found". The second message hid the first one, so it wasn't obvious to the user what is actually the problem.
2014-04-06 15:42:33 +01:00
Oren Hurvitz
abe0f4a088 When preparing a Hypergrid teleport, tell the receiving grid which user is entering the grid.
This can affect which region to use. E.g., returning users may be allowed to enter any region, whereas users from other grids will have to enter a gateway region. Previously per-user decisions were only made later, but by then it's too late to change which region the user enters.
2014-04-06 15:40:45 +01:00
Oren Hurvitz
d4acaf25af Pass the correct position to QueryAccess() instead of UUID.Zero (it was wrong in one place) 2014-04-06 15:40:45 +01:00
Justin Clark-Casey (justincc)
cacbb5c165 Don't re-retrieve sit part in SP.HandleAgentSit() when we already have it (this time with the right code change) 2014-04-05 02:16:14 +01:00
Justin Clark-Casey (justincc)
86a2cd915c Revert "Don't re-retrieve sit part in SP.HandleAgentSit() when we already have it."
This reverts commit 2c00b73cd2.

Wrong code change
2014-04-05 02:11:36 +01:00
Justin Clark-Casey (justincc)
2c00b73cd2 Don't re-retrieve sit part in SP.HandleAgentSit() when we already have it. 2014-04-05 02:09:44 +01:00
tglion
8b8e1b88ec fixed object-collision issue after uncheck phantom-flag
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-04-04 12:29:44 -04:00
Justin Clark-Casey (justincc)
aec723b955 Fix sp.AbsolutePosition when agent is sitting on a child prim, which in turns fixes llDetectedPos(), llGetLinkPrimitiveParams() and similar functions.
Add regression test for this case.
In relation to http://opensimulator.org/mantis/view.php?id=7043
2014-04-03 23:22:57 +01:00
Michael Cerquoni
6b1d09813e remove some whitespace that snuck in with last patch 2014-04-03 13:25:32 -04:00
Dev Random
50eec6df52 Add Varregion support to Terragen Handler
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-04-03 13:14:13 -04:00
Vegaslon
3c5b7d7b79 BulletSim: Minor Fix to vehicle hovering, add more ways to disable it.
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-04-03 13:07:48 -04:00
Dev Random
4aa483777b Move new Estate commands to OpenSim.cs
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-04-03 12:45:43 -04:00
Oren Hurvitz
672bd9fc98 Reduced log levels for REST 404 errors to DEBUG 2014-04-03 15:04:26 +01:00
Oren Hurvitz
01daa74adf Better error messages in RestClient 2014-04-03 14:13:22 +01:00
Oren Hurvitz
6d2893be67 When teleporting using Hypergrid, show more informative error messages in case of error 2014-04-03 14:13:03 +01:00
Robert Adams
65c4cb48ac BulletSim: make avatar physical shape to be a rectangle rather than
a capsule. Set the default to be the rectangle shape and adjust the
parameters in OpenSimDefaults.ini for the new shape.

The rectangle shape will perform better and avatar height can be
computed more accurately.
2014-04-02 21:53:58 -07:00
Robert Adams
9406db3047 Fix problem with floating avatar by passing avatar size information
to the physics engine.

This operation was accidentally removed while in the middle of improving
the computation of the avatar height. This is a temp fix until the real
solution is added.
2014-04-02 21:52:24 -07:00
Justin Clark-Casey (justincc)
e756457703 Remove redundant part.SitTargetAvatar setting from SP.MakeRootAgent as part.AddSittingAvatar already does this. 2014-04-03 01:21:50 +01:00
Justin Clark-Casey (justincc)
6ac9c9c972 refactor: Use m_sittingAvatars to maintain the list of sitting avatars instead of two independent structures that do exactly the same thing
m_sittingAvatars code also already properly handles locking to avoid races.
2014-04-03 01:14:39 +01:00
Justin Clark-Casey (justincc)
91b7679db9 minor: Fix warning in AvatarFactoryModule 2014-04-03 00:35:42 +01:00
Justin Clark-Casey (justincc)
17929abd28 Wrap contents of ETM.CrossAgentToNewRegionAsync() in try/catch to avoid a failure terminating simulators running on Windows
In relation to http://opensimulator.org/mantis/view.php?id=7050
2014-04-03 00:34:20 +01:00
Justin Clark-Casey (justincc)
5cb4044539 Don't clear avsToCross in SOG.AbsolutePosition.set(), this is unnecessary since the structure is local and never reused after the clear 2014-04-03 00:26:55 +01:00
Justin Clark-Casey (justincc)
e6d0dcd4e8 Fix bug where crossing to a neighbouring region and back again would trigger an exception, and a second recross would stop the user moving until relog
Also fixes an issue where sitting avatar counts became inaccurate after any cross.
Part of the problem was due to cloning code using MemberwiseClone() but not resetting certain collection structures.
Adds regression test for this case.
In relation to http://opensimulator.org/mantis/view.php?id=7050
2014-04-03 00:19:53 +01:00
Oren Hurvitz
2051535ce1 String matching in REST handlers: must allow '-' as a separator, because the "/map" handler uses it 2014-04-02 15:11:54 +01:00
Oren Hurvitz
0301c81b01 Made GetScenePresence() case-insensitive when searching by user name. This makes it easier to use console commands such as "show appearance". 2014-04-02 13:08:31 +01:00
Oren Hurvitz
9211361b19 Fixed AssetsExist in SQLite 2014-04-02 10:00:09 +03:00
Oren Hurvitz
6b65895736 Made the SQLite unit tests work on Windows (sqlite3.dll wasn't being loaded) 2014-04-02 09:49:57 +03:00
Oren Hurvitz
559c66afe6 Added System.Core reference to MSSQL 2014-04-02 09:20:28 +03:00
Oren Hurvitz
aa217cf90f Better string matching when searching for REST handlers: must match an entire path component (ending with '/' or a similar character).
For example, these should match: "/assets" and "/assets/12345", but these shouldn't match: "/assets" and "/assets_exist".
2014-04-02 08:52:44 +03:00
Oren Hurvitz
bbfda8e19e Fixed last-resort sending of error response (HTTP 500) when an error occurs while handling a request.
The previous code didn't actually send the response, so the caller was stuck until the timeout (100 seconds).
2014-04-02 06:32:41 +01:00
Oren Hurvitz
fad0fd7f75 Fixed the "Update Asset" handler: it was looking for the Asset ID in the wrong parameter.
This doesn't actually matter because the "Update Asset" operation isn't implemented in AssetsServer. But still, the handler should do the right thing...
2014-04-02 06:32:40 +01:00
Oren Hurvitz
d1c3f8eef5 Added assets service method AssetsExist(), which returns whether the given list of assets exist.
This method is used to optimize sending assets with embedded assets: e.g., when a Hypergrid visitor takes an item into the inventory.
2014-04-02 06:30:57 +01:00
Mic Bowman
ac16a667e1 fix orphaned code in sun module per mantis 7068 2014-04-01 19:48:03 -07:00
Justin Clark-Casey (justincc)
7bafee28fa Removing warning from SceneObjectLinkingTests.TestLinkDelink2SceneObjects() by actually checking whether delinked grp3 is not null 2014-04-02 01:26:58 +01:00
Justin Clark-Casey (justincc)
46095c058e minor: comment out currently unused RegionCombinerModule.LogHeader 2014-04-02 01:24:40 +01:00
Justin Clark-Casey (justincc)
e5a5b69b08 remove EstateManagmentCommands.m_commander that has been unused for some time 2014-04-02 01:23:40 +01:00
Dev Random
43eab5e163 Console command to rename Estate 2014-04-02 01:17:41 +01:00
Justin Clark-Casey (justincc)
444737c830 minor: Only calculate fetched usedPrims and simulatorCapacity info in PrimLimitsModule.CanObjectEnter() when we know for sure that we need them. 2014-04-02 01:05:37 +01:00
Justin Clark-Casey (justincc)
7cb1690589 minor: disable logging in recently added scene object crossing tests and remove some unnecessary test config 2014-04-02 01:01:53 +01:00
Justin Clark-Casey (justincc)
0af8886400 Fix problem where moving an object to another region on the same simulator was failing, with the object returning to its original position.
Root cause was that PrimLimitsModule was not properly handling the case where the parcel it was asked to check was outside the current region's bounds.
If this is the case, we can abort the check since the receiving region will perform it.
Added a regression test for this case.
2014-04-02 00:58:33 +01:00
BlueWall
4cbd45f3d5 Merge branch 'master' of /home/opensim/src/opensim 2014-03-31 15:50:27 -04:00
BlueWall
59d0e3c3c8 Add check to prevent the return of a wrong value when key is NULL_KEY 2014-03-31 15:49:53 -04:00
Dev Random
635f3f77ab Console command to change Estate owner
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-03-29 00:59:15 -04:00
Oren Hurvitz
6557eba235 Removed default timeout when starting scripts after Load OAR 2014-03-28 13:04:19 +03:00
Oren Hurvitz
1fe504fee5 Better skipping of "SculptData" when parsing XML 2014-03-28 12:52:06 +03:00
Oren Hurvitz
f360b687d6 Removed "SculptData" from the serialized XML format of prims 2014-03-28 07:51:21 +01:00
BlueWall
ba5a236922 Profiles local StorageProvider fix, round 3 2014-03-27 13:41:20 -04:00
BlueWall
20640357ab Fix to local StorageProvider override 2014-03-27 13:27:46 -04:00
BlueWall
45ada5ca2d Merge branch 'master' of /home/opensim/var/repo/opensim 2014-03-27 12:56:12 -04:00
BlueWall
9c7b28341c Add support for specifying non-default StorageProvider 2014-03-27 12:36:30 -04:00
BlueWall
a15282f023 Merge branch 'master' into m_test 2014-03-27 12:21:38 -04:00
Oren Hurvitz
161c827a44 Fixed a case where logging an HTTP response failed because the stream was non-seekable 2014-03-27 17:46:37 +02:00
Oren Hurvitz
76add0fdb0 Log errors in MakeRequest() as INFO, not ERROR. Some communications problems are benign (e.g., can't send Friend status update to a region that is down), so don't log them as ERROR so soon. We rethrow the exception, so the caller can still decide to log the error as an ERROR.
Resolves http://opensimulator.org/mantis/view.php?id=7077
2014-03-27 15:00:42 +01:00
Justin Clark-Casey (justincc)
af54e6f370 minor: Change incorrect "Maximum" in the PhysicalPrimMin OpenSim.ini.example description to "Minimum"
Thanks to aiaustin for the spot.
2014-03-26 23:45:02 +00:00
Justin Clark-Casey (justincc)
e7fa8a4699 minor: change misspelling of overriden to overridden in comments within config files
Thanks to aiaustin for the spot.
2014-03-26 23:43:49 +00:00
Justin Clark-Casey (justincc)
262892336b Add LuciusSirnah to contributors list 2014-03-26 21:03:21 +00:00
Justin Clark-Casey (justincc)
1247174db4 Fix MSSQLInventoryHandler.IncreementFolderVersion where sql accidentally used a MySQL style ?folderID insted of @folderID
Thanks to LuciusSirnah in http://opensimulator.org/mantis/view.php?id=7075 for this fix
2014-03-26 21:02:26 +00:00
Justin Clark-Casey (justincc)
de941d2ec7 minor: remove compiler warning from NullEstateData 2014-03-26 21:00:57 +00:00
Justin Clark-Casey (justincc)
b0bae62c30 refactor: Actually use MaptileStaticFile in RegionInfo rather than having both a public field and a get property 2014-03-26 20:58:58 +00:00
Justin Clark-Casey (justincc)
7a4c5b067d Add MSSQL EstateStore.migrations VERSION 10 transaction to add AllowLandMark, AllowParcelChanges and AllowSetHome columns to estate_settings table.
Taken from http://opensimulator.org/mantis/view.php?id=7074 by LuciusSirnah.  Thanks!
2014-03-26 20:42:53 +00:00
Justin Clark-Casey (justincc)
6c447f892e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-26 20:36:33 +00:00
Justin Clark-Casey (justincc)
5e8dfb4f7e Fix extra physics params MSSQL migration (version 39).
This was failing because it used MySQL syntax
This is taken from Lucius Sirnah's entry in http://opensimulator.org/mantis/view.php?id=6593
But with the column existence checking removed, as this should not be necessary in a migration and is inconsistent with all other migrations, though I can see a case for doing it.
2014-03-26 20:34:04 +00:00
Oren Hurvitz
7a47c15edb - Increased the threadpool timeout to 10 minutes
- Changed a few places that launch long-lasting threads to skip the timeout altogether
2014-03-26 20:34:55 +01:00
Oren Hurvitz
14a7ddb885 Revert "Use log-rolling on the log files (once per day)"
This reverts commit 8ecab21b37.
2014-03-26 08:56:56 +02:00
Justin Clark-Casey (justincc)
2fbb906ff6 Reinsert code to extract size_x and size_y parameters from GetHomeRegion response in UserAgentServiceConnector.
This is actually code from commits afb2e07 and cf61cdf
For as yet unexplained reasons, the section of these commits which changed UserAgentServiceConnector.cs disappeared from its history between approx Feb 5 2014 and Feb 13 2014.
This ought to be impossible.  More details to follow in opensim-dev mailing list
2014-03-26 02:34:22 +00:00
Justin Clark-Casey (justincc)
62a03a5cac Also take YP/commented out JS references from script engine CodeTools.
Fixes build break from d3387d591a
2014-03-26 01:20:49 +00:00
Justin Clark-Casey (justincc)
d3387d591a Remove unmaintained and unused YieldProlog scripting language
This hasn't been mainntained since 2008 and has not been kept up with the rest of the language infrastructure.
Hence, it almost certainly doesn't work and has never been used, afaik
If this is wrong, please say on the opensim-users/dev mailing list.
Removing to reduce maintenance burden (since it still needs to be made to compile).
2014-03-26 00:59:57 +00:00
Justin Clark-Casey (justincc)
cffea984f1 minor: Remove "js" (Javascript) from list of allowed languages in script config since it hasn't been present in OpenSimulator for a very long time (0.6 days)
One reason support was removed is that the external DLL that implemented Javascript stopped development.
Not sure how well this ever worked in OpenSimulator.
Not removing vb for now as this is directly supported by Mono (via vbnc compiler) though I strongly suspect it is also inoperable.
2014-03-26 00:50:33 +00:00
Justin Clark-Casey (justincc)
99308d64c6 minor: Add some doc to Scene.Backup() detailing its direct invocation if the indepedent backup thread is not running (e.g. in a regression test) 2014-03-26 00:43:17 +00:00
Oren Hurvitz
6d1d58b654 Use the "X-Content-Encoding" header to indicate gzipped data, because old OpenSims fail if they get an unknown "Content-Encoding" 2014-03-25 18:09:23 +01:00
BlueWall
14836e60ff Fix issue with user picks creation. The snapshot id is UUID.Zero in new parcels. 2014-03-25 11:10:48 -04:00
BlueWall
9aec36156e Sync code that has moved in development branch with changes in master 2014-03-25 11:09:27 -04:00
BlueWall
fce3fca7f9 Add the UserProfiles local service module to non-HG Standalone configuration. 2014-03-25 11:08:58 -04:00
BlueWall
542bef20e8 Move JsonRpc request code out for general availability 2014-03-25 11:08:27 -04:00
BlueWall
dba33fee39 Move from UserProfileModule for general availability 2014-03-25 11:08:11 -04:00
Oren Hurvitz
b1d8aa0b64 Use the "Content-Encoding" header to indicate gzipped streams 2014-03-25 15:36:59 +01:00
Oren Hurvitz
8ecab21b37 Use log-rolling on the log files (once per day)
Resolves http://opensimulator.org/mantis/view.php?id=6950
2014-03-25 09:53:02 +01:00
Oren Hurvitz
368b29a680 In Core Profiles: as a fallback, try to get profiles from foreign grids using the OpenProfile protocol
Resolves http://opensimulator.org/mantis/view.php?id=6954
2014-03-25 09:37:18 +01:00
Oren Hurvitz
f90aee696a Always throw an exception if MakeRequest (used for HTTP POST) fails. (Previously many exceptions were ignored)
Resolves http://opensimulator.org/mantis/view.php?id=6949
2014-03-25 09:37:10 +01:00
Oren Hurvitz
f901a38204 Improved logging of HTTP requests
- MemoryBuffer isn't seekable, so we can't log it. Log the string instead.
- Handle compressed streams
- Don't attempt to dump binary data. Either don't log it at all (if we know it's binary), or at least convert non-ASCII characters to ASCII.
- Log responses to HTTP requests
- Use the same log prefix for all of these log messages ("[LOGHTTP]"), to make them easy to see at a glance
- Increased the snippet length to 200 (80 doesn't show enough), and add "..." only if the message was actually truncated

Resolves http://opensimulator.org/mantis/view.php?id=6949
2014-03-25 09:36:53 +01:00
Oren Hurvitz
4289b71141 Fixed unit tests due to changes in the threadpool 2014-03-25 10:04:52 +02:00
Oren Hurvitz
e131e73652 Run slow operations in a separate thread, instead of using FireAndForget (which has a 1-minute timeout)
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:55 +01:00
Oren Hurvitz
84d7227dfd Changed LogThreadPool to have 4 logging levels. Added console command "debug threadpool level" to set the logging level.
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:50 +01:00
Oren Hurvitz
b13214af27 Added a watchdog to abort slow threads in the main thread pool
If a task in the thread pool hangs then it will permanently take up
one of the threads. If this happens repeatedly then the thread pool will
become exhausted and OpenSim will fail. This watchdog terminates threads in the
thread pool that have been executing for over a minute (which probably
means they're hung).

Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:45 +01:00
Oren Hurvitz
e735f76553 LogThreadPool: when the thread is for ProcessPacketMethod, also log the packet type
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:41 +01:00
Oren Hurvitz
4031933475 Refactored DebugFlagsEnum
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:37 +01:00
Oren Hurvitz
8555e54e22 Automatically start logging FireAndForget activity if the threadpool is full
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:32 +01:00
Oren Hurvitz
7c0ebcb984 Added debug flag: LogThreadPool. It makes us log every use of the main threadpool.
Resolves http://opensimulator.org/mantis/view.php?id=6945
2014-03-25 08:01:13 +01:00
Justin Clark-Casey (justincc)
091f3a8000 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-25 00:20:38 +00:00
Justin Clark-Casey (justincc)
e12c044eab Don't fail to enable permissions modules correctly if there is any leading or trailing whitespace between comma separate module combinations. 2014-03-25 00:19:24 +00:00
Oren Hurvitz
8276a9e5f7 Fixed Debug command for Groups. (Use of wrong capitalization caused *two* "debug" options to appear in "help")
This is a (small) part of http://opensimulator.org/mantis/view.php?id=6949
2014-03-24 18:27:18 +01:00
Oren Hurvitz
6a477e044d If prim region crossing fails then don't delete the prim from the original region
Resolves http://opensimulator.org/mantis/view.php?id=6946
2014-03-24 18:24:50 +01:00
Oren Hurvitz
1769e93c42 Fixed parsing of coalesced objects if the XML starts with an XML Declaration ("<xml ...>")
Resolves http://opensimulator.org/mantis/view.php?id=6944
2014-03-24 18:18:29 +01:00
Oren Hurvitz
1a32b35279 In Load OAR, correctly restore group-owned objects
Resolves http://opensimulator.org/mantis/view.php?id=6943
2014-03-24 18:18:23 +01:00
Oren Hurvitz
305f5110c6 In Load OAR: Zero isn't a valid Group ID
Resolves http://opensimulator.org/mantis/view.php?id=6943
2014-03-24 18:18:08 +01:00
Oren Hurvitz
35078e03e5 During Load OAR, fix the User and Group ID's in objects that are embedded in assets (previously only rezzed objects were fixed)
Resolves http://opensimulator.org/mantis/view.php?id=6942
2014-03-24 18:17:59 +01:00
Oren Hurvitz
5fd9411143 Refactored Load IAR: created a generic mechanism to modify the SOG's as they are being loaded
Resolves http://opensimulator.org/mantis/view.php?id=6942
2014-03-24 18:17:35 +01:00
Oren Hurvitz
0ff61341e4 HGAssetService searches for the "HomeURI" setting in several sections: Startup, Hypergrid, HGAssetService
Resolves http://opensimulator.org/mantis/view.php?id=6940
2014-03-24 18:02:22 +01:00
Oren Hurvitz
8cec0b3fa1 If updating a user's profile notes fails then return an error
Resolves http://opensimulator.org/mantis/view.php?id=6938
2014-03-24 18:02:17 +01:00
Oren Hurvitz
1b30ae81b5 Fixed updating usersettings in the database
Resolves http://opensimulator.org/mantis/view.php?id=6938
2014-03-24 18:02:05 +01:00
Oren Hurvitz
b9e0d0fdb2 Don't show hidden groups in search results
Resolves http://opensimulator.org/mantis/view.php?id=6937
2014-03-24 18:01:56 +01:00
Oren Hurvitz
1d4551e52f Check settings for groups module
Resolves http://opensimulator.org/mantis/view.php?id=6937
2014-03-24 18:01:47 +01:00
Oren Hurvitz
c8583e566d When searching for users, don't add users from the local cache if they have an invalid UUID
Resolves http://opensimulator.org/mantis/view.php?id=6935
2014-03-24 18:01:37 +01:00
Oren Hurvitz
a2dd8f31de Trim search queries (for users, groups, etc.). I have found that sometimes the viewer adds a space at the end, which causes searches to fail.
Resolves http://opensimulator.org/mantis/view.php?id=6935
2014-03-24 18:01:28 +01:00
Oren Hurvitz
6edc446780 Fixed: OnRegionInfoChange was never triggered
Resolves http://opensimulator.org/mantis/view.php?id=6934
2014-03-24 18:01:22 +01:00
Oren Hurvitz
bf68dbabd7 Save to database these parcel updates: Force Owner, Abandon Request, Reclaim. (Previously these updates only changed the parcel in memory)
Resolves http://opensimulator.org/mantis/view.php?id=6934
2014-03-24 18:01:08 +01:00
Oren Hurvitz
89945f8829 Refactored: ExternalRepresentationUtils should be the only place where the "CreatorData" field is calculated, to ensure uniformity
Resolves http://opensimulator.org/mantis/view.php?id=6933
2014-03-24 18:00:59 +01:00
Oren Hurvitz
edc04d4184 When updating the CreatorId of an inventory item, automatically update the CreatorIdAsUuid field as well
Resolves http://opensimulator.org/mantis/view.php?id=6933
2014-03-24 18:00:39 +01:00
Oren Hurvitz
5b2af7f99e Moved the linkage between LoginService and HGInventoryService to the config file 2014-03-24 18:33:18 +02:00
Oren Hurvitz
df9845a283 When a user logs-in, automatically create the Suitcase folder
This is only done if the Suitcase Inventory Service is used.
Previously the Suitcase was created at a later time, which meant that it wasn't shown in the viewer until the viewer was restarted.
2014-03-24 17:02:13 +01:00
Oren Hurvitz
7496d0b0f7 Fixed unit tests for delinking objects 2014-03-24 15:05:39 +02:00
Oren Hurvitz
4bccfed80c When logging in UserAgentServiceConnector, always log the original server URL (the hostname), not the IP
This resolves http://opensimulator.org/mantis/view.php?id=6955 (that patch was modified a bit)
2014-03-24 14:20:19 +02:00
Oren Hurvitz
eaf99bf928 Changed to Unix line-endings in VS2010Target.cs
Resolves http://opensimulator.org/mantis/view.php?id=6951
2014-03-24 12:27:07 +01:00
Oren Hurvitz
f5ae36d7e2 Updated Prebuild to support .NET 4.5
Resolves http://opensimulator.org/mantis/view.php?id=6951
2014-03-24 12:26:54 +01:00
Oren Hurvitz
425d76bb98 Enable runprebuild.bat to run in Cygwin
This resolves http://opensimulator.org/mantis/view.php?id=6951
2014-03-24 12:26:53 +01:00
Oren Hurvitz
921f0052f4 Get the full viewer name even if it's (incorrectly) sent in the 'Channel' field
Recent versions of Firestorm and Singularity have started sending the viewer name in the 'Channel' field, leaving only their version number in the 'Viewer' field. So we need to search both of these fields for the viewer name.

This resolves http://opensimulator.org/mantis/view.php?id=6952
2014-03-24 12:26:52 +01:00
Oren Hurvitz
6734b94761 Better error messages
This resolves http://opensimulator.org/mantis/view.php?id=6936
2014-03-24 12:22:32 +01:00
Oren Hurvitz
773ffcafc3 Removed "hacktastic" code that is no longer needed.
We no longer set the object's AbsolutePosition in this place, so the IsAttachment hack doesn't do anything anymore.

This resolves http://opensimulator.org/mantis/view.php?id=6936
2014-03-24 12:05:25 +01:00
Oren Hurvitz
62b3bdf0fc When linking two groups, and then deleting the combined group: delete *all* of the combined group's prims, including those that came from the second subgroup
This fixes http://opensimulator.org/mantis/view.php?id=6175
2014-03-24 11:44:48 +01:00
Robert Adams
b0cb0ec02f BulletSim: fix problem where axis constraints were also constraining
linear motion.

The code was limiting linear motion to be only in the positive direction
for any axis that was constrained.
2014-03-23 13:08:31 -07:00
Oren Hurvitz
81c9952e99 Added missing quotes in Robust.HG.ini.example 2014-03-23 16:40:09 +02:00
Dev Random
db83208794 Fix negative stat for Active Scripts
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-03-22 23:02:10 -04:00
Kevin Cozens
ff5c38534d Reverting "Set default name for mute list" that was pushed by mistake.
This reverts commit 58def34dbe.
2014-03-22 16:38:48 -04:00
Kevin Cozens
58d7e3b8ed Reverting "Pass method to offline.php" commit that was pushed by mistake.
This reverts commit fe16a72a9a.
2014-03-22 16:31:36 -04:00
Kevin Cozens
949139eb0b Moved Kevin Cozens to the core developers list. 2014-03-22 15:57:32 -04:00
Kevin Cozens
fe16a72a9a Pass method to offline.php using ?blah instead of /blah/. Avoids issue with Apache web servers running PHP via CGI. 2014-03-22 15:13:03 -04:00
Kevin Cozens
58def34dbe Set default name for mute list module as shown in OpenSim.ini.example 2014-03-22 15:13:03 -04:00
Vegaslon
d4dad75a3c BulletSim: Fix jumping while running. Was unintentional taking way all upward target motion for avatar when running.
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-03-22 15:00:48 -04:00
Melanie
ebe7726cd7 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2014-03-22 01:49:28 +00:00
Melanie
a4d322dcd1 Allow the setting from the environment to take effect if no explicit setting is given.
This is done by calling the constructor only with a directory if one is actually given.
2014-03-22 01:47:48 +00:00
Justin Clark-Casey (justincc)
ccf18fd2ef Rename SOG.InSceneBackup to CanBeBackedUp to reflect its actual functionality.
It does not indicate that a SOG has been set to be backed up or not.  It indicates that a SOG can be backed up in principle.
In practice, this was added by lbsa71 in 2007 and is set to always true, albeit as a virtual property.
2014-03-22 01:36:21 +00:00
Dev Random
3d0778bcd6 Allow Mono Plugin Registry setting for Regions
Signed-off-by: Melanie <melanie@t-data.com>
2014-03-22 01:29:51 +00:00
Justin Clark-Casey (justincc)
a5800f479e If an object has it's temporary flag unset after being set, put it back in the persistence list.
Effectively uses the patch in http://opensimulator.org/mantis/view.php?id=7060
But also adds a regression test and exposes the necessary property to allow this to work.
2014-03-22 00:29:13 +00:00
Justin Clark-Casey (justincc)
178a5a5585 rename prefix of scene-inventory.<scene-name>.ProcessedFetchInventoryRequests and QueuedFetchInventoryRequests to inventory.httpfetch.*
Actual inventory processing is done with a single set of static structures rather than per scene.
2014-03-21 23:29:31 +00:00
Justin Clark-Casey (justincc)
6664079f84 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-21 23:18:13 +00:00
Talun
fb312279c9 Mantis 6922: No particles are generated if their size exceeds the maximum allowed size.
This patch ensures that no particle scal value can exceed 4.0
2014-03-21 23:13:34 +00:00
Oren Hurvitz
f8caf41bd8 Moved Oren Hurvitz to core developers list 2014-03-21 17:33:19 +02:00
Justin Clark-Casey (justincc)
47e7febebc Add monitored thread last update times as stats in "show stats all"
These have the format server.thread.<thread-name>
2014-03-21 02:06:10 +00:00
Justin Clark-Casey (justincc)
33ae733006 Add H-H-H to contributors 2014-03-20 22:43:00 +00:00
H-H-H
da25903300 Adding a way to disable/enable the in built Dwell Module 2014-03-20 22:35:50 +00:00
Justin Clark-Casey (justincc)
7f027552ec If we find an existing suitcase folder in HGSuitcaseInventoryService.GetRootFolder(), then return that as a response rather than null.
Fixes a regression from commit 346644016c (Fri Nov 15 23:10:59 2013)
This is actually the reverse of zadark's patch in http://opensimulator.org/mantis/view.php?id=6969
But I'm assuming that was a mistake since clearly we should be returning this data - this was original behaviour
2014-03-20 20:36:47 +00:00
Justin Clark-Casey (justincc)
d04bb3ca9b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-20 20:15:57 +00:00
Talun
bd6f734d3a Mantis 6974 PERMISSION_TRACK_CAMERA should be implicit on attach.
http://wiki.secondlife.com/wiki/Run_time_permissions
This change makes PERMISSION_TRACK_CAMERA implicit on attach
2014-03-20 20:11:26 +00:00
Michael Cerquoni
b5f94c72b9 Allow MaptileStaticFile path to be set to anywhere and not force it to bin/maptiles 2014-03-19 11:16:52 -04:00
Robert Adams
220ea9f687 Add Jak Daniels to CONTRIBUTORS.TXT 2014-03-18 22:20:00 -07:00
Jak Daniels
61353dde80 Allow Region specific static maptiles to be loaded from file. 2014-03-18 22:18:50 -07:00
Justin Clark-Casey (justincc)
cf97535d9e Revert "Simplify DoubleQueue to eliminate redundant sempahore work."
This reverts commit 52b7b40034.

Got the semantics wrong - the sempahore is required so that the blocking thread waits for a signal.
2014-03-19 01:40:56 +00:00
Justin Clark-Casey (justincc)
52b7b40034 Simplify DoubleQueue to eliminate redundant sempahore work.
Exclusion is already guaranteed by the lock on m_syncRoot.
Semaphore could not allow more than one thread in these sections anyway since the underlying SDK structures are not thread-safe.
2014-03-19 00:48:13 +00:00
Justin Clark-Casey (justincc)
1497b75361 minor: Put ProcessedFetchInventoryRequests and QueuedFetchInventoryRequests in stats category "scene-inventory" instead of "scene"
To distinguish from general scene stats
2014-03-19 00:37:06 +00:00
Justin Clark-Casey (justincc)
9858766516 minor: Make "stats show" an alias for "show stats" command. 2014-03-19 00:35:49 +00:00
Justin Clark-Casey (justincc)
e6080a38c5 Rename "debug stats record" command to "stats record" for consistency. Move from debug to general command category 2014-03-19 00:29:36 +00:00
Justin Clark-Casey (justincc)
1d0a9e521c Allow a snapshot of stats to be dumped to a file with a "stats save" command 2014-03-19 00:28:57 +00:00
Justin Clark-Casey (justincc)
fad1d70180 Add httpserver.<port>.QueuedPollResponses and httpserver.<port>.ProcessedPollResponses statistics 2014-03-18 23:47:33 +00:00
Justin Clark-Casey (justincc)
9e0d419239 minor: Correction to description of QueuedPollResponses since this covers long poll and other 'poll' types 2014-03-18 23:24:22 +00:00
Justin Clark-Casey (justincc)
eed343ed8a Add httpserver.<port-number>,QueuedPollResponses stat
This shows the number pf poll responses queued for processing.
2014-03-18 23:21:07 +00:00
Justin Clark-Casey (justincc)
7df325c275 Extend locking in BlockingQueue to cover operations that are not guaranteed to be thread-safe 2014-03-18 23:05:49 +00:00
Justin Clark-Casey (justincc)
fdcd392582 Set executable bit on Npgsql.dll for cygwin 2014-03-18 21:04:37 +00:00
Justin Clark-Casey (justincc)
f27766d47b Set executable flag on BulletXNA.dll for cygwin 2014-03-18 21:02:51 +00:00
Justin Clark-Casey (justincc)
a660c0a750 Add scene.<scene-name>.ProcessedFetchInventoryRequests
This shows the number of requests that have been processed.
These have not necessarily been sent back to the request since this is done separately by the PollServiceRequestManager
2014-03-18 20:59:11 +00:00
Justin Clark-Casey (justincc)
8ce3fa646b Allow "show stats" console command to take a full stat name and display only that stat.
For example, scene.test.RootAgents will show only the RootAgents stat in the scene named "test"
2014-03-18 20:21:47 +00:00
Justin Clark-Casey (justincc)
e82d394ddf Add scene.<scene-name>.QueuedFetchInventoryRequests stat
This is to aid in detecting whether there are fetch inventory requests remaining to be processed.
2014-03-18 20:10:41 +00:00
Justin Clark-Casey (justincc)
d5f5649750 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-18 20:09:15 +00:00
Justin Clark-Casey (justincc)
c605c7a7b7 Lock m_syncRoot on DoubleQueue.Count. This is not documented as a thread-safe operation 2014-03-18 19:54:07 +00:00
Melanie Thielker
a53272c5fb Add delete maptile ability to MapImageService - yet untested 2014-03-18 00:50:00 +00:00
Justin Clark-Casey (justincc)
ae56b946cf Fix a bug in previous commit 01520bb where I accidentally saved OtherCleanTime instead of Dwell 2014-03-18 00:34:40 +00:00
Justin Clark-Casey (justincc)
01520bbb3e Save and load dwell parcel stat in MySQL DB adaptor. Field in table already exists!
The SQLite database adaptor was loading and saving dwell whilst MySQL was not, even though the field already exists in the db table.
2014-03-18 00:02:55 +00:00
Justin Clark-Casey (justincc)
f3e177814a Add regression test for http inventory fetch.
Involved some restructuring to allow regression tests to dequeue inventory requests and perform poll responses synchronously rather than async
2014-03-17 20:51:35 +00:00
Justin Clark-Casey (justincc)
873eee5431 Implement osForceBreakAllLinks().
Identical to llBreakAllLinks() except that it doesn't require the script to have link permissions.
2014-03-13 00:04:20 +00:00
Justin Clark-Casey (justincc)
6a279feb2f Only allow llBreakAllLinks() to work if script has received PERMISSION_CHANGE_LINKS
As per http://wiki.secondlife.com/wiki/LlBreakAllLinks
Same as existing llCreateLink() and llBreakLink()
2014-03-12 23:54:20 +00:00
Justin Clark-Casey (justincc)
296d63e20b Implement osForceCreateLink() and osForceBreakLink()
These are identical to llCreateLink() and llBreakLink() except that they don't require script permissions.
However, osForceCreateLink() still requires that linked and linkee still have the same owner.
There's also an AutomaticLinkPermission setting in [XEngine] that could be set to true to prevent the LSL function checks.
But this doesn't allow the finer control over which users/scripts, etc. can do this that the OSSL functions provide.
2014-03-12 23:05:16 +00:00
Justin Clark-Casey (justincc)
beba20846f When sending group notices through group messaging, allow the agent ID to use for fetching group data to be different from im.fromAgentID
This is because xmlrpcgroups currently always checks visibility for the requesting agent ID (unlike Groups v2, which can accept UUID.Zero)
But group notice IMs have a from agent which is the group rather than the sending agent.
Further addresses http://opensimulator.org/mantis/view.php?id=7037
2014-03-12 19:31:04 +00:00
Dev Random
7112ee0015 Enable MapImageServiceModule with no refresh 2014-03-11 23:52:11 +00:00
Justin Clark-Casey (justincc)
86630a1b70 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-11 23:39:07 +00:00
Justin Clark-Casey (justincc)
d975b42f6a Instead of auto-creating a parcel on request if one doesn't cover a given location, fill in gaps or extend existing parcel right after initial data load.
This is in line with simpler and still existing behaviour where a default parcel is created if no parcels are in storage at all.
Making this change as another step to address current problems with spurious parcels occasionally being created.
Also adds regression tests for different load behaviours depending on existing stored parcel data.
Relates to http://opensimulator.org/mantis/view.php?id=7035
2014-03-11 23:38:22 +00:00
Robert Adams
8edf4225f3 varregion: remove serialization of region terrain to floats when sending patches.
This should eliminate much memory thrashing and CPU usage while sending initial
terrain.

The old way of passing terrain was to convert it to an array of floats. This is
really bad for large terrain (think 4096x4096 floats). This change passes a dummy
float array since the real region info is used anyway and the floats are ignored.
(The ignoring the terrain floats is a kludge so as to not change IClientAPI.)
2014-03-11 07:12:47 -07:00
Robert Adams
6b17c9bd98 Add Lani Global to CONTRIBUTORS.txt 2014-03-10 22:12:56 -07:00
Lani Global
71c808cd32 PhysicalPrimMax 64m for OpenSim_ini_example standard size prim
Signed-off-by: Robert Adams <misterblue@misterblue.com>
2014-03-10 22:11:24 -07:00
Lani Global
3e8f593bf2 PhysicalPrimMax to 64m for ini Default files to enable standard size prims and mesh to be used with vehicles.
Signed-off-by: Robert Adams <misterblue@misterblue.com>
2014-03-10 22:11:09 -07:00
Robert Adams
742f505440 Change terrain update sending to be triggered by frame tick rather
than everytime terrain is changed.

The TerrainModule now hooks the frame event and, if terrain has changed,
sends terrain updates to the clients. This polling pattern replaces
the previous push on change pattern and will make it easier to do per
client throttling and per scene presence terrain update ordering.
2014-03-10 22:05:18 -07:00
Oren Hurvitz
0237d9113d Don't start KeyframeMotion timers until all the regions are ready. This prevents problems in megaregions (prims that think they've crossed over to other regions). 2014-03-11 00:55:58 +00:00
Oren Hurvitz
120f872d2b After an object with KeyframeMotion is copied into inventory, resume the motion (previously it remained stopped) 2014-03-11 00:43:22 +00:00
Justin Clark-Casey (justincc)
932c9e757b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-03-11 00:16:31 +00:00
Justin Clark-Casey (justincc)
77e7bbcbf7 Send group notices through the same messaging module mechanism used to send group chat to avoid timeout issues when sending messages to large groups.
Only implementing for XmlRpcGroups initially to test.
May require MessageOnlineUsersOnly = true in [Groups] to be effective.
In relation to http://opensimulator.org/mantis/view.php?id=7037
2014-03-11 00:11:18 +00:00
Michael Cerquoni
4f67286044 fix missing quote for xBakes connector in Robust example ini files 2014-03-09 19:09:10 -04:00
Michael Cerquoni
cfd3e8f0ea minor spelling mistake fix. 2014-03-09 11:46:25 -04:00
Michael Cerquoni
abcb2cdb36 add XBakes connector to Robust.HG.ini.example 2014-03-08 21:50:41 -05:00
Michael Cerquoni
a96601478c add [BakedTextureService] section to Robust.HG.ini.example file same as Robust.ini.example. 2014-03-08 21:48:33 -05:00
Michael Cerquoni
e3c4936dea remove RefreshTime = 0 from [MapImageService] in Standalone.ini, StandaloneHypergrid.ini, Grid.ini, GridHypergrid.ini they were redundant and would not allow variables in OpenSim.ini to be set to anything. 2014-03-08 16:28:45 -05:00
Michael Cerquoni
da990d01f2 set RefreshTime = 0 in [MapImageService] in Standalone.ini and StandaloneHypergrid.ini to eliminate memory leaking for Warp3D map tiler, these variables should be erased needs more discussion! 2014-03-08 15:57:19 -05:00
Michael Cerquoni
12f2648a57 set RefreshTime = 0 in [MapImageService] in Grid.ini and GridHypergrid.ini to eliminate memory leaking for Warp3D map tiler, these variables should be erased needs more discussion! 2014-03-08 15:41:26 -05:00
Dev Random
9de3fe9410 Add Varregion support to osGetRegionSize OSSL function
Signed-off-by: Michael Cerquoni <nebadon2025@gmail.com>
2014-03-07 17:48:07 -05:00
Justin Clark-Casey (justincc)
8225e3f40c Remove try/catch in LandManagmentModule.GetLandObject() - this is very old code and the caught exceptions can no longer occur. 2014-03-07 01:41:31 +00:00
Justin Clark-Casey (justincc)
3c05d67094 Lock m_landlist whilst loading parcels from storage to prevent a race against any parcel auto-creation in GetLandObject() 2014-03-07 01:36:06 +00:00
Justin Clark-Casey (justincc)
6b7625a56b Only auto-create a land parcel when there is none in a specified tile if there is more than 1 existing land parcel.
This is because there are still issues with bad parcels being generated in http://opensimulator.org/mantis/view.php?id=7035
Theorizing now that it's possible that something is calling GetParcel() before any parcel data has been loaded from persistence.
2014-03-07 01:23:19 +00:00
Justin Clark-Casey (justincc)
71918eeab4 Add regression test for sending group notices via xmlrpc groups connector. 2014-03-07 01:04:54 +00:00
Justin Clark-Casey (justincc)
ddd38a3dea Add scene name to bad parcel add logging 2014-03-06 19:12:16 +00:00
Justin Clark-Casey (justincc)
58c0ed78d4 refactor: Simplify land object by using c# get/set auto-properties where applicable. 2014-03-06 02:12:58 +00:00
Justin Clark-Casey (justincc)
470d053443 minor: slightly simplify code in LandObject.ContainsPoint() 2014-03-06 00:51:39 +00:00
Justin Clark-Casey (justincc)
ed14e97bb4 Remove array initialize calls in LMM - these are unnecessary as the VM already does this. 2014-03-06 00:46:16 +00:00
Justin Clark-Casey (justincc)
aa2fb1ec25 minor: Increase size of parcel name field in "land show" console command output. Construct table using CDT rather than string formats 2014-03-06 00:40:24 +00:00
Justin Clark-Casey (justincc)
14569992e1 Prevent adding a land object if it overlaps any existing objects that have not had their bitmaps adjusted.
This is to prevent an immediate problem in http://opensimulator.org/mantis/view.php?id=7035 where a development code bug occasionally overlays all the existing parcels with a blank parcel owned by the estate manager and to gather more data.
My guess is that this parcel is being created by the new code in LandManagementModule.GetLandObject(), probably some race between threads since this only happens occasionally.
Adds regression tests for this case and for parcel subdivide.
2014-03-06 00:11:13 +00:00
Justin Clark-Casey (justincc)
4e6f7435d0 Add UUID and ready status (whether region has finished starting up) to "show regions" console output. 2014-03-05 01:23:48 +00:00
Justin Clark-Casey (justincc)
39ed382ddf Don't request a terse update after local teleport - this will be done by the main frame loop anyway and has the potential to race that thread. 2014-03-05 00:59:27 +00:00
Justin Clark-Casey (justincc)
c9415fd763 If an avatar is sitting, send out position updates to clients for any change, not just those outside the usual tolerances.
This is to allow small adjustments of less than 0.05m in functions such as llSetPrimitiveLinkParams() to work
This is another fix for http://opensimulator.org/mantis/view.php?id=7044
Extends regression test for this case.
2014-03-05 00:38:38 +00:00
Justin Clark-Casey (justincc)
31de7b845f When positioning agent with PRIM_ROTATION in llSetLinkPrimitiveParams(), set the global rotation rather than the local rotation
Functionally the same as the patch in http://opensimulator.org/mantis/view.php?id=7044, thanks Aleric.
This commit also extends the regression test
2014-03-03 23:35:21 +00:00
Justin Clark-Casey (justincc)
5038a59ef3 Maybe slightly reduce warp3d memory leakage by disposing of decoded bitmap in Warp3DImageModule.GetTexture()
However, this still appears to be leaking massively, at least for me.  Possible cause is warp3D using GDI objects internally and not disposing of them.
2014-02-28 00:16:06 +00:00
Justin Clark-Casey (justincc)
88b1fc1382 Set up a StreamReader and call ReadToEnd() instead of using the GetStreamString() extension method
This eliminates some stream seeking that was never necessary and makes disposable of the StreamReader consistent with other code
2014-02-27 23:13:26 +00:00
Justin Clark-Casey (justincc)
94ad69faf2 Remove long unused UntrustedWebRequest class
This purports to check web requests but doesn't appear to actually do that.
2014-02-27 22:58:44 +00:00
Justin Clark-Casey (justincc)
5fafea6631 refactor: More consistently use using construct within WebUtil to match other existing code there. 2014-02-27 22:52:43 +00:00
Justin Clark-Casey (justincc)
1f4f09ad69 Add more details to InvalidOperationException logging in SychronousRestFormsRequest.MakeRequest(). 2014-02-27 20:35:56 +00:00
Justin Clark-Casey (justincc)
91333b9267 Stop LSL_Api.GetLinkEntities() from creating an unused list on every parameter except LINK_THIS. Simplify code. 2014-02-27 00:23:24 +00:00
Justin Clark-Casey (justincc)
ed760f2586 minor: remove unused variable from recent commit 0e23374 2014-02-27 00:14:16 +00:00
Justin Clark-Casey (justincc)
d7c9725ec0 refactor: Make osGetPrimtiveParams() and soSetPrimitiveParams() use common get/set params code in LSL_Api rather than an old copy&pasted section. 2014-02-27 00:11:50 +00:00
Dev Random
6955190c7d Add Util method to load OpSys env vars 2014-02-26 23:39:45 +00:00
Justin Clark-Casey (justincc)
ce5d308d23 Add some regression tests for previous commit 0e23374 2014-02-26 23:13:56 +00:00
Justin Clark-Casey (justincc)
0e23374aa2 Implement PRIM_ROTATION, PRIM_ROT_LOCAL, PRIM_POSITION and PRIM_POS_LOCAL when manipulating avatars via llSetLinkPrimitiveParams()
Combination of core parts of Freaky's patch at https://github.com/ft-/opensim-patches/blob/master/opensim-llsetlinkprimitive-agent-fix.patch plus further adjustments from myself.
Resolves Mantises 6121, 6421, 6573, 6657
2014-02-26 23:07:13 +00:00
Justin Clark-Casey (justincc)
26fe59c35e Improve regression test TestSetAppearance() 2014-02-24 19:43:06 +00:00
Justin Clark-Casey (justincc)
bc9952f901 Re-enable regression TestSaveBakedTextures() 2014-02-24 19:30:33 +00:00
Justin Clark-Casey (justincc)
fd1b2a1c57 Stop mesh avatars that specify the alpha texture in their bake slots from causing the simulator to continually request that they rebake
This is because the alpha texture is not in the cache, we must continue to have the fallback of looking for these and other persisted bakes in the asset service.
Relates to http://opensimulator.org/mantis/view.php?id=6927
2014-02-24 19:20:50 +00:00
Robert Adams
0f03c64a0c Make Scene.DefaultDrawDistance to be the max of the region size and the
user setting. Seems this parameter has many side effects.
2014-02-23 21:56:37 -08:00
dahlia
d6837f5dc7 update libomv to 59280cfe3e96714151158f4ec7b167af57f60e93 (current head) to hopefully resolve zlib incompatibilities when rendering maptiles with mesh 2014-02-22 18:52:59 -08:00
Robert Adams
0b213af675 Fix problem of hurricane speed winds. Thanks Vegaslon. 2014-02-22 15:04:28 -08:00
Diva Canto
cddf1ec0dc Added 2 new behaviors to pCampBot 2014-02-21 10:06:08 -08:00
Diva Canto
97c74afca8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-02-21 10:05:06 -08:00
Diva Canto
d27e188fe2 Added 2 new behavirors to pCampBot. These are part of a systematic study I'm doing for understanding the load that AgentUpdate packets incur on the server. 2014-02-21 10:04:12 -08:00
Justin Clark-Casey (justincc)
11b4f534c2 If texture decode fails in Warp3D map maker, log uuid of asset that failed to decode along with exception 2014-02-20 23:36:50 +00:00
Justin Clark-Casey (justincc)
d50d169441 If GetFolderContent called by WebFetchInvDescHandler.Fetch() fails for some reason and returns null, log and return empty contents rather than throwing an exception that ends up terminating the simulator. 2014-02-20 22:35:41 +00:00
Justin Clark-Casey (justincc)
28419251bf minor: Add some method doc to AFM,SetAppearanceAssets() 2014-02-20 19:30:47 +00:00
Justin Clark-Casey (justincc)
d1bb73d068 In core.groups GroupsServiceRemoveConnector, if GetGroupRecord() or UpdateGroup() do not have a RESULT parameter in the result message, return null rather than fail with NullReferenceException
This check was already done by other methods.
Looks to resolve http://opensimulator.org/mantis/view.php?id=7012
2014-02-20 19:17:21 +00:00
Justin Clark-Casey (justincc)
4d1426e77d For now, do not replacing missing wearables with default wearables if itme details cannot be found.
This is causing many issues on OSGrid, possibly due to teleporting timing differences with simulators hosted in different places or HG teleports
Added a bit more logging for debug purposes.
See http://opensimulator.org/mantis/view.php?id=6939
2014-02-20 18:40:21 +00:00
dahlia
a2866b85f3 add newRegion parameter to CrossAgentToNewRegion event and trigger the event after crossing thread is invoked 2014-02-20 00:18:28 -08:00
dahlia
269a6410a0 add EventManager event OnCrossAgentToNewRegion 2014-02-19 17:52:38 -08:00
Robert Adams
c26f01ff8c varregion: make scene default draw distance to be the maximum size of the
region. This is a temp fix for the use of draw distance to compute child
regions. Eventually must use the draw distance from the viewer for the
computation.
2014-02-19 09:51:49 -08:00
Robert Adams
fc9930e420 Repair check for if in region position (I mean || is kinda like &&). 2014-02-15 18:49:40 -08:00
Robert Adams
79200ed270 Fix displacement and location operations on legacy trees and grass in
the 'load oar' and 'scene' commands. Before they  were ignored but the
code now relies on the SOG.IsAttachment function for attachmentness.
2014-02-15 17:10:20 -08:00
Robert Adams
7fc289c039 Properly restore position on crossing failure for mega-regions.
Fix odd "cannot cross into banned parcel" viewer error message when crossing
into non-existant region. Proper permission failure messages are now returned.
2014-02-15 17:02:53 -08:00
Robert Adams
877bdcdce1 Rewrite of mega-region code to use new form of border checking.
This commit eliminates all of the 'border' class and list code and replaces
it with testing if in the current region.
Impacts: can make a mega-region out of varregions of the same size; and
mega-region combinations must be rectangular (not square but rectangular)
2014-02-15 16:01:43 -08:00
Robert Adams
bdbbeaa494 Non-functional changes of numbers into symbolic references and a few
comments on what variables really mean.
2014-02-15 16:01:01 -08:00
Justin Clark-Casey (justincc)
f6913e911e Merge branch 'justincc-master' 2014-02-15 01:18:10 +00:00
Justin Clark-Casey (justincc)
f74aafaf63 In GridUserService, if a UUID is given consistently use the longest matched entry (as already done by GetGridUserInfo()) in order to avoid problems with multiple entries.
This is to avoid issues where LoggedIn, SetHome, etc were always using the exact UUID match but GetGridUserInfo() would use the longest.
Looks to address http://opensimulator.org/mantis/view.php?id=6986
2014-02-15 01:13:58 +00:00
Justin Clark-Casey (justincc)
4fed301e65 Don't request group information in SP.MakeRootAgent() if the presence belongs to no group (UUID.Zero)
This was trigger the XmlRpcGroups errors described in http://opensimulator.org/mantis/view.php?id=6986
Introduced in commit 5b73b9c4 (Wed Dec 11 01:39:56 2013)
2014-02-14 23:43:07 +00:00
Justin Clark-Casey (justincc)
733e067958 Log information about which function, request data and agent ID triggered an XmlRpcGroupsServiceConnector error 2014-02-14 21:28:45 +00:00
Justin Clark-Casey (justincc)
ffd0da23fb Merge branch 'justincc-master' 2014-02-14 00:16:17 +00:00
Justin Clark-Casey (justincc)
f49d513089 Change warns associated with UserAgentServiceConnector to debugs, as this is not necessarily a problen with the source simulator (e.g. someone else's remote simulator cannot be contacted).
This is Oren Hurvitz's second patch from http://opensimulator.org/mantis/view.php?id=6956 with a small amount of correction
2014-02-14 00:08:13 +00:00
Justin Clark-Casey (justincc)
fc35b45e21 If calls to UserAgentServiceConnector fail then throw an exception. This lets the caller decide whether to discard the error or not.
This is Oren Hurvitz's 0001 patch from http://opensimulator.org/mantis/view.php?id=6956 but I ended up doing some tweaking to resolve patch application issues.
2014-02-14 00:01:12 +00:00
Justin Clark-Casey (justincc)
bc7fda39b4 Merge branch 'justincc-master' 2014-02-12 23:23:56 +00:00
Justin Clark-Casey (justincc)
e10012a7a6 If a caller tries to queue a CAPs message to a scene presence that has no event queue (e.g. an NPC), only warn if event queue debugging is greater than zero.
Removes the spurious log warnings if groups are active when NPCs are used.
Adds more regression tests associated with adding messages to the event queue
2014-02-12 23:18:10 +00:00
Robert Adams
3a7c8d1f32 BulletSim: the minimum vehicle velocity was set too low so moving slow
was getting zeroed too easily. Added VehicleMinVelocity parameter.
2014-02-11 21:07:55 -08:00
Robert Adams
c0cc5e0fa4 varregion: Send large region patches for wind and clouds. 2014-02-11 21:07:55 -08:00
Mic Bowman
b83a224147 Add JsonRezAtRoot script function. Operation is very similar to
llRezAtRoot except that the start parameter is a Json string that will
be unpacked into a json store identified by the objects uuid.  This
makes a much more expressive (and simpler) way of passing initial
parameters to a rezzed object.
2014-02-09 18:07:49 -08:00
Robert Adams
4a1c1fc009 Add zadark to CONTRIBUTORS.txt 2014-02-06 11:47:19 -08:00
Roger Kirkman
cf61cdf58c Fix - Viewer crash during HG Teleport
Signed-off-by: Robert Adams <misterblue@misterblue.com>
2014-02-06 11:33:17 -08:00
Mic Bowman
1913ab5ad5 Update the SimianMaptile uploader to accommodate varregions. 2014-02-05 21:26:39 -08:00
Melanie
29c8461631 Remove the added whitespace, test concluded 2014-02-04 05:54:28 +00:00
Melanie
8f372b8ac8 Bot test 2014-02-04 05:52:22 +00:00
Robert Adams
342be228c6 Remove compile error from returning value in void function 2014-02-03 21:53:14 -08:00
Michael Cerquoni
87abf06956 test again undoing previous changes 2014-02-04 00:32:40 -05:00
Michael Cerquoni
f81841a2c5 this is just a test 2014-02-04 00:30:35 -05:00
Robert Adams
1b41ec0a85 Fix raw32 terrain heightmap reader so it estimates terrain size from
the size of the input stream. This is required since the raw heightmap
format (.r32) does not contain any size information.
The estimation relies on terrain being square.
2014-02-03 21:23:32 -08:00
Melanie
31cba5aa66 Add one check for a blank URL because the module wasn't quite sure not to work when unconfigured :| 2014-02-04 04:20:37 +00:00
Melanie
1aed6567a8 Samle configurations for the baked texture server. 2014-02-04 02:49:13 +00:00
Melanie
f0f852b27f Final code drop for appearance. Adding Avination's baked texture storage server. 2014-02-04 02:29:02 +00:00
Melanie
1197658233 Adding the Avination XBakesModule, the client for the persistent bakes system 2014-02-04 02:09:39 +00:00
Melanie
e1d1c27965 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2014-02-04 01:55:41 +00:00
Melanie
49c2213a01 Dropping the rest of Avination's modified appearance code for core.
Module to follow.
2014-02-04 01:54:16 +00:00
Robert Adams
41b6602a77 Add "--no-objects" parameter to 'load oar'. 2014-02-02 22:16:01 -08:00
Robert Adams
8c6a0cb44a Really add the old parameter names to load oar to keep downward compatibiliy 2014-02-02 17:18:08 -08:00
Robert Adams
2a4dd34616 Change new 'load oar' parameters to be hyphenated to be consistant with
existing parameters. ('--forceterrain' becomes '--force-terrain').
The old forms have been kept for downward compatiblity.
2014-02-02 12:21:18 -08:00
Robert Adams
9c97fb8e12 Implement terrain merging in TerrainChannel.
Modify archiver to use terrain merging when loading oars.
This makes displacement AND rotation properly work on terrain when loading oars.
Especially useful when loading legacy region oars into large varregions.
2014-02-02 11:17:49 -08:00
dahlia
a8e64cd59a Overload INPCModule.CreateNPC() to allow agentID to be specified. Note: this is intended for use in region modules and is not exposed to scripts. 2014-02-01 04:09:20 -08:00
Oren Hurvitz
abb193ec94 In UuidGatherer, gather materials referenced in the prim's TextureEntry
Signed-off-by: dahlia <dahlia@nomail>
2014-02-01 02:56:15 -08:00
Justin Clark-Casey (justincc)
b2878eb773 Merge branch 'justincc-master' 2014-01-31 00:51:22 +00:00
Oren Hurvitz
b8e22f02e7 Make sure Web streams are disposed after use 2014-01-31 00:44:22 +00:00
David Rowe
1380b37d71 Made error messages more consistent 2014-01-31 00:24:52 +00:00
David Rowe
3d62f4369d Replaced throwing exceptions with calls to Error() 2014-01-31 00:24:47 +00:00
David Rowe
d405254971 Replaced llSay()ing LSL errors with calls Error() 2014-01-31 00:24:43 +00:00
David Rowe
9db4090c07 Replaced LSLError() calls with calls to Error() 2014-01-31 00:24:40 +00:00
David Rowe
c9550e473d Updated "deprecated" LSL errors to use Deprecrated() 2014-01-31 00:24:36 +00:00
David Rowe
257f9cec40 Updated "not implemented" LSL errors to use NotImplemented() 2014-01-31 00:24:31 +00:00
David Rowe
13bb9ea682 Updated ShoutError() calls to use new LSL error methods 2014-01-31 00:21:22 +00:00
David Rowe
67ec95bde8 Updated methods for handling LSL script errors, deprecated, and not implemented 2014-01-31 00:20:10 +00:00
Justin Clark-Casey (justincc)
c467dfcd81 Merge branch 'justincc-master' 2014-01-30 00:42:20 +00:00
Justin Clark-Casey (justincc)
b73baeb4a4 Record whether login to home fails because no home set (UUID.Zero) or region not found. 2014-01-30 00:40:56 +00:00
Justin Clark-Casey (justincc)
b50e5704b8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-01-30 00:06:09 +00:00
Justin Clark-Casey (justincc)
7807b19a89 Merge branch 'justincc-master' 2014-01-30 00:05:12 +00:00
Justin Clark-Casey (justincc)
bdab05df0e Add "show grid user" robust/standalone console command for debug purposes.
Shows all data on entries which match or start with a given ID.
This would usually be a UUID.
2014-01-30 00:03:22 +00:00
Robert Adams
0842e2e15b BulletSim: default physical terrain implementation to heightmap.
It originally looked like mesh terrain would perform better for vehicles
but, after much use, heightmap is the clear winner.
Force terrain implementation to heightmap if the physics region is
larger than legacy region size. This solves running out of memory for
very large regions.
2014-01-29 06:44:14 -08:00
Mic Bowman
fbf33ef1de Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-01-28 22:42:35 -08:00
Mic Bowman
3f5c6c897f One more run at fixing the sun module. Parameter setting fixed to
work through the OSSL interface. And setting the parameters now
adjusts all the dependent variables correctly so the sun moves
at the modified rate.
2014-01-28 22:40:39 -08:00
Robert Adams
1900254e77 Restore brush tests with correct values and adjustments for new terrain height
rounding characteristics.
2014-01-28 21:43:18 -08:00
Robert Adams
678c107915 Temporarily disable brush test. It will come back when tuning is complete. 2014-01-28 16:58:27 -08:00
Robert Adams
dde0e547a7 Change area of brush test to account for rounding errors in terrain implementation 2014-01-28 16:48:34 -08:00
Robert Adams
226b5e4d75 Increase the strength of brushes in brush test in an attempt to overcome rounding
introduced with new terrain height class.
2014-01-28 16:36:56 -08:00
Mic Bowman
cfe1bced7d Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-01-28 16:34:49 -08:00
Mic Bowman
2877c7d94d Actually make the parameter updates change the behavior of
sun movement.
2014-01-28 16:34:22 -08:00
Robert Adams
0c3493f619 clear land tainting when tested. Then testing, pass scene to LandObject as now needed to get region size 2014-01-28 16:25:01 -08:00
Robert Adams
d25265ae82 Fix terrain tests by properly initializing low detail terrain to zero height.
Also remove PI heightmap test as new heightmaps only have two significant digits.
2014-01-28 15:58:45 -08:00
Mic Bowman
1d533b0f01 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2014-01-28 15:47:24 -08:00
Mic Bowman
bfb0011cd3 Some major surgery on the sun module. Updates to the client were gated
by a "mode" check. That mode check has been removed (it didn't result
in any change of behavior anyway). Also added a command line variable
update to set the sun position time offset (offset from the system
clock). Default is no offset to preserve existing behavior.
2014-01-28 15:43:47 -08:00
Robert Adams
e5d59dc696 Repair database routines so they properly return null when asked for
the heighmap of a region that does not exist.
2014-01-28 15:29:06 -08:00
Robert Adams
8eec717f5f Merge branch 'master' into varregion 2014-01-28 08:50:28 -08:00
Robert Adams
4faf11e001 varregion: fix for teleporting by double clicking on a map location.
Thanks Garmin.
2014-01-28 08:49:22 -08:00
Robert Adams
49af6b53e7 varregion: enable teleporting to a varregion by clicking on the map and
pressing the 'teleport' button.
This commit adds returning region map info for all the subregions of a
varregion. This also handles the selection of the extra region and then
the displacement of the postion so the teleport is to the correct location.
2014-01-26 19:32:28 -08:00
Robert Adams
13a9d5409c Merge branch 'master' into varregion
Conflicts:
	OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
	OpenSim/Region/CoreModules/World/LegacyMap/ShadedMapTileRenderer.cs
	OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs
2014-01-26 07:56:47 -08:00
Robert Adams
6831e58616 varregion: modify MapImageModule structure so it will better merge
with changes made in master.
2014-01-26 07:38:28 -08:00
Robert Adams
afb2e07111 varregion: pass region size in more HG services. 2014-01-24 06:30:38 -08:00
Mic Bowman
674a3a5639 Enable the simulator to handle region size information returned from
a hypergrid gatekeeper. Fields are "size_x" and "size_y". Server side
will be updated separately.
2014-01-23 16:20:18 -08:00
Robert Adams
4c362a83f9 Merge branch 'master' into varregion 2014-01-21 11:31:51 -08:00
Robert Adams
90fa3202c6 varregion: remove debugging splat file saving that fills up the
maptile dir and causes errors.
2014-01-19 13:37:51 -08:00
Robert Adams
5e6a47f13f varregion: remove --noterrain and --noparcel parameters in 'load oar'.
Add --forceterrain and --forceparcel to 'load oar'. In order to not change
the operation of --merge (which does an object merge and suppresses terrain
and parcel information loading), added the --force* parameters to be used
when loading multiple oars to build up a varregion.

Added --rotation and --rotationcenter parameters to 'load oar' which apply a rotation to
the loaded oar objects before displacing. The rotation is in degrees (pos or neg)
and the center defaults to "<128, 128, 0>".
2014-01-19 12:45:16 -08:00
Robert Adams
6fbfb47b92 varregion: add --noterrain and --noparcel to 'load oar'.
--noterrain suppresses the loading of the terrain from the oar.
--noparcels suppresses the loading of parcel information from the oar.
2014-01-19 11:03:08 -08:00
Robert Adams
dd6db72939 varregion: add --displacement parameter to 'load oar'.
Adds displacment to all objects and terrain loaded from the oar.
As an example, if you have a 512x512 region and an old 256x256 oar, doing
  load oar --displacement "<128,128,0>" oarFile.oar
will load the object (and terrain) into the middle of the 512x512 region.
If displacement is not specified, 'load oar' works like it always has.
If you have a 5
2014-01-19 10:09:43 -08:00
Robert Adams
f127e4b4ee Merge branch 'master' into varregion 2014-01-19 07:38:53 -08:00
Robert Adams
54a4b9eab4 varregion: Update Warp3D to properly handle varregions.
This includes additions to Warp3D:
   Optional rendering of mesh and scupltie prims (INI parameter. Off by default)
   Texturing of large prims (INI parameter. On by default)
   Better garbage collection
2014-01-19 07:33:56 -08:00
Robert Adams
813f0da00b Add J2K decoder routine that converts directly to an image. 2014-01-19 07:32:41 -08:00
Robert Adams
08fa0a6a8a Fix casting error for float type INI file parameter parsing. 2014-01-19 07:26:55 -08:00
Robert Adams
60de0bc3c2 varregion: split up generated maptile images for storage in map. This
makes maps for varregions show up properly.
2014-01-19 05:09:03 -08:00
Robert Adams
cc5cffc212 varregion: properly pack the region size parameters so he viewer will parse them.
This gets rid of the viewer crash when teleporting into varregions and allows
multiple, adjacent varregions (of the same size) with border crossings.
2014-01-11 22:00:52 -08:00
Robert Adams
1eea6fd452 varregion: Debug messages for region crossing debugging. 2014-01-11 22:00:24 -08:00
Robert Adams
3760d10cd0 varregion: remove unnecessary border checking code in ScenePresence. 2014-01-11 21:59:22 -08:00
Robert Adams
1cf17a3cf7 Merge branch 'master' into varregion
Conflicts:
	OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
	OpenSim/Region/Framework/Scenes/SceneBase.cs
	OpenSim/Services/Interfaces/IGridService.cs
	OpenSim/Services/LLLoginService/LLLoginResponse.cs
(conflicts were debug statements that are commented out in master branch)
2014-01-11 08:52:23 -08:00
Robert Adams
fd045d520e Merge branch 'master' into varregion
Conflicts:
	OpenSim/Framework/Constants.cs
	OpenSim/Framework/RegionInfo.cs
	OpenSim/Services/GridService/GridService.cs
	OpenSim/Services/Interfaces/IGridService.cs
Most conflicts had to do with Util routines not in master branch yet.
2014-01-04 08:57:51 -08:00
Robert Adams
9984ecf862 varregion: Add region size to teleport event messages (EnableSimulator,
CorssRegion, TeleportFinishEvent).
Have Simian grid service return the region size.
Many teleport related debug log messages. Can be removed when teleport
works (like that's ever going to happen).
2014-01-03 07:41:06 -08:00
Robert Adams
01c0bbf181 varregion: extract banned region logic into a class for cleanlyness.
Add 'not found' caching in EntityTransferModule.GetRegionContainingWorldLocation
so hitting borders and bad teleports do not continuiously hammer on the GridService.
2013-12-27 08:23:37 -08:00
Robert Adams
2d2bea4aa7 varregion: many more updates removing the constant RegionSize and replacing
with a passed region size. This time in the map code and grid services code.
2013-12-26 22:45:59 -08:00
Robert Adams
e5f7c8b6e8 varregion: add lots of DEBUG level log messages. Especially for teleport. 2013-12-24 12:31:26 -08:00
Robert Adams
b40b57776b varregion: remove unused Scene.HaveNeighbor routine. Its computation
was wrong for large regions anyway.
2013-12-24 12:28:54 -08:00
Robert Adams
5c9fa15f30 varregion: fix bug where destination region is not found and object is
not restored to its original location.
2013-12-24 11:51:50 -08:00
Robert Adams
a01862509e Merge branch 'master' into varregion 2013-12-20 06:52:28 -08:00
Robert Adams
6937eec258 Merge branch 'master' into varregion
Add new region crossing code to varregion

Conflicts:
	OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2013-12-17 06:18:13 -08:00
Robert Adams
13a9a4b653 varregion: rename 'LegacyRegionLocX' back to 'RegionLocX' and same for Y and Z.
Rename 'RegionWorldLocX' to 'WorldLocX' and same for Y and Z.
This keeps the downward compatibility and follows the scheme of 'region'
and 'world' location naming that is happening in the Util module.
2013-12-14 07:53:01 -08:00
Robert Adams
4eb52eb19e Merge branch 'master' into varregion 2013-12-05 21:07:44 -08:00
Robert Adams
31bacfbb63 Merge branch 'master' into varregion 2013-12-01 15:51:42 -08:00
Robert Adams
6cd0d7a62b varregion: Add MaxRegionSize constant and enforce in RegionInfo.
Intermediate checkin of changing border cross computation from checking
boundry limits to requests to GridService. Not totally functional.
2013-11-30 15:28:39 -08:00
Robert Adams
109136c074 varregion: add ITerrainChannel.GetHeightAtXYZ() for eventual mesh terrain.
Implementation of same in TerrainChannel.cs.
Check for bounds in TerrainChannel[x,y] to prevent array access exceptions.
2013-11-28 08:22:41 -08:00
Robert Adams
7aa00632b9 varregion: many replacements of in-place arithmetic with calls to
the Util functions for converting world addresses to region addresses
and converting region handles to locations.
2013-11-28 08:20:16 -08:00
Robert Adams
3193bcaae1 Merge branch 'master' into varregion 2013-11-24 07:23:12 -08:00
Robert Adams
604b39cea9 Merge branch 'master' into varregion 2013-11-15 14:56:13 -08:00
Robert Adams
d67236c09d Merge branch 'master' into varregion 2013-11-13 16:10:25 -08:00
Robert Adams
e2a1fa806d varregion: extend TerrainModule to use the region size from RegionInfo
rather than using Constants.RegionSize. This allows loading and saving
of terrain heightmaps that match the size of non-legacy sized regions.
2013-11-10 21:12:17 -08:00
Robert Adams
c12e68e34d varregion: fix GetLandObject error return and initialization of square
land object bitmaps. This fixes creation of child presences and the
editing of parcels.
Also lots of commented out debugging messages.
2013-11-10 19:52:31 -08:00
Robert Adams
7061784cc6 Merge branch 'master' into varregion 2013-11-08 20:55:28 -08:00
Robert Adams
beeec1c467 varregion: elimination of Constants.RegionSize from all over OpenSimulator.
Routines in Util to compute region world coordinates from region coordinates
as well as the conversion to and from region handles. These routines have
replaced a lot of math scattered throughout the simulator.
Should be no functional changes.
2013-11-08 20:53:37 -08:00
Robert Adams
a7a837550e varregion: Massive work to LandManagementModule and LandObject to
handle variable sized regions. Many changes for both the region and parcels.
Most of the constant "4" (for the 4x4 parcel units) have been replaced
with symbols and math.
2013-11-08 20:51:09 -08:00
Robert Adams
f7bd0da026 Merge branch 'master' into varregion 2013-11-06 06:32:11 -08:00
Robert Adams
a75ce7423c Merge branch 'master' into varregion 2013-11-05 21:42:27 -08:00
Robert Adams
d0854e4ace varregion: properly sense size of terrain heightmap and store as
compressed 2D database blob if a varregion.
2013-11-05 21:33:02 -08:00
Robert Adams
c931b16c1f Merge branch 'master' into varregion 2013-11-04 22:12:57 -08:00
Robert Adams
f2810bf03a varregion: add plumbing to pass region size from Scene down to the
physics engine.
Older physics engines will default to the legacy region size.
Update BulletSim to use the new region size information.
2013-11-04 22:10:54 -08:00
Robert Adams
cd1a23fc14 varregion: remove uses of region size constant. In particular, update scene
to check for border crossings based on the size of the region.
2013-11-04 22:09:52 -08:00
Robert Adams
ac94dc8a14 varregion: remove unused terrain serialization code in SQLite and PGSQL modules 2013-11-04 22:06:20 -08:00
Robert Adams
9bf363e9be varregion: send the proper terrain patch layer code for large terrain.
Code cleanups.
2013-11-03 08:14:51 -08:00
Robert Adams
79b031bd0c varregion: send region size in LLLoginResponse. 2013-11-02 15:42:26 -07:00
Robert Adams
6df7d4219d varregion: add linkage for region size in creations and conversions
of GridRegion. New variables for size and code to initialize same.
2013-11-02 15:40:48 -07:00
Robert Adams
f66737fe56 varregion: Enforce the configuration of square regions in RegionInfo.cs. 2013-11-02 15:36:16 -07:00
Robert Adams
92c06a5d0b varregion: fix lawn-mower terrain fill so it works for non-square regions.
Add some debugging logs on region creation to report region size.
2013-11-01 16:37:27 -07:00
Robert Adams
976530569a varregion: enforce multiple of 256 for region size when parameters fetched from user.
Output info and warning messages for non-legacy region sizes.
2013-11-01 16:06:19 -07:00
Robert Adams
ff5885ab23 varregion: push TerrainData implementation up and down the database storage stack.
Implement both LoadTerrain and StoreTerrain for all DBs.
Move all database blob serialization/deserialization into TerrainData.
2013-11-01 11:35:31 -07:00
Robert Adams
39777db8ef varregion: fix problem of X/Y dimensions swapped and incorrect terrain
compression base computation.
Complete replacement of float[] for terrain heightmap with TerrainData instance.
2013-10-31 09:24:06 -07:00
Robert Adams
2be0347f50 Merge branch 'master' into varregion 2013-10-28 09:30:26 -07:00
Robert Adams
c581506058 varregion: update PGSQL driver for storing variable terrain size blobs. 2013-10-16 08:13:06 -07:00
Robert Adams
8937a2244d Merge branch 'master' into varregion 2013-10-16 07:53:44 -07:00
Robert Adams
97bc5263de varregion: move the compressed heighmap compression factor from
Constants into TerrainData.
Save compression factor with the terrain blob in the database.
2013-10-16 07:52:30 -07:00
Robert Adams
86bf79aa2b Merge branch 'master' into varregion 2013-10-07 13:58:17 -07:00
Robert Adams
7416809077 varregion: plug in TerrainData class and modify TerrainModule and LLClientView to use same. This passes a terrain info class around rather than passing a one dimensional array thus allowing variable regions. Update the database storage for variable region sizes. This should be downward compatible (same format for 256x256 regions). 2013-10-07 13:57:40 -07:00
Robert Adams
25ae59b9eb varregion: remove scattered use of Constants.RegionSize by having routines reference RegionInfo.RegionWorldLoc?. 2013-10-07 13:57:30 -07:00
Robert Adams
9b150194f6 varregion: add new TerrainData and TerrainCompressor routines. TerrainCompressor needed to replace the one in libopenmetaverse that doesn't know about the larger terrain packets. 2013-10-07 13:57:16 -07:00
Robert Adams
8c432c7c9b Merge branch 'varregion' of git://opensimulator.org/git/opensim into varregion 2013-09-28 07:35:30 -07:00
Robert Adams
8c1d80fdfd varregion: serious rework of TerrainChannel:
-- addition of varaible region size in X and Y
    -- internal storage of heightmap changed from double[] to short[]
    -- helper routines for handling internal structure while keeping existing API
    -- to and from XML that adds region size information (for downward compatibility,
        output in the legacy XML format if X and Y are 256)
Updated and commented Constants.RegionSize but didn't change the name for compatibility.
2013-09-28 07:33:56 -07:00
Robert Adams
aea5d3a842 Remove time based terrain storage in SQLite so revision number can be used
to denote terrain format revision.
Add terrain DB format revision codes to ISimulationDataStore.cs.
Setup so legacy compatible terrain storage and fetch is possible while
allowing future format extensions.
2013-09-28 07:33:55 -07:00
Robert Adams
fa1c688342 varregion: go back to using Constants.RegionSize so as not to break
external modules. People shouldn't use it but don't want to cause
too much breakage of legacy modules.
2013-09-28 07:33:54 -07:00
Robert Adams
139639d25e VarRegion: add RegionSize[XYZ] to RegionInfo.cs.
Update RegionInfo parameter and serialization routines to serialize
the region size if it is not the LegacyRegionSize.
2013-09-28 07:33:53 -07:00
Robert Adams
317c04fe17 VarRegion: change RegionInfo storage of region coordinates from region
count number to integer world coordinates.
Added new methods RegionWorldLoc[XY].
Refactored name of 'RegionLoc*' to 'LegacyRegionLoc*' throughout OpenSim.
Kept old 'RegionLoc*' entrypoint to RegionInfo for downward compatability
of external region management packages.
2013-09-28 07:33:52 -07:00
Robert Adams
fbc9072a5c varregion: serious rework of TerrainChannel:
-- addition of varaible region size in X and Y
    -- internal storage of heightmap changed from double[] to short[]
    -- helper routines for handling internal structure while keeping existing API
    -- to and from XML that adds region size information (for downward compatibility,
        output in the legacy XML format if X and Y are 256)
Updated and commented Constants.RegionSize but didn't change the name for compatibility.
2013-09-25 17:30:53 -07:00
Robert Adams
7fa64cce7d Remove time based terrain storage in SQLite so revision number can be used
to denote terrain format revision.
Add terrain DB format revision codes to ISimulationDataStore.cs.
Setup so legacy compatible terrain storage and fetch is possible while
allowing future format extensions.
2013-09-25 17:30:51 -07:00
Robert Adams
ab1474b5de varregion: go back to using Constants.RegionSize so as not to break
external modules. People shouldn't use it but don't want to cause
too much breakage of legacy modules.
2013-09-25 17:30:49 -07:00
Robert Adams
0765a83a8c VarRegion: add RegionSize[XYZ] to RegionInfo.cs.
Update RegionInfo parameter and serialization routines to serialize
the region size if it is not the LegacyRegionSize.
2013-09-25 17:30:47 -07:00
Robert Adams
96abbbb6fb VarRegion: change RegionInfo storage of region coordinates from region
count number to integer world coordinates.
Added new methods RegionWorldLoc[XY].
Refactored name of 'RegionLoc*' to 'LegacyRegionLoc*' throughout OpenSim.
Kept old 'RegionLoc*' entrypoint to RegionInfo for downward compatability
of external region management packages.
2013-09-25 17:30:45 -07:00
536 changed files with 39112 additions and 44995 deletions

View File

@@ -19,10 +19,14 @@ Prereqs:
From the distribution type:
* ./runprebuild.sh
* nant (or xbuild)
* nant (or !* xbuild)
* cd bin
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* run mono OpenSim.exe
!* xbuild option switches
!* clean: xbuild /target:clean
!* debug: (default) xbuild /property:Configuration=Debug
!* release: xbuild /property:Configuration=Release
# Using Monodevelop

View File

@@ -9,13 +9,15 @@ people that make the day to day of OpenSim happen.
* dahlia
* Melanie Thielker
* Diva (Crista Lopes, University of California, Irvine)
* Dan Lake (Intel)
* Dan Lake
* Marck
* Mic Bowman (Intel)
* Mic Bowman
* BlueWall (James Hughes)
* Nebadon Izumi (Michael Cerquoni, OSgrid)
* Snoopy Pfeffer
* Robert Adams (Intel)
* Robert Adams
* Oren Hurvitz (Kitely)
* Kevin Cozens
= Core Developers Following the White Rabbit =
Core developers who have temporarily (we hope) gone chasing the white rabbit.
@@ -66,6 +68,7 @@ what it is today.
* alex_carnell
* Alan Webb (IBM)
* Aleric
* Alicia Raven
* Allen Kerensky
* BigFootAg
* BlueWall Slade
@@ -78,12 +81,13 @@ what it is today.
* ctrlaltdavid (David Rowe)
* Daedius
* daTwitch
* Dev Random
* devalnor-#708
* dmiles (Daxtron Labs)
* Dong Jun Lan (IBM)
* DoranZemlja
* dr0b3rts
* dslake (Intel)
* dslake
* FredoChaplin
* Garmin Kawaguichi
* Gerhard
@@ -97,10 +101,12 @@ what it is today.
* Flyte Xevious
* Garmin Kawaguichi
* Gryc Ueusp
* H-H-H (ginge264)
* Hiro Lecker
* Iain Oliver
* Imaze Rhiano
* Intimidated
* Jak Daniels
* Jeremy Bongio (IBM)
* jhurliman
* John R Sohn (XenReborn)
@@ -108,26 +114,30 @@ what it is today.
* Jon Cundill
* Junta Kohime
* Kayne
* Kevin Cozens
* kinoc (Daxtron Labs)
* Kira
* Kitto Flora
* KittyLiu
* Kurt Taylor (IBM)
* Lani Global
* lillith_xue
* lkalif
* LuciusSirnah
* lulurun
* M.Igarashi
* maimedleech
* Mana Janus
* MarcelEdward
* Matt Lehmann
* Mic Bowman
* Michelle Argus
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
* Micheil Merlin
* Mike Osias (IBM)
* Mike Pitman (IBM)
* mikemig
* mikkopa/_someone - RealXtend
* Misterblue (Intel)
* Misterblue
* Mircea Kitsune
* mpallari
* MrMonkE
@@ -136,7 +146,6 @@ what it is today.
* nornalbion
* Omar Vera Ustariz (IBM)
* openlifegrid.com
* Oren Hurvitz (Kitely)
* otakup0pe
* Pixel Tomsen
* ralphos
@@ -145,6 +154,7 @@ what it is today.
* Richard Alimi (IBM)
* Rick Alther (IBM)
* Rob Smart (IBM)
* Roger Kirkman (zadark)
* rtomita
* Ruud Lathorp
* SachaMagne

View File

@@ -56,8 +56,8 @@ namespace OpenSim.Groups
private IGroupsServicesConnector m_groupData = null;
// Config Options
private bool m_groupMessagingEnabled = false;
private bool m_debugEnabled = true;
private bool m_groupMessagingEnabled;
private bool m_debugEnabled;
/// <summary>
/// If enabled, module only tries to send group IMs to online users by querying cached presence information.
@@ -83,7 +83,6 @@ namespace OpenSim.Groups
private Dictionary<UUID, List<string>> m_groupsAgentsDroppedFromChatSession = new Dictionary<UUID, List<string>>();
private Dictionary<UUID, List<string>> m_groupsAgentsInvitedToChatSession = new Dictionary<UUID, List<string>>();
#region Region Module interfaceBase Members
public void Initialise(IConfigSource config)
@@ -111,9 +110,17 @@ namespace OpenSim.Groups
m_messageOnlineAgentsOnly = groupsConfig.GetBoolean("MessageOnlineUsersOnly", false);
if (m_messageOnlineAgentsOnly)
{
m_usersOnlineCache = new ExpiringCache<UUID, PresenceInfo[]>();
}
else
{
m_log.Error("[Groups.Messaging]: GroupsMessagingModule V2 requires MessageOnlineUsersOnly = true");
m_groupMessagingEnabled = false;
return;
}
m_debugEnabled = groupsConfig.GetBoolean("DebugEnabled", true);
m_debugEnabled = groupsConfig.GetBoolean("MessagingDebugEnabled", m_debugEnabled);
m_log.InfoFormat(
"[Groups.Messaging]: GroupsMessagingModule enabled with MessageOnlineOnly = {0}, DebugEnabled = {1}",
@@ -133,6 +140,14 @@ namespace OpenSim.Groups
scene.EventManager.OnMakeChildAgent += OnMakeChildAgent;
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
scene.EventManager.OnClientLogin += OnClientLogin;
scene.AddCommand(
"Debug",
this,
"debug groups messaging verbose",
"debug groups messaging verbose <true|false>",
"This setting turns on very verbose groups messaging debugging",
HandleDebugGroupsMessagingVerbose);
}
public void RegionLoaded(Scene scene)
@@ -172,10 +187,8 @@ namespace OpenSim.Groups
return;
}
if (m_presenceService == null)
m_presenceService = scene.PresenceService;
}
public void RemoveRegion(Scene scene)
@@ -222,6 +235,25 @@ namespace OpenSim.Groups
#endregion
private void HandleDebugGroupsMessagingVerbose(object modules, string[] args)
{
if (args.Length < 5)
{
MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
return;
}
bool verbose = false;
if (!bool.TryParse(args[4], out verbose))
{
MainConsole.Instance.Output("Usage: debug groups messaging verbose <true|false>");
return;
}
m_debugEnabled = verbose;
MainConsole.Instance.OutputFormat("{0} verbose logging set to {1}", Name, m_debugEnabled);
}
/// <summary>
/// Not really needed, but does confirm that the group exists.
@@ -242,11 +274,23 @@ namespace OpenSim.Groups
return false;
}
}
public void SendMessageToGroup(GridInstantMessage im, UUID groupID)
{
SendMessageToGroup(im, groupID, UUID.Zero, null);
}
public void SendMessageToGroup(
GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func<GroupMembersData, bool> sendCondition)
{
int requestStartTick = Environment.TickCount;
UUID fromAgentID = new UUID(im.fromAgentID);
// Unlike current XmlRpcGroups, Groups V2 can accept UUID.Zero when a perms check for the requesting agent
// is not necessary.
List<GroupMembersData> groupMembers = m_groupData.GetGroupMembers(UUID.Zero.ToString(), groupID);
int groupMembersCount = groupMembers.Count;
PresenceInfo[] onlineAgents = null;
@@ -254,7 +298,7 @@ namespace OpenSim.Groups
// Sending to offline members is not an option.
string[] t1 = groupMembers.ConvertAll<string>(gmd => gmd.AgentID.ToString()).ToArray();
// We cache in order not to overwhlem the presence service on large grids with many groups. This does
// We cache in order not to overwhelm the presence service on large grids with many groups. This does
// mean that members coming online will not see all group members until after m_usersOnlineCacheExpirySeconds has elapsed.
// (assuming this is the same across all grid simulators).
if (!m_usersOnlineCache.TryGetValue(groupID, out onlineAgents))
@@ -273,8 +317,6 @@ namespace OpenSim.Groups
// "[Groups.Messaging]: SendMessageToGroup called for group {0} with {1} visible members, {2} online",
// groupID, groupMembersCount, groupMembers.Count());
int requestStartTick = Environment.TickCount;
im.imSessionID = groupID.Guid;
im.fromGroup = true;
IClientAPI thisClient = GetActiveClient(fromAgentID);
@@ -299,12 +341,27 @@ namespace OpenSim.Groups
if (clientsAlreadySent.Contains(member.AgentID))
continue;
clientsAlreadySent.Add(member.AgentID);
if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID))
if (sendCondition != null)
{
if (!sendCondition(member))
{
if (m_debugEnabled)
m_log.DebugFormat(
"[Groups.Messaging]: Not sending to {0} as they do not fulfill send condition",
member.AgentID);
continue;
}
}
else if (hasAgentDroppedGroupChatSession(member.AgentID.ToString(), groupID))
{
// Don't deliver messages to people who have dropped this session
if (m_debugEnabled) m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID);
if (m_debugEnabled)
m_log.DebugFormat("[Groups.Messaging]: {0} has dropped session, not delivering to them", member.AgentID);
continue;
}

View File

@@ -45,9 +45,6 @@ namespace OpenSim.Groups
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")]
public class GroupsModule : ISharedRegionModule, IGroupsModule
{
/// <summary>
/// </summary>
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -104,7 +101,7 @@ namespace OpenSim.Groups
{
scene.RegisterModuleInterface<IGroupsModule>(this);
scene.AddCommand(
"debug",
"Debug",
this,
"debug groups verbose",
"debug groups verbose <true|false>",
@@ -466,6 +463,7 @@ namespace OpenSim.Groups
OnNewGroupNotice(GroupID, NoticeID);
}
// Send notice out to everyone that wants notices
foreach (GroupMembersData member in m_groupData.GetGroupMembers(GetRequestingAgentIDStr(remoteClient), GroupID))
{
@@ -498,12 +496,13 @@ namespace OpenSim.Groups
Util.ParseUniversalUserIdentifier(notice.noticeData.AttachmentOwnerID, out giver, out tmp, out tmp, out tmp, out tmp);
m_log.DebugFormat("[Groups]: Giving inventory from {0} to {1}", giver, remoteClient.AgentId);
string message;
InventoryItemBase itemCopy = ((Scene)(remoteClient.Scene)).GiveInventoryItem(remoteClient.AgentId,
giver, notice.noticeData.AttachmentItemID);
giver, notice.noticeData.AttachmentItemID, out message);
if (itemCopy == null)
{
remoteClient.SendAgentAlertMessage("Can't find item to give. Nothing given.", false);
remoteClient.SendAgentAlertMessage(message, false);
return;
}

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@@ -560,7 +560,7 @@ namespace OpenSim.Groups
// so we have the list of urls to send the notice to
// this may take a long time...
Util.FireAndForget(delegate
Util.RunThreadNoTimeout(delegate
{
foreach (string u in urls)
{
@@ -571,7 +571,7 @@ namespace OpenSim.Groups
hasAttachment, attType, attName, attItemID, AgentUUIForOutside(attOwnerID));
}
}
});
}, "AddGroupNotice", null);
return true;
}

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@@ -158,7 +158,7 @@ namespace OpenSim.Groups
}
catch (Exception e)
{
m_log.DebugFormat("[Groups.RobustHGConnector]: Exception {0}", e.StackTrace);
m_log.Error(string.Format("[Groups.RobustHGConnector]: Exception {0} ", e.Message), e);
}
return FailureResult();

View File

@@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]
[assembly: Addin("OpenSim.Groups", "0.1")]
[assembly: AddinDependency("OpenSim", "0.5")]

View File

@@ -32,27 +32,47 @@ using System.Reflection;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.ServiceAuth;
using OpenSim.Server.Base;
using OpenMetaverse;
using log4net;
using Nini.Config;
namespace OpenSim.Groups
{
public class GroupsServiceRemoteConnector
public class GroupsServiceRemoteConnector
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_ServerURI;
private IServiceAuth m_Auth;
private object m_Lock = new object();
public GroupsServiceRemoteConnector(string url)
public GroupsServiceRemoteConnector(IConfigSource config)
{
IConfig groupsConfig = config.Configs["Groups"];
string url = groupsConfig.GetString("GroupsServerURI", string.Empty);
if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
throw new Exception(string.Format("[Groups.RemoteConnector]: Malformed groups server URL {0}. Fix it or disable the Groups feature.", url));
m_ServerURI = url;
if (!m_ServerURI.EndsWith("/"))
m_ServerURI += "/";
m_log.DebugFormat("[Groups.RemoteConnector]: Groups server at {0}", m_ServerURI);
/// This is from BaseServiceConnector
string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", "Groups" }, "None");
switch (authType)
{
case "BasicHttpAuthentication":
m_Auth = new BasicHttpAuthentication(config, "Groups");
break;
}
///
m_log.DebugFormat("[Groups.RemoteConnector]: Groups server at {0}, authentication {1}",
m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString()));
}
public ExtendedGroupRecord CreateGroup(string RequestingAgentID, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment,
@@ -106,7 +126,7 @@ namespace OpenSim.Groups
sendData["OP"] = "UPDATE";
Dictionary<string, object> ret = MakeRequest("PUTGROUP", sendData);
if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL"))
if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL")))
return null;
return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]);
@@ -127,7 +147,7 @@ namespace OpenSim.Groups
Dictionary<string, object> ret = MakeRequest("GETGROUP", sendData);
if (ret == null || (ret != null && ret["RESULT"].ToString() == "NULL"))
if (ret == null || (ret != null && (!ret.ContainsKey("RESULT") || ret["RESULT"].ToString() == "NULL")))
return null;
return GroupsDataUtils.GroupRecord((Dictionary<string, object>)ret["RESULT"]);
@@ -267,6 +287,7 @@ namespace OpenSim.Groups
if (ret["RESULT"].ToString() == "NULL")
return members;
foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values)
{
ExtendedGroupMembersData m = GroupsDataUtils.GroupMembersData((Dictionary<string, object>)v);
@@ -357,6 +378,7 @@ namespace OpenSim.Groups
if (ret["RESULT"].ToString() == "NULL")
return roles;
foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values)
{
GroupRolesData m = GroupsDataUtils.GroupRolesData((Dictionary<string, object>)v);
@@ -657,7 +679,8 @@ namespace OpenSim.Groups
lock (m_Lock)
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "groups",
ServerUtils.BuildQueryString(sendData));
ServerUtils.BuildQueryString(sendData),
m_Auth);
if (reply == string.Empty)
return null;
@@ -667,7 +690,7 @@ namespace OpenSim.Groups
return replyData;
}
#endregion
#endregion
}
}
}

View File

@@ -72,12 +72,7 @@ namespace OpenSim.Groups
private void Init(IConfigSource config)
{
IConfig groupsConfig = config.Configs["Groups"];
string url = groupsConfig.GetString("GroupsServerURI", string.Empty);
if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
throw new Exception(string.Format("[Groups.RemoteConnector]: Malformed groups server URL {0}. Fix it or disable the Groups feature.", url));
m_GroupsService = new GroupsServiceRemoteConnector(url);
m_GroupsService = new GroupsServiceRemoteConnector(config);
m_Scenes = new List<Scene>();
}

View File

@@ -36,6 +36,7 @@ using OpenSim.Framework;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Framework.ServiceAuth;
using OpenSim.Server.Handlers.Base;
using log4net;
using OpenMetaverse;
@@ -52,14 +53,26 @@ namespace OpenSim.Groups
public GroupsServiceRobustConnector(IConfigSource config, IHttpServer server, string configName) :
base(config, server, configName)
{
string key = string.Empty;
if (configName != String.Empty)
m_ConfigName = configName;
m_log.DebugFormat("[Groups.RobustConnector]: Starting with config name {0}", m_ConfigName);
IConfig groupsConfig = config.Configs[m_ConfigName];
if (groupsConfig != null)
{
key = groupsConfig.GetString("SecretKey", string.Empty);
m_log.DebugFormat("[Groups.RobustConnector]: Starting with secret key {0}", key);
}
// else
// m_log.DebugFormat("[Groups.RobustConnector]: Unable to find {0} section in configuration", m_ConfigName);
m_GroupsService = new GroupsService(config);
server.AddStreamHandler(new GroupsServicePostHandler(m_GroupsService));
IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
server.AddStreamHandler(new GroupsServicePostHandler(m_GroupsService, auth));
}
}
@@ -69,8 +82,8 @@ namespace OpenSim.Groups
private GroupsService m_GroupsService;
public GroupsServicePostHandler(GroupsService service) :
base("POST", "/groups")
public GroupsServicePostHandler(GroupsService service, IServiceAuth auth) :
base("POST", "/groups", auth)
{
m_GroupsService = service;
}
@@ -96,7 +109,7 @@ namespace OpenSim.Groups
string method = request["METHOD"].ToString();
request.Remove("METHOD");
m_log.DebugFormat("[Groups.Handler]: {0}", method);
// m_log.DebugFormat("[Groups.Handler]: {0}", method);
switch (method)
{
case "PUTGROUP":
@@ -140,7 +153,7 @@ namespace OpenSim.Groups
}
catch (Exception e)
{
m_log.DebugFormat("[GROUPS HANDLER]: Exception {0}", e.StackTrace);
m_log.Error(string.Format("[GROUPS HANDLER]: Exception {0} ", e.Message), e);
}
return FailureResult();
@@ -652,7 +665,11 @@ namespace OpenSim.Groups
GroupInviteInfo invite = m_GroupsService.GetAgentToGroupInvite(request["RequestingAgentID"].ToString(),
new UUID(request["InviteID"].ToString()));
result["RESULT"] = GroupsDataUtils.GroupInviteInfo(invite);
if (invite != null)
result["RESULT"] = GroupsDataUtils.GroupInviteInfo(invite);
else
result["RESULT"] = "NULL";
return Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result));
}
@@ -784,6 +801,14 @@ namespace OpenSim.Groups
string xmlString = ServerUtils.BuildXmlResponse(result);
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
}
private byte[] FailureResult(string reason)
{
Dictionary<string, object> result = new Dictionary<string, object>();
NullResult(result, reason);
string xmlString = ServerUtils.BuildXmlResponse(result);
return Util.UTF8NoBomEncoding.GetBytes(xmlString);
}
#endregion
}
}

View File

@@ -66,7 +66,7 @@ namespace OpenSim.OfflineIM
if (serviceLocation == string.Empty)
m_OfflineIMService = new OfflineIMService(config);
else
m_OfflineIMService = new OfflineIMServiceRemoteConnector(serviceLocation);
m_OfflineIMService = new OfflineIMServiceRemoteConnector(config);
m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages);
m_log.DebugFormat("[OfflineIM.V2]: Offline messages enabled by {0}", Name);
@@ -226,10 +226,6 @@ namespace OpenSim.OfflineIM
return;
}
Scene scene = FindScene(new UUID(im.fromAgentID));
if (scene == null)
scene = m_SceneList[0];
string reason = string.Empty;
bool success = m_OfflineIMService.StoreMessage(im, out reason);

View File

@@ -30,7 +30,7 @@ using Mono.Addins;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]
[assembly: Addin("OpenSim.OfflineIM", "0.1")]
[assembly: AddinDependency("OpenSim", "0.5")]

View File

@@ -32,6 +32,7 @@ using System.Reflection;
using System.Text;
using OpenSim.Framework;
using OpenSim.Framework.ServiceAuth;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
@@ -46,6 +47,7 @@ namespace OpenSim.OfflineIM
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_ServerURI = string.Empty;
private IServiceAuth m_Auth;
private object m_Lock = new object();
public OfflineIMServiceRemoteConnector(string url)
@@ -65,6 +67,18 @@ namespace OpenSim.OfflineIM
m_ServerURI = cnf.GetString("OfflineMessageURL", string.Empty);
/// This is from BaseServiceConnector
string authType = Util.GetConfigVarFromSections<string>(config, "AuthType", new string[] { "Network", "Messaging" }, "None");
switch (authType)
{
case "BasicHttpAuthentication":
m_Auth = new BasicHttpAuthentication(config, "Messaging");
break;
}
///
m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: Offline IM server at {0} with auth {1}",
m_ServerURI, (m_Auth == null ? "None" : m_Auth.GetType().ToString()));
}
#region IOfflineIMService
@@ -82,8 +96,13 @@ namespace OpenSim.OfflineIM
if (!ret.ContainsKey("RESULT"))
return ims;
if (ret["RESULT"].ToString() == "NULL")
string result = ret["RESULT"].ToString();
if (result == "NULL" || result.ToLower() == "false")
{
string reason = ret.ContainsKey("REASON") ? ret["REASON"].ToString() : "Unknown error";
m_log.DebugFormat("[OfflineIM.V2.RemoteConnector]: GetMessages for {0} failed: {1}", principalID, reason);
return ims;
}
foreach (object v in ((Dictionary<string, object>)ret["RESULT"]).Values)
{
@@ -110,7 +129,7 @@ namespace OpenSim.OfflineIM
string result = ret["RESULT"].ToString();
if (result == "NULL" || result.ToLower() == "false")
{
reason = ret["REASON"].ToString();
reason = ret.ContainsKey("REASON") ? ret["REASON"].ToString() : "Unknown error";
return false;
}
@@ -138,7 +157,8 @@ namespace OpenSim.OfflineIM
lock (m_Lock)
reply = SynchronousRestFormsRequester.MakeRequest("POST",
m_ServerURI + "/offlineim",
ServerUtils.BuildQueryString(sendData));
ServerUtils.BuildQueryString(sendData),
m_Auth);
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(
reply);

View File

@@ -36,6 +36,7 @@ using OpenSim.Framework;
using OpenSim.Server.Base;
using OpenSim.Services.Interfaces;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Framework.ServiceAuth;
using OpenSim.Server.Handlers.Base;
using log4net;
using OpenMetaverse;
@@ -59,7 +60,9 @@ namespace OpenSim.OfflineIM
m_OfflineIMService = new OfflineIMService(config);
server.AddStreamHandler(new OfflineIMServicePostHandler(m_OfflineIMService));
IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
server.AddStreamHandler(new OfflineIMServicePostHandler(m_OfflineIMService, auth));
}
}
@@ -69,8 +72,8 @@ namespace OpenSim.OfflineIM
private IOfflineIMService m_OfflineIMService;
public OfflineIMServicePostHandler(IOfflineIMService service) :
base("POST", "/offlineim")
public OfflineIMServicePostHandler(IOfflineIMService service, IServiceAuth auth) :
base("POST", "/offlineim", auth)
{
m_OfflineIMService = service;
}
@@ -109,7 +112,7 @@ namespace OpenSim.OfflineIM
}
catch (Exception e)
{
m_log.DebugFormat("[OFFLINE IM HANDLER]: Exception {0}", e.StackTrace);
m_log.Error(string.Format("[OFFLINE IM HANDLER]: Exception {0} ", e.Message), e);
}
return FailureResult();

View File

@@ -104,7 +104,7 @@ namespace OpenSim.OfflineIM
using (MemoryStream mstream = new MemoryStream())
{
XmlWriterSettings settings = new XmlWriterSettings();
settings.Encoding = Encoding.UTF8;
settings.Encoding = Util.UTF8NoBomEncoding;
using (XmlWriter writer = XmlWriter.Create(mstream, settings))
{
@@ -112,7 +112,7 @@ namespace OpenSim.OfflineIM
writer.Flush();
}
imXml = Util.UTF8.GetString(mstream.ToArray());
imXml = Util.UTF8NoBomEncoding.GetString(mstream.ToArray());
}
OfflineIMData data = new OfflineIMData();

View File

@@ -39,6 +39,7 @@ using OpenSim.Region.CoreModules.Avatar.InstantMessage;
using OpenSim.Region.CoreModules.Scripting.DynamicTexture;
using OpenSim.Region.CoreModules.Scripting.LoadImageURL;
using OpenSim.Region.CoreModules.Scripting.XMLRPC;
using OpenSim.Services.Interfaces;
namespace OpenSim.ApplicationPlugins.LoadRegions
{
@@ -130,7 +131,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
createdScenes.Add(scene);
if (changed)
regionsToLoad[i].EstateSettings.Save();
m_openSim.EstateDataService.StoreEstateSettings(regionsToLoad[i].EstateSettings);
}
foreach (IScene scene in createdScenes)

View File

@@ -62,4 +62,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
// [assembly: AssemblyVersion("0.7.6.*")]
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]

View File

@@ -32,6 +32,7 @@ using log4net;
using Mono.Addins;
using Nini.Config;
using OpenSim;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
@@ -45,6 +46,12 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Controls whether we load modules from Mono.Addins.
/// </summary>
/// <remarks>For debug purposes. Defaults to true.</remarks>
public bool LoadModulesFromAddins { get; set; }
// Config access
private OpenSimBase m_openSim;
@@ -61,6 +68,11 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
private List<ISharedRegionModule> m_sharedInstances =
new List<ISharedRegionModule>();
public RegionModulesControllerPlugin()
{
LoadModulesFromAddins = true;
}
#region IApplicationPlugin implementation
public void Initialise (OpenSimBase openSim)
@@ -69,6 +81,9 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
m_log.DebugFormat("[REGIONMODULES]: Initializing...");
if (!LoadModulesFromAddins)
return;
// Who we are
string id = AddinManager.CurrentAddin.Id;
@@ -88,40 +103,8 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
Dictionary<RuntimeAddin, IList<int>> loadedModules = new Dictionary<RuntimeAddin, IList<int>>();
// Scan modules and load all that aren't disabled
foreach (TypeExtensionNode node in
AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
{
IList<int> loadedModuleData;
if (!loadedModules.ContainsKey(node.Addin))
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
loadedModuleData = loadedModules[node.Addin];
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
m_sharedModules.Add(node);
loadedModuleData[0]++;
}
}
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node);
loadedModuleData[1]++;
}
}
else
{
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
loadedModuleData[2]++;
}
}
foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
AddNode(node, modulesConfig, loadedModules);
foreach (KeyValuePair<RuntimeAddin, IList<int>> loadedModuleData in loadedModules)
{
@@ -194,6 +177,41 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
#region IPlugin implementation
private void AddNode(
TypeExtensionNode node, IConfig modulesConfig, Dictionary<RuntimeAddin, IList<int>> loadedModules)
{
IList<int> loadedModuleData;
if (!loadedModules.ContainsKey(node.Addin))
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
loadedModuleData = loadedModules[node.Addin];
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
m_sharedModules.Add(node);
loadedModuleData[0]++;
}
}
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
{
if (CheckModuleEnabled(node, modulesConfig))
{
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
m_nonSharedModules.Add(node);
loadedModuleData[1]++;
}
}
else
{
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
loadedModuleData[2]++;
}
}
// We don't do that here
//
public void Initialise ()
@@ -215,6 +233,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
m_sharedInstances[0].Close();
m_sharedInstances.RemoveAt(0);
}
m_sharedModules.Clear();
m_nonSharedModules.Clear();
}

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]

View File

@@ -162,6 +162,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList);
availableMethods["admin_estate_reload"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcEstateReload);
// Land management
availableMethods["admin_reset_land"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcResetLand);
// Either enable full remote functionality or just selected features
string enabledMethods = m_config.GetString("enabled_methods", "all");
@@ -694,7 +697,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
region.EstateSettings.EstateName = (string) requestData["estate_name"];
region.EstateSettings.EstateOwner = userID;
// Persistence does not seem to effect the need to save a new estate
region.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(region.EstateSettings);
if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID))
throw new Exception("Failed to join estate.");
@@ -724,7 +727,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// If an access specification was provided, use it.
// Otherwise accept the default.
newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess);
newScene.RegionInfo.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(newScene.RegionInfo.EstateSettings);
// enable voice on newly created region if
// requested by either the XmlRpc request or the
@@ -910,7 +913,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
scene.RegionInfo.EstateSettings.PublicAccess =
GetBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess);
if (scene.RegionInfo.Persistent)
scene.RegionInfo.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
if (requestData.ContainsKey("enable_voice"))
{
@@ -1022,7 +1025,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// Set home position
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
(int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize));
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
if (null == home)
{
m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstName, lastName);
@@ -1252,7 +1255,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if ((null != regionXLocation) && (null != regionYLocation))
{
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
(int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize));
(int)Util.RegionToWorldLoc((uint)regionXLocation), (int)Util.RegionToWorldLoc((uint)regionYLocation));
if (null == home) {
m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName);
} else {
@@ -1484,8 +1487,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
Dictionary<string, object> archiveOptions = new Dictionary<string,object>();
if (mergeOar) archiveOptions.Add("merge", null);
if (skipAssets) archiveOptions.Add("skipAssets", null);
if (archiver != null)
archiver.DearchiveRegion(filename, mergeOar, skipAssets, Guid.Empty);
archiver.DearchiveRegion(filename, Guid.Empty, archiveOptions);
else
throw new Exception("Archiver module not present for scene");
@@ -1789,7 +1795,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
scene.RegionInfo.EstateSettings.EstateAccess = new UUID[]{};
if (scene.RegionInfo.Persistent)
scene.RegionInfo.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
m_log.Info("[RADMIN]: Access List Clear Request complete");
}
@@ -1835,7 +1841,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray();
if (scene.RegionInfo.Persistent)
scene.RegionInfo.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
}
responseData["added"] = addedUsers;
@@ -1884,7 +1890,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
}
scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray();
if (scene.RegionInfo.Persistent)
scene.RegionInfo.EstateSettings.Save();
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
}
responseData["removed"] = removedUsers;
@@ -2060,6 +2066,56 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = true;
}
private void XmlRpcResetLand(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
{
Hashtable requestData = (Hashtable)request.Params[0];
Hashtable responseData = (Hashtable)response.Value;
string musicURL = string.Empty;
UUID groupID = UUID.Zero;
uint flags = 0;
bool set_group = false, set_music = false, set_flags = false;
if (requestData.Contains("group") && requestData["group"] != null)
set_group = UUID.TryParse(requestData["group"].ToString(), out groupID);
if (requestData.Contains("music") && requestData["music"] != null)
{
musicURL = requestData["music"].ToString();
set_music = true;
}
if (requestData.Contains("flags") && requestData["flags"] != null)
set_flags = UInt32.TryParse(requestData["flags"].ToString(), out flags);
m_log.InfoFormat("[RADMIN]: Received Reset Land Request group={0} musicURL={1} flags={2}",
(set_group ? groupID.ToString() : "unchanged"),
(set_music ? musicURL : "unchanged"),
(set_flags ? flags.ToString() : "unchanged"));
m_application.SceneManager.ForEachScene(delegate(Scene s)
{
List<ILandObject> parcels = s.LandChannel.AllParcels();
foreach (ILandObject p in parcels)
{
if (set_music)
p.LandData.MusicURL = musicURL;
if (set_group)
p.LandData.GroupID = groupID;
if (set_flags)
p.LandData.Flags = flags;
s.LandChannel.UpdateLandObject(p.LandData.LocalID, p.LandData);
}
}
);
responseData["success"] = true;
m_log.Info("[RADMIN]: Reset Land Request complete");
}
/// <summary>
/// Parse a float with the given parameter name from a request data hash table.
/// </summary>
@@ -2235,7 +2291,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
account.ServiceURLs = new Dictionary<string, object>();
account.ServiceURLs["HomeURI"] = string.Empty;
account.ServiceURLs["GatekeeperURI"] = string.Empty;
account.ServiceURLs["InventoryServerURI"] = string.Empty;
account.ServiceURLs["AssetServerURI"] = string.Empty;
}
@@ -2881,7 +2936,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// Set home position
GridRegion home = scene.GridService.GetRegionByPosition(scopeID,
(int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize));
(int)Util.RegionToWorldLoc(regionXLocation), (int)Util.RegionToWorldLoc(regionYLocation));
if (null == home) {
m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]);
} else {

View File

@@ -50,8 +50,7 @@ namespace OpenSim.Framework.Capabilities
public class Caps
{
// private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_httpListenerHostName;
private uint m_httpListenPort;
@@ -152,6 +151,10 @@ namespace OpenSim.Framework.Capabilities
public void RegisterPollHandler(string capName, PollServiceEventArgs pollServiceHandler)
{
// m_log.DebugFormat(
// "[CAPS]: Registering handler with name {0}, url {1} for {2}",
// capName, pollServiceHandler.Url, m_agentID, m_regionName);
m_pollServiceHandlers.Add(capName, pollServiceHandler);
m_httpListener.AddPollServiceHTTPHandler(pollServiceHandler.Url, pollServiceHandler);

View File

@@ -56,12 +56,15 @@ namespace OpenSim.Capabilities.Handlers
public const string DefaultFormat = "x-j2c";
// TODO: Change this to a config option
const string REDIRECT_URL = null;
private string m_RedirectURL = null;
public GetTextureHandler(string path, IAssetService assService, string name, string description)
public GetTextureHandler(string path, IAssetService assService, string name, string description, string redirectURL)
: base("GET", path, name, description)
{
m_assetService = assService;
m_RedirectURL = redirectURL;
if (m_RedirectURL != null && !m_RedirectURL.EndsWith("/"))
m_RedirectURL += "/";
}
protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
@@ -134,7 +137,7 @@ namespace OpenSim.Capabilities.Handlers
if (format != DefaultFormat)
fullID = fullID + "-" + format;
if (!String.IsNullOrEmpty(REDIRECT_URL))
if (!String.IsNullOrEmpty(m_RedirectURL))
{
// Only try to fetch locally cached textures. Misses are redirected
texture = m_assetService.GetCached(fullID);
@@ -150,8 +153,9 @@ namespace OpenSim.Capabilities.Handlers
}
else
{
string textureUrl = REDIRECT_URL + textureID.ToString();
string textureUrl = m_RedirectURL + "?texture_id="+ textureID.ToString();
m_log.Debug("[GETTEXTURE]: Redirecting texture request to " + textureUrl);
httpResponse.StatusCode = (int)OSHttpStatusCode.RedirectMovedPermanently;
httpResponse.RedirectLocation = textureUrl;
return true;
}

View File

@@ -62,8 +62,10 @@ namespace OpenSim.Capabilities.Handlers
if (m_AssetService == null)
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
string rurl = serverConfig.GetString("GetTextureRedirectURL");
;
server.AddStreamHandler(
new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null));
new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null, rurl));
}
}
}

View File

@@ -52,7 +52,7 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
// Overkill - we only really need the asset service, not a whole scene.
Scene scene = new SceneHelpers().SetupScene();
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null);
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null, null);
TestOSHttpRequest req = new TestOSHttpRequest();
TestOSHttpResponse resp = new TestOSHttpResponse();
req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012");

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]

View File

@@ -238,7 +238,15 @@ namespace OpenSim.Capabilities.Handlers
if (folderID != UUID.Zero)
{
contents = m_InventoryService.GetFolderContent(agentID, folderID);
InventoryCollection fetchedContents = m_InventoryService.GetFolderContent(agentID, folderID);
if (fetchedContents == null)
{
m_log.WarnFormat("[WEB FETCH INV DESC HANDLER]: Could not get contents of folder {0} for user {1}", folderID, agentID);
return contents;
}
contents = fetchedContents;
InventoryFolderBase containingFolder = new InventoryFolderBase();
containingFolder.ID = folderID;
containingFolder.Owner = agentID;

View File

@@ -37,9 +37,8 @@ namespace OpenSim.Data
public abstract class AssetDataBase : IAssetDataPlugin
{
public abstract AssetBase GetAsset(UUID uuid);
public abstract void StoreAsset(AssetBase asset);
public abstract bool ExistsAsset(UUID uuid);
public abstract bool[] AssetsExist(UUID[] uuids);
public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);

View File

@@ -35,7 +35,7 @@ namespace OpenSim.Data
{
AssetBase GetAsset(UUID uuid);
void StoreAsset(AssetBase asset);
bool ExistsAsset(UUID uuid);
bool[] AssetsExist(UUID[] uuids);
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
void Initialise(string connect);
bool Delete(string id);

View File

@@ -29,7 +29,7 @@ using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
namespace OpenSim.Data
{
public interface IEstateDataStore
{

View File

@@ -54,12 +54,12 @@ namespace OpenSim.Data
/// <summary>
/// Return the x-coordinate of this region.
/// </summary>
public int coordX { get { return posX / (int)Constants.RegionSize; } }
public int coordX { get { return (int)Util.WorldToRegionLoc((uint)posX); } }
/// <summary>
/// Return the y-coordinate of this region.
/// </summary>
public int coordY { get { return posY / (int)Constants.RegionSize; } }
public int coordY { get { return (int)Util.WorldToRegionLoc((uint)posY); } }
public Dictionary<string, object> Data;
}

View File

@@ -39,7 +39,7 @@ namespace OpenSim.Data
{
AssetBase GetAsset(UUID uuid);
void StoreAsset(AssetBase asset);
bool ExistsAsset(UUID uuid);
bool[] AssetsExist(UUID[] uuids);
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
void Initialise(string connect);
bool Delete(string id);

View File

@@ -48,9 +48,57 @@ namespace OpenSim.Data
public ulong everyonePowers;
public ulong ownersPowers;
public Dictionary<UUID, XGroupMember> members = new Dictionary<UUID, XGroupMember>();
public Dictionary<UUID, XGroupNotice> notices = new Dictionary<UUID, XGroupNotice>();
public XGroup Clone()
{
return (XGroup)MemberwiseClone();
XGroup clone = (XGroup)MemberwiseClone();
clone.members = new Dictionary<UUID, XGroupMember>();
clone.notices = new Dictionary<UUID, XGroupNotice>();
foreach (KeyValuePair<UUID, XGroupMember> kvp in members)
clone.members[kvp.Key] = kvp.Value.Clone();
foreach (KeyValuePair<UUID, XGroupNotice> kvp in notices)
clone.notices[kvp.Key] = kvp.Value.Clone();
return clone;
}
}
public class XGroupMember
{
public UUID agentID;
public UUID groupID;
public UUID roleID;
public bool acceptNotices = true;
public bool listInProfile = true;
public XGroupMember Clone()
{
return (XGroupMember)MemberwiseClone();
}
}
public class XGroupNotice
{
public UUID groupID;
public UUID noticeID;
public uint timestamp;
public string fromName;
public string subject;
public string message;
public byte[] binaryBucket;
public bool hasAttachment;
public int assetType;
public XGroupNotice Clone()
{
XGroupNotice clone = (XGroupNotice)MemberwiseClone();
clone.binaryBucket = (byte[])binaryBucket.Clone();
return clone;
}
}
@@ -58,14 +106,13 @@ namespace OpenSim.Data
/// Early stub interface for groups data, not final.
/// </summary>
/// <remarks>
/// Currently in-use only for regression test purposes. Needs to be filled out over time.
/// Currently in-use only for regression test purposes.
/// </remarks>
public interface IXGroupData
{
bool StoreGroup(XGroup group);
XGroup[] GetGroups(string field, string val);
XGroup[] GetGroups(string[] fields, string[] vals);
bool DeleteGroups(string field, string val);
bool DeleteGroups(string[] fields, string[] vals);
XGroup GetGroup(UUID groupID);
Dictionary<UUID, XGroup> GetGroups();
bool DeleteGroup(UUID groupID);
}
}

View File

@@ -160,18 +160,18 @@ namespace OpenSim.Data.MSSQL
@temporary, @create_time, @access_time, @creatorid, @asset_flags, @data)";
string assetName = asset.Name;
if (asset.Name.Length > 64)
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
assetName = asset.Name.Substring(0, 64);
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
m_log.WarnFormat(
"[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{
assetDescription = asset.Description.Substring(0, 64);
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
m_log.WarnFormat(
"[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
@@ -225,17 +225,38 @@ namespace OpenSim.Data.MSSQL
// }
/// <summary>
/// Check if asset exist in m_database
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuid"></param>
/// <returns>true if exist.</returns>
override public bool ExistsAsset(UUID uuid)
/// <param name="uuids">The assets' IDs</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public override bool[] AssetsExist(UUID[] uuids)
{
if (GetAsset(uuid) != null)
if (uuids.Length == 0)
return new bool[0];
HashSet<UUID> exist = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format("SELECT id FROM assets WHERE id IN ({0})", ids);
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
return true;
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
UUID id = DBGuid.FromDB(reader["id"]);
exist.Add(id);
}
}
}
return false;
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exist.Contains(uuids[i]);
return results;
}
/// <summary>

View File

@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
@@ -55,7 +55,7 @@ namespace OpenSim.Data.MSSQL
return Delete(principalID.ToString(), friend);
}
public bool Delete(string principalID, string friend)
public override bool Delete(string principalID, string friend)
{
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
using (SqlCommand cmd = new SqlCommand())

View File

@@ -49,6 +49,7 @@ namespace OpenSim.Data.MSSQL
// private static FileSystemDataStore Instance = new FileSystemDataStore();
private static readonly ILog _Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string LogHeader = "[REGION DB MSSQL]";
/// <summary>
/// The database manager
@@ -530,43 +531,53 @@ ELSE
/// <returns></returns>
public double[,] LoadTerrain(UUID regionID)
{
double[,] terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize];
terrain.Initialize();
double[,] ret = null;
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
if (terrData != null)
ret = terrData.GetDoubles();
return ret;
}
// Returns 'null' if region not found
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
string sql = "select top 1 RegionUUID, Revision, Heightfield from terrain where RegionUUID = @RegionUUID order by Revision desc";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
// MySqlParameter param = new MySqlParameter();
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", regionID));
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
int rev;
if (reader.Read())
// MySqlParameter param = new MySqlParameter();
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", regionID));
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
MemoryStream str = new MemoryStream((byte[])reader["Heightfield"]);
BinaryReader br = new BinaryReader(str);
for (int x = 0; x < (int)Constants.RegionSize; x++)
int rev;
if (reader.Read())
{
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
terrain[x, y] = br.ReadDouble();
}
rev = (int)reader["Revision"];
byte[] blob = (byte[])reader["Heightfield"];
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
}
rev = (int)reader["Revision"];
else
{
_Log.Info("[REGION DB]: No terrain found for region");
return null;
}
_Log.Info("[REGION DB]: Loaded terrain revision r" + rev);
}
else
{
_Log.Info("[REGION DB]: No terrain found for region");
return null;
}
_Log.Info("[REGION DB]: Loaded terrain revision r" + rev);
}
}
return terrain;
return terrData;
}
// Legacy entry point for when terrain was always a 256x256 hieghtmap
public void StoreTerrain(double[,] ter, UUID regionID)
{
StoreTerrain(new HeightmapTerrainData(ter), regionID);
}
/// <summary>
@@ -574,10 +585,8 @@ ELSE
/// </summary>
/// <param name="terrain">terrain map data.</param>
/// <param name="regionID">regionID.</param>
public void StoreTerrain(double[,] terrain, UUID regionID)
public void StoreTerrain(TerrainData terrData, UUID regionID)
{
int revision = Util.UnixTimeSinceEpoch();
//Delete old terrain map
string sql = "delete from terrain where RegionUUID=@RegionUUID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
@@ -590,17 +599,23 @@ ELSE
sql = "insert into terrain(RegionUUID, Revision, Heightfield) values(@RegionUUID, @Revision, @Heightfield)";
int terrainDBRevision;
Array terrainDBblob;
terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", regionID));
cmd.Parameters.Add(_Database.CreateParameter("@Revision", revision));
cmd.Parameters.Add(_Database.CreateParameter("@Heightfield", serializeTerrain(terrain)));
conn.Open();
cmd.ExecuteNonQuery();
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", regionID));
cmd.Parameters.Add(_Database.CreateParameter("@Revision", terrainDBRevision));
cmd.Parameters.Add(_Database.CreateParameter("@Heightfield", terrainDBblob));
conn.Open();
cmd.ExecuteNonQuery();
}
}
_Log.Info("[REGION DB]: Stored terrain revision r " + revision);
_Log.InfoFormat("{0} Stored terrain revision r={1}", LogHeader, terrainDBRevision);
}
/// <summary>
@@ -1344,30 +1359,6 @@ VALUES
#region Private Methods
/// <summary>
/// Serializes the terrain data for storage in DB.
/// </summary>
/// <param name="val">terrain data</param>
/// <returns></returns>
private static Array serializeTerrain(double[,] val)
{
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double));
BinaryWriter bw = new BinaryWriter(str);
// TODO: COMPATIBILITY - Add byte-order conversions
for (int x = 0; x < (int)Constants.RegionSize; x++)
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
double height = val[x, y];
if (height == 0.0)
height = double.Epsilon;
bw.Write(height);
}
return str.ToArray();
}
/// <summary>
/// Stores new regionsettings.
/// </summary>

View File

@@ -278,7 +278,7 @@ namespace OpenSim.Data.MSSQL
// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
// Util.PrintCallStack();
string sql = "update inventoryfolders set version=version+1 where folderID = ?folderID";
string sql = "update inventoryfolders set version=version+1 where folderID = @folderID";
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
{

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -331,4 +331,12 @@ ALTER TABLE dbo.estate_map ADD CONSTRAINT
COMMIT
:VERSION 10
BEGIN transaction
ALTER TABLE estate_settings ADD AllowLandmark tinyint NOT NULL default 1;
ALTER TABLE estate_settings ADD AllowParcelChanges tinyint NOT NULL default 1;
ALTER TABLE estate_settings ADD AllowSetHome tinyint NOT NULL default 1;
COMMIT;

View File

@@ -1,4 +1,4 @@
:VERSION 1
:VERSION 1
BEGIN TRANSACTION
@@ -26,6 +26,14 @@ COMMIT
BEGIN TRANSACTION
ALTER TABLE Presence ADD LastSeen DateTime
ALTER TABLE Presence ADD LastSeen DateTime;
COMMIT
COMMIT
:VERSION 3
BEGIN TRANSACTION
CREATE INDEX RegionID ON Presence(RegionID);
COMMIT

View File

@@ -1161,11 +1161,11 @@ COMMIT
BEGIN TRANSACTION
ALTER TABLE prims ADD `PhysicsShapeType` tinyint(4) NOT NULL default '0';
ALTER TABLE prims ADD `Density` double NOT NULL default '1000';
ALTER TABLE prims ADD `GravityModifier` double NOT NULL default '1';
ALTER TABLE prims ADD `Friction` double NOT NULL default '0.6';
ALTER TABLE prims ADD `Restitution` double NOT NULL default '0.5';
ALTER TABLE prims ADD PhysicsShapeType tinyint NOT NULL default 0;
ALTER TABLE prims ADD Density float NOT NULL default 1000;
ALTER TABLE prims ADD GravityModifier float NOT NULL default 1;
ALTER TABLE prims ADD Friction float NOT NULL default 0.6;
ALTER TABLE prims ADD Restitution float NOT NULL default 0.5;
COMMIT

View File

@@ -171,18 +171,18 @@ namespace OpenSim.Data.MySQL
dbcon))
{
string assetName = asset.Name;
if (asset.Name.Length > 64)
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
assetName = asset.Name.Substring(0, 64);
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
m_log.WarnFormat(
"[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{
assetDescription = asset.Description.Substring(0, 64);
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
m_log.WarnFormat(
"[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
@@ -257,46 +257,44 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
/// Check if the asset exists in the database
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuid">The asset UUID</param>
/// <returns>true if it exists, false otherwise.</returns>
override public bool ExistsAsset(UUID uuid)
/// <param name="uuidss">The assets' IDs</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public override bool[] AssetsExist(UUID[] uuids)
{
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
if (uuids.Length == 0)
return new bool[0];
bool assetExists = false;
HashSet<UUID> exist = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format("SELECT id FROM assets WHERE id IN ({0})", ids);
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT id FROM assets WHERE id=?id", dbcon))
using (MySqlCommand cmd = new MySqlCommand(sql, dbcon))
{
cmd.Parameters.AddWithValue("?id", uuid.ToString());
try
using (MySqlDataReader dbReader = cmd.ExecuteReader())
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
while (dbReader.Read())
{
if (dbReader.Read())
{
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
assetExists = true;
}
UUID id = DBGuid.FromDB(dbReader["id"]);
exist.Add(id);
}
}
catch (Exception e)
{
m_log.Error(
string.Format("[ASSETS DB]: MySql failure fetching asset {0}. Exception ", uuid), e);
}
}
}
}
return assetExists;
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exist.Contains(uuids[i]);
return results;
}
/// <summary>

View File

@@ -145,7 +145,11 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = sql;
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
return DoLoad(cmd, regionID, create);
EstateSettings e = DoLoad(cmd, regionID, create);
if (!create && e.EstateID == 0) // Not found
return null;
return e;
}
}
@@ -427,7 +431,10 @@ namespace OpenSim.Data.MySQL
cmd.CommandText = sql;
cmd.Parameters.AddWithValue("?EstateID", estateID);
return DoLoad(cmd, UUID.Zero, false);
EstateSettings e = DoLoad(cmd, UUID.Zero, false);
if (e.EstateID != estateID)
return null;
return e;
}
}

View File

@@ -47,7 +47,7 @@ namespace OpenSim.Data.MySQL
return Delete(principalID.ToString(), friend);
}
public bool Delete(string principalID, string friend)
public override bool Delete(string principalID, string friend)
{
using (MySqlCommand cmd = new MySqlCommand())
{

View File

@@ -86,11 +86,11 @@ namespace OpenSim.Data.MySQL
public GroupData[] RetrieveGroups(string pattern)
{
if (string.IsNullOrEmpty(pattern))
pattern = "1 ORDER BY Name LIMIT 100";
pattern = "1";
else
pattern = string.Format("Name LIKE '%{0}%' ORDER BY Name LIMIT 100", pattern);
pattern = string.Format("Name LIKE '%{0}%'", MySqlHelper.EscapeString(pattern));
return m_Groups.Get(pattern);
return m_Groups.Get(string.Format("ShowInList=1 AND ({0}) ORDER BY Name LIMIT 100", pattern));
}
public bool DeleteGroup(UUID groupID)

View File

@@ -48,6 +48,7 @@ namespace OpenSim.Data.MySQL
public class MySQLSimulationData : ISimulationDataStore
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string LogHeader = "[REGION DB MYSQL]";
private string m_connectionString;
private object m_dbLock = new object();
@@ -91,7 +92,7 @@ namespace OpenSim.Data.MySQL
}
catch (Exception e)
{
m_log.Error("[REGION DB]: MySQL error in ExecuteReader: " + e.Message);
m_log.ErrorFormat("{0} MySQL error in ExecuteReader: {1}", LogHeader, e);
throw;
}
@@ -572,10 +573,14 @@ namespace OpenSim.Data.MySQL
}
}
// Legacy entry point for when terrain was always a 256x256 hieghtmap
public void StoreTerrain(double[,] ter, UUID regionID)
{
m_log.Info("[REGION DB]: Storing terrain");
StoreTerrain(new HeightmapTerrainData(ter), regionID);
}
public void StoreTerrain(TerrainData terrData, UUID regionID)
{
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
@@ -589,11 +594,18 @@ namespace OpenSim.Data.MySQL
ExecuteNonQuery(cmd);
cmd.CommandText = "insert into terrain (RegionUUID, " +
"Revision, Heightfield) values (?RegionUUID, " +
"1, ?Heightfield)";
cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter));
int terrainDBRevision;
Array terrainDBblob;
terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
m_log.InfoFormat("{0} Storing terrain. X={1}, Y={2}, rev={3}",
LogHeader, terrData.SizeX, terrData.SizeY, terrainDBRevision);
cmd.CommandText = "insert into terrain (RegionUUID, Revision, Heightfield)"
+ "values (?RegionUUID, ?Revision, ?Heightfield)";
cmd.Parameters.AddWithValue("Revision", terrainDBRevision);
cmd.Parameters.AddWithValue("Heightfield", terrainDBblob);
ExecuteNonQuery(cmd);
}
@@ -601,9 +613,20 @@ namespace OpenSim.Data.MySQL
}
}
// Legacy region loading
public double[,] LoadTerrain(UUID regionID)
{
double[,] terrain = null;
double[,] ret = null;
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
if (terrData != null)
ret = terrData.GetDoubles();
return ret;
}
// Returns 'null' if region not found
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
lock (m_dbLock)
{
@@ -623,32 +646,15 @@ namespace OpenSim.Data.MySQL
while (reader.Read())
{
int rev = Convert.ToInt32(reader["Revision"]);
terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize];
terrain.Initialize();
using (MemoryStream mstr = new MemoryStream((byte[])reader["Heightfield"]))
{
using (BinaryReader br = new BinaryReader(mstr))
{
for (int x = 0; x < (int)Constants.RegionSize; x++)
{
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
terrain[x, y] = br.ReadDouble();
}
}
}
m_log.InfoFormat("[REGION DB]: Loaded terrain revision r{0}", rev);
}
byte[] blob = (byte[])reader["Heightfield"];
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
}
}
}
}
}
return terrain;
return terrData;
}
public void RemoveLandObject(UUID globalID)
@@ -689,7 +695,7 @@ namespace OpenSim.Data.MySQL
"MusicURL, PassHours, PassPrice, SnapshotUUID, " +
"UserLocationX, UserLocationY, UserLocationZ, " +
"UserLookAtX, UserLookAtY, UserLookAtZ, " +
"AuthbuyerID, OtherCleanTime, MediaType, MediaDescription, " +
"AuthbuyerID, OtherCleanTime, Dwell, MediaType, MediaDescription, " +
"MediaSize, MediaLoop, ObscureMusic, ObscureMedia) values (" +
"?UUID, ?RegionUUID, " +
"?LocalLandID, ?Bitmap, ?Name, ?Description, " +
@@ -700,7 +706,7 @@ namespace OpenSim.Data.MySQL
"?MusicURL, ?PassHours, ?PassPrice, ?SnapshotUUID, " +
"?UserLocationX, ?UserLocationY, ?UserLocationZ, " +
"?UserLookAtX, ?UserLookAtY, ?UserLookAtZ, " +
"?AuthbuyerID, ?OtherCleanTime, ?MediaType, ?MediaDescription, "+
"?AuthbuyerID, ?OtherCleanTime, ?Dwell, ?MediaType, ?MediaDescription, "+
"CONCAT(?MediaWidth, ',', ?MediaHeight), ?MediaLoop, ?ObscureMusic, ?ObscureMedia)";
FillLandCommand(cmd, parcel.LandData, parcel.RegionUUID);
@@ -1478,6 +1484,7 @@ namespace OpenSim.Data.MySQL
UUID.TryParse((string)row["AuthBuyerID"], out authedbuyer);
UUID.TryParse((string)row["SnapshotUUID"], out snapshotID);
newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]);
newData.Dwell = Convert.ToSingle(row["Dwell"]);
newData.AuthBuyerID = authedbuyer;
newData.SnapshotID = snapshotID;
@@ -1524,30 +1531,6 @@ namespace OpenSim.Data.MySQL
return entry;
}
/// <summary>
///
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
private static Array SerializeTerrain(double[,] val)
{
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double));
BinaryWriter bw = new BinaryWriter(str);
// TODO: COMPATIBILITY - Add byte-order conversions
for (int x = 0; x < (int)Constants.RegionSize; x++)
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
double height = val[x, y];
if (height == 0.0)
height = double.Epsilon;
bw.Write(height);
}
return str.ToArray();
}
/// <summary>
/// Fill the prim command with prim values
/// </summary>
@@ -1833,6 +1816,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("UserLookAtZ", land.UserLookAt.Z);
cmd.Parameters.AddWithValue("AuthBuyerID", land.AuthBuyerID);
cmd.Parameters.AddWithValue("OtherCleanTime", land.OtherCleanTime);
cmd.Parameters.AddWithValue("Dwell", land.Dwell);
cmd.Parameters.AddWithValue("MediaDescription", land.MediaDescription);
cmd.Parameters.AddWithValue("MediaType", land.MediaType);
cmd.Parameters.AddWithValue("MediaWidth", land.MediaWidth);
@@ -1840,7 +1824,6 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("MediaLoop", land.MediaLoop);
cmd.Parameters.AddWithValue("ObscureMusic", land.ObscureMusic);
cmd.Parameters.AddWithValue("ObscureMedia", land.ObscureMedia);
}
/// <summary>

View File

@@ -634,8 +634,6 @@ namespace OpenSim.Data.MySQL
{
if(reader.HasRows)
{
m_log.DebugFormat("[PROFILES_DATA]" +
": Getting data for {0}.", props.UserId);
reader.Read();
props.WebUrl = (string)reader["profileURL"];
UUID.TryParse((string)reader["profileImage"], out props.ImageId);
@@ -651,9 +649,6 @@ namespace OpenSim.Data.MySQL
}
else
{
m_log.DebugFormat("[PROFILES_DATA]" +
": No data for {0}", props.UserId);
props.WebUrl = string.Empty;
props.ImageId = UUID.Zero;
props.AboutText = string.Empty;
@@ -974,8 +969,8 @@ namespace OpenSim.Data.MySQL
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand(query, dbcon))
{
cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail);
cmd.Parameters.AddWithValue("?Visible", pref.Visible);
cmd.Parameters.AddWithValue("?ImViaEmail", pref.IMViaEmail.ToString().ToLower());
cmd.Parameters.AddWithValue("?Visible", pref.Visible.ToString().ToLower());
cmd.Parameters.AddWithValue("?uuid", pref.UserId.ToString());
cmd.ExecuteNonQuery();

View File

@@ -210,18 +210,18 @@ namespace OpenSim.Data.MySQL
using (MySqlTransaction transaction = dbcon.BeginTransaction())
{
string assetName = asset.Name;
if (asset.Name.Length > 64)
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
assetName = asset.Name.Substring(0, 64);
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
m_log.WarnFormat(
"[XASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{
assetDescription = asset.Description.Substring(0, 64);
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
m_log.WarnFormat(
"[XASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
@@ -346,7 +346,7 @@ namespace OpenSim.Data.MySQL
cmd.ExecuteNonQuery();
}
}
catch (Exception e)
catch (Exception)
{
m_log.ErrorFormat(
"[XASSET MYSQL DB]: Failure updating access_time for asset {0} with name {1}",
@@ -397,45 +397,43 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
/// Check if the asset exists in the database
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuid">The asset UUID</param>
/// <returns>true if it exists, false otherwise.</returns>
public bool ExistsAsset(UUID uuid)
/// <param name="uuids">The asset UUID's</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public bool[] AssetsExist(UUID[] uuids)
{
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
if (uuids.Length == 0)
return new bool[0];
bool assetExists = false;
HashSet<UUID> exists = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format("SELECT ID FROM assets WHERE ID IN ({0})", ids);
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT ID FROM XAssetsMeta WHERE ID=?ID", dbcon))
using (MySqlCommand cmd = new MySqlCommand(sql, dbcon))
{
cmd.Parameters.AddWithValue("?ID", uuid.ToString());
try
using (MySqlDataReader dbReader = cmd.ExecuteReader())
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
while (dbReader.Read())
{
if (dbReader.Read())
{
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
assetExists = true;
}
UUID id = DBGuid.FromDB(dbReader["ID"]);
exists.Add(id);
}
}
catch (Exception e)
{
m_log.Error(string.Format("[XASSETS DB]: MySql failure fetching asset {0}", uuid), e);
}
}
}
}
return assetExists;
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exists.Contains(uuids[i]);
return results;
}

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -1,4 +1,4 @@
:VERSION 1 # --------------------------
:VERSION 1 # --------------------------
BEGIN;
@@ -32,3 +32,11 @@ ALTER TABLE `im_offline`
ADD KEY `FromID` (`FromID`);
COMMIT;
:VERSION 4 # --------------------------
BEGIN;
ALTER TABLE im_offline CONVERT TO CHARACTER SET utf8;
COMMIT;

View File

@@ -1,4 +1,4 @@
:VERSION 1 # --------------------------
:VERSION 1 # --------------------------
BEGIN;
@@ -21,3 +21,11 @@ BEGIN;
ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp;
COMMIT;
:VERSION 3 # --------------------------
BEGIN;
CREATE INDEX RegionID ON Presence(RegionID);
COMMIT;

View File

@@ -42,7 +42,7 @@ namespace OpenSim.Data.Null
// private string m_connectionString;
private Dictionary<uint, EstateSettings> m_knownEstates = new Dictionary<uint, EstateSettings>();
// private Dictionary<uint, EstateSettings> m_knownEstates = new Dictionary<uint, EstateSettings>();
private EstateSettings m_estate = null;
private EstateSettings GetEstate()

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Data.Null
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static NullPresenceData Instance;
public static NullPresenceData Instance;
Dictionary<UUID, PresenceData> m_presenceData = new Dictionary<UUID, PresenceData>();

View File

@@ -132,15 +132,33 @@ namespace OpenSim.Data.Null
return new List<SceneObjectGroup>();
}
Dictionary<UUID, double[,]> m_terrains = new Dictionary<UUID, double[,]>();
public void StoreTerrain(double[,] ter, UUID regionID)
Dictionary<UUID, TerrainData> m_terrains = new Dictionary<UUID, TerrainData>();
public void StoreTerrain(TerrainData ter, UUID regionID)
{
if (m_terrains.ContainsKey(regionID))
m_terrains.Remove(regionID);
m_terrains.Add(regionID, ter);
}
// Legacy. Just don't do this.
public void StoreTerrain(double[,] ter, UUID regionID)
{
TerrainData terrData = new HeightmapTerrainData(ter);
StoreTerrain(terrData, regionID);
}
// Legacy. Just don't do this.
// Returns 'null' if region not found
public double[,] LoadTerrain(UUID regionID)
{
if (m_terrains.ContainsKey(regionID))
{
return m_terrains[regionID].GetDoubles();
}
return null;
}
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
if (m_terrains.ContainsKey(regionID))
{

View File

@@ -38,7 +38,7 @@ using OpenSim.Data;
namespace OpenSim.Data.Null
{
public class NullXGroupData : NullGenericDataHandler, IXGroupData
public class NullXGroupData : IXGroupData
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -56,35 +56,31 @@ namespace OpenSim.Data.Null
return true;
}
public XGroup[] GetGroups(string field, string val)
public XGroup GetGroup(UUID groupID)
{
return GetGroups(new string[] { field }, new string[] { val });
XGroup group = null;
lock (m_groups)
m_groups.TryGetValue(groupID, out group);
return group;
}
public XGroup[] GetGroups(string[] fields, string[] vals)
public Dictionary<UUID, XGroup> GetGroups()
{
Dictionary<UUID, XGroup> groupsClone = new Dictionary<UUID, XGroup>();
lock (m_groups)
foreach (XGroup group in m_groups.Values)
groupsClone[group.groupID] = group.Clone();
return groupsClone;
}
public bool DeleteGroup(UUID groupID)
{
lock (m_groups)
{
List<XGroup> origGroups = Get<XGroup>(fields, vals, m_groups.Values.ToList());
return origGroups.Select(g => g.Clone()).ToArray();
}
}
public bool DeleteGroups(string field, string val)
{
return DeleteGroups(new string[] { field }, new string[] { val });
}
public bool DeleteGroups(string[] fields, string[] vals)
{
lock (m_groups)
{
XGroup[] groupsToDelete = GetGroups(fields, vals);
Array.ForEach(groupsToDelete, g => m_groups.Remove(g.groupID));
}
return true;
return m_groups.Remove(groupID);
}
}
}

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -166,18 +166,18 @@ namespace OpenSim.Data.PGSQL
";
string assetName = asset.Name;
if (asset.Name.Length > 64)
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
assetName = asset.Name.Substring(0, 64);
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
m_log.WarnFormat(
"[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{
assetDescription = asset.Description.Substring(0, 64);
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
m_log.WarnFormat(
"[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
@@ -231,17 +231,38 @@ namespace OpenSim.Data.PGSQL
// }
/// <summary>
/// Check if asset exist in m_database
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuid"></param>
/// <returns>true if exist.</returns>
override public bool ExistsAsset(UUID uuid)
/// <param name="uuids">The assets' IDs</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public override bool[] AssetsExist(UUID[] uuids)
{
if (GetAsset(uuid) != null)
if (uuids.Length == 0)
return new bool[0];
HashSet<UUID> exist = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format("SELECT id FROM assets WHERE id IN ({0})", ids);
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
return true;
conn.Open();
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
UUID id = DBGuid.FromDB(reader["id"]);
exist.Add(id);
}
}
}
return false;
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exist.Contains(uuids[i]);
return results;
}
/// <summary>

View File

@@ -51,7 +51,7 @@ namespace OpenSim.Data.PGSQL
}
public bool Delete(string principalID, string friend)
public override bool Delete(string principalID, string friend)
{
UUID princUUID = UUID.Zero;

View File

@@ -300,7 +300,6 @@ namespace OpenSim.Data.PGSQL
m_Realm, where);
cmd.Connection = conn;
cmd.CommandText = query;
//m_log.WarnFormat("[PGSQLGenericTable]: SELECT {0} WHERE {1}", m_Realm, where);
conn.Open();
@@ -308,6 +307,25 @@ namespace OpenSim.Data.PGSQL
}
}
public virtual T[] Get(string where, NpgsqlParameter parameter)
{
using (NpgsqlConnection conn = new NpgsqlConnection(m_ConnectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand())
{
string query = String.Format("SELECT * FROM {0} WHERE {1}",
m_Realm, where);
cmd.Connection = conn;
cmd.CommandText = query;
//m_log.WarnFormat("[PGSQLGenericTable]: SELECT {0} WHERE {1}", m_Realm, where);
cmd.Parameters.Add(parameter);
conn.Open();
return DoQuery(cmd);
}
}
public virtual bool Store(T row)
{
List<string> constraintFields = GetConstraints();

View File

@@ -83,11 +83,15 @@ namespace OpenSim.Data.PGSQL
public GroupData[] RetrieveGroups(string pattern)
{
if (string.IsNullOrEmpty(pattern)) // True for where clause
{
pattern = " true ORDER BY lower(\"Name\") LIMIT 100";
return m_Groups.Get(pattern);
}
else
pattern = string.Format(" lower(\"Name\") LIKE lower('%{0}%') ORDER BY lower(\"Name\") LIMIT 100", pattern);
return m_Groups.Get(pattern);
{
pattern = " lower(\"Name\") LIKE lower('%:pattern%') ORDER BY lower(\"Name\") LIMIT 100";
return m_Groups.Get(pattern, new NpgsqlParameter("pattern", pattern));
}
}
public bool DeleteGroup(UUID groupID)

View File

@@ -46,6 +46,7 @@ namespace OpenSim.Data.PGSQL
public class PGSQLSimulationData : ISimulationDataStore
{
private const string _migrationStore = "RegionStore";
private const string LogHeader = "[REGION DB PGSQL]";
// private static FileSystemDataStore Instance = new FileSystemDataStore();
private static readonly ILog _Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -523,44 +524,54 @@ namespace OpenSim.Data.PGSQL
/// <returns></returns>
public double[,] LoadTerrain(UUID regionID)
{
double[,] terrain = new double[(int)Constants.RegionSize, (int)Constants.RegionSize];
terrain.Initialize();
double[,] ret = null;
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
if (terrData != null)
ret = terrData.GetDoubles();
return ret;
}
// Returns 'null' if region not found
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
string sql = @"select ""RegionUUID"", ""Revision"", ""Heightfield"" from terrain
where ""RegionUUID"" = :RegionUUID order by ""Revision"" desc limit 1; ";
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
// PGSqlParameter param = new PGSqlParameter();
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
conn.Open();
using (NpgsqlDataReader reader = cmd.ExecuteReader())
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
int rev;
if (reader.Read())
// PGSqlParameter param = new PGSqlParameter();
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
conn.Open();
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
MemoryStream str = new MemoryStream((byte[])reader["Heightfield"]);
BinaryReader br = new BinaryReader(str);
for (int x = 0; x < (int)Constants.RegionSize; x++)
int rev;
if (reader.Read())
{
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
terrain[x, y] = br.ReadDouble();
}
rev = Convert.ToInt32(reader["Revision"]);
byte[] blob = (byte[])reader["Heightfield"];
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
}
rev = (int)reader["Revision"];
else
{
_Log.Info("[REGION DB]: No terrain found for region");
return null;
}
_Log.Info("[REGION DB]: Loaded terrain revision r" + rev);
}
else
{
_Log.Info("[REGION DB]: No terrain found for region");
return null;
}
_Log.Info("[REGION DB]: Loaded terrain revision r" + rev);
}
}
return terrain;
return terrData;
}
// Legacy entry point for when terrain was always a 256x256 heightmap
public void StoreTerrain(double[,] terrain, UUID regionID)
{
StoreTerrain(new HeightmapTerrainData(terrain), regionID);
}
/// <summary>
@@ -568,35 +579,43 @@ namespace OpenSim.Data.PGSQL
/// </summary>
/// <param name="terrain">terrain map data.</param>
/// <param name="regionID">regionID.</param>
public void StoreTerrain(double[,] terrain, UUID regionID)
public void StoreTerrain(TerrainData terrData, UUID regionID)
{
int revision = Util.UnixTimeSinceEpoch();
//Delete old terrain map
string sql = @"delete from terrain where ""RegionUUID""=:RegionUUID";
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
conn.Open();
cmd.ExecuteNonQuery();
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
conn.Open();
cmd.ExecuteNonQuery();
_Log.InfoFormat("{0} Deleted terrain revision id = {1}", LogHeader, regionID);
}
}
_Log.Info("[REGION DB]: Deleted terrain revision r " + revision);
int terrainDBRevision;
Array terrainDBblob;
terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
sql = @"insert into terrain(""RegionUUID"", ""Revision"", ""Heightfield"") values(:RegionUUID, :Revision, :Heightfield)";
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
cmd.Parameters.Add(_Database.CreateParameter("Revision", revision));
cmd.Parameters.Add(_Database.CreateParameter("Heightfield", serializeTerrain(terrain)));
conn.Open();
cmd.ExecuteNonQuery();
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("RegionUUID", regionID));
cmd.Parameters.Add(_Database.CreateParameter("Revision", terrainDBRevision));
cmd.Parameters.Add(_Database.CreateParameter("Heightfield", terrainDBblob));
conn.Open();
cmd.ExecuteNonQuery();
_Log.InfoFormat("{0} Stored terrain id = {1}, terrainSize = <{2},{3}>",
LogHeader, regionID, terrData.SizeX, terrData.SizeY);
}
}
_Log.Info("[REGION DB]: Stored terrain revision r " + revision);
}
/// <summary>
@@ -1349,30 +1368,6 @@ namespace OpenSim.Data.PGSQL
#region Private Methods
/// <summary>
/// Serializes the terrain data for storage in DB.
/// </summary>
/// <param name="val">terrain data</param>
/// <returns></returns>
private static Array serializeTerrain(double[,] val)
{
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double));
BinaryWriter bw = new BinaryWriter(str);
// TODO: COMPATIBILITY - Add byte-order conversions
for (int x = 0; x < (int)Constants.RegionSize; x++)
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
double height = val[x, y];
if (height == 0.0)
height = double.Epsilon;
bw.Write(height);
}
return str.ToArray();
}
/// <summary>
/// Stores new regionsettings.
/// </summary>

View File

@@ -406,6 +406,43 @@ namespace OpenSim.Data.PGSQL
return exists;
}
/// <summary>
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuids">The assets' IDs</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public bool[] AssetsExist(UUID[] uuids)
{
if (uuids.Length == 0)
return new bool[0];
HashSet<UUID> exist = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format(@"SELECT ""ID"" FROM XAssetsMeta WHERE ""ID"" IN ({0})", ids);
using (NpgsqlConnection conn = new NpgsqlConnection(m_connectionString))
{
conn.Open();
using (NpgsqlCommand cmd = new NpgsqlCommand(sql, conn))
{
using (NpgsqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
UUID id = DBGuid.FromDB(reader["id"]);
exist.Add(id);
}
}
}
}
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exist.Contains(uuids[i]);
return results;
}
/// <summary>
/// Check if the asset exists in the database
/// </summary>

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.7.6.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -134,25 +134,25 @@ namespace OpenSim.Data.SQLite
override public void StoreAsset(AssetBase asset)
{
string assetName = asset.Name;
if (asset.Name.Length > 64)
if (asset.Name.Length > AssetBase.MAX_ASSET_NAME)
{
assetName = asset.Name.Substring(0, 64);
assetName = asset.Name.Substring(0, AssetBase.MAX_ASSET_NAME);
m_log.WarnFormat(
"[ASSET DB]: Name '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Name, asset.ID, asset.Name.Length, assetName.Length);
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
if (asset.Description.Length > AssetBase.MAX_ASSET_DESC)
{
assetDescription = asset.Description.Substring(0, 64);
assetDescription = asset.Description.Substring(0, AssetBase.MAX_ASSET_DESC);
m_log.WarnFormat(
"[ASSET DB]: Description '{0}' for asset {1} truncated from {2} to {3} characters on add",
asset.Description, asset.ID, asset.Description.Length, assetDescription.Length);
}
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
if (ExistsAsset(asset.FullID))
if (AssetsExist(new[] { asset.FullID })[0])
{
//LogAssetLoad(asset);
@@ -214,32 +214,39 @@ namespace OpenSim.Data.SQLite
// }
/// <summary>
/// Check if an asset exist in database
/// Check if the assets exist in the database.
/// </summary>
/// <param name="uuid">The asset UUID</param>
/// <returns>True if exist, or false.</returns>
override public bool ExistsAsset(UUID uuid)
/// <param name="uuids">The assets' IDs</param>
/// <returns>For each asset: true if it exists, false otherwise</returns>
public override bool[] AssetsExist(UUID[] uuids)
{
lock (this)
if (uuids.Length == 0)
return new bool[0];
HashSet<UUID> exist = new HashSet<UUID>();
string ids = "'" + string.Join("','", uuids) + "'";
string sql = string.Format("select UUID from assets where UUID in ({0})", ids);
lock (this)
{
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
using (SqliteCommand cmd = new SqliteCommand(sql, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString()));
using (IDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
while (reader.Read())
{
reader.Close();
return true;
}
else
{
reader.Close();
return false;
UUID id = new UUID((string)reader["UUID"]);
exist.Add(id);
}
}
}
}
bool[] results = new bool[uuids.Length];
for (int i = 0; i < uuids.Length; i++)
results[i] = exist.Contains(uuids[i]);
return results;
}
/// <summary>

View File

@@ -67,7 +67,7 @@ namespace OpenSim.Data.SQLite
return Delete(principalID.ToString(), friend);
}
public bool Delete(string principalID, string friend)
public override bool Delete(string principalID, string friend)
{
using (SqliteCommand cmd = new SqliteCommand())
{

View File

@@ -51,6 +51,7 @@ namespace OpenSim.Data.SQLite
public class SQLiteSimulationData : ISimulationDataStore
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly string LogHeader = "[REGION DB SQLLITE]";
private const string primSelect = "select * from prims";
private const string shapeSelect = "select * from primshapes";
@@ -819,45 +820,44 @@ namespace OpenSim.Data.SQLite
prim.Inventory.RestoreInventoryItems(inventory);
}
// Legacy entry point for when terrain was always a 256x256 hieghtmap
public void StoreTerrain(double[,] ter, UUID regionID)
{
StoreTerrain(new HeightmapTerrainData(ter), regionID);
}
/// <summary>
/// Store a terrain revision in region storage
/// </summary>
/// <param name="ter">terrain heightfield</param>
/// <param name="regionID">region UUID</param>
public void StoreTerrain(double[,] ter, UUID regionID)
public void StoreTerrain(TerrainData terrData, UUID regionID)
{
lock (ds)
{
int revision = Util.UnixTimeSinceEpoch();
// This is added to get rid of the infinitely growing
// terrain databases which negatively impact on SQLite
// over time. Before reenabling this feature there
// needs to be a limitter put on the number of
// revisions in the database, as this old
// implementation is a DOS attack waiting to happen.
using (
SqliteCommand cmd =
new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision <= :Revision",
m_conn))
SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID", m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
cmd.ExecuteNonQuery();
}
// the following is an work around for .NET. The perf
// issues associated with it aren't as bad as you think.
m_log.Debug("[SQLITE REGION DB]: Storing terrain revision r" + revision.ToString());
String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" +
" values(:RegionUUID, :Revision, :Heightfield)";
int terrainDBRevision;
Array terrainDBblob;
terrData.GetDatabaseBlob(out terrainDBRevision, out terrainDBblob);
m_log.DebugFormat("{0} Storing terrain revision r {1}", LogHeader, terrainDBRevision);
using (SqliteCommand cmd = new SqliteCommand(sql, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
cmd.Parameters.Add(new SqliteParameter(":Revision", terrainDBRevision));
cmd.Parameters.Add(new SqliteParameter(":Heightfield", terrainDBblob));
cmd.ExecuteNonQuery();
}
}
@@ -870,11 +870,20 @@ namespace OpenSim.Data.SQLite
/// <returns>Heightfield data</returns>
public double[,] LoadTerrain(UUID regionID)
{
double[,] ret = null;
TerrainData terrData = LoadTerrain(regionID, (int)Constants.RegionSize, (int)Constants.RegionSize, (int)Constants.RegionHeight);
if (terrData != null)
ret = terrData.GetDoubles();
return ret;
}
// Returns 'null' if region not found
public TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ)
{
TerrainData terrData = null;
lock (ds)
{
double[,] terret = new double[(int)Constants.RegionSize, (int)Constants.RegionSize];
terret.Initialize();
String sql = "select RegionUUID, Revision, Heightfield from terrain" +
" where RegionUUID=:RegionUUID order by Revision desc";
@@ -887,21 +896,9 @@ namespace OpenSim.Data.SQLite
int rev = 0;
if (row.Read())
{
// TODO: put this into a function
using (MemoryStream str = new MemoryStream((byte[])row["Heightfield"]))
{
using (BinaryReader br = new BinaryReader(str))
{
for (int x = 0; x < (int)Constants.RegionSize; x++)
{
for (int y = 0; y < (int)Constants.RegionSize; y++)
{
terret[x, y] = br.ReadDouble();
}
}
}
}
rev = Convert.ToInt32(row["Revision"]);
byte[] blob = (byte[])row["Heightfield"];
terrData = TerrainData.CreateFromDatabaseBlobFactory(pSizeX, pSizeY, pSizeZ, rev, blob);
}
else
{
@@ -912,8 +909,8 @@ namespace OpenSim.Data.SQLite
m_log.Debug("[SQLITE REGION DB]: Loaded terrain revision r" + rev.ToString());
}
}
return terret;
}
return terrData;
}
public void RemoveLandObject(UUID globalID)
@@ -1608,7 +1605,7 @@ namespace OpenSim.Data.SQLite
prim.SitName = (String)row["SitName"];
prim.TouchName = (String)row["TouchName"];
// permissions
prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]);
prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]);
prim.CreatorIdentification = (String)row["CreatorID"];
prim.OwnerID = new UUID((String)row["OwnerID"]);
prim.GroupID = new UUID((String)row["GroupID"]);
@@ -2016,40 +2013,6 @@ namespace OpenSim.Data.SQLite
return entry;
}
/// <summary>
///
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
private static Array serializeTerrain(double[,] val)
{
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double));
BinaryWriter bw = new BinaryWriter(str);
// TODO: COMPATIBILITY - Add byte-order conversions
for (int x = 0; x < (int)Constants.RegionSize; x++)
for (int y = 0; y < (int)Constants.RegionSize; y++)
bw.Write(val[x, y]);
return str.ToArray();
}
// private void fillTerrainRow(DataRow row, UUID regionUUID, int rev, double[,] val)
// {
// row["RegionUUID"] = regionUUID;
// row["Revision"] = rev;
// MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize)*sizeof (double));
// BinaryWriter bw = new BinaryWriter(str);
// // TODO: COMPATIBILITY - Add byte-order conversions
// for (int x = 0; x < (int)Constants.RegionSize; x++)
// for (int y = 0; y < (int)Constants.RegionSize; y++)
// bw.Write(val[x, y]);
// row["Heightfield"] = str.ToArray();
// }
/// <summary>
///
/// </summary>
@@ -2071,7 +2034,7 @@ namespace OpenSim.Data.SQLite
row["SitName"] = prim.SitName;
row["TouchName"] = prim.TouchName;
// permissions
row["ObjectFlags"] = prim.ObjectFlags;
row["ObjectFlags"] = (uint)prim.Flags;
row["CreatorID"] = prim.CreatorIdentification.ToString();
row["OwnerID"] = prim.OwnerID.ToString();
row["GroupID"] = prim.GroupID.ToString();

View File

@@ -50,7 +50,6 @@ namespace OpenSim.Data.SQLite
private SqliteConnection m_connection;
private string m_connectionString;
private FieldInfo[] m_Fields;
private Dictionary<string, FieldInfo> m_FieldMap =
new Dictionary<string, FieldInfo>();
@@ -585,9 +584,6 @@ namespace OpenSim.Data.SQLite
}
if(reader != null && reader.Read())
{
m_log.DebugFormat("[PROFILES_DATA]" +
": Getting data for {0}.", props.UserId);
props.WebUrl = (string)reader["profileURL"];
UUID.TryParse((string)reader["profileImage"], out props.ImageId);
props.AboutText = (string)reader["profileAboutText"];
@@ -602,9 +598,6 @@ namespace OpenSim.Data.SQLite
}
else
{
m_log.DebugFormat("[PROFILES_DATA]" +
": No data for {0}", props.UserId);
props.WebUrl = string.Empty;
props.ImageId = UUID.Zero;
props.AboutText = string.Empty;

View File

@@ -107,10 +107,11 @@ namespace OpenSim.Data.Tests
public void T001_LoadEmpty()
{
TestHelpers.InMethod();
Assert.That(m_db.ExistsAsset(uuid1), Is.False);
Assert.That(m_db.ExistsAsset(uuid2), Is.False);
Assert.That(m_db.ExistsAsset(uuid3), Is.False);
bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 });
Assert.IsFalse(exist[0]);
Assert.IsFalse(exist[1]);
Assert.IsFalse(exist[2]);
}
[Test]
@@ -159,9 +160,10 @@ namespace OpenSim.Data.Tests
AssetBase a3b = m_db.GetAsset(uuid3);
Assert.That(a3b, Constraints.PropertyCompareConstraint(a3a));
Assert.That(m_db.ExistsAsset(uuid1), Is.True);
Assert.That(m_db.ExistsAsset(uuid2), Is.True);
Assert.That(m_db.ExistsAsset(uuid3), Is.True);
bool[] exist = m_db.AssetsExist(new[] { uuid1, uuid2, uuid3 });
Assert.IsTrue(exist[0]);
Assert.IsTrue(exist[1]);
Assert.IsTrue(exist[2]);
List<AssetMetadata> metadatas = m_db.FetchAssetMetadataSet(0, 1000);

View File

@@ -99,6 +99,9 @@ namespace OpenSim.Data.Tests
if (Directory.Exists("/proc/ppc64") || Directory.Exists("/proc/dasd"))
Assert.Ignore();
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
// for SQLite, if no explicit conn string is specified, use a temp file
if (String.IsNullOrEmpty(m_connStr))
{

View File

@@ -321,6 +321,8 @@ namespace OpenSim.Framework
Mac = args["mac"].AsString();
if (args["id0"] != null)
Id0 = args["id0"].AsString();
if (args["teleport_flags"] != null)
teleportFlags = args["teleport_flags"].AsUInteger();
if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos);

View File

@@ -132,6 +132,11 @@ namespace OpenSim.Framework
return base.Equals(obj);
}
public override int GetHashCode()
{
return base.GetHashCode();
}
public override string ToString()
{
return "AnimID=" + AnimID.ToString()

View File

@@ -59,4 +59,4 @@ using System.Runtime.InteropServices;
// Revision
//
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -50,6 +50,9 @@ namespace OpenSim.Framework
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static readonly int MAX_ASSET_NAME = 64;
public static readonly int MAX_ASSET_DESC = 64;
/// <summary>
/// Data of the Asset
/// </summary>

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]

View File

@@ -98,11 +98,11 @@ namespace OpenSim.Framework
/// </remarks>
public bool Contains(T item)
{
if (m_queue.Count < 1 && m_pqueue.Count < 1)
return false;
lock (m_queueSync)
{
if (m_queue.Count < 1 && m_pqueue.Count < 1)
return false;
if (m_pqueue.Contains(item))
return true;
return m_queue.Contains(item);
@@ -112,12 +112,10 @@ namespace OpenSim.Framework
/// <summary>
/// Return a count of the number of requests on this queue.
/// </summary>
/// <remarks>
/// This method is not thread-safe. Do not rely on the result without consistent external locking.
/// </remarks>
public int Count()
{
return m_queue.Count + m_pqueue.Count;
lock (m_queueSync)
return m_queue.Count + m_pqueue.Count;
}
/// <summary>
@@ -128,11 +126,11 @@ namespace OpenSim.Framework
/// </remarks>
public T[] GetQueueArray()
{
if (m_queue.Count < 1 && m_pqueue.Count < 1)
return new T[0];
lock (m_queueSync)
{
if (m_queue.Count < 1 && m_pqueue.Count < 1)
return new T[0];
return m_queue.ToArray();
}
}

View File

@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -35,6 +35,8 @@ using System.Threading;
using System.Web;
using log4net;
using OpenSim.Framework.ServiceAuth;
namespace OpenSim.Framework.Communications
{
/// <summary>
@@ -298,6 +300,14 @@ namespace OpenSim.Framework.Communications
/// Perform a synchronous request
/// </summary>
public Stream Request()
{
return Request(null);
}
/// <summary>
/// Perform a synchronous request
/// </summary>
public Stream Request(IServiceAuth auth)
{
lock (_lock)
{
@@ -307,6 +317,8 @@ namespace OpenSim.Framework.Communications
_request.Timeout = 200000;
_request.Method = RequestMethod;
_asyncException = null;
if (auth != null)
auth.AddAuthorization(_request.Headers);
// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
try
@@ -318,12 +330,12 @@ namespace OpenSim.Framework.Communications
HttpWebResponse errorResponse = e.Response as HttpWebResponse;
if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
{
m_log.Warn("[REST CLIENT] Resource not found (404)");
// This is often benign. E.g., requesting a missing asset will return 404.
m_log.DebugFormat("[REST CLIENT] Resource not found (404): {0}", _request.Address.ToString());
}
else
{
m_log.Error("[REST CLIENT] Error fetching resource from server " + _request.Address.ToString());
m_log.Debug(e.ToString());
m_log.Error(string.Format("[REST CLIENT] Error fetching resource from server: {0} ", _request.Address.ToString()), e);
}
return null;
@@ -358,7 +370,7 @@ namespace OpenSim.Framework.Communications
}
}
public Stream Request(Stream src)
public Stream Request(Stream src, IServiceAuth auth)
{
_request = (HttpWebRequest) WebRequest.Create(buildUri());
_request.KeepAlive = false;
@@ -367,6 +379,8 @@ namespace OpenSim.Framework.Communications
_request.Method = RequestMethod;
_asyncException = null;
_request.ContentLength = src.Length;
if (auth != null)
auth.AddAuthorization(_request.Headers);
m_log.InfoFormat("[REST]: Request Length {0}", _request.ContentLength);
m_log.InfoFormat("[REST]: Sending Web Request {0}", buildUri());
@@ -384,7 +398,22 @@ namespace OpenSim.Framework.Communications
length = src.Read(buf, 0, 1024);
}
_response = (HttpWebResponse) _request.GetResponse();
try
{
_response = (HttpWebResponse)_request.GetResponse();
}
catch (WebException e)
{
m_log.WarnFormat("[REST]: Request {0} {1} failed with status {2} and message {3}",
RequestMethod, _request.RequestUri, e.Status, e.Message);
}
catch (Exception e)
{
m_log.WarnFormat(
"[REST]: Request {0} {1} failed with exception {2} {3}",
RequestMethod, _request.RequestUri, e.Message, e.StackTrace);
}
// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
@@ -423,7 +452,7 @@ namespace OpenSim.Framework.Communications
try
{
// Perform the operation; if sucessful set the result
Stream s = Request();
Stream s = Request(null);
ar.SetAsCompleted(s, false);
}
catch (Exception e)

View File

@@ -1,123 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Net;
using System.Reflection;
using System.Text;
using log4net;
using OpenSim.Framework.Configuration.XML;
namespace OpenSim.Framework.Configuration.HTTP
{
public class HTTPConfiguration : IGenericConfig
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private RemoteConfigSettings remoteConfigSettings;
private XmlConfiguration xmlConfig;
private string configFileName = String.Empty;
public HTTPConfiguration()
{
remoteConfigSettings = new RemoteConfigSettings("remoteconfig.xml");
xmlConfig = new XmlConfiguration();
}
public void SetFileName(string fileName)
{
configFileName = fileName;
}
public void LoadData()
{
try
{
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
HttpWebRequest request =
(HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (Stream resStream = response.GetResponseStream())
{
string tempString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Util.UTF8.GetString(buf, 0, count);
sb.Append(tempString);
}
}
while (count > 0);
LoadDataFromString(sb.ToString());
}
}
}
catch (WebException)
{
m_log.Warn("Unable to connect to remote configuration file (" +
remoteConfigSettings.baseConfigURL + configFileName +
"). Creating local file instead.");
xmlConfig.SetFileName(configFileName);
xmlConfig.LoadData();
}
}
public void LoadDataFromString(string data)
{
xmlConfig.LoadDataFromString(data);
}
public string GetAttribute(string attributeName)
{
return xmlConfig.GetAttribute(attributeName);
}
public bool SetAttribute(string attributeName, string attributeValue)
{
return true;
}
public void Commit()
{
}
public void Close()
{
}
}
}

View File

@@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Framework.Configuration.HTTP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://opensimulator.org")]
[assembly: AssemblyProduct("OpenSim")]
[assembly: AssemblyCopyright("OpenSimulator develoeprs")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("cb78b672-d000-4f93-88f9-dae151cc0061")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]

View File

@@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenSim.Framework.Configuration.XML")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("http://opensimulator.org")]
[assembly: AssemblyProduct("OpenSim")]
[assembly: AssemblyCopyright("OpenSimulator developers")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("eeb880df-0112-4c3d-87ed-b2108d614c55")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]

View File

@@ -1,141 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Xml;
namespace OpenSim.Framework.Configuration.XML
{
public class XmlConfiguration : IGenericConfig
{
private XmlDocument doc;
private XmlNode rootNode;
private XmlNode configNode;
private string fileName;
private bool createdFile = false;
public void SetFileName(string file)
{
fileName = file;
}
private void LoadDataToClass()
{
rootNode = doc.SelectSingleNode("Root");
if (null == rootNode)
throw new Exception("Error: Invalid .xml File. Missing <Root>");
configNode = rootNode.SelectSingleNode("Config");
if (null == configNode)
throw new Exception("Error: Invalid .xml File. <Root> should contain a <Config>");
}
public void LoadData()
{
lock (this)
{
doc = new XmlDocument();
if (File.Exists(fileName))
{
XmlTextReader reader = new XmlTextReader(fileName);
reader.WhitespaceHandling = WhitespaceHandling.None;
doc.Load(reader);
reader.Close();
}
else
{
createdFile = true;
rootNode = doc.CreateNode(XmlNodeType.Element, "Root", String.Empty);
doc.AppendChild(rootNode);
configNode = doc.CreateNode(XmlNodeType.Element, "Config", String.Empty);
rootNode.AppendChild(configNode);
}
LoadDataToClass();
if (createdFile)
{
Commit();
}
}
}
public void LoadDataFromString(string data)
{
doc = new XmlDocument();
doc.LoadXml(data);
LoadDataToClass();
}
public string GetAttribute(string attributeName)
{
string result = null;
if (configNode.Attributes[attributeName] != null)
{
result = ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value;
}
return result;
}
public bool SetAttribute(string attributeName, string attributeValue)
{
if (configNode.Attributes[attributeName] != null)
{
((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
}
else
{
XmlAttribute attri;
attri = doc.CreateAttribute(attributeName);
attri.Value = attributeValue;
configNode.Attributes.Append(attri);
}
return true;
}
public void Commit()
{
if (string.IsNullOrEmpty(fileName))
return;
if (!Directory.Exists(Util.configDir()))
{
Directory.CreateDirectory(Util.configDir());
}
doc.Save(fileName);
}
public void Close()
{
configNode = null;
rootNode = null;
doc = null;
}
}
}

View File

@@ -1,530 +0,0 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Net;
using System.Reflection;
using System.Xml;
using log4net;
using OpenMetaverse;
//using OpenSim.Framework.Console;
namespace OpenSim.Framework
{
public class ConfigurationMember
{
#region Delegates
public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result);
public delegate void ConfigurationOptionsLoad();
#endregion
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private int cE = 0;
private string configurationDescription = String.Empty;
private string configurationFilename = String.Empty;
private XmlNode configurationFromXMLNode = null;
private List<ConfigurationOption> configurationOptions = new List<ConfigurationOption>();
private IGenericConfig configurationPlugin = null;
/// <summary>
/// This is the default configuration DLL loaded
/// </summary>
private string configurationPluginFilename = "OpenSim.Framework.Configuration.XML.dll";
private ConfigurationOptionsLoad loadFunction;
private ConfigurationOptionResult resultFunction;
private bool useConsoleToPromptOnError = true;
public ConfigurationMember(string configuration_filename, string configuration_description,
ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function, bool use_console_to_prompt_on_error)
{
configurationFilename = configuration_filename;
configurationDescription = configuration_description;
loadFunction = load_function;
resultFunction = result_function;
useConsoleToPromptOnError = use_console_to_prompt_on_error;
}
public ConfigurationMember(XmlNode configuration_xml, string configuration_description,
ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function, bool use_console_to_prompt_on_error)
{
configurationFilename = String.Empty;
configurationFromXMLNode = configuration_xml;
configurationDescription = configuration_description;
loadFunction = load_function;
resultFunction = result_function;
useConsoleToPromptOnError = use_console_to_prompt_on_error;
}
public void setConfigurationFilename(string filename)
{
configurationFilename = filename;
}
public void setConfigurationDescription(string desc)
{
configurationDescription = desc;
}
public void setConfigurationResultFunction(ConfigurationOptionResult result)
{
resultFunction = result;
}
public void forceConfigurationPluginLibrary(string dll_filename)
{
configurationPluginFilename = dll_filename;
}
private void checkAndAddConfigOption(ConfigurationOption option)
{
if ((option.configurationKey != String.Empty && option.configurationQuestion != String.Empty) ||
(option.configurationKey != String.Empty && option.configurationUseDefaultNoPrompt))
{
if (!configurationOptions.Contains(option))
{
configurationOptions.Add(option);
}
}
else
{
m_log.Info(
"Required fields for adding a configuration option is invalid. Will not add this option (" +
option.configurationKey + ")");
}
}
public void addConfigurationOption(string configuration_key,
ConfigurationOption.ConfigurationTypes configuration_type,
string configuration_question, string configuration_default,
bool use_default_no_prompt)
{
ConfigurationOption configOption = new ConfigurationOption();
configOption.configurationKey = configuration_key;
configOption.configurationQuestion = configuration_question;
configOption.configurationDefault = configuration_default;
configOption.configurationType = configuration_type;
configOption.configurationUseDefaultNoPrompt = use_default_no_prompt;
configOption.shouldIBeAsked = null; //Assumes true, I can ask whenever
checkAndAddConfigOption(configOption);
}
public void addConfigurationOption(string configuration_key,
ConfigurationOption.ConfigurationTypes configuration_type,
string configuration_question, string configuration_default,
bool use_default_no_prompt,
ConfigurationOption.ConfigurationOptionShouldBeAsked shouldIBeAskedDelegate)
{
ConfigurationOption configOption = new ConfigurationOption();
configOption.configurationKey = configuration_key;
configOption.configurationQuestion = configuration_question;
configOption.configurationDefault = configuration_default;
configOption.configurationType = configuration_type;
configOption.configurationUseDefaultNoPrompt = use_default_no_prompt;
configOption.shouldIBeAsked = shouldIBeAskedDelegate;
checkAndAddConfigOption(configOption);
}
// TEMP - REMOVE
public void performConfigurationRetrieve()
{
if (cE > 1)
m_log.Error("READING CONFIGURATION COUT: " + cE.ToString());
configurationPlugin = LoadConfigDll(configurationPluginFilename);
configurationOptions.Clear();
if (loadFunction == null)
{
m_log.Error("Load Function for '" + configurationDescription +
"' is null. Refusing to run configuration.");
return;
}
if (resultFunction == null)
{
m_log.Error("Result Function for '" + configurationDescription +
"' is null. Refusing to run configuration.");
return;
}
//m_log.Debug("[CONFIG]: Calling Configuration Load Function...");
loadFunction();
if (configurationOptions.Count <= 0)
{
m_log.Error("[CONFIG]: No configuration options were specified for '" + configurationOptions +
"'. Refusing to continue configuration.");
return;
}
bool useFile = true;
if (configurationPlugin == null)
{
m_log.Error("[CONFIG]: Configuration Plugin NOT LOADED!");
return;
}
if (configurationFilename.Trim() != String.Empty)
{
configurationPlugin.SetFileName(configurationFilename);
try
{
configurationPlugin.LoadData();
useFile = true;
}
catch (XmlException e)
{
m_log.WarnFormat("[CONFIG] Not using {0}: {1}",
configurationFilename,
e.Message.ToString());
//m_log.Error("Error loading " + configurationFilename + ": " + e.ToString());
useFile = false;
}
}
else
{
if (configurationFromXMLNode != null)
{
m_log.Info("Loading from XML Node, will not save to the file");
configurationPlugin.LoadDataFromString(configurationFromXMLNode.OuterXml);
}
m_log.Info("XML Configuration Filename is not valid; will not save to the file.");
useFile = false;
}
foreach (ConfigurationOption configOption in configurationOptions)
{
bool convertSuccess = false;
object return_result = null;
string errorMessage = String.Empty;
bool ignoreNextFromConfig = false;
while (convertSuccess == false)
{
string console_result = String.Empty;
string attribute = null;
if (useFile || configurationFromXMLNode != null)
{
if (!ignoreNextFromConfig)
{
attribute = configurationPlugin.GetAttribute(configOption.configurationKey);
}
else
{
ignoreNextFromConfig = false;
}
}
if (attribute == null)
{
if (configOption.configurationUseDefaultNoPrompt || useConsoleToPromptOnError == false)
{
console_result = configOption.configurationDefault;
}
else
{
if ((configOption.shouldIBeAsked != null &&
configOption.shouldIBeAsked(configOption.configurationKey)) ||
configOption.shouldIBeAsked == null)
{
if (configurationDescription.Trim() != String.Empty)
{
console_result =
MainConsole.Instance.CmdPrompt(
configurationDescription + ": " + configOption.configurationQuestion,
configOption.configurationDefault);
}
else
{
console_result =
MainConsole.Instance.CmdPrompt(configOption.configurationQuestion,
configOption.configurationDefault);
}
}
else
{
//Dont Ask! Just use default
console_result = configOption.configurationDefault;
}
}
}
else
{
console_result = attribute;
}
// if the first character is a "$", assume it's the name
// of an environment variable and substitute with the value of that variable
if (console_result.StartsWith("$"))
console_result = Environment.GetEnvironmentVariable(console_result.Substring(1));
switch (configOption.configurationType)
{
case ConfigurationOption.ConfigurationTypes.TYPE_STRING:
return_result = console_result;
convertSuccess = true;
break;
case ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY:
if (console_result.Length > 0)
{
return_result = console_result;
convertSuccess = true;
}
errorMessage = "a string that is not empty";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN:
bool boolResult;
if (Boolean.TryParse(console_result, out boolResult))
{
convertSuccess = true;
return_result = boolResult;
}
errorMessage = "'true' or 'false' (Boolean)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_BYTE:
byte byteResult;
if (Byte.TryParse(console_result, out byteResult))
{
convertSuccess = true;
return_result = byteResult;
}
errorMessage = "a byte (Byte)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_CHARACTER:
char charResult;
if (Char.TryParse(console_result, out charResult))
{
convertSuccess = true;
return_result = charResult;
}
errorMessage = "a character (Char)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_INT16:
short shortResult;
if (Int16.TryParse(console_result, out shortResult))
{
convertSuccess = true;
return_result = shortResult;
}
errorMessage = "a signed 32 bit integer (short)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_INT32:
int intResult;
if (Int32.TryParse(console_result, out intResult))
{
convertSuccess = true;
return_result = intResult;
}
errorMessage = "a signed 32 bit integer (int)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_INT64:
long longResult;
if (Int64.TryParse(console_result, out longResult))
{
convertSuccess = true;
return_result = longResult;
}
errorMessage = "a signed 32 bit integer (long)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS:
IPAddress ipAddressResult;
if (IPAddress.TryParse(console_result, out ipAddressResult))
{
convertSuccess = true;
return_result = ipAddressResult;
}
errorMessage = "an IP Address (IPAddress)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_UUID:
UUID uuidResult;
if (UUID.TryParse(console_result, out uuidResult))
{
convertSuccess = true;
return_result = uuidResult;
}
errorMessage = "a UUID (UUID)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_UUID_NULL_FREE:
UUID uuidResult2;
if (UUID.TryParse(console_result, out uuidResult2))
{
convertSuccess = true;
if (uuidResult2 == UUID.Zero)
uuidResult2 = UUID.Random();
return_result = uuidResult2;
}
errorMessage = "a non-null UUID (UUID)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_Vector3:
Vector3 vectorResult;
if (Vector3.TryParse(console_result, out vectorResult))
{
convertSuccess = true;
return_result = vectorResult;
}
errorMessage = "a vector (Vector3)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_UINT16:
ushort ushortResult;
if (UInt16.TryParse(console_result, out ushortResult))
{
convertSuccess = true;
return_result = ushortResult;
}
errorMessage = "an unsigned 16 bit integer (ushort)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_UINT32:
uint uintResult;
if (UInt32.TryParse(console_result, out uintResult))
{
convertSuccess = true;
return_result = uintResult;
}
errorMessage = "an unsigned 32 bit integer (uint)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_UINT64:
ulong ulongResult;
if (UInt64.TryParse(console_result, out ulongResult))
{
convertSuccess = true;
return_result = ulongResult;
}
errorMessage = "an unsigned 64 bit integer (ulong)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT:
float floatResult;
if (
float.TryParse(console_result, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, Culture.NumberFormatInfo,
out floatResult))
{
convertSuccess = true;
return_result = floatResult;
}
errorMessage = "a single-precision floating point number (float)";
break;
case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE:
double doubleResult;
if (
Double.TryParse(console_result, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, Culture.NumberFormatInfo,
out doubleResult))
{
convertSuccess = true;
return_result = doubleResult;
}
errorMessage = "an double-precision floating point number (double)";
break;
}
if (convertSuccess)
{
if (useFile)
{
configurationPlugin.SetAttribute(configOption.configurationKey, console_result);
}
if (!resultFunction(configOption.configurationKey, return_result))
{
m_log.Info(
"The handler for the last configuration option denied that input, please try again.");
convertSuccess = false;
ignoreNextFromConfig = true;
}
}
else
{
if (configOption.configurationUseDefaultNoPrompt)
{
m_log.Error(string.Format(
"[CONFIG]: [{3}]:[{1}] is not valid default for parameter [{0}].\nThe configuration result must be parsable to {2}.\n",
configOption.configurationKey, console_result, errorMessage,
configurationFilename));
convertSuccess = true;
}
else
{
m_log.Warn(string.Format(
"[CONFIG]: [{3}]:[{1}] is not a valid value [{0}].\nThe configuration result must be parsable to {2}.\n",
configOption.configurationKey, console_result, errorMessage,
configurationFilename));
ignoreNextFromConfig = true;
}
}
}
}
if (useFile)
{
configurationPlugin.Commit();
configurationPlugin.Close();
}
}
private static IGenericConfig LoadConfigDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
IGenericConfig plug = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IGenericConfig", true);
if (typeInterface != null)
{
plug =
(IGenericConfig) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
}
}
}
}
pluginAssembly = null;
return plug;
}
public void forceSetConfigurationOption(string configuration_key, string configuration_value)
{
configurationPlugin.LoadData();
configurationPlugin.SetAttribute(configuration_key, configuration_value);
configurationPlugin.Commit();
configurationPlugin.Close();
}
}
}

View File

@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly : AssemblyVersion("0.8.0.*")]
[assembly : AssemblyVersion("0.8.1.*")]

View File

@@ -0,0 +1,48 @@
/*
* 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;
namespace OpenSim.Framework.Console
{
/// <summary>
/// This will be a set of typical column sizes to allow greater consistency between console commands.
/// </summary>
public static class ConsoleDisplayUtil
{
public const int CoordTupleSize = 11;
public const int PortSize = 5;
public const int EstateNameSize = 20;
public const int ParcelNameSize = 40;
public const int RegionNameSize = 20;
public const int UserNameSize = 35;
public const int UuidSize = 36;
public const int VectorSize = 15;
}
}

View File

@@ -252,24 +252,82 @@ namespace OpenSim.Framework.Console
/// The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue
/// Other than that, component values must be numeric.
/// </param>
/// <param name='blankComponentFunc'></param>
/// <param name='blankComponentFunc'>
/// Behaviour if component is blank. If null then conversion fails on a blank component.
/// </param>
/// <param name='vector'></param>
/// <returns></returns>
public static bool TryParseConsoleVector(
string rawConsoleVector, Func<string, string> blankComponentFunc, out Vector3 vector)
{
List<string> components = rawConsoleVector.Split(VectorSeparatorChars).ToList();
if (components.Count < 1 || components.Count > 3)
return Vector3.TryParse(CookVector(rawConsoleVector, 3, blankComponentFunc), out vector);
}
/// <summary>
/// Convert a vector input from the console to an OpenMetaverse.Vector2
/// </summary>
/// <param name='rawConsoleVector'>
/// A string in the form <x>,<y> where there is no space between values.
/// Any component can be missing (e.g. ,40). blankComponentFunc is invoked to replace the blank with a suitable value
/// Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40)
/// The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue
/// Other than that, component values must be numeric.
/// </param>
/// <param name='blankComponentFunc'>
/// Behaviour if component is blank. If null then conversion fails on a blank component.
/// </param>
/// <param name='vector'></param>
/// <returns></returns>
public static bool TryParseConsole2DVector(
string rawConsoleVector, Func<string, string> blankComponentFunc, out Vector2 vector)
{
// We don't use Vector2.TryParse() for now because for some reason it expects an input with 3 components
// rather than 2.
string cookedVector = CookVector(rawConsoleVector, 2, blankComponentFunc);
if (cookedVector == null)
{
vector = Vector3.Zero;
vector = Vector2.Zero;
return false;
}
else
{
string[] cookedComponents = cookedVector.Split(VectorSeparatorChars);
vector = new Vector2(float.Parse(cookedComponents[0]), float.Parse(cookedComponents[1]));
return true;
}
//return Vector2.TryParse(CookVector(rawConsoleVector, 2, blankComponentFunc), out vector);
}
/// <summary>
/// Convert a raw console vector into a vector that can be be parsed by the relevant OpenMetaverse.TryParse()
/// </summary>
/// <param name='rawConsoleVector'></param>
/// <param name='dimensions'></param>
/// <param name='blankComponentFunc'></param>
/// <returns>null if conversion was not possible</returns>
private static string CookVector(
string rawConsoleVector, int dimensions, Func<string, string> blankComponentFunc)
{
List<string> components = rawConsoleVector.Split(VectorSeparatorChars).ToList();
for (int i = components.Count; i < 3; i++)
components.Add("");
if (components.Count < 1 || components.Count > dimensions)
return null;
List<string> semiDigestedComponents
if (components.Count < dimensions)
{
if (blankComponentFunc == null)
return null;
else
for (int i = components.Count; i < dimensions; i++)
components.Add("");
}
List<string> cookedComponents
= components.ConvertAll<string>(
c =>
{
@@ -283,11 +341,7 @@ namespace OpenSim.Framework.Console
return c;
});
string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray());
// m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector);
return Vector3.TryParse(semiDigestedConsoleVector, out vector);
return string.Join(VectorSeparator, cookedComponents.ToArray());
}
}
}

View File

@@ -46,6 +46,11 @@ namespace OpenSim.Framework.Console
// private readonly object m_syncRoot = new object();
private const string LOGLEVEL_NONE = "(none)";
// Used to extract categories for colourization.
private Regex m_categoryRegex
= new Regex(
@"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)", RegexOptions.Singleline | RegexOptions.Compiled);
private int m_cursorYPosition = -1;
private int m_cursorXPosition = 0;
private StringBuilder m_commandLine = new StringBuilder();
@@ -280,11 +285,8 @@ namespace OpenSim.Framework.Console
string outText = text;
if (level != LOGLEVEL_NONE)
{
string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)";
Regex RE = new Regex(regex, RegexOptions.Multiline);
MatchCollection matches = RE.Matches(text);
{
MatchCollection matches = m_categoryRegex.Matches(text);
if (matches.Count == 1)
{

View File

@@ -40,7 +40,9 @@ namespace OpenSim.Framework.Console
/// </summary>
public class MockConsole : ICommandConsole
{
#pragma warning disable 0067
public event OnOutputDelegate OnOutput;
#pragma warning restore 0067
private MockCommands m_commands = new MockCommands();

View File

@@ -25,6 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using OpenMetaverse;
namespace OpenSim.Framework
@@ -111,5 +115,50 @@ namespace OpenSim.Framework
}
}
public EstateBan() { }
public Dictionary<string, object> ToMap()
{
Dictionary<string, object> map = new Dictionary<string, object>();
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo p in properties)
map[p.Name] = p.GetValue(this, null);
return map;
}
public EstateBan(Dictionary<string, object> map)
{
foreach (KeyValuePair<string, object> kvp in map)
{
PropertyInfo p = this.GetType().GetProperty(kvp.Key, BindingFlags.Public | BindingFlags.Instance);
if (p == null)
continue;
object value = p.GetValue(this, null);
if (value is String)
p.SetValue(this, map[p.Name], null);
else if (value is UInt32)
p.SetValue(this, UInt32.Parse((string)map[p.Name]), null);
else if (value is Boolean)
p.SetValue(this, Boolean.Parse((string)map[p.Name]), null);
else if (value is UUID)
p.SetValue(this, UUID.Parse((string)map[p.Name]), null);
}
}
/// <summary>
/// For debugging
/// </summary>
/// <returns></returns>
public override string ToString()
{
Dictionary<string, object> map = ToMap();
string result = string.Empty;
foreach (KeyValuePair<string, object> kvp in map)
result += string.Format("{0}: {1} {2}", kvp.Key, kvp.Value, Environment.NewLine);
return result;
}
}
}

View File

@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using OpenMetaverse;
namespace OpenSim.Framework
@@ -411,5 +412,119 @@ namespace OpenSim.Framework
{
return l_EstateGroups.Contains(groupID);
}
public Dictionary<string, object> ToMap()
{
Dictionary<string, object> map = new Dictionary<string, object>();
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo p in properties)
{
// EstateBans is a complex type, let's treat it as special
if (p.Name == "EstateBans")
continue;
object value = p.GetValue(this, null);
if (value != null)
{
if (p.PropertyType.IsArray) // of UUIDs
{
if (((Array)value).Length > 0)
{
string[] args = new string[((Array)value).Length];
int index = 0;
foreach (object o in (Array)value)
args[index++] = o.ToString();
map[p.Name] = String.Join(",", args);
}
}
else // simple types
map[p.Name] = value;
}
}
// EstateBans are special
if (EstateBans.Length > 0)
{
Dictionary<string, object> bans = new Dictionary<string, object>();
int i = 0;
foreach (EstateBan ban in EstateBans)
bans["ban" + i++] = ban.ToMap();
map["EstateBans"] = bans;
}
return map;
}
/// <summary>
/// For debugging
/// </summary>
/// <returns></returns>
public override string ToString()
{
Dictionary<string, object> map = ToMap();
String result = String.Empty;
foreach (KeyValuePair<string, object> kvp in map)
{
if (kvp.Key == "EstateBans")
{
result += "EstateBans:" + Environment.NewLine;
foreach (KeyValuePair<string, object> ban in (Dictionary<string, object>)kvp.Value)
result += ban.Value.ToString();
}
else
result += string.Format("{0}: {1} {2}", kvp.Key, kvp.Value.ToString(), Environment.NewLine);
}
return result;
}
public EstateSettings(Dictionary<string, object> map)
{
foreach (KeyValuePair<string, object> kvp in map)
{
PropertyInfo p = this.GetType().GetProperty(kvp.Key, BindingFlags.Public | BindingFlags.Instance);
if (p == null)
continue;
// EstateBans is a complex type, let's treat it as special
if (p.Name == "EstateBans")
continue;
if (p.PropertyType.IsArray)
{
string[] elements = ((string)map[p.Name]).Split(new char[] { ',' });
UUID[] uuids = new UUID[elements.Length];
int i = 0;
foreach (string e in elements)
uuids[i++] = new UUID(e);
p.SetValue(this, uuids, null);
}
else
{
object value = p.GetValue(this, null);
if (value is String)
p.SetValue(this, map[p.Name], null);
else if (value is UInt32)
p.SetValue(this, UInt32.Parse((string)map[p.Name]), null);
else if (value is Boolean)
p.SetValue(this, Boolean.Parse((string)map[p.Name]), null);
else if (value is UUID)
p.SetValue(this, UUID.Parse((string)map[p.Name]), null);
}
}
// EstateBans are special
if (map.ContainsKey("EstateBans"))
{
var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
EstateBan[] bans = new EstateBan[banData.Count];
int b = 0;
foreach (Dictionary<string, object> ban in banData)
bans[b++] = new EstateBan(ban);
PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
bansProperty.SetValue(this, bans, null);
}
}
}
}

View File

@@ -38,6 +38,7 @@ namespace OpenSim.Framework
int GetParcelMaxPrimCount();
int GetSimulatorMaxPrimCount();
int GetPrimsFree();
Dictionary<UUID, int> GetLandObjectOwners();
LandData LandData { get; set; }
bool[,] LandBitmap { get; set; }

View File

@@ -35,6 +35,10 @@ namespace OpenSim.Framework
/// </summary>
public class InventoryItemBase : InventoryNodeBase, ICloneable
{
public static readonly string SUITCASE_FOLDER_NAME = "My Suitcase";
public static readonly sbyte SUITCASE_FOLDER_TYPE = 100;
public static readonly sbyte SUITCASE_FOLDER_FAKE_TYPE = 8;
/// <value>
/// The inventory type of the item. This is slightly different from the asset type in some situations.
/// </value>
@@ -82,12 +86,15 @@ namespace OpenSim.Framework
set
{
m_creatorId = value;
if ((m_creatorId == null) || !UUID.TryParse(m_creatorId, out m_creatorIdAsUuid))
m_creatorIdAsUuid = UUID.Zero;
}
}
protected string m_creatorId;
/// <value>
/// The CreatorId expressed as a UUID.tely
/// The CreatorId expressed as a UUID.
/// </value>
public UUID CreatorIdAsUuid
{

View File

@@ -27,6 +27,7 @@
using System;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
namespace OpenSim.Framework
{
@@ -40,9 +41,26 @@ namespace OpenSim.Framework
public byte WaterHeight;
public ushort X;
public ushort Y;
public ushort SizeX;
public ushort SizeY;
public MapBlockData()
{
}
public OSDMap ToOSD()
{
OSDMap map = new OSDMap();
map["X"] = X;
map["Y"] = Y;
map["SizeX"] = SizeX;
map["SizeY"] = SizeY;
map["Name"] = Name;
map["Access"] = Access;
map["RegionFlags"] = RegionFlags;
map["WaterHeight"] = WaterHeight;
map["MapImageID"] = MapImageId;
return map;
}
}
}

View File

@@ -26,6 +26,7 @@
*/
using OpenMetaverse;
using OpenMetaverse.StructuredData;
namespace OpenSim.Framework
{
@@ -37,5 +38,37 @@ namespace OpenSim.Framework
public int Extra;
public int Extra2;
public string name;
public mapItemReply(uint pX, uint pY, UUID pId, string pName, int pExt1, int pExt2)
{
x = pX;
y = pY;
id = pId;
name = pName;
Extra = pExt1;
Extra2 = pExt2;
}
public OSDMap ToOSD()
{
OSDMap map = new OSDMap();
map["X"] = OSD.FromInteger((int)x);
map["Y"] = OSD.FromInteger((int)y);
map["ID"] = OSD.FromUUID(id);
map["Name"] = OSD.FromString(name);
map["Extra"] = OSD.FromInteger(Extra);
map["Extra2"] = OSD.FromInteger(Extra2);
return map;
}
public void FromOSD(OSDMap map)
{
x = (uint) map["X"].AsInteger();
y = (uint) map["Y"].AsInteger();
id = map["ID"].AsUUID();
Extra = map["Extra"].AsInteger();
Extra2 = map["Extra2"].AsInteger();
name = map["Name"].AsString();
}
}
}

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.8.0.*")]
[assembly: AssemblyVersion("0.8.1.*")]

View File

@@ -26,7 +26,10 @@
*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Timers;
using log4net;
@@ -45,13 +48,22 @@ namespace OpenSim.Framework.Monitoring
public static void RegisterConsoleCommands(ICommandConsole console)
{
console.Commands.AddCommand(
"Debug",
"General",
false,
"debug stats record",
"debug stats record start|stop",
"stats record",
"stats record start|stop",
"Control whether stats are being regularly recorded to a separate file.",
"For debug purposes. Experimental.",
HandleStatsRecordCommand);
console.Commands.AddCommand(
"General",
false,
"stats save",
"stats save <path>",
"Save stats snapshot to a file. If the file already exists, then the report is appended.",
"For debug purposes. Experimental.",
HandleStatsSaveCommand);
}
public static void HandleStatsRecordCommand(string module, string[] cmd)
@@ -76,6 +88,27 @@ namespace OpenSim.Framework.Monitoring
}
}
public static void HandleStatsSaveCommand(string module, string[] cmd)
{
ICommandConsole con = MainConsole.Instance;
if (cmd.Length != 3)
{
con.Output("Usage: stats save <path>");
return;
}
string path = cmd[2];
using (StreamWriter sw = new StreamWriter(path, true))
{
foreach (string line in GetReport())
sw.WriteLine(line);
}
MainConsole.Instance.OutputFormat("Stats saved to file {0}", path);
}
public static void Start()
{
if (m_loggingTimer != null)
@@ -97,12 +130,22 @@ namespace OpenSim.Framework.Monitoring
private static void Log(object sender, ElapsedEventArgs e)
{
m_statsLog.InfoFormat("*** STATS REPORT AT {0} ***", DateTime.Now);
foreach (string report in StatsManager.GetAllStatsReports())
m_statsLog.Info(report);
foreach (string line in GetReport())
m_statsLog.Info(line);
m_loggingTimer.Start();
}
private static List<string> GetReport()
{
List<string> lines = new List<string>();
lines.Add(string.Format("*** STATS REPORT AT {0} ***", DateTime.Now));
foreach (string report in StatsManager.GetAllStatsReports())
lines.Add(report);
return lines;
}
}
}

View File

@@ -72,8 +72,8 @@ namespace OpenSim.Framework.Monitoring
console.Commands.AddCommand(
"General",
false,
"show stats",
"show stats [list|all|(<category>[.<container>])+",
"stats show",
"stats show [list|all|(<category>[.<container>])+",
"Show statistical information for this server",
"If no final argument is specified then legacy statistics information is currently shown.\n"
+ "'list' argument will show statistic categories.\n"
@@ -84,6 +84,14 @@ namespace OpenSim.Framework.Monitoring
+ "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
HandleShowStatsCommand);
console.Commands.AddCommand(
"General",
false,
"show stats",
"show stats [list|all|(<category>[.<container>])+",
"Alias for 'stats show' command",
HandleShowStatsCommand);
StatsLogger.RegisterConsoleCommands(console);
}
@@ -99,6 +107,7 @@ namespace OpenSim.Framework.Monitoring
string categoryName = components[0];
string containerName = components.Length > 1 ? components[1] : null;
string statName = components.Length > 2 ? components[2] : null;
if (categoryName == AllSubCommand)
{
@@ -128,7 +137,23 @@ namespace OpenSim.Framework.Monitoring
SortedDictionary<string, Stat> container;
if (category.TryGetValue(containerName, out container))
{
OutputContainerStatsToConsole(con, container);
if (String.IsNullOrEmpty(statName))
{
OutputContainerStatsToConsole(con, container);
}
else
{
Stat stat;
if (container.TryGetValue(statName, out stat))
{
OutputStatToConsole(con, stat);
}
else
{
con.OutputFormat(
"No such stat {0} in {1}.{2}", statName, categoryName, containerName);
}
}
}
else
{
@@ -200,6 +225,11 @@ namespace OpenSim.Framework.Monitoring
con.Output(report);
}
private static void OutputStatToConsole(ICommandConsole con, Stat stat)
{
con.Output(stat.ToConsoleString());
}
// Creates an OSDMap of the format:
// { categoryName: {
// containerName: {

View File

@@ -82,12 +82,32 @@ namespace OpenSim.Framework.Monitoring
/// </summary>
public Func<string> AlarmMethod { get; set; }
/// <summary>
/// Stat structure associated with this thread.
/// </summary>
public Stat Stat { get; set; }
public ThreadWatchdogInfo(Thread thread, int timeout)
{
Thread = thread;
Timeout = timeout;
FirstTick = Environment.TickCount & Int32.MaxValue;
LastTick = FirstTick;
Stat
= new Stat(
thread.Name,
string.Format("Last update of thread {0}", thread.Name),
"",
"ms",
"server",
"thread",
StatType.Pull,
MeasuresOfInterest.None,
stat => stat.Value = Environment.TickCount & Int32.MaxValue - LastTick,
StatVerbosity.Debug);
StatsManager.RegisterStat(Stat);
}
public ThreadWatchdogInfo(ThreadWatchdogInfo previousTwi)
@@ -100,6 +120,11 @@ namespace OpenSim.Framework.Monitoring
AlarmIfTimeout = previousTwi.AlarmIfTimeout;
AlarmMethod = previousTwi.AlarmMethod;
}
public void Cleanup()
{
StatsManager.DeregisterStat(Stat);
}
}
/// <summary>
@@ -238,6 +263,7 @@ namespace OpenSim.Framework.Monitoring
m_log.DebugFormat(
"[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
twi.Cleanup();
m_threads.Remove(threadID);
return true;

View File

@@ -215,7 +215,7 @@ namespace OpenSim.Framework
AddinManager.AddinLoadError += on_addinloaderror_;
AddinManager.AddinLoaded += on_addinloaded_;
clear_registry_();
clear_registry_(dir);
suppress_console_output_(true);
AddinManager.Initialize(dir);
@@ -239,18 +239,19 @@ namespace OpenSim.Framework
+ args.Exception.StackTrace);
}
private void clear_registry_()
private void clear_registry_(string dir)
{
// The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
// occasionally seems to corrupt its addin cache
// Hence, as a temporary solution we'll remove it before each startup
try
{
if (Directory.Exists("addin-db-000"))
Directory.Delete("addin-db-000", true);
if (Directory.Exists(dir + "/addin-db-000"))
Directory.Delete(dir + "/addin-db-000", true);
if (Directory.Exists("addin-db-001"))
Directory.Delete("addin-db-001", true);
if (Directory.Exists(dir + "/addin-db-001"))
Directory.Delete(dir + "/addin-db-001", true);
}
catch (IOException)
{

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