Compare commits

...

898 Commits

Author SHA1 Message Date
Melanie Thielker
f2d7f3e731 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-14 14:00:12 +02:00
Melanie Thielker
a32b0ce0ae Fix a possible nullref in BestAvatarResponsiveness policy 2010-08-14 13:59:36 +02:00
sacha
042eb80a62 clearing some debugmessages 2010-08-14 08:59:57 +00:00
meta7
df9521caf3 Add ini.example section for the MOTD module. 2010-08-11 15:30:42 -07:00
meta7
7aac4d650f Fix the llRemoveInventory recursive lock error (again) 2010-08-11 14:30:09 -07:00
meta7
24577876be Add some console debug to help fix a threadlock issue. 2010-08-11 14:10:47 -07:00
meta7
ac581b532e Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-11 13:40:31 -07:00
meta7
fa393cb13a Fix Omega getting overwritten on startup. 2010-08-11 13:39:36 -07:00
Melanie Thielker
d00a954d35 Log the state of the prejump flag 2010-08-11 03:09:56 +02:00
Melanie Thielker
a5a60df687 Change chat packets to bypass the throttles. This should alleviate chat lag 2010-08-11 02:52:52 +02:00
Melanie Thielker
af60b8ac16 Set triggering the texture and height update on a two second timer. This fixes
the texture rubberbanding.
2010-08-10 22:52:51 +02:00
meta7
1582e05ac7 Fix a nullref issue in the AgentSetAppearance packet handler when removing the physactor from the scene 2010-08-10 09:55:40 -07:00
meta7
48c52d6e48 Fix a dangling lock issue in llRemoveInventory 2010-08-10 09:50:18 -07:00
meta7
fb14390fb0 Note to self: don't break the build 2010-08-10 09:17:30 -07:00
meta7
9fba4b66bb Resolve merge failure 2010-08-10 09:11:55 -07:00
Melanie
5e8c3f8325 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-10 20:12:13 +01:00
sacha
7fead01786 remoning debug messages 2010-08-10 19:43:32 +00:00
sacha
d0a22fb359 fixed ground texture issues ( it seems ) 2010-08-10 19:35:17 +00:00
Melanie
24b9a2885f Resolve merge issues 2010-08-10 20:11:55 +01:00
Melanie
c2e5d1d203 Merge branch 'master' into careminster-presence-refactor 2010-08-10 19:49:35 +01:00
Melanie
383ee0d647 Remove 4000+ DOS line endings. Grrr! 2010-08-10 19:48:45 +01:00
Melanie
d98d5ee6be Remove windows line endinge 2010-08-10 19:42:18 +01:00
meta7
1ead2ed5ee Add a stack trace to the error output on the recursive read lock warning on my RWlocks. Whilst recursive locks are safe, coupled with other issues we're experiencing with the TaskInventoryDictionary it implies that somewhere the lock is not being freed possibly due to a merge error somewhere, and thus it needs to be looked into. 2010-08-10 09:07:17 -07:00
meta7
912bfba20c Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-09 23:36:59 -07:00
meta7
eb5c508f8b Add a DebuggerSafe option to the ini to help with debugging in visual studio. This essentially silences exceptions in the script engine. Disabled by default, naturally. 2010-08-09 23:35:40 -07:00
meta7
f0bad66d41 For my own sanity, fix a bug in xengine 2010-08-09 23:34:37 -07:00
Melanie Thielker
0f9eebdfb1 Change prejump from hardcoded true to default true so it can be disabled.
It completely destroys roleplay jumping
2010-08-10 03:52:00 +02:00
meta7
bef6fa37b9 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-08 18:57:16 -07:00
meta7
32ccc19a62 Make fallbacks work, the destination was never actually updated with the fallback details. 2010-08-08 18:56:47 -07:00
Melanie Thielker
f20dc512e8 Whitespace conflict 2010-08-09 02:46:09 +02:00
Melanie
1f052520ae Merge branch 'master' into careminster-presence-refactor 2010-08-09 02:27:54 +01:00
meta7
680e801bf2 Print a console message when we deny access because of no valid parcel found. 2010-08-08 17:32:20 -07:00
meta7
603b3a1606 Fix minimap issues. This addresses mantis #228. 2010-08-08 17:31:29 -07:00
Melanie
b0795bcfef Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-09 00:49:40 +01:00
Melanie
52f49b2a78 Merge branch 'master' into careminster-presence-refactor 2010-08-09 00:49:15 +01:00
Melanie Thielker
ca2a4bbded Add debug messages to attachment receiving and cowardly refuse to create
them if the owner can't be determined.
2010-08-08 19:35:20 +02:00
Melanie
321e1148da Merge branch 'master' into careminster-presence-refactor 2010-08-08 18:24:33 +01:00
Melanie Thielker
6cb50c49b5 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-08 17:53:25 +02:00
Melanie Thielker
1cde77293e Thank you, Marck00, for a patch that implemented region distance sorting
for fallback regions. Applied with changes.
2010-08-08 17:51:43 +02:00
meta7
a1f2be5e69 The real fix for unscripted sit positions. This one doesn't fuck everything else up. Promise. 2010-08-07 22:25:37 -07:00
meta7
f9b5f23383 Reverted: * Fix the unscripted sit rotation being incorrect .. will commit a proper fix now. 2010-08-07 22:19:26 -07:00
meta7
12dd97c9f8 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 20:14:58 -07:00
meta7
0794c6a941 Implement parcel group access control. This addresses mantis #158. 2010-08-07 20:13:45 -07:00
meta7
aa54e8d95e Increase sit distance to 256 meters, but leave the initial autopilot process in the picture so sit position can still be raycast by the existing code. 2010-08-07 17:35:16 -07:00
meta7
b771965f28 Get rid of some debug chatter that someone who can't spell left behind. ;) 2010-08-07 17:33:27 -07:00
meta7
acb1590cf0 Fix the unscripted sit rotation being incorrect (relative to the prim). Note that unscripted sit offset is still really poor but this is not something i'm prepared to spend time on fixing. 2010-08-07 17:32:36 -07:00
Melanie Thielker
d2b3d45d76 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-08 02:04:37 +02:00
Melanie Thielker
50ac61e17f In my crusade against facelights, I am striking the killing blow. Add a
DisableFacelights option to OpenSim.ini to finally kill those immersion-
breaking, silly vanity lights that destroy nighttime RP. Girls, you look
just fine without them. Guys, you too. Thank you. Melanie has left the building.
2010-08-08 02:01:24 +02:00
meta7
19ab4c9508 Fix a rather nasty issue where the Backup() process causes objects and avatars sitting on them to be pushed to the corner of the sim. 2010-08-07 16:52:03 -07:00
meta7
8d3a73d126 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 16:32:18 -07:00
meta7
a6048518b7 Repair lsGetWindlightScene, the constant was added to the list as a uint, which is bad - convert to LSL_Integer first. 2010-08-07 16:18:44 -07:00
Melanie
4c5788c4c0 Add search URL to Login Service 2010-08-07 22:24:17 +01:00
Melanie
68e4b1115a Dumb error in fix 2010-08-07 22:23:51 +01:00
Melanie Thielker
71f2cec1bd Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 22:11:18 +02:00
sacha
4900d39b7d Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 21:05:18 +00:00
sacha
478d835392 removing more stains ... 2010-08-07 21:04:16 +00:00
Melanie Thielker
7bac069976 Mantis #229. Fix Global sim ccordinates 2010-08-07 22:10:46 +02:00
meta7
cabbd187e7 Fix the distance from which autopilot is negated when sitting on an unscripted prim - and also add some more Velocity code to ensure it gets set to zero in all cases 2010-08-07 11:13:05 -07:00
Melanie Thielker
97f8175090 Delete some files from bin that should not have been committed 2010-08-07 18:34:11 +02:00
meta7
413b0525db It seems hippo disregards velocities in full updates, so also send a terse update when an agent sits to avoid drifting off 2010-08-07 11:06:07 -07:00
meta7
19debab060 Fix the general alert message so it doesn't get sent to child agents 2010-08-07 08:17:11 -07:00
meta7
b017d985ab Add some nullref checks to the UnackedPacketCollection. 2010-08-07 08:06:41 -07:00
sacha
b58a47c373 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 13:41:56 +00:00
sacha
00cc42a607 and another endless debug cleaning 2010-08-07 13:40:38 +00:00
meta7
bcb3b57f8d Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 06:33:51 -07:00
Tom
4f80d75bf3 Add a CHANGED_POSITION event so scripts don't have to run expensive loops to check for position changes 2010-08-07 06:28:04 -07:00
sacha
047a4764f2 and another one... 2010-08-07 13:19:53 +00:00
sacha
e69efdd4ce Clean the loo after use please !!!!!
No need to keep useless debug message !
Never heard of wasted cpucycle you darn kid !
2010-08-07 13:13:27 +00:00
Melanie
8fd3f6cf7f Merge branch 'master' into careminster-presence-refactor 2010-08-07 05:41:41 +01:00
Melanie Thielker
c554de7501 Correct display of landmark about info. Also correct region maturity rating
in LM info. Maturity is NOT the parcel's setting, that is only for the
image and text. Parcel maturity is governed by region maturity.
2010-08-07 05:45:52 +02:00
Melanie Thielker
fa11ac8c85 Change the (hackish) constant to match the changed enum for attachs 2010-08-07 05:42:30 +02:00
Melanie Thielker
7477d7a036 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-07 03:40:01 +02:00
Melanie Thielker
a783f048a3 Make the landmark properties and search places work again 2010-08-07 03:38:35 +02:00
Tom
f9f776e407 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 11:44:57 -07:00
Tom
330343505c Implement CreateNewOutfitAttachments. This addresses mantis #199. 2010-08-06 11:39:10 -07:00
Melanie
26387252f5 Merge branch 'master' into careminster-presence-refactor 2010-08-06 18:08:40 +01:00
Tom
e941da205b Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 09:54:09 -07:00
Tom
03da22378e Estate managers should be allowed to add and remove new users, groups and bans to/from the estate settings. 2010-08-06 09:53:40 -07:00
Tom
0d4086e602 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 08:09:10 -07:00
Tom
52e2360e91 Since i've narrowed the fault down to one function, add some spammy debug to try and fix ghost prims on HUDs in future. Note, the console only gets messages if there is a problem, so it's harmless. 2010-08-06 08:08:43 -07:00
Melanie Thielker
5559422d32 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 16:09:45 +02:00
Melanie Thielker
c48be64d9a Remove posting region restart event from SOP, as it's now in XMRe 2010-08-06 16:08:50 +02:00
Tom
3ce335c6f8 Fix StateSource constants, provide RegionStart 2010-08-06 06:41:25 -07:00
Tom
a636af13e7 Make sure the avatar position gets moved along with a prim it is sitting on. This fixes mantis #208 and (maybe) issues with chat and sound coming from the wrong place when sat on a vehicle. 2010-08-06 06:37:40 -07:00
Melanie Thielker
696c2c429b Change XEngine to use the new constant 2010-08-06 15:33:22 +02:00
Melanie Thielker
42613ec536 Allow the trash folder itself to be passed to PurgeFolder 2010-08-06 15:18:48 +02:00
sacha
5da272d042 reverese my last commit 2010-08-06 14:45:54 +00:00
sacha
23d1f0978e Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 14:39:34 +00:00
sacha
a390541e1c Allowing the expected purge trash folder...
Please validate !!!
2010-08-06 14:38:11 +00:00
Tom
0a004f8c44 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-06 02:43:26 -07:00
Tom
c5c6627adb Implement CHANGED_REGION_(RE)START and also fix various CHANGED_* constants which had the wrong values (checked using LSL in SL). This addresses mantis #217 and mantis #53. 2010-08-06 02:40:31 -07:00
Melanie Thielker
d7fe9f7b44 Prevent users from becoming stuck online. This affects only 0.7 2010-08-06 00:02:38 +02:00
Melanie Thielker
7368992ee9 Actually cache positives 2010-08-05 23:48:55 +02:00
Melanie Thielker
d8f9b98c4a Prevent hammering the grid services with llRequestAgentData requests. Cache the
user information permanently, and the online status for 20 seconds. Also
cache negatives.
2010-08-05 22:50:09 +02:00
Melanie Thielker
8bdbcda2b7 We already have a record of killed prims. It just wasn't used by the new
JHurlicane code anymore. Use it to prevent sending updates after kills.
2010-08-05 18:50:17 +02:00
Melanie Thielker
05520d676c Revert "Enforce a 0.2 second sleep on llDie() before the command is executed - this should get rid of ghost prims (which are much rarer, but still occuring)"
This reverts commit 85fd2def9c.

The sleep helps in only one case: static prims rezzed by script.
In other cases (physical prims, bullets) it's harmful.
2010-08-05 18:45:17 +02:00
Tom
0eda6714f3 llRequestSimulatorData DATA_SIM_POS : Divide by RegionSize, don't multiply. This resolves mantis #215 2010-08-05 08:41:08 -07:00
Tom
85fd2def9c Enforce a 0.2 second sleep on llDie() before the command is executed - this should get rid of ghost prims (which are much rarer, but still occuring) 2010-08-05 08:15:05 -07:00
Tom
8689cdd4dc Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-04 19:47:47 -07:00
Tom
663e25fd3a Pacify osGetAvatarList to provide LSL types instead of omv types 2010-08-04 19:46:41 -07:00
Kitto Flora
0871d20adb Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-04 21:08:14 +00:00
Kitto Flora
cb3b124df9 Fixes fresh hollowed prim collision shape. 2010-08-04 21:08:00 +00:00
Melanie Thielker
4a33210771 Send attachment updates only to the owner if it's a HUD 2010-08-04 18:12:31 +02:00
sacha
a48c493210 Cost Reduction : Removing verbose message.... 2010-08-04 08:16:55 +00:00
Tom
463fbb4990 If a user has no home position set, tell them so instead of leaving the request dangling 2010-08-04 00:17:02 -07:00
Tom
c8f09f7fcb Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-03 22:42:32 -07:00
Tom
cd9506e842 Don't know HOW we missed this, llSetPos was broken in child prims (and in the llSetPrimitveParams family), it was using the global coordinate as a start location. This resolves mantis #204 2010-08-03 22:41:02 -07:00
Tom
6076eb5558 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-03 19:55:57 -07:00
Tom
f1c51c8bb4 Scripted sit target fixes 2010-08-03 19:51:32 -07:00
Melanie Thielker
b38d69287a Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-04 03:24:06 +02:00
Melanie Thielker
0020dbee23 Remove StandAlone from default hardcoded config 2010-08-04 03:23:19 +02:00
Melanie Thielker
5ff9db7388 Clean up some messiness in IM sending. Having offline IM enabled now no longer
suppresses "Inventory Saved" messages.
2010-08-04 02:51:41 +02:00
Melanie Thielker
d57bfec702 A god is a god is a god is a god. Right? Right. You're a god from 200, let's
show it!
2010-08-04 02:16:46 +02:00
Melanie
757929012e Merge branch 'master' into careminster-presence-refactor 2010-08-04 01:11:47 +01:00
Melanie
164719119b Merge branch 'master' into careminster-presence-refactor 2010-08-04 01:01:08 +01:00
Melanie
e12993ed22 Merge branch 'master' into careminster-presence-refactor 2010-08-04 00:33:02 +01:00
Melanie Thielker
d9ae837063 Allow specifying default region flags. Correct a typo. 2010-08-04 00:45:15 +02:00
Tom
e3cea888fb Fix some more issues causing regions with corrupt sculpts to freeze. 2010-08-03 16:07:18 -07:00
Tom
ae99c1393d Fix scripted sit offset in child prims 2010-08-03 15:31:04 -07:00
Tom
2221517935 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-03 14:12:05 -07:00
Tom
1d1da5069c Catch a meshing exception caused by corrupt or missing sculpt maps, and mark the prim as "mesh failed" so it doesn't try meshing continuously 2010-08-03 14:11:11 -07:00
Mike Rieker
6e3c79f31e don't mask current time reads (since we don't mask the corresponding subtract)
if you mask the reads you have to mask the subtract as well.
simplest is just don't mask any of it.
2010-08-03 20:09:00 +00:00
Tom
f04d51378f Drop the RestClient timeout from 15 minutes to 30 seconds. This does not address the problem, but it will allow the regions to recover in the event that the remote server goes away. 2010-08-03 11:06:41 -07:00
Melanie Thielker
e3184753a6 Log the UUID of a prim that fails meshing and set the prim to phantom during
region startup
2010-08-03 05:25:23 +02:00
Melanie Thielker
d2d1c63b17 Revert "Catch meshing error in Meshmerizer"
This reverts commit 8f2986bc6a.

In favor of a fix that tells us where the issue is instead of eating the error
2010-08-03 05:25:01 +02:00
Tom
ecfea5fa69 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-08-02 21:56:30 -07:00
Tom
8f2986bc6a Catch meshing error in Meshmerizer 2010-08-02 21:54:47 -07:00
Melanie Thielker
16e90809a9 Remove the (wrong) implementation if llPointAt. It never worked on the LL
grid and is officially deprecated. There is no way to rotate an avatar
programmatically.
2010-08-02 00:54:58 +02:00
Tom
d2d56494b2 Fix the XmlRpcRouterModule so it reads from the correct config section ([XMLRPC] not [Startup]) and disable by default (since it's disabled in the ini by default) 2010-08-01 10:24:43 -07:00
Tom
763dc8bb76 Add an m_enabled flag to XmlRpcRouterModule so it won't try to bind the xmlrpc_uri event if it's not mentioned in the ini. 2010-08-01 10:24:17 -07:00
Tom
b860c8021e First, change DefaultPermissionsModule so it returns the correct name...
... Then, make sure we also check the old-style module stack before we throw a tantrum
2010-08-01 10:23:48 -07:00
Tom
d5f497478a Add config option securePermissionsLoading which will stop the region from loading if the specified permissions modules fail to load. 2010-08-01 10:21:56 -07:00
Melanie
5f94b98cb2 Merge branch 'master' into careminster-presence-refactor 2010-08-01 18:00:04 +01:00
Melanie
dd2d9a68a7 Merge branch 'master' into careminster-presence-refactor 2010-07-31 01:05:13 +01:00
Melanie
3302e8ddc4 Merge branch 'master' into careminster-presence-refactor 2010-07-31 00:57:50 +01:00
Melanie Thielker
f9280374d2 Bannination fixes. Objects in nonpublic parcels were muted by default. Gods
were muted, too.
2010-07-30 15:03:03 +02:00
Melanie
7a9e246ccd Merge branch 'master' into careminster-presence-refactor 2010-07-29 16:20:59 +01:00
Melanie Thielker
7871dd606e Allow gods and estate managers/owners to be unaffected by parcel bans 2010-07-29 16:33:20 +02:00
Melanie Thielker
516ec4acd0 Eat a lockign exception that kills scripts. May bear more investigation
in the long run.
2010-07-25 08:11:39 +02:00
Melanie Thielker
83aec1ec94 Fix a little infinite recursion i added just for sh.ts and giggles. NOT. 2010-07-22 23:47:10 +02:00
Melanie Thielker
7ebabf185e change the delay to 0.2s. My bad. 2010-07-22 19:31:02 +02:00
Melanie Thielker
ce8b9b4181 LSL compatibility fix. Add 0.1 s sleep to llSetLinkPrimitiveParams so fade scripts will time correctly. The -Fast version works without a delay 2010-07-22 19:20:09 +02:00
Melanie Thielker
fb89d0ff4e Allow megaregions to be used in M7, should we so decide 2010-07-21 12:32:23 +02:00
Melanie Thielker
d4022becc3 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-21 12:16:30 +02:00
Melanie
f63a4c8f2f Merge branch 'master' into careminster-presence-refactor 2010-07-21 12:03:44 +01:00
Melanie Thielker
c72c84b455 Refine autoreturn a bit 2010-07-21 12:16:17 +02:00
Melanie
4ccc141764 Resync with master 2010-07-20 21:49:31 +01:00
Melanie
c0b8cbd85b Merge branch 'master' into careminster-presence-refactor 2010-07-20 21:47:53 +01:00
Melanie
dcf7973c9b Merge branch 'master' into careminster-presence-refactor 2010-07-20 21:39:20 +01:00
Melanie
686837d9ed Merge branch 'master' into careminster-presence-refactor 2010-07-20 21:18:27 +01:00
Melanie Thielker
fd66ee57f3 When a god uses mass permission setting, the V bit is cleared from next
perms, rendering the item unmoveable for the next owenr. Make god mods
conform to the rules, too.
2010-07-20 14:45:46 +02:00
Melanie Thielker
191bee2ed0 Remove the null checks altogether 2010-07-20 00:55:31 +02:00
Melanie Thielker
54da64acac Remove exception badness in the LSL Types. Who ever came up with that.....?! 2010-07-20 00:46:39 +02:00
Melanie Thielker
c263fc54ac Add a state change method to the Async commands handler to allow timers
and http requests to survive state changes
2010-07-18 21:05:50 +02:00
Tom Grimshaw
c088397ec7 If the client requests that an object be deleted, and the SOG/SOP is null and/or is marked as deleted, just send the KillObject 2010-07-18 06:01:26 -07:00
Tom Grimshaw
fabe2206db Ensure that packets do NOT get delivered to a client before the modules that can deal with the client's response have finished loading. 2010-07-17 15:08:59 -07:00
Tom Grimshaw
17412389f3 Revert 233c872.. "* Call client.Start() sunchronously. Calling thos async avoids some stuttering", pending fix for the core issue 2010-07-17 14:34:35 -07:00
Tom Grimshaw
ef6565470f XGitminster: Update config options; commitFrameInterval -> CommitInterval and a new option DisableNonEssentialCommits 2010-07-17 06:54:46 -07:00
Melanie Thielker
d52fb4d2e9 Shorten LLEmail delay to 15s. With the external spam protection, we can
afford to do that
2010-07-17 16:35:14 +02:00
Melanie Thielker
22371ac527 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-17 16:33:31 +02:00
Melanie Thielker
c41d418380 Allow communicating with blue box dialogs across a region border via a
child agent
2010-07-17 16:32:55 +02:00
Melanie
859e3252be Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-17 03:18:01 +01:00
Melanie Thielker
d1040c9ff9 Replace the screenful of code i deleted. 2010-07-17 02:46:04 +02:00
Melanie Thielker
e06b7ee368 Make webloading more robust by addign retries 2010-07-17 02:38:00 +02:00
Melanie Thielker
85f454e3ae Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-17 02:26:34 +02:00
Melanie Thielker
9bf6179d24 Fix scripted give of items 2010-07-17 02:26:09 +02:00
Kitto Flora
236c0f8e8b Fix llSetForecAndTorque([0]) stops linear motion. Mantis #187 2010-07-16 22:17:06 +00:00
Melanie Thielker
2e5f200b3b Fix showing CreateSelected on all parts of a rez 2010-07-16 20:23:41 +02:00
Melanie Thielker
3f91805afb prevent hacked viewers from being able to delete arbitrary items from any
prim. Allow friends with perms and shared group members to move or copy
things out of prims
2010-07-15 20:28:18 +02:00
Melanie Thielker
8d2b4b7b48 Fix a few permissions vulnerability. Owners could cause permissions
escalation on items contained in prims using a hacked viewer
2010-07-15 20:03:08 +02:00
Melanie
0dd2496a56 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-14 23:03:59 +01:00
Melanie Thielker
50d56c54a3 Detach attachments displaced by other attachments 2010-07-14 23:03:38 +01:00
Melanie Thielker
ddfff55cc7 Preserve attachment data while a prim is in world. Allows attachment
editing on the ground without losing attachpoint and position
2010-07-14 21:06:49 +02:00
Melanie
0b74662ce2 Merge branch 'master' into careminster-presence-refactor 2010-07-14 19:53:15 +01:00
Melanie Thielker
d665f0ae66 Detach attachments displaced by other attachments 2010-07-14 20:46:26 +02:00
Melanie Thielker
bebbe407ee Major attachments cleanup. Remove unused AttachObject ClientView method
Clean up use of AttachObject throughout, reduce number of overloads
and number of parameters
2010-07-14 19:58:23 +02:00
Melanie Thielker
0c445239a6 Remove useless quaternion parameter from AttachObject sig 2010-07-14 19:21:01 +02:00
Melanie
d1f94b5d58 Merge branch 'master' into careminster-presence-refactor 2010-07-14 16:12:14 +01:00
Melanie Thielker
cbb3a8ab94 Fix a permissions issue 2010-07-14 16:21:55 +02:00
Melanie Thielker
af13c80d68 Remove getting the object capacity from the money module. It is now set
directly from the Region Info (and the region ini file)
2010-07-14 03:59:26 +02:00
Tom Grimshaw
c5891c14c7 Bail out in AttachToBackup if the group is an attachment 2010-07-13 15:32:35 -07:00
Tom Grimshaw
7270cd0ade Second part of the fix for llGetLocalPos; get attachment offset in the root prim of an attachment. This function now behaves in line with SL. 2010-07-13 14:57:50 -07:00
sacha
8c2e1c6c29 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-13 21:12:01 +00:00
sacha
8c26c8bbc6 adding the 'wearble' case for llGetLocalPos.
Still not working cause the offsets are not updated (always <0,0,0>)
2010-07-13 21:10:26 +00:00
Kitto Flora
84227fd558 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-13 20:37:45 +00:00
Kitto Flora
7ab103c96f Rewrite collision dictionary handling, cleans up deleted obects/avs. Fixes occasional collision event failure. ChOde only. 2010-07-13 20:37:13 +00:00
Melanie
eacf3d9221 Merge branch 'master' into careminster-presence-refactor 2010-07-13 20:46:21 +01:00
Melanie Thielker
89c1c5c35a Revamp the permissions propagation. This MAY mess up. Please test.
Change the slam bit from 3 to 4. Assume the old slam bit is always set.
The new slam bit is a "changed owner" bit, correcting a bug where an item
passed from the creator to another with less than full perms, then back (sale
test) would arrive back full perm. Lots of in-code docs.
2010-07-13 20:40:23 +02:00
Melanie Thielker
31cbd6d113 Add CreateSelected flag onto objects rezzed from inventory 2010-07-13 18:23:23 +02:00
Tom Grimshaw
5f4105d48c Removed the CHANGED_COLOR event post from the Color accessor in SOP. This is not the correct usage of this changed event - it's only supposed to be posted when the /textures/ change colour or alpha transparency, not the floating text. This fixes several race conditions in scripts ported from SL. 2010-07-12 13:55:56 -07:00
Melanie Thielker
7f0f11304f Add scripted controllers into agent intersim messaging 2010-07-11 14:26:57 +02:00
Melanie
922e874653 Merge branch 'master' into careminster-presence-refactor 2010-07-11 13:32:10 +01:00
Tom Grimshaw
cea856cfc2 Fix the synchronousrestformsrequester so it will successfully handle a response from a server which does not provide a valid content length header 2010-07-10 19:00:12 -07:00
Tom Grimshaw
cecd660388 Fix an issue where the SynchronousRestObjectRequester will fail if a webserver does not report a content length (-1), but the content is still valid 2010-07-10 18:48:49 -07:00
Melanie Thielker
8aa5f30082 Make taken items go back to the folder they came from 2010-07-10 10:51:49 +02:00
Melanie
05b35eb57c Correct a merge artefact 2010-07-08 18:17:02 +01:00
Melanie
5f400a50be Merge branch 'master' into careminster-presence-refactor 2010-07-08 17:32:57 +01:00
Mike Rieker
faaef1b498 minimizes temp garbage for llParseStringKeepNulls()
and uses common routine for llParseStringKeepNulls()/llParseString2List()
2010-07-06 23:59:06 +00:00
Mike Rieker
6e7f1a3ac1 Merge branch 'careminster-presence-refactor' of www.3dhosting.de:/var/git/careminster into careminster-presence-refactor 2010-07-06 02:23:10 +00:00
Mike Rieker
90c5555d6d rewrote hanging llParseStringKeepNulls() 2010-07-06 02:22:47 +00:00
Tom Grimshaw
e947d04038 Undo fix is now complete. This commit repairs the special case of the root prim moving or rotating independently of the rest of the group. 2010-07-05 05:44:35 -07:00
Tom Grimshaw
be5dd04150 Bring "Redo" up to date with "Undo" so it works too 2010-07-05 03:58:18 -07:00
Tom Grimshaw
8849b9af8b Fix single prim rotation undo. All UNDO functions are now working correctly except for when the root prim is moved or rotated as a single prim (coming soon). 2010-07-04 20:45:11 -07:00
Tom Grimshaw
c616335019 Rotation undo fix and remove a debug chatter i missed. Still not working: Individual child prim rotational undo and special cases where the root prim was moved or rotated (all the children then need to restore their offsets). Coming shortly. 2010-07-04 19:58:52 -07:00
Tom Grimshaw
5b68343361 The majority of the Undo fix. There is still an issue with Rotation which i'll address next; however position undo and scale undo should be working just fine now. Also removed some residual debug logging. 2010-07-04 19:28:39 -07:00
Tom Grimshaw
7665013ad8 Correct positioning of timeout modifier in the SynchronousRestObjectRequester 2010-07-04 19:25:54 -07:00
Tom Grimshaw
f3e902092a Add System.Core assembly reference to two projects so that TimeZoneInfo can be used 2010-07-04 12:51:48 -07:00
Tom Grimshaw
14ab22dcd4 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-04 06:51:01 -07:00
Tom Grimshaw
3368e3853a Check cached asset to make sure it contains data, and if not, re-request 2010-07-04 06:45:04 -07:00
Melanie
8a45191aa9 Merge branch 'master' into careminster-presence-refactor 2010-07-04 11:02:21 +01:00
Melanie Thielker
baa20a10c3 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-03 20:29:06 +02:00
Melanie Thielker
edcfaf60c9 Fix IMs the right way. This sets it up so that timestamps are actually
in PST (to match viewer time), does correct storage and retrieval of
IMs, corrects the session ID and makes sure IMs don't get marked "saved"
if they're live. Removes the group IM save option, which our group IM
module never had in the first place, as saving group chatter makes no
sense at all.
2010-07-03 20:27:00 +02:00
Tom Grimshaw
4cd5e64231 Use SendTransferAbort in a more sensible place 2010-07-03 09:22:58 -07:00
Tom Grimshaw
e4739523d3 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-03 06:11:46 -07:00
Tom Grimshaw
fe2b044d38 Fix Undo! Made a lot of changes to Undo state saving; it now considers that groups of objects can be moved and not just individual prims.. 2010-07-03 06:10:55 -07:00
Tom Grimshaw
39ae1def85 Re-implement the Undo stack as a List; the old implementation was buggy 2010-07-03 06:10:02 -07:00
Tom Grimshaw
2b49cb9227 Make sure the AssetServiceConnector times out within 30 seconds. If it doesn't, the client will get bored and give an upload error, instead of granting success and entering the asset into our retry queue. 2010-07-03 06:09:20 -07:00
Tom Grimshaw
3d495b709e Implement a timeout value in the SynchronousRestObjectRequester. Default is 100 seconds. 2010-07-03 06:08:18 -07:00
Melanie Thielker
86a82e6ecb Now, fix the slash issue the right way. Our URLs now work like SL's 2010-07-03 08:33:08 +02:00
Melanie Thielker
721d8a7298 Re-add the slashes at the end of the URL. Too much depends on them 2010-07-03 07:09:27 +02:00
Melanie Thielker
233c872d24 Call client.Start() sunchronously. Calling thos async avoids some stuttering
when people log in, but fatally screws up money.
2010-07-02 09:40:58 +02:00
Melanie Thielker
c87e6a289c Clean up IMoneyModule and adjust the other modules to the changes 2010-07-02 06:20:36 +02:00
Melanie Thielker
beb5259cd1 Remove GetEconomyData and the economy data structure (unused) 2010-07-02 04:51:31 +02:00
Melanie Thielker
a7c4cb95aa Fox another scripting nasty. Stuff no system.string objects into lists 2010-07-02 04:26:55 +02:00
Melanie Thielker
120c9a4ebb Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-02 03:11:18 +02:00
Melanie
ec73074aac Merge branch 'master' into careminster-presence-refactor 2010-07-02 03:02:53 +01:00
Melanie Thielker
60c15d7c28 Fix a dumb little sign error that makes a LSL wiki example fail 2010-07-02 03:05:40 +02:00
Tom Grimshaw
68281b356c Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-01 09:47:18 -07:00
Tom Grimshaw
071d601dcb Cache all assets on upload so that the client can still retrieve the asset if it enters a retry queue 2010-07-01 09:46:57 -07:00
Tom Grimshaw
b38a22506b Fix build break 2010-07-01 08:57:13 -07:00
Tom Grimshaw
38384cc79c Report asset upload success if it has previously failed 2010-07-01 08:52:30 -07:00
Tom Grimshaw
4851706d35 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-01 08:49:53 -07:00
Tom Grimshaw
1cb7695fb0 Catch newid == null which is what happens if the asset service is offline (seems a connection failure does not throw an exception) 2010-07-01 08:48:02 -07:00
Melanie Thielker
3d5d44279b ANother stab at LSL compatibility 2010-07-01 17:06:29 +02:00
Melanie Thielker
2312504b04 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-07-01 16:41:03 +02:00
Melanie Thielker
d5cbe4cb75 Remove trailing slash from HTTP URLs to be compatible with SL 2010-07-01 16:40:26 +02:00
Melanie Thielker
3940a4dbc7 Avoid a spurious error message when taking a friend's no copy item 2010-07-01 16:11:10 +02:00
Melanie
46a531d865 Merge branch 'master' into careminster-presence-refactor 2010-06-30 21:35:05 +01:00
Tom Grimshaw
9012084d11 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-29 23:19:08 -07:00
Tom Grimshaw
8dc7c0849e The other half of the asset fix. Implement an exponentially incrementing retry timer for asset upload failures. Total queue time in the ballpark of 24 hours, which should be a reasonable time for any grid admin to get their asset service back online. This should stop lost assets. 2010-06-29 23:18:48 -07:00
Melanie Thielker
3cd717d929 Comment the "Notecard saved" notification that pops up when a notecard
is saved into a prim. Sl doesn't have it, and for good reason: It also
happens on scripts in our version. Which is wrong. Better no message
than a wrong one.
2010-06-29 04:09:14 +02:00
Melanie Thielker
6f4d4543b9 Make newly created prims be named "Object" and make newly created scripts
have a default touch handler. Compatibility patch
2010-06-29 03:51:16 +02:00
Tom Grimshaw
06fa038875 Return a UUID.Zero if the asset fails to upload 2010-06-28 07:09:05 -07:00
Tom Grimshaw
a5a1df68c2 Provide the interface for StoreAsset to report success or failure 2010-06-28 04:02:33 -07:00
Melanie Thielker
3e908023b2 Force IM timestamps to current server time to prevent "Saved on" headers
while the sender is online
2010-06-28 08:58:51 +02:00
Tom Grimshaw
7807d11807 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-27 22:23:08 -07:00
Tom Grimshaw
827d9be48f Fix the sound issue. It was caused by missing assets; once the client has made one request, it continued to wait for asset before requesting any new ones, until the TransferRequest timed out. Fixed by adding a TransferAbortPacket if the asset cannot be retrieved. 2010-06-27 22:23:01 -07:00
Melanie Thielker
4fa1d4896c Change the way IRegionModule us referenced by IEmailModule to
allow later conversion to new style
2010-06-28 02:30:36 +02:00
Melanie Thielker
a817f6b48c Remove AgentID and GroupOD from the signature of SOG.Copy(). They were never
used, but made for a very mispleading read of the code in the callers.
2010-06-28 01:48:24 +02:00
Melanie Thielker
d570cffa39 Fix Copy on Ray, Drag Copy and other little things. Removed the wrong and
nonworking ownership assignment in SOG, which messed things up before.
No longer trust the client to send the ID of the person something is copied
as, since it allows to run a script with someone else's permissions. Properly
adjust inventory ownership and perms.
2010-06-28 01:29:30 +02:00
Melanie Thielker
2cced72d70 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-27 21:05:06 +02:00
Melanie
9c553cd254 Fix more perms weirdness. Preserve "Locked" status across gives and rez/take.
Preserve "Anyone can move" flag in most cases.
2010-06-27 20:20:08 +01:00
Melanie
ba38c697e8 Merge branch 'master' into careminster-presence-refactor 2010-06-27 20:05:55 +01:00
Melanie Thielker
19f18c8a1b Make drag copy and copy-on-ray handle friends list perms properly 2010-06-27 21:04:30 +02:00
Tom Grimshaw
ef0ac7c403 Deal with incoming land objects properly so they don't just stack up 2010-06-26 23:20:28 -07:00
Tom Grimshaw
9f00f141fe Restore "AllowCareminsterFunctions" as an alias to the new "AllowLightshareFunctions". 2010-06-26 18:54:55 -07:00
Tom Grimshaw
592ff1288d Add a new global event : OnTerrainUpdate 2010-06-26 18:51:19 -07:00
Tom Grimshaw
c97e9f8621 Reverting the ITerrainModule changes. Turns out this was useless. 2010-06-26 18:43:01 -07:00
Tom Grimshaw
3bcee57e3e add HasChanged to ITerrainModule 2010-06-26 17:34:19 -07:00
Tom Grimshaw
c3e806a2ea Add a new accessor for the TerainModule : "HasChanged" 2010-06-26 17:25:45 -07:00
Tom Grimshaw
49272657d7 Make RegionLightShareData serializable 2010-06-26 15:30:47 -07:00
Tom Grimshaw
8f0adfbfb2 Trigger the RegionLightShareData OnSave event properly when the profile is saved 2010-06-26 15:15:19 -07:00
Tom Grimshaw
d188ed8ed8 Return everything at once, it's more efficient that way 2010-06-26 13:07:17 -07:00
Tom Grimshaw
ed5dac7e82 Fix another nullref issue in DeRezSceneObject 2010-06-26 13:06:47 -07:00
Tom Grimshaw
bd19cf739a Fix a bug with DeRezObjects (check for a null remoteClient) 2010-06-26 12:38:08 -07:00
Tom Grimshaw
acab2a159d Return objects which are NoCopy instead of just leaving them when cleaning the scene, if exceptNoCopy = true. 2010-06-26 11:24:36 -07:00
Tom Grimshaw
70d3b9aeca Add a DeleteAllSceneObjects(bool exceptNoCopy) method to allow NoCopy objects to be retained when the scene is cleared. 2010-06-26 11:14:58 -07:00
Tom Grimshaw
5b6485481b Add extra Gitminster config options to ini.example 2010-06-26 11:02:09 -07:00
Melanie Thielker
6c6c7b0927 Remove libs from main tree 2010-06-26 06:25:03 +02:00
Melanie Thielker
d3d63fe553 remove conflicting pdb debug files 2010-06-26 06:21:38 +02:00
Melanie Thielker
06fd49bda9 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-26 06:17:09 +02:00
Melanie Thielker
6274317e63 Fix loading of attachments on login 2010-06-26 06:16:24 +02:00
Tom Grimshaw
f64d1cb396 Add new event: OnChangedBackup 2010-06-25 14:39:15 -07:00
Tom Grimshaw
30397b6fbc Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-25 14:26:07 -07:00
Tom Grimshaw
96e649189f Add two events: OnAttachToBackup and OnDetachFromBackup. 2010-06-25 14:25:39 -07:00
Tom Grimshaw
8daa149c36 Remove the prepending slash from the default git repo name 2010-06-25 13:03:00 -07:00
Tom Grimshaw
3ef70b55e9 Whoops, enabled = true not enabled = 1 2010-06-25 12:58:13 -07:00
Tom Grimshaw
e0d533dc4e Add [Git] section to OpenSim.ini.example for Gitminster 2010-06-25 12:55:02 -07:00
Melanie
dc9e9931eb Merge branch 'master' into careminster-presence-refactor 2010-06-25 20:26:48 +01:00
Tom Grimshaw
94ece2789d Add some libraries for XGitminster 2010-06-25 12:21:24 -07:00
Tom Grimshaw
3101d53064 Make "Allow other residents to edit terrain" default to FALSE 2010-06-25 05:25:41 -07:00
Melanie Thielker
afff74a835 Add DwellModule interface 2010-06-25 01:44:17 +02:00
Melanie Thielker
8a0ec60c8f Unhook the dwell request from the land module (and therefore local storage) 2010-06-25 01:41:00 +02:00
Melanie Thielker
f186882c0f Also make prims send the proper position. I hate it when people comment
out things just because they're "not yet used". Grrrr.
2010-06-24 20:51:04 +02:00
Melanie Thielker
cbca58401a Add the object owner UUID into the binary bucket of object to user IM 2010-06-24 20:46:24 +02:00
Melanie Thielker
2cc1f14b0c Replace the imSessionID, which is useless out of context, with the scope id
in saved IMs
2010-06-24 19:37:02 +02:00
Melanie Thielker
b012e963d7 New viewers don't set the "save offline IM" flag anymore. Set it serverside
so messages get saved
2010-06-24 18:48:40 +02:00
Melanie Thielker
6c37a02c0f bug fix. 0,0 is a vlid sim coordinate 2010-06-24 06:02:44 +02:00
Melanie Thielker
9d03271265 And another 2010-06-24 03:43:50 +02:00
Melanie
e94cf3d9b7 And another conflict 2010-06-24 03:35:42 +01:00
Melanie
e93853623b Merge branch 'master' into careminster-presence-refactor 2010-06-24 03:30:11 +01:00
Melanie
ce6fbd9680 Merge branch 'master' into careminster-presence-refactor 2010-06-22 23:40:59 +01:00
Melanie
317ac50a97 Merge branch 'master' into careminster-presence-refactor 2010-06-22 23:38:56 +01:00
Melanie Thielker
5c02fb435d Security fix: Allow only textures to be fetched using HTTP texture cap 2010-06-22 17:35:00 +02:00
Melanie Thielker
962dade155 Cause collisions with the avatar to be sent to attachments. Currently
ignores collision filter. Physics collisions are still dodgy, so we
don't get the events we should be getting.
2010-06-22 04:04:59 +02:00
Melanie Thielker
3428196631 Guard prioritizer agains null values as those produced by a bullet dying
before it can be updated
2010-06-22 02:33:20 +02:00
Melanie Thielker
3ea4e5ccbe Correctly update the LastSeen field 2010-06-21 23:26:27 +02:00
Melanie Thielker
53905cf919 Bump the migration version, ot it would never happen 2010-06-21 22:15:33 +02:00
Melanie Thielker
ab023c6a29 Fix build break 2010-06-21 18:06:46 +02:00
Melanie Thielker
9fd45406be Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-21 17:06:59 +02:00
Melanie Thielker
973537f819 Ensure no UUID.Zero region ID is ever written to presence. Add a Migration
to add a LastSeen field of type "Timestamp" to Presence for MySQL
2010-06-21 17:06:05 +02:00
Tom Grimshaw
9d251b1dc5 Fix the StandUp position to calculate as if we're still using the child prim id. 2010-06-20 15:57:01 -07:00
Tom Grimshaw
fc715a092c Fix the sit code to ensure that we use the root prim of a linkset as a reference in the case of an avatar sitting on a child prim. This fixes various camera issues and fixes mantis #0000059. 2010-06-20 15:38:48 -07:00
Tom Grimshaw
33d05ef554 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-20 14:45:36 -07:00
Tom Grimshaw
a1416612a9 Update all clients sitting on a linkset if a child prim is moved. This prevents avatars being "lost in the void" until they stand up when a child prim is moved that they're sitting on. 2010-06-20 14:45:04 -07:00
Melanie Thielker
13a0b65a80 Modify avatar responsiveness policy to send roots before children 2010-06-20 21:38:06 +02:00
Melanie Thielker
797767da57 Insert a space after the comma on the ToString methos of lsl vectors
and rotations to match SL.
2010-06-20 07:16:19 +02:00
Melanie Thielker
95c763201f Set the offline flag in inventory offers 2010-06-20 06:36:46 +02:00
Melanie Thielker
76b59b8df7 Make dataserver() return a 0 when agent id offline, instead of a timeout 2010-06-20 06:23:08 +02:00
Melanie
04b60aa490 Merge branch 'master' into careminster-presence-refactor 2010-06-19 20:32:01 +01:00
Tom Grimshaw
49d7d8534c Allow moving an avatar as part of a linkset using llSetLinkPrimitiveParams. This unlocks an awful lot of poseball-free content, and is a step towards resolving mantis #59. 2010-06-19 10:06:09 -07:00
Tom Grimshaw
6d8da699b2 Add "AvatarHeight/2" to the Home Position when set to avoid having the avatar fall through the ground when they TP home. 2010-06-19 07:00:01 -07:00
Melanie
891214c65b Merge branch 'master' into careminster-presence-refactor 2010-06-18 20:49:21 +01:00
Kitto Flora
cea7905602 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-17 13:04:32 -04:00
Kitto Flora
958c6c6fde Add rez on water surface. 2010-06-17 13:04:18 -04:00
Tom Grimshaw
33c092781e Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-17 04:15:56 -07:00
Tom Grimshaw
d1c8b083b8 Fix llRot2Euler with a mathematically sound implementation. The only difference between this an SL is that SL resolves a figure of negative PI into PI, and does the equivalent in the reverse (llEuler2Rot, -1.0 becomes 1.0); 2010-06-17 04:15:07 -07:00
Melanie
8b3042f24f Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-17 03:09:17 +01:00
Melanie
7e22be3441 Merge branch 'master' into careminster-presence-refactor 2010-06-17 03:08:55 +01:00
Tom Grimshaw
b9c40320f1 Fix llAttachToAvatar. This addresses mantis 128 . 2010-06-16 09:20:20 -07:00
Tom Grimshaw
117fd629d6 Allow llMapDestination to be used in any event if the host is an attachment. This fixes Mantis 0000098. 2010-06-16 08:32:47 -07:00
Melanie
0b75f759b4 Merge branch 'master' into careminster-presence-refactor 2010-06-16 04:10:55 +01:00
Tom Grimshaw
ef1496ca2d Add "alert dialog" for sending dialogs to users from the console 2010-06-14 04:28:38 -07:00
Tom Grimshaw
704da8c823 osGetAvatarList: Use AbsolutePosition instead of the position of the physics actor, or the avatar disappears when they sit down. 2010-06-14 04:03:54 -07:00
Melanie
fdf648bcf3 Merge branch 'master' into careminster-presence-refactor 2010-06-14 02:49:15 +01:00
Melanie Thielker
9b30f44672 D.U.H. #2. Inverted test. Again. Argh! 2010-06-14 02:28:31 +02:00
Melanie Thielker
1532dbca0a Guard against a potential nullref 2010-06-14 00:12:39 +02:00
Melanie Thielker
f9b4f5f594 Revert "Introduce SOP.UpdateSitters() to update sitting avatars' chat position if"
This reverts commit f59e272643.
2010-06-14 00:05:01 +02:00
Melanie Thielker
5fda89fdb5 Revert "D.U.H."
This reverts commit 3058761806.
2010-06-14 00:04:02 +02:00
Melanie Thielker
093cc047cd Revert "Try it witht he root prim"
This reverts commit d520360cb8.
2010-06-14 00:03:43 +02:00
Melanie Thielker
62763cc0fb Report current position instead of position at the time we sat down 2010-06-14 00:02:17 +02:00
Melanie Thielker
d520360cb8 Try it witht he root prim 2010-06-13 23:01:15 +02:00
Melanie Thielker
3058761806 D.U.H.
un-reverse a reversed condition
2010-06-13 22:43:14 +02:00
Melanie Thielker
520b0e131c Try to make prims stop moving. Reset velocity, etc, unconditionally. Although
the phys actor may be new, the prim fields could still be set and the
slimupdates system would continue sending that data out.
2010-06-13 22:37:11 +02:00
Melanie Thielker
3d319d6c3f Actually update the SP. EXPERIMENTAL 2010-06-13 22:23:07 +02:00
Melanie Thielker
f59e272643 Introduce SOP.UpdateSitters() to update sitting avatars' chat position if
needed
2010-06-13 22:21:05 +02:00
Melanie
5e4bee0f34 Merge branch 'master' into careminster-presence-refactor 2010-06-12 19:15:59 +01:00
Melanie
4950ee5f3b Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-12 16:27:55 +01:00
Melanie
d2342319da Merge branch 'master' into careminster-presence-refactor 2010-06-12 16:27:37 +01:00
Tom Grimshaw
63531b1df5 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-12 04:36:14 -07:00
Tom Grimshaw
3ea11fe2e6 Get rid of spamming SOG debug message 2010-06-12 04:35:51 -07:00
Melanie Thielker
03a48f87e4 Preserving the link numbers is a serializer's highest duty.
Prevent region crossings from screwing up complex attachments by preserving
link numbers.
2010-06-12 08:29:20 +02:00
Melanie Thielker
e337c9130f Make local teleports send CHANGED_TELEPORT 2010-06-12 07:34:22 +02:00
Melanie
57a60282f5 Don't filre CHANGED_INVENTORY if a prim comes in from storage 2010-06-12 06:57:10 +01:00
Melanie
0ece71f8d1 Merge branch 'master' into careminster-presence-refactor 2010-06-12 06:14:10 +01:00
Melanie
3c3ad08868 Merge branch 'master' into careminster-presence-refactor
0.7.1CM Dev
2010-06-12 02:46:11 +01:00
Melanie
ae0a7e2c37 Merge branch 'master' into careminster-presence-refactor 2010-06-12 02:19:57 +01:00
Melanie
508bfa1de8 Merge branch 'master' into careminster-presence-refactor 2010-06-12 01:26:55 +01:00
Melanie
6a2e0c707c Merge branch 'master' into careminster-presence-refactor 2010-06-12 00:34:26 +01:00
Melanie
836728e5de Merge branch 'master' into careminster-presence-refactor 2010-06-12 00:08:20 +01:00
Melanie
4e34770aba Merge branch 'master' into careminster-presence-refactor 2010-06-11 20:56:43 +01:00
Melanie
1cfebca48d Merge branch 'master' into careminster-presence-refactor 2010-06-11 20:35:00 +01:00
Melanie
9318674cdb Merge branch 'master' into careminster-presence-refactor 2010-06-11 17:54:35 +01:00
Melanie
77ef0053f2 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-11 17:52:59 +01:00
Melanie
8a084cb7e1 Remove a company name referecne from the example 2010-06-11 17:52:29 +01:00
Melanie
de8f9e201f Merge branch 'master' into careminster-presence-refactor 2010-06-11 17:49:12 +01:00
Melanie
b1224c3540 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-11 17:47:34 +01:00
Melanie
aa2f5bdd77 Merge branch 'master' into careminster-presence-refactor 2010-06-11 17:46:29 +01:00
Melanie Thielker
be71a2e5bc Revert "Remove the cm* function namespace"
This reverts commit ef93ac4452.
2010-06-11 17:52:19 +02:00
Melanie Thielker
ef93ac4452 Remove the cm* function namespace 2010-06-11 17:48:33 +02:00
Melanie Thielker
10ef80cf15 Rename CM files to LS 2010-06-11 17:42:16 +02:00
Melanie Thielker
97d83c87ec Rename cm* function set to ls* (for LightShare) 2010-06-11 17:23:06 +02:00
Melanie Thielker
8d5cec5e0d Remove cmGetAvatarList() 2010-06-11 17:08:18 +02:00
Melanie Thielker
b3cf5ccf6d Clone cmGetAvatarList into osGetAvatarList for more generic use. 2010-06-11 17:04:54 +02:00
Melanie
1dce243661 Merge branch 'master' into careminster-presence-refactor 2010-06-09 20:25:05 +01:00
Melanie
30d3ea3d4b Give attachments the same priority as other avatars in BestAvatarResponsiveness
policy
2010-06-09 17:00:24 +01:00
Melanie
6b2d2413f7 Merge branch 'master' into careminster-presence-refactor 2010-06-09 16:48:37 +01:00
Melanie
20ea823c19 Merge branch 'master' into careminster-presence-refactor 2010-06-08 22:07:01 +01:00
Melanie Thielker
7d75dc1294 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-08 22:04:09 +02:00
Kitto Flora
54209907f3 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-08 16:15:45 -04:00
Kitto Flora
6e2cc98eac Fixed llMoveToTarget() and Rotation Lock/Enable (ChODE/ODEPrim only) 2010-06-08 16:15:16 -04:00
Melanie Thielker
4921d5ac2d Make the text mode remote console really work. It can now be used to send
multi-word commands with proper quoting, handles arguments with spaces
and allows interactive use, e.g. user creation.
2010-06-08 22:03:08 +02:00
Melanie
d2dfbbe339 Merge branch 'master' into careminster-presence-refactor 2010-06-08 00:44:53 +01:00
Melanie
74d62901c8 Merge branch 'master' into careminster-presence-refactor 2010-06-07 00:44:36 +01:00
Melanie Thielker
fad5158ab4 Add a call to SOG.ResumeScripts() after region crossing / teleport 2010-06-07 00:09:44 +02:00
Tom Grimshaw
e962c44749 Fix support for PRIM_SCULPT_FLAG_INVERT and PRIM_SCULPT_FLAG_MIRROR in the llSetPrimitiveParams series of functions. This makes it possible to mirror a sculpt by script. 2010-06-04 19:36:31 -07:00
Melanie
c5878b6610 Merge branch 'master' into careminster-presence-refactor 2010-06-04 21:11:15 +01:00
Tom Grimshaw
dda7185b43 Change the admin kick message to something more generic, "OpenSim Manager" is not really accurate 2010-06-03 17:55:50 -07:00
Tom Grimshaw
293f775fa5 Always provide at least 2 packets of a texture (if the texture is larger than 1 packet). This fixes compatibility with the newer (broken) SnowGlobe and Emerald viewer(s), but also matches the behaviour of SL. 2010-06-02 07:59:18 -07:00
Melanie Thielker
655f02b695 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-02 01:05:36 +02:00
Melanie Thielker
70aa965c26 Add a forgotten security check. Make the new functions only work on prims
owned by the host prim owner.
2010-06-02 01:04:17 +02:00
Melanie Thielker
d8962ef415 Add two new osFunctions:
list osGetPrimititveParams(key prim, list rules);
osSetPrimitiveParams(key prim, list rules);
2010-06-02 01:01:56 +02:00
Tom Grimshaw
90c814a7ca Fix nullref in cmGetAvatarList() (ported from 0.69) 2010-06-01 13:29:12 -07:00
Melanie Thielker
6668c789d3 One should not lock null objects. 2010-06-01 19:01:21 +02:00
Melanie Thielker
c900134f91 Lock the object queue when dequeueing 2010-06-01 16:03:53 +02:00
Melanie
f8e2d25739 Merge branch 'master' into careminster-presence-refactor 2010-06-01 02:24:12 +01:00
Melanie Thielker
28c5759456 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-06-01 03:18:03 +02:00
Melanie Thielker
16d8602d3c Fix prim returns I broke earlier 2010-06-01 03:17:21 +02:00
Melanie Thielker
6c4c72546c Fix prim returns I broke earlier 2010-06-01 03:05:08 +02:00
Melanie Thielker
eca15cfbf2 Change the handling of CreateSelected. Only send it on real creation, not
for each prim coming into view.
2010-06-01 02:45:14 +02:00
Melanie Thielker
bf233ea0dc Continuing refactor. Refactor DeRezObject to deal with multiple objects 2010-06-01 02:27:30 +02:00
Melanie Thielker
f57f2370f1 Add a method to get the bounding box and root prim offsets within it for
a group of prims.
2010-06-01 01:25:24 +02:00
Melanie Thielker
70f7790413 Split GetAxisAlignedBoundingBox into two methods to allow calculation of
combined bounding boxes and offsets
2010-06-01 01:07:46 +02:00
Melanie Thielker
9d4913224f Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-31 19:00:36 +02:00
Melanie Thielker
d4b4cbf5a5 Fix create selection getting overwritten by multiple updates for the same prim. 2010-05-31 19:00:02 +02:00
Tom Grimshaw
6c1665bf46 Fix casting in llParcelMediaCommandList so that it actually, you know, works 2010-05-31 08:38:41 -07:00
Melanie Thielker
bbb4d6e4c9 Fix a nullref in EventManager caused by RegionReady not setting the scene 2010-05-31 01:02:04 +02:00
Melanie Thielker
890f3cc54c Changes osFunction permissions again. Allow_ with a list of UUIDs now again
refers to prim OWNERS. A new option set, Creators_, is added to allow
selection by script creator. For existing installs, this means no functional
change. The warning from my prior commit doesn't apply anymore.
2010-05-30 15:46:54 +02:00
Melanie Thielker
59a5367433 Changes OSSL Api permissions for the case of UUID list. In 0.6.9, the UUIDs
would be the IDs of the prim owners in whose prims these functions would
run. This changes it so the UUID is the SCRIPT CREATOR instead. Further,
osfunctions limited by uuid will not run if the creator and owner differ
and the owner has mod rights on the script.
There is still a danger in passing moodifiable scripts to others, as they
can insert a harmful function, then remove the mod rights to make it runnable.
As before, care needs to be taken, but where it was modable prims that were
the risk before, modable scripts are the weak spot now.
In cases where prim owner == script creator == script owner, nothing will
change.
2010-05-30 13:46:05 +02:00
Melanie Thielker
84e30bee6d Revert "Meta7 Communities : Authorization service added, skeleton, not yet functional"
This reverts commit 31439293cc.
2010-05-29 12:34:02 +02:00
Tom Grimshaw
31439293cc Meta7 Communities : Authorization service added, skeleton, not yet functional 2010-05-29 03:56:34 -07:00
Tom Grimshaw
e3dac1292e Implement suspended updates - When an operation is occurring on lots of prims in a single group, don't schedule any updates until the operation has completed. This makes things like llSetAlpha(LINK_SET,0.0,ALL_SIDES); a *lot* faster, more efficient and less buggy, and also makes unlinking a lot better. Linking is still treacherous.. this needs to be analysed. 2010-05-29 02:10:34 -07:00
Tom Grimshaw
3a5d379db8 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-29 01:07:19 -07:00
Tom Grimshaw
2f409116db Stop IGridService from throwing a fatal exception when an IPEndPoint cannot be resolved, and add some handlers to deal with this cleanly; a condition was observed on OSGrid where a neighbouring region with an invalid (unresolveable) hostname would prevent a region from starting. This is bad. 2010-05-29 01:03:59 -07:00
Melanie Thielker
e7bf6afd3a Get the user's DOB back from the server response properly. 2010-05-29 05:14:18 +02:00
Melanie
542e6b8af4 Merge branch 'master' into careminster-presence-refactor 2010-05-28 21:56:42 +01:00
Mike Rieker
ea5bcc7b88 Merge branch 'careminster-presence-refactor' of www.3dhosting.de:/var/git/careminster into careminster-presence-refactor 2010-05-27 22:14:43 -04:00
Mike Rieker
9ea42fdfab Merge branch 'careminster-presence-refactor' of www.3dhosting.de:/var/git/careminster into careminster-presence-refactor 2010-05-27 21:31:10 -04:00
Mike Rieker
7d6680b38a fix hanging output throttle arithmetic
had multiply overflow and subtract wrap-around errors
2010-05-27 21:28:47 -04:00
Melanie Thielker
66b4309f34 Apply Mike's TokenBucket fix 2010-05-28 02:44:12 +02:00
Melanie Thielker
ba49319c07 Prevent a null ref 2010-05-27 20:08:48 +02:00
Melanie Thielker
ac5373427f Comment noisy "CONNECTION DEBUGGING" messages, because they push more
important stuff off screen too fast. Clean this time
2010-05-27 20:08:12 +02:00
Melanie Thielker
9e3b5a5587 Remove orphaned .dll.config files from tests 2010-05-26 19:29:56 +02:00
Melanie Thielker
f90d81a864 Just because there is an agent update handler, that doesn't mean there is
a pre agent update handler. Null check these separately.
2010-05-26 19:26:30 +02:00
Melanie
97501495eb Merge branch 'master' into careminster-presence-refactor 2010-05-26 17:19:02 +01:00
Melanie
00737f1c13 Merge branch 'master' into careminster-presence-refactor 2010-05-24 23:40:22 +01:00
Melanie
72b96e8121 Add the SitGround flag back in 2010-05-23 06:12:11 +01:00
Melanie
a9dad99432 Merge branch 'master' into careminster-presence-refactor
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2010-05-23 06:09:54 +01:00
Melanie
297bcb5c3d Merge branch 'master' into careminster-presence-refactor 2010-05-21 21:16:04 +01:00
Melanie
c0cb66e602 Merge branch 'master' into careminster-presence-refactor 2010-05-21 15:58:34 +01:00
Melanie
ccbcf421e7 Merge branch 'master' into careminster-presence-refactor 2010-05-21 15:27:17 +01:00
Melanie
344f209565 Merge branch 'master' into careminster-presence-refactor 2010-05-21 06:28:13 +01:00
Melanie Thielker
af5eeab7cf Ensure that the first update sent out for any given prim is a full update 2010-05-21 07:37:55 +02:00
Melanie
a92780fe5f Merge branch 'master' into careminster-presence-refactor 2010-05-21 03:51:58 +01:00
Melanie
d28da5e5ce Refactor scene presence list for lockless iteration. Lock contention will now only be for simultaneous add/removes of scene presences from the scene. 2010-05-21 03:41:32 +01:00
Melanie
b6674c9b76 Merge branch 'careminster' into careminster-presence-refactor 2010-05-21 03:03:35 +01:00
Melanie
ddd072b3fb Merge branch '0.6.9-post-fixes' into careminster 2010-05-21 02:44:20 +01:00
Melanie
147c2d6f80 Change the way the object perms are propagated to attempt to salvage
some older content
2010-05-21 02:31:14 +01:00
Tom Grimshaw
5532341bf9 Initialise m_initialSitTarget to ZERO_VACTOR for safety's sake as per convo with kitto 2010-05-19 14:04:44 -07:00
Tom Grimshaw
6933b48a7e Fix a nullref issue in SitAltitudeCallback 2010-05-19 13:49:34 -07:00
Tom Grimshaw
f77f9ecd8f Fix a nullref issue in SitAltitudeCallback 2010-05-19 13:44:59 -07:00
Tom Grimshaw
fc76b5f589 Fix a null reference issue in cmGetAvatarList() 2010-05-19 00:24:54 -07:00
Tom Grimshaw
71a95900fd Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-19 00:21:38 -07:00
Tom Grimshaw
ba36c62caa Fix a null reference issue in cmGetAvatarList() 2010-05-19 00:20:51 -07:00
Melanie Thielker
55f124745f Allow remote admin to be used on a different port from the main region port 2010-05-18 19:25:40 +02:00
Melanie
1c3790a70d Merge branch 'master' into careminster-presence-refactor 2010-05-18 15:31:19 +01:00
Tom Grimshaw
bb0806c61e Don't send kill packets to child agents as we close them 2010-05-18 03:44:09 -07:00
Tom Grimshaw
1c040d8c1e Fix to the scenario where we send an agent to a neighbouring sim (via teleport), then tell our neighbours to close the agents.. thereby disconnecting the user. Added a new CloseChildAgent method in lieu of CloseAgent. This has been a long standing problem - with any luck this will cure it. 2010-05-18 03:24:43 -07:00
Tom Grimshaw
ed1cfb5245 Missed a nullref in the previous commit 2010-05-18 02:33:41 -07:00
Tom Grimshaw
91b1d17e5b Fix for hanging on "Connecting to region".. caused by packets being processed before the presence has bound to receive events. Fixed this by adding packets to a queue and then processing them when the presence is ready. 2010-05-18 01:09:47 -07:00
Tom Grimshaw
ae7c30a0f3 While examining our 10,10,10 issue I discovered that several threads were locked with each other in an unusual place; I've moved the piece of code inside a lock[] context and so far it's looking promising. 2010-05-18 00:07:17 -07:00
Melanie Thielker
eb5a95d26b Prevent an "index out of range" error on login 2010-05-18 03:02:36 +02:00
Tom Grimshaw
c25c40a3f9 Following on from the last commit, the stop/disconnect packet should NOT be sent when the user logs out. This eliminates the annoying "crash on log out" bug, and allows the client to commit important information at the last moment (attachment data!) 2010-05-17 15:24:28 -07:00
Tom Grimshaw
6bc7e3429f Provide interface to prevent the client close function from sending the stop packet 2010-05-17 14:32:21 -07:00
Tom Grimshaw
8f838c722d When killing a zombie session, don't send the stop packet since it often has the effect of killing a newly connected client. 2010-05-17 14:14:19 -07:00
Melanie
a003c36de5 Merge branch 'master' into careminster-presence-refactor 2010-05-16 20:32:58 +01:00
Melanie
d8bf370fd6 Merge branch 'master' into careminster-presence-refactor 2010-05-16 17:22:38 +01:00
Melanie
a723225179 Merge branch 'careminster-presence-refactor' of ssh://melanie@3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-16 15:02:23 +01:00
Melanie
b94cace547 Merge branch 'master' into careminster-presence-refactor 2010-05-16 15:01:56 +01:00
Tom Grimshaw
9079ad5ceb Add some debug output to GetAgent to try and track down our presence problems 2010-05-13 12:40:18 -07:00
Tom Grimshaw
fd37a21b59 Kill some locks that have crept into SOG 2010-05-12 08:34:47 -07:00
Tom Grimshaw
7705012ee7 Optimise the heavily used GetScenePresences; eliminate the array->list conversion on every call and transition from hard locks to ReaderWriter locks. 2010-05-12 08:25:40 -07:00
Tom Grimshaw
98bd3e1f34 Don't convert UUID -> ToString for every friend (Minor optimisation based on profiler feedback) 2010-05-12 07:14:06 -07:00
Tom Grimshaw
40e05f4109 Spin the AddNewClient process off into a new thread to avoid locking up the LLUDPServer (and therefore the entire scene) 2010-05-11 09:28:46 -07:00
Tom Grimshaw
14a86de115 Fix another ReaderWriterLockSlim issue 2010-05-10 12:45:33 -07:00
Melanie
5814d16b58 Merge branch 'master' into careminster-presence-refactor 2010-05-10 15:57:32 +01:00
Tom Grimshaw
3cda854ef3 Fix overlooked readLock which was left open 2010-05-10 08:47:41 -07:00
Tom Grimshaw
ab716125d7 Correct an odd merge anomaly 2010-05-10 05:51:49 -07:00
Tom Grimshaw
2e94c75729 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-10 05:44:24 -07:00
Tom Grimshaw
2fe669448f Greatly improve login time for users with large friends lists by requesting all unknown UUID's in one go rather than individually 2010-05-10 05:43:16 -07:00
Melanie
fada4cb6c4 Merge branch 'master' into careminster-presence-refactor 2010-05-10 04:05:04 +01:00
Melanie
6a3e1734e6 Merge branch 'master' into careminster-presence-refactor 2010-05-09 18:03:57 +01:00
Melanie
4e0d62547d Merge branch 'master' into careminster-presence-refactor 2010-05-09 17:04:23 +01:00
Melanie
420dd78fb7 Merge branch 'careminster' into careminster-presence-refactor 2010-05-08 14:17:43 +01:00
Melanie
14fcc2510e Merge branch 'master' into careminster-presence-refactor 2010-05-08 13:31:36 +01:00
Kitto Flora
bc7d84b75c Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-05-07 15:16:59 -04:00
Kitto Flora
add7abc1de Fix Mouse+WASD makes Av rise; Fix PREJUMP. 2010-05-07 14:12:07 -04:00
Melanie
b309781f2d Merge branch 'master' into careminster-presence-refactor 2010-05-07 01:00:58 +01:00
Melanie
69d0201d4c Revert "Patch from mcortez: Update groups, add ALPHA Siman grid connector for groups"
Causes an exception within HttpServer, headers have already been sent.

This reverts commit 8187fccd25.
2010-05-06 16:38:23 +01:00
Melanie
11971fb302 Merge branch 'master' into careminster-presence-refactor 2010-05-06 16:09:36 +01:00
Melanie Thielker
02dea4ce58 Remove the m_Viewer variable and make the property a shortcut to the
proper field in AgentCircuitData instead
2010-05-06 02:02:12 +02:00
Melanie
7e0d5b8665 Merge branch 'master' into careminster-presence-refactor 2010-05-05 22:50:11 +01:00
Melanie Thielker
2d9a20529d Plumb Viewer version into ScenePresence for initial login. It's still not
carried along
2010-05-06 00:54:21 +02:00
Melanie Thielker
733a07e061 Plumb the viewer version string through into AgentCircuitData. Now all that
is left os to figure out what black magic turns AgentCircuitData into
AgentData and then copy that into the ScenePresence, where m_Viewer is
already added with this commit and waits for the data.
2010-05-06 00:34:49 +02:00
Melanie Thielker
65775b87e5 Add a XMLRPC method to remotely set the login level for the LLLoginService.
This requires a special XMLRPC call, which has to supply the credentials of
a god user (User level >= 200). Disabled by default. Also Adds a configuration
option to set the initial permitted login level.
2010-05-05 23:06:36 +02:00
Melanie Thielker
e0f9b1a699 Removed a test for a "can't happen" case. ParentGroup is never null anymore. 2010-05-05 21:12:02 +02:00
unknown
91cfce3758 back port groups changes
Signed-off-by: Melanie <melanie@t-data.com>
2010-05-05 16:11:00 +01:00
unknown
8a69070b51 back port groups changes 2010-05-05 16:09:53 +01:00
Melanie
6fdd5bfe2d Revert "Patch from mcortez: Update groups, add ALPHA Siman grid connector for groups"
The patch was for 0.7

This reverts commit 608bb0dfef.
2010-05-05 16:03:20 +01:00
Melanie
608bb0dfef Patch from mcortez: Update groups, add ALPHA Siman grid connector for groups
Mantis #4646

Signed-off-by: Melanie <melanie@t-data.com>
2010-05-05 14:37:05 +01:00
Melanie Thielker
efc3241541 Add perms check to the teleport home client command handlers. 2010-05-05 01:32:55 +02:00
Melanie Thielker
49efec2ef1 Strip estate message sending out from the estate management module and
the dialog module. Convert it to an event on the estate module interface.
The old implementation did the same as message to region, a button that
is right next to it on the UI. This implementation prevented people from
adding a more sane one in a module.
2010-05-04 23:45:59 +02:00
Melanie Thielker
07e0732a10 make the events more useful by providing the source region 2010-05-04 21:16:20 +02:00
Melanie
9ca79df802 Merge branch 'careminster' into careminster-presence-refactor 2010-05-04 18:41:20 +01:00
Melanie
585259ef08 Merge branch 'master' into careminster-presence-refactor 2010-05-04 18:39:04 +01:00
Melanie Thielker
97bbce92a8 Add events to the estate interface to let interested modules know of
changes to estate settings
2010-05-04 20:57:31 +02:00
Melanie Thielker
ce86d39c70 Add "reload estate" command to sims 2010-05-04 18:31:52 +02:00
Melanie Thielker
4f93d30790 Allow reloading of estate settings into a running region. Move sun update
helper into Scene, since that is less evil than exposing m_storageManager
to the public.
2010-05-04 18:10:13 +02:00
Melanie Thielker
da849aea78 Allow regions to get the list of the other regions in the estate 2010-05-04 17:56:30 +02:00
Melanie Thielker
dbce360566 Fix full circle sensors 2010-05-04 02:43:22 +02:00
Melanie Thielker
c86259c671 Fix scripted give and interactive give to offline avatars. Both folder and
single items are now supported. Magic Boxes, yeah!
2010-05-04 00:44:05 +02:00
Melanie Thielker
deaa79ca9e Refix the fix 2010-05-03 23:53:49 +02:00
Melanie Thielker
87e0c17707 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-05-03 23:47:50 +02:00
Melanie Thielker
80bf3934af Add folder version incrementing to XInventoryService. Fixes offline give
for avatar->avatar
2010-05-03 23:47:32 +02:00
Melanie Thielker
8ec6e42e34 Add folder version uncrementing to XInventoryService. Fixes offline give
for avatar->avatar
2010-05-03 23:45:05 +02:00
Melanie Thielker
4df87631ed Store given items in correct parent folder. Fixes items given to offline avatars
not getting lost.
2010-05-03 23:44:23 +02:00
Melanie Thielker
9c8d7d34b3 Fix a bug in owner change notification 2010-05-03 04:55:41 +02:00
Melanie Thielker
8766401777 Adapt CM to the new CHANGED_OWNER handling 2010-05-03 04:28:30 +02:00
Melanie
9f8acbfe3e Merge branch 'master' into careminster-presence-refactor 2010-05-03 01:40:24 +01:00
Melanie Thielker
175f3f992a Make the IUserAccountData properly unpack the god mode data, so grid gods
work again
2010-05-03 01:50:32 +02:00
Melanie Thielker
0fa57cac3f Fix sensor cone for sensing avatars 2010-05-03 00:54:24 +02:00
sacha
5f6e9e6ab9 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-05-02 08:18:33 -04:00
sacha
7ad36d3d75 Adding DebugEvent Trap
Adding XMREEvent Trap

 trapDebug("Modulename" ,"My data here ",  scene);
 trapXMRE(int data, string Message, Scene scene);
2010-05-02 08:15:12 -04:00
Melanie Thielker
881fcb7def Allow retrieval if admin users in scope mode 2010-04-30 23:32:58 +02:00
Melanie Thielker
7ae55f6248 Fix linking issue introduced in my earlier commit 2010-04-30 20:18:29 +01:00
Melanie Thielker
0a9c98e7c4 Fix linking issue introduced in my earlier commit 2010-04-30 20:18:08 +01:00
Melanie
9bc5098dd8 Merge branch 'master' into careminster-presence-refactor 2010-04-30 20:15:19 +01:00
Melanie Thielker
3e30de7430 Fix linking issue introduced in my earlier commit 2010-04-30 22:35:07 +02:00
Melanie
486ab82c02 Fix some symbol errors 2010-04-30 12:08:37 +01:00
Melanie
10750421a3 Fix some symbol errors 2010-04-30 12:07:47 +01:00
Melanie
9500ba2ff5 Fix some symbol errors 2010-04-30 12:06:58 +01:00
Melanie
13960b3b86 Merge branch 'master' into careminster-presence-refactor 2010-04-30 11:49:24 +01:00
Melanie
7dc5ebc929 Merge branch 'careminster' into careminster-presence-refactor 2010-04-30 11:49:16 +01:00
Melanie
8b70477556 Merge branch '0.6.9-post-fixes' into careminster 2010-04-30 11:48:57 +01:00
Melanie
04845c1898 Fix link security issue 2010-04-30 11:48:09 +01:00
Melanie
9c79fd6308 Treat a UserLevel of -1 as an unverified account and refer them to their
activation email.
2010-04-30 05:33:45 +01:00
Kitto Flora
f3c21524be Fix Av jump motion S/W 2010-04-29 19:41:08 -04:00
Melanie
08ebcdb0b8 Merge branch 'master' into careminster-presence-refactor 2010-04-29 23:33:26 +01:00
Melanie
f06772a088 Merge branch 'careminster' into careminster-presence-refactor 2010-04-29 23:33:20 +01:00
Kitto Flora
5c23b4aa56 Fix vertical attractor 2010-04-29 13:50:11 -04:00
Melanie
8a32ee7dd2 Merge branch 'careminster' into careminster-presence-refactor 2010-04-27 03:58:43 +01:00
Melanie
89a003c6fc Merge branch 'master' into careminster-presence-refactor 2010-04-27 03:57:36 +01:00
Melanie
bbffe16f13 Merge branch 'master' into careminster-presence-refactor 2010-04-27 00:27:05 +01:00
Melanie Thielker
06661708b4 Add a parameter to prim inventory update to prevent event firing 2010-04-27 02:40:30 +02:00
Melanie Thielker
81ff5eaba0 Make scripted attachment states work. Finally. Also replace two monitor locks
with RWLocks, hunting the 10^3 bug. Not successful, but needed to be done anyway
2010-04-25 22:03:35 +02:00
Melanie Thielker
899d521ab4 Use the saved script states 2010-04-24 18:59:34 +02:00
Melanie Thielker
27b3f23ff3 Remove some usings that stopped compilation 2010-04-24 16:53:47 +02:00
Melanie Thielker
71f42f185a Plumb a data path to initialize an attachment from an alternate source 2010-04-24 16:45:25 +02:00
Melanie Thielker
56f60a04d9 Add an additional serialization call do the detach procedure. This call is
executed only for it's side effects, which are to block until attach(NULL_KEY)
completes, before commencing detachment.
2010-04-23 20:18:34 +02:00
sacha
85646b157c Adding some more SNMP events and some refactoring
Signed : The Masqued Foxi
2010-04-23 12:40:27 -04:00
Melanie Thielker
31e0704c8d Remove debug output, the culprit has been identified 2010-04-23 17:48:50 +02:00
sacha
7eda9364fd Adding LinkUp/LinkDown when a region is started or stoped.
Those two events could be used to compute the region availibility
2010-04-23 10:51:27 -04:00
Melanie Thielker
780630d7c0 Fix a nullref in attachment handling. Add some debug to find the attachment
state issue
2010-04-23 14:41:20 +02:00
Melanie
af778f09d5 Merge branch 'master' into careminster-presence-refactor 2010-04-21 19:51:17 +01:00
Melanie Thielker
de63b60748 Avoid duplicate script resumes. Move resume calls to more logical places 2010-04-19 19:27:45 +02:00
Melanie Thielker
80024c023a Remove the event trigger for the attach event from the attachment module.
The script engine already triggers this internally.
2010-04-19 18:44:21 +02:00
Melanie
d2e4f2d376 Merge branch 'master' into careminster-presence-refactor 2010-04-19 15:33:20 +01:00
Melanie Thielker
1667a29c88 And some more rez modes that weren't covered before 2010-04-19 12:54:33 +02:00
Melanie
efa7873ae1 Merge branch 'master' into careminster-presence-refactor 2010-04-19 10:44:01 +01:00
Melanie
65079b1106 Merge branch 'careminster' into careminster-presence-refactor 2010-04-19 07:00:51 +01:00
Melanie
98cb4f74b2 Merge branch 'master' into careminster-presence-refactor 2010-04-19 07:00:40 +01:00
Melanie
f8d49e0a30 Merge branch '0.6.9-post-fixes' into careminster 2010-04-19 06:32:29 +01:00
Melanie Thielker
72d380acf0 Merge branch 'master' into careminster-presence-refactor 2010-04-19 06:10:23 +02:00
Mike Rieker
68a4f897b4 This GetScriptErrors() change allows initial XEngine to run in background
thread.  It should block only for the case of being called by
CapsUpdateTaskInventoryScriptAsset().
2010-04-18 19:19:16 -04:00
Justin Clark-Casey (justincc)
43acd99bb3 Slightly tweak README to account for the fact that first-time standalone users may effectively set up their avatar as 'master avatar' in the region configuration stage. 2010-04-18 19:19:50 +01:00
Justin Clark-Casey (justincc)
b7457a0a5d Update OpenMetaverse libraries to those used in master as of commit 9a781e7
This removes Mono.Security.dll which might help with Mono 2.6.3 compatability issues (notwithstanding the sqlite problem)
2010-04-18 19:16:41 +01:00
Justin Clark-Casey (justincc)
c77444a821 Fix http://opensimulator.org/mantis/view.php?id=4657 where OpenSim.Grid.UserServer.exe fails on startup if no previous config
probably appears to occur because mono 2.4.2.3 (and possibly later) erroneously returns a value of 0 for BufferWidth and BufferHeight in some circumstances
2010-04-16 20:40:01 +01:00
Melanie Thielker
ccc56e6dd4 Merge branch 'master' into careminster-presence-refactor 2010-04-16 05:20:25 +02:00
Melanie
1636f535ba Committing sacha's partial work (from orpheus). The GridBrat needs to learn
a bit of git
2010-04-14 10:42:14 +01:00
Melanie
fac55bc78b Change ISnmpModule to use scene references 2010-04-14 01:17:27 +01:00
Melanie
4433f53f72 Drop unused Alert() method from ISnmpModule 2010-04-13 20:14:56 +01:00
Melanie
9920e219dd Merge branch 'careminster' into careminster-presence-refactor 2010-04-13 04:36:08 +01:00
Melanie
a1c4585a39 Merge branch '0.6.9-post-fixes' into careminster 2010-04-13 04:13:26 +01:00
Kitto Flora
9b6e89457c Fixed LINEAR_MOTOR Z drive, Mantis #30 2010-04-11 14:12:01 -04:00
lcc
7ecd9b3f1a Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
resolved
Conflicts:
	OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
2010-04-10 23:52:10 +02:00
lcc
c6ba50b7e2 Adding ColdStart event 2010-04-10 23:39:06 +02:00
Mike Rieker
0b2b2daf23 guarantee that a script engine's GetScriptErrors() will not be called
until after its OnRezScript() returns so that script compile error
messages can be retrieved
2010-04-10 14:43:26 -04:00
lcc
58dac970af re-fixing this darn file 2010-04-10 18:05:08 +02:00
lcc
c4eaf195b5 dding this deleted file... 2010-04-10 17:59:08 +02:00
lcc
d975bd8e5c Fixing Trap 2010-04-10 17:51:51 +02:00
Melanie
7701ea2798 Add Scene.SnmpService, which is of type ISnmpModule and, if nun-null, can
be used to send snmp alerts
2010-04-09 06:49:14 +01:00
John Hurliman
54cedfe432 Changed the GetTextureModule backport to work with the 0.6.9 codebase 2010-04-08 15:57:57 -07:00
John Hurliman
94a46867ed Added a missing reference to prebuild.xml 2010-04-08 15:38:58 -07:00
John Hurliman
c4c4c3696e Backported WebUtil.cs from master to 0.6.9-postfixes to fix the build break 2010-04-08 15:26:51 -07:00
John Hurliman
0f3314c04c Backported GetTextureModule and IAssetService.GetCached() 2010-04-08 15:00:01 -07:00
Thomas Grimshaw
d834a2c3da Implement cmGetAvatarList(). This returns a strided list of all avatars in the region, including their UUID, position and name. The radar is often the most taxing scripts on a sim, this function can help radars reduce their impact by 66% by eliminating the need for sensors. 2010-04-07 23:53:08 +02:00
Thomas Grimshaw
e80e04c5fd Increase the amount of time we wait for a teleport to complete. This allows teleportation to a remote region without a local connection to the asset server without timing out. 2010-04-07 22:59:13 +02:00
Thomas Grimshaw
309f440fc0 Fix llDialog responses so that they can be heard throughout the region. This now conforms to the behaviour in SL. ( http://bugs.meta7.com/view.php?id=13 ) 2010-04-07 10:13:47 +02:00
Thomas Grimshaw
db5ea850f6 Fix llLookAt so that it doesn't "roll" the object and more closely imitates the behaviour in SL. ( http://bugs.meta7.com/view.php?id=28 ) 2010-04-07 09:49:11 +02:00
Thomas Grimshaw
20e3de1f0a Add CHANGED_REGION_START (alias for CHANGED_REGION_RESTART as per LL Jira SVC-3773) 2010-04-07 08:28:57 +02:00
Thomas Grimshaw
335c1b4420 Implement PSYS_SRC_INNERANGLE and PSYS_SRC_OUTERANGLE 2010-04-07 07:48:26 +02:00
Kitto Flora
a97a887ea4 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-04-05 23:25:46 -04:00
Melanie Thielker
e40acda6c8 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-04-05 23:22:14 +02:00
Melanie Thielker
e7be131b89 Add the ISnmpModule interface definition to Careminster release 2010-04-05 23:20:56 +02:00
Thomas Grimshaw
fd4a059e9b Merge branch 'master' of ssh://TOR/var/git/careminster 2010-04-05 23:17:31 +02:00
Thomas Grimshaw
2f454843d8 Fix up my own shoddy code! Fixes prim rez break. Whups! 2010-04-05 23:17:06 +02:00
Melanie Thielker
a573b5767b Test commit 2010-04-05 22:31:30 +02:00
Melanie Thielker
5c04d768a6 Bump version number 2010-04-05 22:26:18 +02:00
Kitto Flora
4bf1598930 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-04-05 16:15:23 -04:00
Thomas Grimshaw
07b4889eab Merge branch 'master' of ssh://TOR/var/git/careminster 2010-04-05 22:11:11 +02:00
Thomas Grimshaw
7a3bb266eb This commit adds some randomness to object persistence. It's a Work In Progress, I am working on improving this to a tiered approach. 2010-04-05 22:11:05 +02:00
Thomas Grimshaw
f34cc6b469 Add a much cheaper agent count retrieval method. This is obsoleted by 0.7 so it can be reverted then. 2010-04-05 22:08:34 +02:00
Kitto Flora
9b9e2a8c71 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-04-05 15:27:13 -04:00
Melanie
2fbbc13c71 Fix some overlooked merge conflicts that got committed 2010-04-05 19:42:15 +01:00
Kitto Flora
35bf75a77a Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-04-05 14:08:57 -04:00
Melanie
ba31b31ed0 Merge branch 'careminster' into careminster-presence-refactor 2010-04-05 18:22:15 +01:00
Melanie
fe034dc3e4 Merge branch 'master' into careminster-presence-refactor 2010-04-05 18:12:29 +01:00
Melanie
f505c1d0a4 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-04-05 18:10:49 +01:00
Melanie
04a68db195 Merge branch '0.6.9-post-fixes' into careminster 2010-04-05 18:10:36 +01:00
kitto
e2a521742a ChODE Only: Corrected Heightmap load to iliminate crack at 255M. Added 'fence' option to prevent physical objects crossing region border. 2010-04-04 22:57:32 -04:00
lcc
956225f0e1 Fixed Ban and parcel exclusion. Need to fix the parcel chat too 2010-04-04 18:29:18 +02:00
Melanie
4fefd05839 Merge branch 'master' into careminster-presence-refactor
Remerge the LightShare bits that were pushed to core
2010-03-31 04:38:19 +01:00
Melanie
7d917e7c5c Rename Meta7Windlight to LightShare 2010-03-30 23:29:03 +01:00
Melanie
5693870fe2 Merge branch 'master' into careminster-presence-refactor 2010-03-30 21:34:27 +01:00
Justin Clark-Casey (justincc)
18ed68cd31 add nant distbin target
this will delete all extraneous source code files and copy OpenSim.ini.example to OpenSim.ini
2010-03-26 20:47:26 +00:00
Justin Clark-Casey (justincc)
4d712ddaae comment out very probably unused dist and distdir nant targets 2010-03-26 19:36:21 +00:00
Justin Clark-Casey (justincc)
dd544f811a switch flavor to RC1 2010-03-26 19:09:09 +00:00
Melanie Thielker
e0b287961f Change land overlay to send group owned status properly 2010-03-23 17:04:37 +01:00
Kitto Flora
0f5fb6f190 Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor 2010-03-19 19:14:09 -04:00
Kitto Flora
add47befac Update acceleration to 0 on no tphysical. 2010-03-19 18:53:16 -04:00
Kitto Flora
0e36994fe7 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-03-19 13:27:12 -04:00
Kitto Flora
3ea72eeabb Fix sit with autopilot. 2010-03-19 13:26:34 -04:00
Melanie
4c2a51b1b5 Merge branch 'master' into careminster-presence-refactor 2010-03-18 20:09:04 +00:00
Melanie
46d990419b Merge branch 'careminster' into careminster-presence-refactor 2010-03-18 20:00:58 +00:00
Melanie
69b5ddceda Unify a previous refactor of object return with the older solution. We
really don't need two methods doing the same thing, but differently.
2010-03-18 18:58:56 +00:00
Melanie
1a2cbbc8c1 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-03-18 18:58:44 +00:00
Melanie
f35eb8819c Unify a previous refactor of object return with the older solution. We
really don't need two methods doing the same thing, but differently.
2010-03-18 18:58:37 +00:00
Kitto Flora
6df969894c Fix AbsolutePosition for autopilot/sit. 2010-03-17 13:30:48 -04:00
Thomas Grimshaw
e442c2a3f9 Prevent llTeleportAgentHome from affecting gods 2010-03-17 17:42:33 +01:00
Thomas Grimshaw
37815f3402 Debugger tags for VS2010 2010-03-16 18:13:00 +01:00
Melanie
a1cd3b5b88 Change GodLevel to UserLevel so gods can teleport freely without having
to enter god mode first
2010-03-15 17:54:39 +00:00
Melanie
d3f33acc1a Merge branch 'master' into careminster-presence-refactor 2010-03-15 17:23:35 +00:00
Melanie
898fa637c3 Merge branch 'careminster' into careminster-presence-refactor 2010-03-15 17:12:08 +00:00
Kitto Flora
8cbd0d3b5f Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-03-14 16:23:12 -04:00
Kitto Flora
8198062610 RotLookAt repaired; debug msg cleanup. 2010-03-14 16:22:13 -04:00
CasperW
80e4068b3e Fix the delay in llGiveInventory so that it only takes effect when giving inventory to an avatar (this now replicates SL behaviour) 2010-03-13 15:13:19 +01:00
Kitto Flora
1379ae4310 Fix Rotation Lock. NOTE: This version had poor border crossing control 2010-03-12 16:13:52 -05:00
Kitto Flora
7bd48d383d Resolved merge 2010-03-12 13:48:31 -05:00
Kitto Flora
f6f6ef1532 Dynamics Integration Part 1 2010-03-11 19:12:38 -05:00
Melanie
689514a40a Cache UserLevel in ScenePresence on SP creation. Change IsAdministrator
to use that stored value.
2010-03-09 23:12:10 +00:00
Melanie
40873504dc Merge branch 'master' into careminster-presence-refactor 2010-03-09 22:46:17 +00:00
unknown
fce9e499e4 - parcel blocking, region crossing blocking, teleport blocking 2010-03-09 22:38:58 +00:00
Melanie
80b5a95bb8 Revert "Adds Land Banning."
This reverts commit a87d7a1296.
2010-03-09 22:29:02 +00:00
Melanie
06e351f1ef Revert "Adds land ejection and freezing. Adds more checks to land banning."
This reverts commit 44d523518a.
2010-03-09 22:28:52 +00:00
Justin Clark-Casey (justincc)
4423630f1e remove milliseconds from console log again 2010-03-09 18:56:32 +00:00
Justin Clark-Casey (justincc)
5caae0293a Fix bug where approximately half the time, attachments would rez only their root prim until right clicked (or otherwise updated).
The root cause of this problem was that multiple ObjectUpdates were being sent on attachment which differed enough to confuse the client.
Sometimes these would eliminate each other and sometimes not, depending on whether the scheduler looked at the queued updates.
The solution here is to only schedule the ObjectUpdate once the attachment code has done all it needs to do.

Backport from head.
2010-03-09 18:53:04 +00:00
Melanie
49baf090cd Small consistency change 2010-03-07 16:08:00 +00:00
Melanie
c8c608acc8 Small consistency change 2010-03-07 16:07:40 +00:00
Melanie
3d053b194a Small consistency change 2010-03-07 16:06:52 +00:00
Melanie
8180c72cbc Merge branch 'master' into careminster-presence-refactor 2010-03-06 12:37:24 +00:00
Melanie
2fdd535302 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-03-06 12:24:26 +00:00
Melanie
1f7a0cf892 Merge branch '0.6.9-post-fixes' into careminster 2010-03-06 12:24:09 +00:00
unknown
83929c69e3 - implementing server 1.38 functions
Signed-off-by: Melanie <melanie@t-data.com>
2010-03-06 11:59:16 +00:00
Kitto Flora
87590491b5 Fix Physics angular reference frame. 2010-03-04 16:33:26 -05:00
Melanie
107a0a4905 Merge branch 'master' into careminster-presence-refactor 2010-03-04 11:02:01 +00:00
Melanie
62dd83f473 Remove a superfluous array creation 2010-03-04 10:47:16 +00:00
Melanie
84b0a23e19 Remove a superfluous array creation 2010-03-04 10:45:46 +00:00
Melanie
7ec1a3fcad Merge branch 'master' into careminster-presence-refactor 2010-03-03 03:18:19 +00:00
Melanie
028a87fe37 Merge branch 'master' into careminster-presence-refactor
This brings careminster on the level of master. To be tested
2010-03-03 02:07:03 +00:00
Melanie
01c4bb4a5e Revert "test"
This reverts commit 2f0011c605.
2010-03-03 01:29:42 +00:00
Melanie
2f0011c605 test 2010-03-03 01:26:19 +00:00
CasperW
393a782858 Fix the crashed session notification from the userserver. 2010-02-25 18:05:30 +01:00
CasperW
7f61de8f57 Allow particles and texture anims to be persisted to XML. This behaviour is expected. 2010-02-25 14:14:53 +01:00
CasperW
e99341d7df llDie() should not work on attachments (results in an incosistent attachment state) 2010-02-25 12:07:56 +01:00
CasperW
efd4810851 Disable blocking teleports within the same parcel for now; it's not implemented correctly. Will review soon. 2010-02-25 12:04:51 +01:00
Melanie
92a8d7ce6c Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-02-16 23:15:59 +00:00
Melanie
d6eff8ebcf Change a condition to actually make linden land reclaim work 2010-02-16 23:14:57 +00:00
CasperW
af2d20c5fa Fix an inconsistency in llSetPayPrice between SL and OS behaviour 2010-02-15 22:22:36 +01:00
CasperW
47a9e48f46 Merge branch 'master' of ssh://TOR/var/git/careminster 2010-02-15 06:15:14 +01:00
CasperW
94c417c90c Implement missing llGetPrimitiveParams parameters 2010-02-15 06:10:04 +01:00
Melanie
ce3e265575 Plug a small hole 2010-02-15 00:06:03 +00:00
Melanie
b2fefe3e3f Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-02-14 22:27:59 +00:00
Melanie
2084e08ad7 Merge branch 'master' into careminster 2010-02-14 22:27:39 +00:00
Kitto Flora
9568718add Angular motor adjustments 2010-02-12 15:56:21 -05:00
Kitto Flora
6a70349512 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-02-12 14:08:32 -05:00
Melanie
0ad8046582 Resolve a merge issue 2010-02-08 22:44:17 +00:00
Melanie
ad38450f9c Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-02-08 22:43:53 +00:00
Melanie
c8f3bb56ff Merge branch 'master' into careminster 2010-02-08 22:11:38 +00:00
Kitto Flora
59851ceee6 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-02-08 14:29:06 -05:00
CasperW
044979066c Fix two inconsistencies with LightShare 2010-02-05 00:53:32 +01:00
Melanie
776d62b9c6 Merge branch 'master' into careminster 2010-02-04 17:29:33 +00:00
Melanie
ae9362636e Line endings cleanup 2010-02-04 17:00:16 +00:00
Kitto Flora
48134af616 Motor angular decay fix. 2010-02-03 16:20:13 -05:00
Kitto Flora
fc1ac25935 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-02-03 14:32:29 -05:00
Melanie
0f1a3f8ed2 Merge branch 'master' into careminster 2010-02-03 00:16:02 +00:00
Kitto Flora
8c20610293 AngMotor update 1 2010-02-02 13:28:42 -05:00
Melanie
d5ed92cf38 Merge branch 'master' into careminster 2010-02-02 03:56:29 +00:00
Melanie
6478617c93 Revert "improve locking of m_items in SceneObjectPartInventory"
This reverts commit 968b9e160d.
2010-02-02 03:49:00 +00:00
Melanie
0c5850237e Small fix for a spurious exception 2010-01-29 16:50:00 +00:00
Melanie
9e37d24624 Prevent empty ObjectProperties packets being sent 2010-01-29 11:47:45 +00:00
Melanie
44c86cedcf Resolve one more conflict I overlooked 2010-01-29 07:47:50 +00:00
Melanie
cfca9e1e81 Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e.
2010-01-29 07:20:13 +00:00
Melanie
5b9ca6e35f Merge branch 'master' into careminster 2010-01-28 14:38:46 +00:00
Revolution
862caa72a8 Fixes terrain editing. Changes ThrottleOutPacketType to task instead of land. 2010-01-28 03:04:38 +00:00
Melanie
2d9b69c186 Merge branch 'master' into careminster 2010-01-28 02:07:18 +00:00
Melanie
e9c9a74e0a Some merge fixups 2010-01-26 15:12:41 +00:00
Melanie
b80ea00265 Merge branch 'master' into careminster 2010-01-26 14:53:14 +00:00
Melanie
d2e17f4ffb Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2010-01-21 23:48:11 +00:00
Kitto Flora
1abb70cc73 Add glue for llSetVehicleFlags(), llRemoveVehicleFlags(). ChODE: Add associated methods. 2010-01-21 19:31:02 -05:00
Melanie
946e06eb58 Merge branch 'master' into careminster 2010-01-21 23:47:40 +00:00
Kitto Flora
66692f90e3 ChODE Object Linear Motion update 2010-01-21 14:39:11 -05:00
CasperW
a964431c21 Merge branch 'master' into casper 2010-01-20 22:19:14 +01:00
CasperW
496a8a4f7c Fixed an issue with PayPrice sometimes being shared between multiple objects 2010-01-20 22:14:43 +01:00
Careminster Staff
24056dc98b Adds example to OpenSim.ini.example for Admin Default Parcel settings 2010-01-19 01:46:50 +00:00
Melanie
6772c9d2b6 Comment the asset deletion handler. It can be abused and is not currently
needed.
2010-01-18 17:35:49 +00:00
Melanie
e3dbd79543 Merge branch 'master' into careminster 2010-01-18 17:24:21 +00:00
CasperW
d9c48e70a9 Fix a major security problem with osSetDynamicTexture which allowed the deletion of /any/ asset. 2010-01-18 17:56:27 +01:00
Melanie
51bb311565 Add chat banning. Staff patch 2010-01-18 02:53:31 +00:00
Melanie
f4e30664e6 Fix a typo 2010-01-18 01:55:54 +00:00
Careminster Staff
44d523518a Adds land ejection and freezing. Adds more checks to land banning. 2010-01-18 01:27:01 +00:00
Melanie
8c39392eaa Merge branch 'master' into careminster 2010-01-16 00:15:26 +00:00
Melanie
884410501e Allow renaming of items that contain no-mod items 2010-01-15 20:19:06 +00:00
Careminster Staff
a87d7a1296 Adds Land Banning. 2010-01-14 04:11:17 +00:00
Melanie
f0152790cf Merge branch 'master' into careminster 2010-01-14 01:20:07 +00:00
Melanie
8452c0869d Merge branch 'master' into careminster 2010-01-11 08:00:03 +00:00
Melanie
20e748205e Merge branch 'master' into careminster 2010-01-11 03:50:24 +00:00
Melanie
649d45a2d4 Merge branch 'master' into careminster 2010-01-11 02:04:58 +00:00
Melanie
0ae861d7d7 Merge branch 'master' into careminster 2010-01-11 02:01:23 +00:00
Melanie
511481e8d9 Merge branch 'master' into careminster 2010-01-10 19:59:49 +00:00
Melanie
1676e70dfe Merge branch 'master' into careminster 2010-01-10 04:16:06 +00:00
Melanie
46b5fe5acd Merge branch 'master' into careminster 2010-01-09 20:54:59 +00:00
Melanie
089f5403a7 Merge branch 'master' into careminster 2010-01-09 16:35:32 +00:00
Melanie
1597e33549 Merge branch 'master' into careminster 2010-01-09 15:59:33 +00:00
Melanie
121c6b4835 Merge branch 'master' into careminster 2010-01-09 15:34:58 +00:00
Melanie
a764eb5dc7 Merge branch 'master' into careminster 2010-01-09 14:21:50 +00:00
Melanie
d22bdb5095 Merge branch 'master' into careminster 2010-01-09 12:02:48 +00:00
Kitto Flora
a2aadb78a9 Maintain control() event stream 2010-01-08 23:12:11 -05:00
Kitto Flora
71adb37fa8 Fix llRotBetween 2010-01-07 23:58:19 -05:00
Kitto Flora
6591f8a592 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-01-07 23:04:28 -05:00
Melanie
3724a38ab4 Allow estate managers (if estate_owner_is_god is set) to actually enter
god mode. Allow god modification of objects if the object owner is the
same god that wants to modify, this allows you to regain perms on your
own objects after IAR import messed them up.
2010-01-05 15:39:53 +00:00
Melanie
54e6c26def Merge branch 'master' into careminster 2010-01-04 22:29:43 +00:00
Melanie
0907d5d69e Finish conversion if XInventoryService 2010-01-04 20:52:44 +00:00
Melanie
53d3f46add First stage port of the XInventoryService 2010-01-04 18:47:47 +00:00
Melanie
d657b76dba Merge branch 'master' into careminster 2010-01-04 06:17:38 +00:00
Kitto Flora
253e2ed699 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2010-01-03 23:10:01 -05:00
Melanie
1121919b57 Solve conflict 2010-01-03 22:02:36 +00:00
Melanie
61ce884336 Merge branch 'master' into careminster 2010-01-03 21:43:39 +00:00
Melanie
71fdc24f5c Add virtual method StateChange to ScriptBaseClass 2010-01-02 21:21:31 +01:00
Melanie
aa51b83fdc Merge branch 'master' into careminster 2009-12-31 23:31:45 +00:00
Melanie
b321c0a932 Merge branch 'master' into careminster 2009-12-31 21:53:39 +00:00
Kitto Flora
3f901d313b Vehicle Linear parameter adjustments 2009-12-31 16:07:36 -05:00
Melanie
67cfe34e67 Merge branch 'master' into careminster 2009-12-31 06:42:33 +00:00
Melanie
643cc7a0ee Merge branch 'master' into careminster 2009-12-31 04:53:05 +00:00
Melanie
b3cb99036c Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2009-12-31 06:21:03 +01:00
Melanie
9602227eb6 Add a small delay in NewAgentConnection to fix an issue with Hippo
(and possibly other cleints) getting their data mixed up.
2009-12-31 06:20:35 +01:00
Melanie
5e103f2b2e Revert "Merge branch 'master' into careminster"
This reverts commit d49d44923d.
2009-12-30 20:26:22 +00:00
Melanie
d49d44923d Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2009-12-30 20:25:57 +00:00
Melanie
cbe0841bc9 Revert "Merge branch 'master' into careminster"
This reverts commit 596af3f600.
2009-12-30 20:13:18 +00:00
Melanie
596af3f600 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2009-12-30 20:12:21 +00:00
Melanie
8f0d6d6b5c Fix an omission in LSL that causes a viewer crash 2009-12-30 00:37:28 +00:00
Melanie
a08360e3cd Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2009-12-30 00:27:34 +01:00
Melanie
06f639b8f3 Fix a timer list locking issue causing XMREngine deadlocks 2009-12-30 00:27:01 +01:00
Melanie
ba3dfe4121 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2009-12-29 18:42:30 +00:00
Melanie
67cfac0cf1 Merge branch 'master' into careminster 2009-12-29 18:41:45 +00:00
Melanie
8ad8bd6282 Fix up the new Sirikata cient view 2009-12-27 17:52:27 +01:00
Melanie
045a44b1af One should not copy/paste so much :) 2009-12-27 16:07:59 +00:00
Melanie
d321d23afe Fix the spelling :/ 2009-12-27 16:03:00 +00:00
Melanie
e3f60ce06f Merge branch 'master' into careminster 2009-12-27 15:48:43 +00:00
CasperW
4b96a78039 Merge branch 'master' into casper 2009-12-27 07:11:21 +01:00
CasperW
19a5e606b3 Convert some remaining legacy lock()s for m_parts in SceneObjectGroup to ReaderWriteLockSlim, hopefully fixes a native crash 2009-12-27 07:08:16 +01:00
root
a18f4964cf Correct some issues with the last commit 2009-12-27 01:32:23 +01:00
Melanie
f5c310d9d4 Merge branch 'master' into careminster 2009-12-26 23:39:02 +00:00
CasperW
a6c93ce875 Make sure that we're not bounds checking attachments. 'Cos otherwise your hair will end up on your bum. Seen that before? 2009-12-26 22:55:18 +01:00
CasperW
1b8f91a0db Merge branch 'master' into casper 2009-12-26 18:17:55 +01:00
CasperW
7371c7662a Fix for landing points. Only one scenario is not fully covered by this change, and that is people who teleport from neighbouring regions, who won't get affected by the landing point. 2009-12-26 18:14:12 +01:00
Melanie
f3a4860635 Merge branch 'master' into careminster 2009-12-26 04:13:27 +00:00
root
43c303e27a Make the GenericTableHandler work as intended 2009-12-26 03:24:46 +01:00
Melanie
e51be5f4a7 Merge branch 'master' into careminster 2009-12-26 00:21:03 +00:00
Melanie
59f683066a Set version back to core version (base) and suffix CM. Please DO NOT CHANGE THIS
in the repo. This is the Caremninster repo and the number follows CORE. Always.
2009-12-25 23:23:49 +00:00
Melanie
b19e564317 Restore version suffix. 2009-12-25 23:20:30 +00:00
Melanie
e881f35fbb Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2009-12-25 23:20:08 +00:00
Melanie
59a841d69c Merge branch 'master' into careminster 2009-12-25 23:17:08 +00:00
Kitto Flora
e7439efc74 Recover out-of-region objects during db load. 2009-12-24 19:19:44 -05:00
Melanie
0054afd39b Merge branch 'master' into careminster 2009-12-24 16:45:27 +00:00
Melanie
7f699fca9a Add the body to the LSL List Size property 2009-12-24 18:18:14 +01:00
Melanie
e5e951d92c Merge branch 'master' into careminster 2009-12-24 00:45:53 +00:00
Melanie
5a653ef96f Merge branch 'master' into careminster 2009-12-23 23:10:34 +00:00
Melanie
165f193f78 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2009-12-23 21:25:08 +00:00
Melanie
6eecbc95e4 Merge branch 'master' into careminster 2009-12-23 21:22:19 +00:00
CasperW
a9f4d7a29c Add a debugger tag to stop Visual Studio from breaking 2009-12-23 17:34:08 +01:00
CasperW
c54e0953d0 Merge branch 'master' of ssh://TOR/var/git/careminster 2009-12-23 14:15:27 +01:00
CasperW
b575bf2524 Added some null reference and deleted group checks to certain functions to fix region crash scenarios. 2009-12-23 14:14:20 +01:00
Melanie
30f59370d3 Merge branch 'master' into careminster 2009-12-22 15:48:41 +00:00
Melanie
73491cceed Merge branch 'master' into careminster 2009-12-22 15:37:24 +00:00
Melanie
28c7bb99bf Merge branch 'master' into careminster 2009-12-22 09:30:50 +00:00
Melanie
551727cd19 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2009-12-22 06:43:31 +01:00
Melanie
bde26a8282 Add missing file 2009-12-22 06:43:03 +01:00
Kitto Flora
11c4a2cfd0 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2009-12-22 00:34:06 -05:00
Kitto Flora
93b930b937 Fix conflicts 2009-12-22 00:33:31 -05:00
root
b53b871669 Add a data path for error messages 2009-12-22 06:25:32 +01:00
Kitto Flora
0a29842caf Include ChOdePlugin 2009-12-22 00:20:04 -05:00
root
49fbe0ddb4 Should not commit without compiling 2009-12-22 03:26:47 +01:00
root
46fea74726 Jumped the gun... 2009-12-22 03:25:09 +01:00
root
69b551c516 Allow 100ms for scripts to run attach(NULL_KEY) on detach 2009-12-22 03:22:33 +01:00
Melanie
fa0621b486 Merge branch 'master' into careminster 2009-12-22 00:41:56 +00:00
Melanie
84a1a0a729 Merge branch 'master' into careminster 2009-12-21 22:07:22 +00:00
Melanie
b891291135 Merge branch 'master' into careminster 2009-12-21 15:02:57 +00:00
CasperW
d8d6e8a304 Merge branch 'master' into casper 2009-12-21 13:29:48 +01:00
CasperW
e3c1466047 Fixed a nasty crash in StandUp() that occurred when the part got killed with an avatar sitting on it. 2009-12-21 13:22:52 +01:00
Melanie
df30b1c832 Merge branch 'master' into careminster 2009-12-21 10:28:50 +00:00
Melanie
3d3e0ea4f3 Merge branch 'master' into careminster 2009-12-20 16:45:28 +00:00
CasperW
c7a457f9ee Merge branch 'casper' 2009-12-20 16:20:48 +01:00
CasperW
31bf25d05e Reverted my changes to jhurliman's packet stack since it currently causes more problems than it resolves. The stack DOES need a rework particularly with regards to priorities, but this is not it. 2009-12-20 16:18:43 +01:00
Kitto Flora
eecaa3d9dd Merge branch 'tests' 2009-12-19 20:00:00 -05:00
Kitto Flora
e38e8ae987 Fix mantis #10 & #14 2009-12-19 19:54:44 -05:00
CasperW
6dbe25360e Add cmSetWindlightSceneTargeted. Add restrictions on windlight script use. 2009-12-17 18:40:34 +01:00
Kitto Flora
6483470ec5 Fix GetWorldRotation(), and a host of related Sit fixes. 2009-12-17 02:54:02 -05:00
Kitto Flora
83fad75e22 Merge branch 'tests' 2009-12-16 18:59:46 -05:00
Kitto Flora
7cd44c1a81 Fix prim linking bug, Manis #14 2009-12-15 20:04:53 -05:00
Melanie
f8b6bc8d11 Merge branch 'master' into careminster 2009-12-15 15:46:18 +00:00
Kitto Flora
0020afaf67 Merge branch 'master' into tests 2009-12-15 06:01:59 -05:00
Kitto Flora
b8b4517211 Removed excessive call to UpdateMovementAnimations which prevented GroundSit; Corrected cause of 'sit on roof'. 2009-12-15 01:49:23 -05:00
Melanie
824d7190c2 Merge branch 'master' into careminster 2009-12-14 00:40:56 +00:00
Melanie
30d64444a0 And reverse 2009-12-12 16:01:53 +00:00
Melanie
9904700dfd Another whitespace test commit 2009-12-12 16:00:44 +00:00
Kitto Flora
49dbae65c9 Merge branch 'master' into tests 2009-12-12 10:14:06 -05:00
Kitto Flora
b056c243e4 Commit partial work because of repo change 2009-12-12 10:12:59 -05:00
Melanie
c00158b238 Reverse test commit (again) 2009-12-12 14:35:12 +00:00
Melanie
794419852b Another test 2009-12-12 14:23:20 +00:00
Melanie
fbafd22124 Reverse text commit whitespace change 2009-12-12 13:43:49 +00:00
Melanie
b9cd66d510 test commit 2009-12-12 13:33:45 +00:00
Melanie
b310efc50f Merge branch 'master' into careminster 2009-12-12 12:54:43 +00:00
Melanie
0fdf883cbd Merge branch 'master' into careminster 2009-12-12 04:56:28 +00:00
Melanie
1382dc976c Merge branch 'master' into careminster 2009-12-12 04:14:47 +00:00
Melanie
54e4dcf454 Merge branch 'master' into careminster 2009-12-11 02:49:41 +00:00
Melanie
f6b1344722 Refix the fix 2009-12-11 02:40:33 +00:00
grid
5ffd59e7b8 Kill a NRE caused by an error message trying to print unavailable data 2009-12-10 22:09:16 -05:00
Melanie
0889b5aef1 Fix version number 2009-12-10 18:20:40 +00:00
Melanie
59ca92b10b Merge branch 'tests' of kitto@tor.k-grid.com:/home/kitto/opensim into careminster 2009-12-10 18:17:29 +00:00
Melanie
956f337046 Merge branch 'careminster' of kitto@tor.k-grid.com:/home/kitto/opensim into careminster 2009-12-09 22:07:03 +00:00
CasperW
a6a6bf007a Move osFunctions into a new Careminster script interface 2009-12-09 23:28:00 +01:00
Melanie
2e9890bbe6 Merge branch 'careminster' of kitto@tor.k-grid.com:/home/kitto/opensim into careminster 2009-12-09 16:57:35 +00:00
Melanie
f2427a7320 Merge branch 'master' into careminster 2009-12-09 16:57:26 +00:00
CasperW
2a6dbd068e Last bits and bobs to clean up the Meta7WindlightModule 2009-12-09 03:58:56 +01:00
unknown
d092977f4a Windlight configuration option in ini, and migration 2009-12-09 01:53:41 +01:00
unknown
e3f229225c Enable scripting interface for windlight 2009-12-09 01:34:26 +01:00
KittoFlora
ee9d46c825 Correct AbsolutePosition calculation 2009-12-08 05:49:05 +01:00
unknown
dbd8c400ce Merge branch 'careminster' into windlight 2009-12-07 18:14:02 +01:00
unknown
29a740ec8c Initial windlight codebase commit 2009-12-07 18:05:40 +01:00
Melanie
c2d3afdeee Same for the remote auth connector 2009-12-07 14:31:20 +00:00
Melanie
9155c9ee37 Merge branch 'master' into careminster 2009-12-07 14:14:00 +00:00
KittoFlora
0d1d437bd3 Fix linked physical daughter prim position update. 2009-12-06 21:11:59 +01:00
CasperW
b15f20520f Merge branch 'careminster' of ssh://TOR/home/kitto/opensim/ into careminster 2009-12-06 17:23:22 +01:00
CasperW
172e2f4e76 Fix to existing ReaderWriterLockSlim implementations 2009-12-06 17:23:07 +01:00
Melanie
23cd1b1954 Revert "Make ObjectSelect packet processing not use FireAndForget"
This reverts commit cade14c58c.
2009-12-06 05:24:43 +00:00
Melanie
cade14c58c Make ObjectSelect packet processing not use FireAndForget 2009-12-06 05:14:17 +00:00
Melanie
1e222d52e6 Change EntityManager to use RWlocks 2009-12-06 03:56:15 +00:00
Melanie
f9ae9afaac Fix build break from conflicted merge 2009-12-06 03:10:34 +00:00
Melanie
09bbfc1d56 Merge branch 'master' into careminster 2009-12-06 03:01:58 +00:00
Melanie
79511ecce2 Experimental: Remove explicit property sends 2009-12-06 02:15:52 +00:00
Melanie
2fe75a62be Skip single prims in unlink selections 2009-12-06 02:00:32 +00:00
Melanie
da414fd509 Change locking to not mix explicit Monitor.* calls with lock() 2009-12-06 01:20:39 +00:00
Melanie
f2891e7738 Remove extra forced updates. They're not needed for each prim. Really. 2009-12-06 00:50:28 +00:00
Melanie
fbefa8273b Lock updates out while linking and unlinking 2009-12-06 00:25:04 +00:00
Melanie
ceccfe02d0 Eliminate multiple updates on link/unlink 2009-12-06 00:02:24 +00:00
Melanie
129de26032 Cause better packing of ObjectProperties 2009-12-05 23:25:30 +00:00
Melanie
43a6fa1d01 Merge branch 'master' into careminster 2009-12-05 19:53:54 +00:00
KittoFlora
cc8246206d Secnond revision of Sit and Stand for unscripted prims; Comment out
spammy debug messages in Interregion....
2009-12-05 09:03:02 +01:00
Melanie
551696bb45 Merge branch 'master' into careminster 2009-12-02 10:22:21 +00:00
Melanie
ded16d3529 Merge branch 'master' into careminster 2009-12-02 00:36:53 +00:00
CasperW
2e6dce434f Enforce physical prim max size on single prims.
Also convert a lock() to ReaderWriterLockSlim that i missed in the last commit
2009-11-30 21:52:55 +01:00
CasperW
9888f95068 Convert multiple lock()s which directly hinder script performance in linksets to ReaderWriterLockSlim. 2009-11-30 21:17:15 +01:00
Melanie
8bbb88ea4e Merge branch 'master' into careminster 2009-11-30 14:16:42 +00:00
Melanie
69d83e1548 Merge branch 'master' into careminster 2009-11-30 08:25:40 +00:00
Melanie
d3e7a52933 Merge branch 'master' into careminster 2009-11-28 09:26:00 +00:00
Melanie
aa695e92f7 Reset update flag when a SOG is deleted. This fixes llDie(); 2009-11-27 08:58:26 +00:00
Melanie
0ddd1ce0b7 Merge branch 'master' into careminster 2009-11-27 08:18:16 +00:00
Melanie
cc18ab12f8 Merge branch 'master' into careminster 2009-11-27 00:40:56 +00:00
root
2c3f6aaa87 Merge branch 'careminster' into tests 2009-11-26 20:41:38 +01:00
KittoFlora
5dedacca3c First attempt at mult-sit on large single prims. 2009-11-26 20:37:08 +01:00
Melanie
ad2f0a1290 Remove OS version crap from about dialog 2009-11-26 18:04:58 +00:00
Melanie
bd3b9f79c2 Update CM version 2009-11-26 17:59:28 +00:00
Melanie
ed148eba32 Merge branch 'master' into careminster 2009-11-26 17:45:09 +00:00
Melanie
06f41bb017 Merge branch 'master' into careminster 2009-11-26 17:27:03 +00:00
Melanie
a27d33cb63 Remove the old remoting-type interregion code for prim/script crossing 2009-11-26 13:13:56 +00:00
Melanie
22c325aa5a Remove GetAssemblyName and friends from the SE interface. It's now handled
internally
2009-11-26 13:13:48 +00:00
CasperW
ac2fcbe224 Improvements to rAdmin admin_shutdown and admin_restart. Both methods can now accept a parameter of noticetype = dialog in order to display a blue persistant dropdown instead of a short notice. Added an optional and configurable delay to the restart method, defaulting at 30 seconds as before. Both methods can also accept a noticetype = none dialog in order to act silently. 2009-11-26 15:17:44 +01:00
CasperW
63b6b9cdce Added animation support for my last commit 2009-11-26 02:35:27 +01:00
CasperW
de55110247 Merge branch 'careminster' into casper 2009-11-26 02:01:51 +01:00
CasperW
b9d22aa821 Add nudge right and left to avatar movement (faster reaction times when stepping left or right.) 2009-11-26 01:59:08 +01:00
Melanie
de927adf27 Add the dummy "Size" property to the list type 2009-11-25 20:01:21 +00:00
Melanie
79395bc7db Merge branch 'master' into careminster 2009-11-25 17:04:05 +00:00
Melanie
c81f37cf82 Change osTeleportAgent parameters from long to int. That numerical range is
not even supported by the underlying type, so there is no need to ask
for a type the script can not even supply.
2009-11-25 17:01:41 +00:00
Melanie
25b4160434 Merge branch 'master' into careminster 2009-11-25 08:45:41 +00:00
KittoFlora
32c464ad1f Fixed animation sequencing: SitHere, Falling, Stand/Walk etc. Login Init
Av Animation at Stand.
2009-11-25 08:03:09 +01:00
CasperW
d5aceb6d95 Append a prefix to the god avatar names appearing in chat whilst in god mode (disabled by default, config entry admin_prefix) 2009-11-24 23:33:12 +01:00
Melanie
81f7e9b462 Merge branch 'careminster' of kitto@tor.k-grid.com:/home/kitto/opensim into careminster 2009-11-24 16:00:45 +00:00
CasperW
8383bde768 Removed some extra debug chatter 2009-11-24 18:18:19 +01:00
CasperW
d114713694 Drop all locking of part.TaskInventory in favour of a ReaderWriterLockSlim lock handler. This gives us:
- Faster prim inventory actions. Multiple threads can read at once.
 - Fixes the known prim inventory thread locks
 - In the event of a thread lock occurring, it will usually self heal after sixty seconds with an error message in the console
2009-11-24 18:02:12 +01:00
Melanie
cad2bf5b08 Merge branch 'master' into careminster 2009-11-24 16:00:35 +00:00
CasperW
247c66b3fe Swap the locking of m_EventQueue and m_Script to ease locks on script inventory operations 2009-11-23 20:25:53 +01:00
CasperW
73c2162ff6 Fixed nullrefs 2009-11-23 19:51:40 +01:00
CasperW
889ce36afa Added some [DebuggerNonUserCode] modifiers to functions that throw EventAbortException() to ease debugging on Visual Studio 2009-11-23 17:59:24 +01:00
Melanie
c3d4b66953 Revert "testing checkout"
This reverts commit 234b29cf66.
2009-11-23 12:52:52 +00:00
unknown
234b29cf66 testing checkout 2009-11-23 14:59:39 +01:00
Melanie
31827b0286 Merge branch 'tests' of kitto@tor.k-grid.com:/home/kitto/opensim into careminster 2009-11-23 04:26:42 +00:00
Melanie
df121a7cd0 Merge branch 'master' into careminster 2009-11-23 04:24:58 +00:00
Melanie
03df03b269 Merge branch 'master' into careminster 2009-11-22 08:37:07 +00:00
KittoFlora
f1522e6204 Add non-scripted sit, fix scripted sit. 2009-11-22 08:31:35 +01:00
Melanie
87bce90086 Merge branch 'master' into careminster 2009-11-22 03:14:21 +00:00
CasperW
4a29a7f92c Minor packet ordering fix 2009-11-21 16:51:08 +00:00
CasperW
0149265ee8 Improved avatar responsiveness. 2009-11-21 16:50:33 +00:00
Melanie
0844e5951c Merge branch 'master' into careminster 2009-11-21 16:00:18 +00:00
KittoFlora
251d1b8fbb Merge branch 'careminster' into tests 2009-11-19 20:20:03 +01:00
KittoFlora
7f0f5060ec Clean up messages in ODE 2009-11-19 20:13:26 +01:00
Melanie
d179f2cce9 Merge branch 'master' into careminster 2009-11-19 17:53:34 +00:00
Melanie
5d0778014d Merge branch 'master' into careminster 2009-11-18 06:20:21 +00:00
KittoFlora
4c10826caa Fix merge conflicts 2009-11-16 02:12:56 +01:00
KittoFlora
873c9098d8 Merge branch 'careminster' into tests 2009-11-16 01:40:15 +01:00
Melanie
6ce5080049 Merge branch 'master' into careminster 2009-11-15 22:38:22 +00:00
Melanie
b9546d12f2 Change land packet sending back to what the careminster release used
to use, remove the silly spiral stuff. Revert to double packets for
improved user experience
2009-11-15 21:20:42 +00:00
Melanie
a49c524c9e Add the ability to send messages to users ir regions via remote admin 2009-11-15 20:22:15 +00:00
Melanie
b7f1fc116e Prevent a nullref if a recipient of a group message gas left the scene 2009-11-15 20:21:46 +00:00
unknown
28aa8010b2 - Lower TIME_MS_TOLERANCE to 200ms - Allow m_updateFlag to be reset to 0 in the event of a terse update being rejected - Re-add a synchronous SendTo for certain types of packets 2009-11-15 19:40:58 +00:00
KittoFlora
c09eb00031 Merge branch 'vehicles' into tests 2009-10-27 23:32:39 +01:00
KittoFlora
1113b3b6eb Merge branch 'vehicles' into tests
Conflicts:

	OpenSim/Region/Physics/Manager/PhysicsActor.cs
	OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
2009-10-27 22:42:55 +01:00
KittoFlora
a81a16f22f llRotLookAt Pt 2 2009-10-27 19:56:39 +01:00
KittoFlora
8428b25939 Add llRotLookat pt1. 2009-10-26 00:10:23 +01:00
142 changed files with 17806 additions and 4464 deletions

3
.gitignore vendored
View File

@@ -1,5 +1,6 @@
.project
.settings
.gitignore
*.csproj
*.csproj.user
*.build
@@ -10,6 +11,7 @@
*.pidb
*.dll.build
*.dll
*.log
*.VisualState.xml
*/*/obj
*/*/*/obj
@@ -23,6 +25,7 @@
*/*/*/*/*/bin
*/*/*/*/*/*/bin
*/*/*/*/*/*/*/bin
addon-modules/
bin/Debug/*.dll
bin/*.dll.mdb
bin/*.db

View File

@@ -126,6 +126,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
availableMethods["admin_dialog"] = XmlRpcDialogMethod;
availableMethods["admin_restart"] = XmlRpcRestartMethod;
availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
// User management
@@ -215,9 +216,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (!m_application.SceneManager.TryGetScene(regionID, out rebootedScene))
throw new Exception("region not found");
int timeout = 30000;
string message;
if (requestData.ContainsKey("restart")
&& ((string)requestData["restart"] == "delayed")
&& requestData.ContainsKey("milliseconds"))
{
timeout = Int32.Parse(requestData["milliseconds"].ToString());
if (timeout < 15000)
{
//It must be at least 15 seconds or we'll cancel the reboot request
timeout = 15000;
}
message
= "Region is restarting in " + ((int)(timeout / 1000)).ToString()
+ " second(s). Please save what you are doing and log out.";
}
else
{
message = "Region is restarting in 30 second(s). Please save what you are doing and log out.";
}
if (requestData.ContainsKey("noticetype")
&& ((string)requestData["noticetype"] == "dialog"))
{
m_application.SceneManager.ForEachScene(
delegate(Scene scene)
{
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
if (dialogModule != null)
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
});
}
else
{
if (!requestData.ContainsKey("noticetype")
|| ((string)requestData["noticetype"] != "none"))
{
m_application.SceneManager.ForEachScene(
delegate(Scene scene)
{
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
if (dialogModule != null)
dialogModule.SendGeneralAlert(message);
});
}
}
responseData["rebooting"] = true;
response.Value = responseData;
rebootedScene.Restart(30);
rebootedScene.Restart(timeout / 1000,false);
}
catch (Exception e)
{
@@ -280,6 +331,53 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.Info("[RADMIN]: Alert request complete");
return response;
}
public XmlRpcResponse XmlRpcDialogMethod(XmlRpcRequest request, IPEndPoint remoteClient)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
m_log.Info("[RADMIN]: Dialog request started");
try
{
Hashtable requestData = (Hashtable)request.Params[0];
CheckStringParameters(request, new string[] { "password", "from", "message" });
if (m_requiredPassword != String.Empty &&
(!requestData.Contains("password") || (string)requestData["password"] != m_requiredPassword))
throw new Exception("wrong password");
string message = (string)requestData["message"];
string fromuuid = (string)requestData["from"];
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
responseData["accepted"] = true;
responseData["success"] = true;
response.Value = responseData;
m_application.SceneManager.ForEachScene(
delegate(Scene scene)
{
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
if (dialogModule != null)
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
});
}
catch (Exception e)
{
m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message);
m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
responseData["accepted"] = false;
responseData["success"] = false;
responseData["error"] = e.Message;
response.Value = responseData;
}
m_log.Info("[RADMIN]: Alert request complete");
return response;
}
public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient)
{
@@ -387,13 +485,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
message = "Region is going down now.";
}
m_application.SceneManager.ForEachScene(
if (requestData.ContainsKey("noticetype")
&& ((string) requestData["noticetype"] == "dialog"))
{
m_application.SceneManager.ForEachScene(
delegate(Scene scene)
{
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
if (dialogModule != null)
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
});
}
else
{
if (!requestData.ContainsKey("noticetype")
|| ((string)requestData["noticetype"] != "none"))
{
m_application.SceneManager.ForEachScene(
delegate(Scene scene)
{
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
if (dialogModule != null)
dialogModule.SendGeneralAlert(message);
});
}
}
// Perform shutdown
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing

View File

@@ -593,6 +593,7 @@ namespace OpenSim.Client.MXP.ClientStack
public event DisconnectUser OnDisconnectUser;
public event RequestAvatarProperties OnRequestAvatarProperties;
public event SetAlwaysRun OnSetAlwaysRun;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
public event DeRezObject OnDeRezObject;
public event Action<IClientAPI> OnRegionHandShakeReply;
@@ -819,6 +820,10 @@ namespace OpenSim.Client.MXP.ClientStack
//throw new System.NotImplementedException();
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
//throw new System.NotImplementedException();
@@ -834,11 +839,19 @@ namespace OpenSim.Client.MXP.ClientStack
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
m_log.Info("[MXP ClientStack] Close Called");
// Tell the client to go
SendLogoutPacket();
if (sendStop == true)
{
SendLogoutPacket();
}
// Let MXPPacketServer clean it up
if (Session.SessionState != SessionState.Disconnected)

View File

@@ -253,6 +253,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
public event AddNewPrim OnAddPrim;
public event FetchInventory OnAgentDataUpdateRequest;
public event TeleportLocationRequest OnSetStartLocationRequest;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event RequestGodlikePowers OnRequestGodlikePowers;
public event GodKickUser OnGodKickUser;
public event ObjectDuplicate OnObjectDuplicate;
@@ -439,12 +440,21 @@ namespace OpenSim.Client.Sirikata.ClientStack
throw new System.NotImplementedException();
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
throw new System.NotImplementedException();
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
throw new System.NotImplementedException();
}

View File

@@ -290,6 +290,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public event GenericCall2 OnStopMovement = delegate { };
public event Action<UUID> OnRemoveAvatar = delegate { };
public event ObjectPermissions OnObjectPermissions = delegate { };
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy = delegate { };
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
@@ -445,12 +446,21 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
throw new System.NotImplementedException();
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
throw new System.NotImplementedException();
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
throw new System.NotImplementedException();
}

View File

@@ -38,7 +38,7 @@ namespace OpenSim.Data
{
public abstract AssetBase GetAsset(UUID uuid);
public abstract void StoreAsset(AssetBase asset);
public abstract bool StoreAsset(AssetBase asset);
public abstract bool ExistsAsset(UUID uuid);
public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);

View File

@@ -34,7 +34,7 @@ namespace OpenSim.Data
public interface IAssetDataPlugin : IPlugin
{
AssetBase GetAsset(UUID uuid);
void StoreAsset(AssetBase asset);
bool StoreAsset(AssetBase asset);
bool ExistsAsset(UUID uuid);
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
void Initialise(string connect);

View File

@@ -143,7 +143,7 @@ namespace OpenSim.Data.MSSQL
/// Create asset in m_database
/// </summary>
/// <param name="asset">the asset</param>
override public void StoreAsset(AssetBase asset)
override public bool StoreAsset(AssetBase asset)
{
string sql =
@@ -192,10 +192,12 @@ namespace OpenSim.Data.MSSQL
try
{
command.ExecuteNonQuery();
return true;
}
catch(Exception e)
{
m_log.Error("[ASSET DB]: Error storing item :" + e.Message);
return false;
}
}
}

View File

@@ -153,7 +153,7 @@ namespace OpenSim.Data.MySQL
/// </summary>
/// <param name="asset">Asset UUID to create</param>
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
override public void StoreAsset(AssetBase asset)
override public bool StoreAsset(AssetBase asset)
{
lock (m_dbLock)
{
@@ -201,12 +201,14 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("?data", asset.Data);
cmd.ExecuteNonQuery();
cmd.Dispose();
return true;
}
}
catch (Exception e)
{
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
asset.FullID, asset.Name, e.Message);
return false;
}
}
}

View File

@@ -78,9 +78,12 @@ namespace OpenSim.Data.MySQL
if (pd.Length == 0)
return false;
if (regionID == UUID.Zero)
return false;
MySqlCommand cmd = new MySqlCommand();
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID where `SessionID`=?SessionID", m_Realm);
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
@@ -90,6 +93,5 @@ namespace OpenSim.Data.MySQL
return true;
}
}
}

View File

@@ -13,3 +13,11 @@ CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
CREATE INDEX UserID ON Presence(UserID);
COMMIT;
:VERSION 2 # --------------------------
BEGIN;
ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp;
COMMIT;

View File

@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
COMMIT;
:VERSION 32
:VERSION 32 #---------------------
BEGIN;
CREATE TABLE `regionwindlight` (

View File

@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLite
/// Create an asset
/// </summary>
/// <param name="asset">Asset Base</param>
override public void StoreAsset(AssetBase asset)
override public bool StoreAsset(AssetBase asset)
{
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
if (ExistsAsset(asset.FullID))
@@ -141,6 +141,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
return true;
}
}
}
@@ -161,6 +162,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
return true;
}
}
}

View File

@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLiteLegacy
/// Create an asset
/// </summary>
/// <param name="asset">Asset Base</param>
override public void StoreAsset(AssetBase asset)
override public bool StoreAsset(AssetBase asset)
{
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
if (ExistsAsset(asset.FullID))
@@ -139,6 +139,7 @@ namespace OpenSim.Data.SQLiteLegacy
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
return true;
}
}
}
@@ -157,6 +158,7 @@ namespace OpenSim.Data.SQLiteLegacy
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
return true;
}
}
}

View File

@@ -60,6 +60,8 @@ namespace OpenSim.Framework
/// </summary>
private AssetMetadata m_metadata;
private int m_uploadAttempts;
// This is needed for .NET serialization!!!
// Do NOT "Optimize" away!
public AssetBase()
@@ -197,6 +199,12 @@ namespace OpenSim.Framework
set { m_metadata.Type = value; }
}
public int UploadAttempts
{
get { return m_uploadAttempts; }
set { m_uploadAttempts = value; }
}
/// <summary>
/// Is this a region only asset, or does this exist on the asset server also
/// </summary>

View File

@@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications
_request = (HttpWebRequest) WebRequest.Create(buildUri());
_request.KeepAlive = false;
_request.ContentType = "application/xml";
_request.Timeout = 900000;
_request.Timeout = 30000;
_request.Method = RequestMethod;
_asyncException = null;
_request.ContentLength = src.Length;

View File

@@ -264,6 +264,9 @@ namespace OpenSim.Framework
public delegate void MoveInventoryItem(
IClientAPI remoteClient, List<InventoryItemBase> items);
public delegate void MoveItemsAndLeaveCopy(
IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
public delegate void RemoveInventoryItem(
IClientAPI remoteClient, List<UUID> itemIDs);
@@ -772,6 +775,7 @@ namespace OpenSim.Framework
event RequestTaskInventory OnRequestTaskInventory;
event UpdateInventoryItem OnUpdateInventoryItem;
event CopyInventoryItem OnCopyInventoryItem;
event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
event MoveInventoryItem OnMoveInventoryItem;
event RemoveInventoryFolder OnRemoveInventoryFolder;
event RemoveInventoryItem OnRemoveInventoryItem;
@@ -940,8 +944,10 @@ namespace OpenSim.Framework
void SetDebugPacketLevel(int newDebug);
void InPacket(object NewPack);
void ProcessPendingPackets();
void ProcessInPacket(Packet NewPack);
void Close();
void Close(bool sendStop);
void Kick(string message);
/// <summary>

View File

@@ -62,7 +62,7 @@ namespace OpenSim.Framework
private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark |
(uint) ParcelFlags.AllowAPrimitiveEntry |
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform |
(uint) ParcelFlags.AllowDeedToGroup |
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
(uint) ParcelFlags.SoundLocal;

View File

@@ -27,7 +27,7 @@
namespace OpenSim.Framework
{
public enum ParcelMediaCommandEnum
public enum ParcelMediaCommandEnum : int
{
Stop = 0,
Pause = 1,

View File

@@ -1208,7 +1208,7 @@ namespace OpenSim.Framework
prim.Textures = this.Textures;
prim.Properties = new Primitive.ObjectProperties();
prim.Properties.Name = "Primitive";
prim.Properties.Name = "Object";
prim.Properties.Description = "";
prim.Properties.CreatorID = UUID.Zero;
prim.Properties.GroupID = UUID.Zero;

View File

@@ -40,6 +40,7 @@ using OpenSim.Framework.Console;
namespace OpenSim.Framework
{
[Serializable]
public class RegionLightShareData : ICloneable
{
public UUID regionID = UUID.Zero;

View File

@@ -48,6 +48,9 @@ namespace OpenSim.Framework.RegionLoader.Web
public RegionInfo[] LoadRegions()
{
int tries = 3;
int wait = 2000;
if (m_configSource == null)
{
m_log.Error("[WEBLOADER]: Unable to load configuration source!");
@@ -64,35 +67,47 @@ namespace OpenSim.Framework.RegionLoader.Web
}
else
{
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
webRequest.Timeout = 30000; //30 Second Timeout
m_log.Debug("[WEBLOADER]: Sending Download Request...");
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = String.Empty;
string tempStr = reader.ReadLine();
while (tempStr != null)
while (tries > 0)
{
xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine();
}
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource);
if (xmlDoc.FirstChild.Name == "Regions")
{
RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count];
int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
webRequest.Timeout = 30000; //30 Second Timeout
m_log.Debug("[WEBLOADER]: Sending Download Request...");
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = String.Empty;
string tempStr = reader.ReadLine();
while (tempStr != null)
{
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine();
}
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xmlSource);
if (xmlDoc.FirstChild.Name == "Regions")
{
RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count];
int i;
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
{
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
regionInfos[i] =
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
}
if (i > 0)
return regionInfos;
}
return regionInfos;
m_log.Debug("[WEBLOADER]: Request yielded no regions.");
tries--;
if (tries > 0)
{
m_log.Debug("[WEBLOADER]: Retrying");
System.Threading.Thread.Sleep(wait);
}
}
return null;
}

View File

@@ -99,7 +99,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength > 0)
if (resp.ContentLength != 0)
{
Stream respStream = null;
try

View File

@@ -56,12 +56,28 @@ namespace OpenSim.Framework.Servers.HttpServer
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
{
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100);
}
/// <summary>
/// Perform a synchronous REST request.
/// </summary>
/// <param name="verb"></param>
/// <param name="requestUrl"></param>
/// <param name="obj"> </param>
/// <param name="timeout"> </param>
/// <returns></returns>
///
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
{
Type type = typeof (TRequest);
TResponse deserial = default(TResponse);
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
request.Timeout = pTimeout * 1000;
if ((verb == "POST") || (verb == "PUT"))
{
@@ -81,7 +97,6 @@ namespace OpenSim.Framework.Servers.HttpServer
int length = (int) buffer.Length;
request.ContentLength = length;
Stream requestStream = null;
try
{
@@ -103,7 +118,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
using (WebResponse resp = request.GetResponse())
{
if (resp.ContentLength > 0)
if (resp.ContentLength != 0)
{
Stream respStream = resp.GetResponseStream();
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));

View File

@@ -29,11 +29,11 @@ namespace OpenSim
{
public class VersionInfo
{
private const string VERSION_NUMBER = "0.7.1";
private const string VERSION_NUMBER = "0.7.1CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour
{
{
Unknown,
Dev,
RC1,

View File

@@ -27,9 +27,13 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Reflection;
using System.Xml;
using System.Diagnostics;
using System.Xml.Schema;
using System.Xml.Serialization;
using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
@@ -45,6 +49,124 @@ namespace OpenSim.Framework
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Thread LockedByThread;
/// <value>
/// An advanced lock for inventory data
/// </value>
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
/// <summary>
/// Are we readlocked by the calling thread?
/// </summary>
public bool IsReadLockedByMe()
{
if (m_itemLock.RecursiveReadCount > 0)
{
return true;
}
else
{
return false;
}
}
/// <summary>
/// Lock our inventory list for reading (many can read, one can write)
/// </summary>
public void LockItemsForRead(bool locked)
{
if (locked)
{
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
{
if (!LockedByThread.IsAlive)
{
//Locked by dead thread, reset.
m_itemLock = new System.Threading.ReaderWriterLockSlim();
}
}
if (m_itemLock.RecursiveReadCount > 0)
{
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
try
{
StackTrace stackTrace = new StackTrace(); // get call stack
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
// write call stack method names
foreach (StackFrame stackFrame in stackFrames)
{
m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name
}
}
catch
{}
m_itemLock.ExitReadLock();
}
if (m_itemLock.RecursiveWriteCount > 0)
{
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
m_itemLock.ExitWriteLock();
}
while (!m_itemLock.TryEnterReadLock(60000))
{
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
if (m_itemLock.IsWriteLockHeld)
{
m_itemLock = new System.Threading.ReaderWriterLockSlim();
}
}
}
else
{
if (m_itemLock.RecursiveReadCount>0)
{
m_itemLock.ExitReadLock();
}
}
}
/// <summary>
/// Lock our inventory list for writing (many can read, one can write)
/// </summary>
public void LockItemsForWrite(bool locked)
{
if (locked)
{
//Enter a write lock, wait indefinately for one to open.
if (m_itemLock.RecursiveReadCount > 0)
{
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
m_itemLock.ExitReadLock();
}
if (m_itemLock.RecursiveWriteCount > 0)
{
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
m_itemLock.ExitWriteLock();
}
while (!m_itemLock.TryEnterWriteLock(60000))
{
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
if (m_itemLock.IsWriteLockHeld)
{
m_itemLock = new System.Threading.ReaderWriterLockSlim();
}
}
LockedByThread = Thread.CurrentThread;
}
else
{
if (m_itemLock.RecursiveWriteCount > 0)
{
m_itemLock.ExitWriteLock();
}
}
}
#region ICloneable Members
@@ -52,13 +174,12 @@ namespace OpenSim.Framework
{
TaskInventoryDictionary clone = new TaskInventoryDictionary();
lock (this)
m_itemLock.EnterReadLock();
foreach (UUID uuid in Keys)
{
foreach (UUID uuid in Keys)
{
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
}
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
}
m_itemLock.ExitReadLock();
return clone;
}

View File

@@ -26,6 +26,7 @@
*/
using System;
using System.Collections.Generic;
namespace OpenSim.Framework
{
@@ -36,33 +37,30 @@ namespace OpenSim.Framework
[Serializable]
public class UndoStack<T>
{
private int m_new = 1;
private int m_old = 0;
private T[] m_Undos;
private List<T> m_undolist;
private int m_max;
public UndoStack(int capacity)
{
m_Undos = new T[capacity + 1];
m_undolist = new List<T>();
m_max = capacity;
}
public bool IsFull
{
get { return m_new == m_old; }
get { return m_undolist.Count >= m_max; }
}
public int Capacity
{
get { return m_Undos.Length - 1; }
get { return m_max; }
}
public int Count
{
get
{
int count = m_new - m_old - 1;
if (count < 0)
count += m_Undos.Length;
return count;
return m_undolist.Count;
}
}
@@ -70,45 +68,39 @@ namespace OpenSim.Framework
{
if (IsFull)
{
m_old++;
if (m_old >= m_Undos.Length)
m_old -= m_Undos.Length;
m_undolist.RemoveAt(0);
}
if (++m_new >= m_Undos.Length)
m_new -= m_Undos.Length;
m_Undos[m_new] = item;
m_undolist.Add(item);
}
public T Pop()
{
if (Count > 0)
if (m_undolist.Count > 0)
{
T deleted = m_Undos[m_new];
m_Undos[m_new--] = default(T);
if (m_new < 0)
m_new += m_Undos.Length;
return deleted;
int ind = m_undolist.Count - 1;
T item = m_undolist[ind];
m_undolist.RemoveAt(ind);
return item;
}
else
throw new InvalidOperationException("Cannot pop from emtpy stack");
throw new InvalidOperationException("Cannot pop from empty stack");
}
public T Peek()
{
return m_Undos[m_new];
if (m_undolist.Count > 0)
{
return m_undolist[m_undolist.Count - 1];
}
else
{
return default(T);
}
}
public void Clear()
{
if (Count > 0)
{
for (int i = 0; i < m_Undos.Length; i++)
{
m_Undos[i] = default(T);
}
m_new = 1;
m_old = 0;
}
m_undolist.Clear();
}
}
}

View File

@@ -997,19 +997,19 @@ namespace OpenSim.Framework
{
string os = String.Empty;
if (Environment.OSVersion.Platform != PlatformID.Unix)
{
os = Environment.OSVersion.ToString();
}
else
{
os = ReadEtcIssue();
}
if (os.Length > 45)
{
os = os.Substring(0, 45);
}
// if (Environment.OSVersion.Platform != PlatformID.Unix)
// {
// os = Environment.OSVersion.ToString();
// }
// else
// {
// os = ReadEtcIssue();
// }
//
// if (os.Length > 45)
// {
// os = os.Substring(0, 45);
// }
return os;
}

View File

@@ -51,7 +51,7 @@ namespace OpenSim.Framework
public ThreadWatchdogInfo(Thread thread)
{
Thread = thread;
LastTick = Environment.TickCount & Int32.MaxValue;
LastTick = Environment.TickCount;
}
}
@@ -143,7 +143,7 @@ namespace OpenSim.Framework
try
{
if (m_threads.TryGetValue(threadID, out threadInfo))
threadInfo.LastTick = Environment.TickCount & Int32.MaxValue;
threadInfo.LastTick = Environment.TickCount;
else
AddThread(new ThreadWatchdogInfo(Thread.CurrentThread));
}
@@ -160,7 +160,7 @@ namespace OpenSim.Framework
lock (m_threads)
{
int now = Environment.TickCount & Int32.MaxValue;
int now = Environment.TickCount;
foreach (ThreadWatchdogInfo threadInfo in m_threads.Values)
{

View File

@@ -425,7 +425,7 @@ namespace OpenSim
if (alert != null)
presence.ControllingClient.Kick(alert);
else
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
// ...and close on our side
presence.Scene.IncomingCloseAgent(presence.UUID);

View File

@@ -88,6 +88,10 @@ namespace OpenSim
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
private List<string> m_permsModules;
private bool m_securePermissionsLoading = true;
/// <value>
/// The config information passed into the OpenSimulator region server.
/// </value>
@@ -185,6 +189,11 @@ namespace OpenSim
CreatePIDFile(pidFile);
userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
m_permsModules = new List<string>(permissionModules.Split(','));
}
base.StartupSpecific();
@@ -342,11 +351,50 @@ namespace OpenSim
}
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
if (m_securePermissionsLoading)
{
foreach (string s in m_permsModules)
{
if (!scene.RegionModules.ContainsKey(s))
{
bool found = false;
foreach (IRegionModule m in modules)
{
if (m.Name == s)
{
found = true;
}
}
if (!found)
{
m_log.Fatal("[MODULES]: Required module " + s + " not found.");
Environment.Exit(0);
}
}
}
}
scene.SetModuleInterfaces();
// First Step of bootreport sequence
if (scene.SnmpService != null)
{
scene.SnmpService.ColdStart(1,scene);
scene.SnmpService.LinkDown(scene);
}
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Loading prins", scene);
}
// Prims have to be loaded after module configuration since some modules may be invoked during the load
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Creating region texture", scene);
}
// moved these here as the terrain texture has to be created after the modules are initialized
// and has to happen before the region is registered with the grid.
scene.CreateTerrainTexture();
@@ -354,6 +402,10 @@ namespace OpenSim
// TODO : Try setting resource for region xstats here on scene
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
}
try
{
scene.RegisterRegionWithGrid();
@@ -362,11 +414,20 @@ namespace OpenSim
{
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
if (scene.SnmpService != null)
{
scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
}
// Carrying on now causes a lot of confusion down the
// line - we need to get the user's attention
Environment.Exit(1);
}
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Grid Registration done", scene);
}
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
@@ -374,6 +435,11 @@ namespace OpenSim
// scripting engines.
scene.CreateScriptInstances();
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("ScriptEngine started", scene);
}
m_sceneManager.Add(scene);
if (m_autoCreateClientStack)
@@ -382,6 +448,10 @@ namespace OpenSim
clientServer.Start();
}
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("Initializing region modules", scene);
}
if (do_post_init)
{
foreach (IRegionModule module in modules)
@@ -393,6 +463,12 @@ namespace OpenSim
mscene = scene;
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("The region is operational", scene);
scene.SnmpService.LinkUp(scene);
}
scene.StartTimer();
return clientServer;
@@ -401,6 +477,11 @@ namespace OpenSim
private void ShutdownRegion(Scene scene)
{
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("The region is shutting down", scene);
scene.SnmpService.LinkDown(scene);
}
IRegionModulesController controller;
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
{

View File

@@ -202,6 +202,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_stopPacket = TexturePacketCount();
}
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
if (m_stopPacket == 1 && Layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
m_currentPacket = StartPacket;
}
}

View File

@@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public event RequestTaskInventory OnRequestTaskInventory;
public event UpdateInventoryItem OnUpdateInventoryItem;
public event CopyInventoryItem OnCopyInventoryItem;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event MoveInventoryItem OnMoveInventoryItem;
public event RemoveInventoryItem OnRemoveInventoryItem;
public event RemoveInventoryFolder OnRemoveInventoryFolder;
@@ -335,11 +336,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// protected HashSet<uint> m_attachmentsSent;
private int m_moneyBalance;
private bool m_deliverPackets = true;
private int m_animationSequenceNumber = 1;
private bool m_SendLogoutPacketWhenClosing = true;
private AgentUpdateArgs lastarg;
private bool m_IsActive = true;
private bool m_IsLoggingOut = false;
private bool m_IsPresenceReady = false;
protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
@@ -362,6 +365,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private Timer m_propertiesPacketTimer;
private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
private List<Packet> m_pendingPackets;
#endregion Class Members
@@ -377,6 +381,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_startpos; }
set { m_startpos = value; }
}
public bool DeliverPackets
{
get { return m_deliverPackets; }
set {
m_deliverPackets = value;
m_udpClient.m_deliverPackets = value;
}
}
public UUID AgentId { get { return m_agentId; } }
public UUID ActiveGroupId { get { return m_activeGroupID; } }
public string ActiveGroupName { get { return m_activeGroupName; } }
@@ -402,6 +414,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_IsActive; }
set { m_IsActive = value; }
}
public bool IsLoggingOut
{
get { return m_IsLoggingOut; }
@@ -471,18 +484,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#region Client Methods
/// <summary>
/// Shut down the client view
/// </summary>
public void Close()
{
Close(true);
}
/// <summary>
/// Shut down the client view
/// </summary>
public void Close(bool sendStop)
{
m_log.DebugFormat(
"[CLIENT]: Close has been called for {0} attached to scene {1}",
Name, m_scene.RegionInfo.RegionName);
// Send the STOP packet
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
OutPacket(disable, ThrottleOutPacketType.Unknown);
if (sendStop)
{
// Send the STOP packet
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
OutPacket(disable, ThrottleOutPacketType.Unknown);
}
IsActive = false;
@@ -762,7 +787,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
reply.ChatData.OwnerID = fromAgentID;
reply.ChatData.SourceID = fromAgentID;
OutPacket(reply, ThrottleOutPacketType.Task);
OutPacket(reply, ThrottleOutPacketType.Unknown);
}
/// <summary>
@@ -1048,6 +1073,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public virtual void SendLayerData(float[] map)
{
Util.FireAndForget(DoSendLayerData, map);
// Send it sync, and async. It's not that much data
// and it improves user experience just so much!
DoSendLayerData(map);
}
/// <summary>
@@ -1060,16 +1089,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
try
{
//for (int y = 0; y < 16; y++)
//{
// for (int x = 0; x < 16; x++)
// {
// SendLayerData(x, y, map);
// }
//}
// Send LayerData in a spiral pattern. Fun!
SendLayerTopRight(map, 0, 0, 15, 15);
for (int y = 0; y < 16; y++)
{
for (int x = 0; x < 16; x+=4)
{
SendLayerPacket(x, y, map);
}
}
}
catch (Exception e)
{
@@ -1077,51 +1103,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
{
// Row
for (int i = x1; i <= x2; i++)
SendLayerData(i, y1, map);
// Column
for (int j = y1 + 1; j <= y2; j++)
SendLayerData(x2, j, map);
if (x2 - x1 > 0)
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
}
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
{
// Row in reverse
for (int i = x2; i >= x1; i--)
SendLayerData(i, y2, map);
// Column in reverse
for (int j = y2 - 1; j >= y1; j--)
SendLayerData(x1, j, map);
if (x2 - x1 > 0)
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
}
/// <summary>
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
/// </summary>
/// <param name="map">heightmap</param>
/// <param name="px">X coordinate for patches 0..12</param>
/// <param name="py">Y coordinate for patches 0..15</param>
// private void SendLayerPacket(float[] map, int y, int x)
// {
// int[] patches = new int[4];
// patches[0] = x + 0 + y * 16;
// patches[1] = x + 1 + y * 16;
// patches[2] = x + 2 + y * 16;
// patches[3] = x + 3 + y * 16;
private void SendLayerPacket(int x, int y, float[] map)
{
int[] patches = new int[4];
patches[0] = x + 0 + y * 16;
patches[1] = x + 1 + y * 16;
patches[2] = x + 2 + y * 16;
patches[3] = x + 3 + y * 16;
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
// OutPacket(layerpack, ThrottleOutPacketType.Land);
// }
float[] heightmap = (map.Length == 65536) ?
map :
LLHeightFieldMoronize(map);
try
{
Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
OutPacket(layerpack, ThrottleOutPacketType.Land);
}
catch
{
for (int px = x ; px < x + 4 ; px++)
SendLayerData(px, y, map);
}
}
/// <summary>
/// Sends a specified patch to a client
@@ -1141,7 +1151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
layerpack.Header.Reliable = true;
OutPacket(layerpack, ThrottleOutPacketType.Land);
OutPacket(layerpack, ThrottleOutPacketType.Task);
}
catch (Exception e)
{
@@ -2213,6 +2223,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(sound, ThrottleOutPacketType.Task);
}
public void SendTransferAbort(TransferRequestPacket transferRequest)
{
TransferAbortPacket abort = (TransferAbortPacket)PacketPool.Instance.GetPacket(PacketType.TransferAbort);
abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID;
abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType;
m_log.Debug("[Assets] Aborting transfer; asset request failed");
OutPacket(abort, ThrottleOutPacketType.Task);
}
public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
{
SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger);
@@ -3474,6 +3493,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// </summary>
public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
{
if (entity is SceneObjectPart)
{
SceneObjectPart e = (SceneObjectPart)entity;
SceneObjectGroup g = e.ParentGroup;
if (g.RootPart.Shape.State > 30) // HUD
if (g.OwnerID != AgentId)
return; // Don't send updates for other people's HUDs
}
double priority = m_prioritizer.GetUpdatePriority(this, entity);
lock (m_entityUpdates.SyncRoot)
@@ -3494,9 +3522,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EntityUpdate update;
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
{
// If we have sent a kill packet for this object
// drop any updates on the floor
if (update.Entity is SceneObjectPart)
{
SceneObjectPart part = (SceneObjectPart)update.Entity;
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
continue;
if (part.ParentGroup.IsAttachment && m_disableFacelights)
{
@@ -3930,6 +3962,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
m_propertiesPacketTimer.Stop();
if (m_propertiesBlocks.Count == 0)
return;
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
int index = 0;
@@ -4829,6 +4864,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
@@ -4928,6 +4964,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
(x.ControlFlags != lastarg.ControlFlags) ||
(x.ControlFlags != 0) ||
(x.Far != lastarg.Far) ||
(x.Flags != lastarg.Flags) ||
(x.State != lastarg.State) ||
@@ -5299,7 +5336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
args.Channel = ch;
args.From = String.Empty;
args.Message = Utils.BytesToString(msg);
args.Type = ChatTypeEnum.Shout;
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
args.Position = new Vector3();
args.Scene = Scene;
args.Sender = this;
@@ -9337,6 +9374,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
return true;
}
private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack)
{
CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
#region Packet Session and User Check
if (m_checkPackets)
{
if (packet.AgentData.SessionID != SessionId ||
packet.AgentData.AgentID != AgentId)
return true;
}
#endregion
MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null;
List<InventoryItemBase> items = new List<InventoryItemBase>();
foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
{
InventoryItemBase b = new InventoryItemBase();
b.ID = n.OldItemID;
b.Folder = n.OldFolderID;
items.Add(b);
}
handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
if (handlerMoveItemsAndLeaveCopy != null)
{
handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID);
}
return true;
}
private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
{
@@ -11179,19 +11247,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
/// <summary>
/// This processes packets which have accumulated while the presence was still in the process of initialising.
/// </summary>
public void ProcessPendingPackets()
{
m_IsPresenceReady = true;
if (m_pendingPackets == null)
return;
foreach (Packet p in m_pendingPackets)
{
ProcessInPacket(p);
}
m_pendingPackets.Clear();
}
/// <summary>
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
/// </summary>
/// <param name="Pack">OpenMetaverse.packet</param>
public void ProcessInPacket(Packet Pack)
{
if (m_debugPacketLevel >= 255)
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
if (!m_IsPresenceReady)
{
if (m_pendingPackets == null)
{
m_pendingPackets = new List<Packet>();
}
m_pendingPackets.Add(Pack);
}
else
{
if (m_debugPacketLevel >= 255)
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
if (!ProcessPacketMethod(Pack))
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
if (!ProcessPacketMethod(Pack))
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
PacketPool.Instance.ReturnPacket(Pack);
PacketPool.Instance.ReturnPacket(Pack);
}
}
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
@@ -11428,7 +11522,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
//Note, the bool returned from the below function is useless since it is always false.
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
}
/// <summary>

View File

@@ -149,6 +149,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private int m_defaultRTO = 3000;
private int m_maxRTO = 60000;
public bool m_deliverPackets = true;
/// <summary>
/// Default constructor
@@ -389,6 +390,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (category >= 0 && category < m_packetOutboxes.Length)
{
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
if (m_deliverPackets == false)
{
queue.Enqueue(packet);
return true;
}
TokenBucket bucket = m_throttleCategories[category];
if (bucket.RemoveTokens(packet.Buffer.DataLength))
@@ -419,6 +427,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <returns>True if any packets were sent, otherwise false</returns>
public bool DequeueOutgoing()
{
if (m_deliverPackets == false) return false;
OutgoingPacket packet;
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue;
TokenBucket bucket;

View File

@@ -904,7 +904,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
client.DisableFacelights = m_disableFacelights;
// Start the IClientAPI
client.Start();
// Spin it off so that it doesn't clog up the LLUDPServer
//First, and very importantly:
//
//Set our DeliverPackets flag in the client to *false*
//this will prevent us from missing important messages
//before the modules are bound
client.DeliverPackets = false;
client.DisableFacelights = m_disableFacelights;
Util.FireAndForget(
delegate
{
try
{
client.Start();
}
finally
{
//Now, release the hounds. er, packets.
client.DeliverPackets = true;
}
}
);
}
else
{
@@ -920,7 +943,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_scene.TryGetClient(udpClient.AgentID, out client))
{
client.IsLoggingOut = true;
client.Close();
client.Close(false);
}
}

View File

@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
this.parent = parent;
MaxBurst = maxBurst;
DripRate = dripRate;
lastDrip = Environment.TickCount & Int32.MaxValue;
lastDrip = Environment.TickCount;
}
/// <summary>
@@ -143,41 +143,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <returns>True if the requested number of tokens were removed from
/// the bucket, otherwise false</returns>
public bool RemoveTokens(int amount)
{
bool dummy;
return RemoveTokens(amount, out dummy);
}
/// <summary>
/// Remove a given number of tokens from the bucket
/// </summary>
/// <param name="amount">Number of tokens to remove from the bucket</param>
/// <param name="dripSucceeded">True if tokens were added to the bucket
/// during this call, otherwise false</param>
/// <returns>True if the requested number of tokens were removed from
/// the bucket, otherwise false</returns>
public bool RemoveTokens(int amount, out bool dripSucceeded)
{
if (maxBurst == 0)
{
dripSucceeded = true;
return true;
}
dripSucceeded = Drip();
if (content - amount >= 0)
if (amount > maxBurst)
{
if (parent != null && !parent.RemoveTokens(amount))
return false;
content -= amount;
return true;
throw new Exception("amount " + amount + " exceeds maxBurst " + maxBurst);
}
else
Drip();
if (content < amount)
{
return false;
}
if (parent != null && !parent.RemoveTokens(amount))
{
return false;
}
content -= amount;
return true;
}
/// <summary>
@@ -193,25 +183,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
content = maxBurst;
return true;
}
else
int now = Environment.TickCount;
int deltaMS = now - lastDrip;
lastDrip = now;
if (deltaMS <= 0)
{
int now = Environment.TickCount & Int32.MaxValue;
int deltaMS = now - lastDrip;
if (deltaMS <= 0)
{
if (deltaMS < 0)
lastDrip = now;
return false;
}
int dripAmount = deltaMS * tokensPerMS;
content = Math.Min(content + dripAmount, maxBurst);
lastDrip = now;
return true;
return false;
}
long dripAmount = (long)deltaMS * (long)tokensPerMS + (long)content;
if (dripAmount > maxBurst)
{
dripAmount = maxBurst;
}
content = (int)dripAmount;
return true;
}
}
}

View File

@@ -1,169 +1,184 @@
/*
* 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.Net;
using OpenMetaverse;
namespace OpenSim.Region.ClientStack.LindenUDP
{
/// <summary>
/// Special collection that is optimized for tracking unacknowledged packets
/// </summary>
public sealed class UnackedPacketCollection
{
/// <summary>
/// Holds information about a pending acknowledgement
/// </summary>
private struct PendingAck
{
/// <summary>Sequence number of the packet to remove</summary>
public uint SequenceNumber;
/// <summary>Environment.TickCount value when the remove was queued.
/// This is used to update round-trip times for packets</summary>
public int RemoveTime;
/// <summary>Whether or not this acknowledgement was attached to a
/// resent packet. If so, round-trip time will not be calculated</summary>
public bool FromResend;
public PendingAck(uint sequenceNumber, int currentTime, bool fromResend)
{
SequenceNumber = sequenceNumber;
RemoveTime = currentTime;
FromResend = fromResend;
}
}
/// <summary>Holds the actual unacked packet data, sorted by sequence number</summary>
private Dictionary<uint, OutgoingPacket> m_packets = new Dictionary<uint, OutgoingPacket>();
/// <summary>Holds packets that need to be added to the unacknowledged list</summary>
private LocklessQueue<OutgoingPacket> m_pendingAdds = new LocklessQueue<OutgoingPacket>();
/// <summary>Holds information about pending acknowledgements</summary>
private LocklessQueue<PendingAck> m_pendingRemoves = new LocklessQueue<PendingAck>();
/// <summary>
/// Add an unacked packet to the collection
/// </summary>
/// <param name="packet">Packet that is awaiting acknowledgement</param>
/// <returns>True if the packet was successfully added, false if the
/// packet already existed in the collection</returns>
/// <remarks>This does not immediately add the ACK to the collection,
/// it only queues it so it can be added in a thread-safe way later</remarks>
public void Add(OutgoingPacket packet)
{
m_pendingAdds.Enqueue(packet);
}
/// <summary>
/// Marks a packet as acknowledged
/// </summary>
/// <param name="sequenceNumber">Sequence number of the packet to
/// acknowledge</param>
/// <param name="currentTime">Current value of Environment.TickCount</param>
/// <remarks>This does not immediately acknowledge the packet, it only
/// queues the ack so it can be handled in a thread-safe way later</remarks>
public void Remove(uint sequenceNumber, int currentTime, bool fromResend)
{
m_pendingRemoves.Enqueue(new PendingAck(sequenceNumber, currentTime, fromResend));
}
/// <summary>
/// Returns a list of all of the packets with a TickCount older than
/// the specified timeout
/// </summary>
/// <param name="timeoutMS">Number of ticks (milliseconds) before a
/// packet is considered expired</param>
/// <returns>A list of all expired packets according to the given
/// expiration timeout</returns>
/// <remarks>This function is not thread safe, and cannot be called
/// multiple times concurrently</remarks>
public List<OutgoingPacket> GetExpiredPackets(int timeoutMS)
{
ProcessQueues();
List<OutgoingPacket> expiredPackets = null;
if (m_packets.Count > 0)
{
int now = Environment.TickCount & Int32.MaxValue;
foreach (OutgoingPacket packet in m_packets.Values)
{
// TickCount of zero means a packet is in the resend queue
// but hasn't actually been sent over the wire yet
if (packet.TickCount == 0)
continue;
if (now - packet.TickCount >= timeoutMS)
{
if (expiredPackets == null)
expiredPackets = new List<OutgoingPacket>();
// The TickCount will be set to the current time when the packet
// is actually sent out again
packet.TickCount = 0;
expiredPackets.Add(packet);
}
}
}
return expiredPackets;
}
private void ProcessQueues()
{
// Process all the pending adds
OutgoingPacket pendingAdd;
while (m_pendingAdds.Dequeue(out pendingAdd))
m_packets[pendingAdd.SequenceNumber] = pendingAdd;
// Process all the pending removes, including updating statistics and round-trip times
PendingAck pendingRemove;
OutgoingPacket ackedPacket;
while (m_pendingRemoves.Dequeue(out pendingRemove))
{
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
{
m_packets.Remove(pendingRemove.SequenceNumber);
// Update stats
System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
if (!pendingRemove.FromResend)
{
// Calculate the round-trip time for this packet and its ACK
int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
if (rtt > 0)
ackedPacket.Client.UpdateRoundTrip(rtt);
}
}
}
}
}
}
/*
* 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.Net;
using OpenMetaverse;
namespace OpenSim.Region.ClientStack.LindenUDP
{
/// <summary>
/// Special collection that is optimized for tracking unacknowledged packets
/// </summary>
public sealed class UnackedPacketCollection
{
/// <summary>
/// Holds information about a pending acknowledgement
/// </summary>
private struct PendingAck
{
/// <summary>Sequence number of the packet to remove</summary>
public uint SequenceNumber;
/// <summary>Environment.TickCount value when the remove was queued.
/// This is used to update round-trip times for packets</summary>
public int RemoveTime;
/// <summary>Whether or not this acknowledgement was attached to a
/// resent packet. If so, round-trip time will not be calculated</summary>
public bool FromResend;
public PendingAck(uint sequenceNumber, int currentTime, bool fromResend)
{
SequenceNumber = sequenceNumber;
RemoveTime = currentTime;
FromResend = fromResend;
}
}
/// <summary>Holds the actual unacked packet data, sorted by sequence number</summary>
private Dictionary<uint, OutgoingPacket> m_packets = new Dictionary<uint, OutgoingPacket>();
/// <summary>Holds packets that need to be added to the unacknowledged list</summary>
private LocklessQueue<OutgoingPacket> m_pendingAdds = new LocklessQueue<OutgoingPacket>();
/// <summary>Holds information about pending acknowledgements</summary>
private LocklessQueue<PendingAck> m_pendingRemoves = new LocklessQueue<PendingAck>();
/// <summary>
/// Add an unacked packet to the collection
/// </summary>
/// <param name="packet">Packet that is awaiting acknowledgement</param>
/// <returns>True if the packet was successfully added, false if the
/// packet already existed in the collection</returns>
/// <remarks>This does not immediately add the ACK to the collection,
/// it only queues it so it can be added in a thread-safe way later</remarks>
public void Add(OutgoingPacket packet)
{
m_pendingAdds.Enqueue(packet);
}
/// <summary>
/// Marks a packet as acknowledged
/// </summary>
/// <param name="sequenceNumber">Sequence number of the packet to
/// acknowledge</param>
/// <param name="currentTime">Current value of Environment.TickCount</param>
/// <remarks>This does not immediately acknowledge the packet, it only
/// queues the ack so it can be handled in a thread-safe way later</remarks>
public void Remove(uint sequenceNumber, int currentTime, bool fromResend)
{
m_pendingRemoves.Enqueue(new PendingAck(sequenceNumber, currentTime, fromResend));
}
/// <summary>
/// Returns a list of all of the packets with a TickCount older than
/// the specified timeout
/// </summary>
/// <param name="timeoutMS">Number of ticks (milliseconds) before a
/// packet is considered expired</param>
/// <returns>A list of all expired packets according to the given
/// expiration timeout</returns>
/// <remarks>This function is not thread safe, and cannot be called
/// multiple times concurrently</remarks>
public List<OutgoingPacket> GetExpiredPackets(int timeoutMS)
{
ProcessQueues();
List<OutgoingPacket> expiredPackets = null;
if (m_packets.Count > 0)
{
int now = Environment.TickCount & Int32.MaxValue;
foreach (OutgoingPacket packet in m_packets.Values)
{
// TickCount of zero means a packet is in the resend queue
// but hasn't actually been sent over the wire yet
if (packet.TickCount == 0)
continue;
if (now - packet.TickCount >= timeoutMS)
{
if (expiredPackets == null)
expiredPackets = new List<OutgoingPacket>();
// The TickCount will be set to the current time when the packet
// is actually sent out again
packet.TickCount = 0;
expiredPackets.Add(packet);
}
}
}
return expiredPackets;
}
private void ProcessQueues()
{
// Process all the pending adds
OutgoingPacket pendingAdd;
if (m_pendingAdds != null)
{
while (m_pendingAdds.Dequeue(out pendingAdd))
{
if (pendingAdd != null && m_packets != null)
{
m_packets[pendingAdd.SequenceNumber] = pendingAdd;
}
}
}
// Process all the pending removes, including updating statistics and round-trip times
PendingAck pendingRemove;
OutgoingPacket ackedPacket;
if (m_pendingRemoves != null)
{
while (m_pendingRemoves.Dequeue(out pendingRemove))
{
if (m_pendingRemoves != null && m_packets != null)
{
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
{
m_packets.Remove(pendingRemove.SequenceNumber);
// Update stats
System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
if (!pendingRemove.FromResend)
{
// Calculate the round-trip time for this packet and its ACK
int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
if (rtt > 0)
ackedPacket.Client.UpdateRoundTrip(rtt);
}
}
}
}
}
}
}
}

View File

@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Xml;
using log4net;
using Mono.Addins;
using Nini.Config;
@@ -37,6 +38,7 @@ using OpenSim.Framework;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Framework.Scenes.Serialization;
namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
@@ -233,8 +235,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
{
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
}
public UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
{
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
if (updateInventoryStatus)
{
@@ -253,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc)
{
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null)
@@ -278,13 +286,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (tainted)
objatt.HasGroupChanged = true;
if (doc != null)
{
objatt.LoadScriptState(doc);
objatt.ResetOwnerChangeFlag();
}
// Fire after attach, so we don't get messy perms dialogs
// 4 == AttachedRez
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
objatt.ResumeScripts();
// Do this last so that event listeners have access to all the effects of the attachment
m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
//m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
}
else
{
@@ -313,7 +327,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = m_scene.InventoryService.GetItem(item);
if (m_scene.InventoryService != null)
item = m_scene.InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
}
@@ -358,6 +373,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
{
// XXYY!!
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
if (item == null)
m_log.Error("[ATTACHMENT]: item == null");
if (m_scene == null)
m_log.Error("[ATTACHMENT]: m_scene == null");
if (m_scene.InventoryService == null)
m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null");
item = m_scene.InventoryService.GetItem(item);
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
@@ -446,6 +467,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (group.GetFromItemID() == itemID)
{
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
// CM / XMREngine!!!! Needed to conclude attach event
SceneObjectSerializer.ToOriginalXmlFormat(group);
group.DetachToInventoryPrep();
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID);

View File

@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
private int m_shoutdistance = 100;
private int m_whisperdistance = 10;
private List<Scene> m_scenes = new List<Scene>();
private List<string> FreezeCache = new List<string>();
private string m_adminPrefix = "";
internal object m_syncy = new object();
internal IConfig m_config;
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
}
public virtual void AddRegion(Scene scene)
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
return;
}
DeliverChatToAvatars(ChatSourceType.Agent, c);
if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
{
if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
}
else
{
DeliverChatToAvatars(ChatSourceType.Agent, c);
}
}
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
{
string fromName = c.From;
string fromNamePrefix = "";
UUID fromID = UUID.Zero;
string message = c.Message;
IScene scene = c.Scene;
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
fromPos = avatar.AbsolutePosition;
fromName = avatar.Name;
fromID = c.Sender.AgentId;
if (avatar.GodLevel >= 200)
{
fromNamePrefix = m_adminPrefix;
}
break;
case ChatSourceType.Object:
@@ -227,7 +241,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
s.ForEachScenePresence(
delegate(ScenePresence presence)
{
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
if (Presencecheck != null)
{
// This will pass all chat from objects. Not
// perfect, but it will do. For now. Better
// than the prior behavior of muting all
// objects on a parcel with access restrictions
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
{
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
}
}
}
);
}
@@ -270,25 +296,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
}
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
((Scene)c.Scene).ForEachScenePresence(
delegate(ScenePresence presence)
{
// ignore chat from child agents
if (presence.IsChildAgent) return;
IClientAPI client = presence.ControllingClient;
// don't forward SayOwner chat from objects to
// non-owner agents
if ((c.Type == ChatTypeEnum.Owner) &&
(null != c.SenderObject) &&
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
return;
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
});
if (c.Scene != null)
{
((Scene)c.Scene).ForEachScenePresence
(
delegate(ScenePresence presence)
{
// ignore chat from child agents
if (presence.IsChildAgent) return;
IClientAPI client = presence.ControllingClient;
// don't forward SayOwner chat from objects to
// non-owner agents
if ((c.Type == ChatTypeEnum.Owner) &&
(null != c.SenderObject) &&
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
return;
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
}
);
}
}
@@ -317,5 +347,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
}
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{
System.Threading.Timer Timer;
if (flags == 0)
{
FreezeCache.Add(target.ToString());
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
Timers.Add(target, Timer);
}
else
{
FreezeCache.Remove(target.ToString());
Timers.TryGetValue(target, out Timer);
Timers.Remove(target);
Timer.Dispose();
}
}
private void OnEndParcelFrozen(object avatar)
{
UUID target = (UUID)avatar;
FreezeCache.Remove(target.ToString());
System.Threading.Timer Timer;
Timers.TryGetValue(target, out Timer);
Timers.Remove(target);
Timer.Dispose();
}
}
}

View File

@@ -1,208 +1,223 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Dialog
{
public class DialogModule : IRegionModule, IDialogModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene;
public void Initialise(Scene scene, IConfigSource source)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IDialogModule>(this);
m_scene.AddCommand(
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
m_scene.AddCommand(
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
}
public void PostInitialise() {}
public void Close() {}
public string Name { get { return "Dialog Module"; } }
public bool IsSharedModule { get { return false; } }
public void SendAlertToUser(IClientAPI client, string message)
{
SendAlertToUser(client, message, false);
}
public void SendAlertToUser(IClientAPI client, string message, bool modal)
{
client.SendAgentAlertMessage(message, modal);
}
public void SendAlertToUser(UUID agentID, string message)
{
SendAlertToUser(agentID, message, false);
}
public void SendAlertToUser(UUID agentID, string message, bool modal)
{
ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal);
}
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
if (presence != null)
presence.ControllingClient.SendAgentAlertMessage(message, modal);
}
public void SendGeneralAlert(string message)
{
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{
if (!presence.IsChildAgent)
presence.ControllingClient.SendAlertMessage(message);
});
}
public void SendDialogToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
string message, UUID textureID, int ch, string[] buttonlabels)
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
string ownerFirstName, ownerLastName;
if (account != null)
{
ownerFirstName = account.FirstName;
ownerLastName = account.LastName;
}
else
{
ownerFirstName = "(unknown";
ownerLastName = "user)";
}
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
}
public void SendUrlToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
{
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
}
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
string ownerFirstName, ownerLastName;
if (account != null)
{
ownerFirstName = account.FirstName;
ownerLastName = account.LastName;
}
else
{
ownerFirstName = "(unknown";
ownerLastName = "user)";
}
ScenePresence sp = m_scene.GetScenePresence(avatarid);
if (sp != null)
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
}
public void SendNotificationToUsersInRegion(
UUID fromAvatarID, string fromAvatarName, string message)
{
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{
if (!presence.IsChildAgent)
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
});
}
/// <summary>
/// Handle an alert command from the console.
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
{
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
return;
if (cmdparams[1] == "general")
{
string message = CombineParams(cmdparams, 2);
m_log.InfoFormat(
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
SendGeneralAlert(message);
}
else
{
string firstName = cmdparams[1];
string lastName = cmdparams[2];
string message = CombineParams(cmdparams, 3);
m_log.InfoFormat(
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
m_scene.RegionInfo.RegionName, firstName, lastName, message);
SendAlertToUser(firstName, lastName, message, false);
}
}
private string CombineParams(string[] commandParams, int pos)
{
string result = string.Empty;
for (int i = pos; i < commandParams.Length; i++)
{
result += commandParams[i] + " ";
}
return result;
}
}
}
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Dialog
{
public class DialogModule : IRegionModule, IDialogModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene;
public void Initialise(Scene scene, IConfigSource source)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IDialogModule>(this);
m_scene.AddCommand(
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
m_scene.AddCommand(
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
m_scene.AddCommand(
this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand);
}
public void PostInitialise() {}
public void Close() {}
public string Name { get { return "Dialog Module"; } }
public bool IsSharedModule { get { return false; } }
public void SendAlertToUser(IClientAPI client, string message)
{
SendAlertToUser(client, message, false);
}
public void SendAlertToUser(IClientAPI client, string message, bool modal)
{
client.SendAgentAlertMessage(message, modal);
}
public void SendAlertToUser(UUID agentID, string message)
{
SendAlertToUser(agentID, message, false);
}
public void SendAlertToUser(UUID agentID, string message, bool modal)
{
ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal);
}
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
{
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
if (presence != null)
presence.ControllingClient.SendAgentAlertMessage(message, modal);
}
public void SendGeneralAlert(string message)
{
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{
if (!presence.IsChildAgent)
{
presence.ControllingClient.SendAlertMessage(message);
}
});
}
public void SendDialogToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
string message, UUID textureID, int ch, string[] buttonlabels)
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
string ownerFirstName, ownerLastName;
if (account != null)
{
ownerFirstName = account.FirstName;
ownerLastName = account.LastName;
}
else
{
ownerFirstName = "(unknown";
ownerLastName = "user)";
}
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
}
public void SendUrlToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
{
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
}
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
{
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
string ownerFirstName, ownerLastName;
if (account != null)
{
ownerFirstName = account.FirstName;
ownerLastName = account.LastName;
}
else
{
ownerFirstName = "(unknown";
ownerLastName = "user)";
}
ScenePresence sp = m_scene.GetScenePresence(avatarid);
if (sp != null)
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
}
public void SendNotificationToUsersInRegion(
UUID fromAvatarID, string fromAvatarName, string message)
{
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{
if (!presence.IsChildAgent)
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
});
}
/// <summary>
/// Handle an alert command from the console.
/// </summary>
/// <param name="module"></param>
/// <param name="cmdparams"></param>
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
{
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
return;
if (cmdparams[1] == "general")
{
string message = CombineParams(cmdparams, 2);
m_log.InfoFormat(
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
SendGeneralAlert(message);
}
else if (cmdparams[1] == "dialog")
{
string message = CombineParams(cmdparams, 2);
m_log.InfoFormat(
"[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
SendNotificationToUsersInRegion(UUID.Zero, "System", message);
}
else
{
string firstName = cmdparams[1];
string lastName = cmdparams[2];
string message = CombineParams(cmdparams, 3);
m_log.InfoFormat(
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
m_scene.RegionInfo.RegionName, firstName, lastName, message);
SendAlertToUser(firstName, lastName, message, false);
}
}
private string CombineParams(string[] commandParams, int pos)
{
string result = string.Empty;
for (int i = pos; i < commandParams.Length; i++)
{
result += commandParams[i] + " ";
}
return result;
}
}
}

View File

@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return false;
}
}
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected List<Scene> m_Scenes = new List<Scene>();
@@ -203,9 +203,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
UserFriendData data = m_Friends[principalID];
string searchFor = friendID.ToString();
foreach (FriendInfo fi in data.Friends)
{
if (fi.Friend == friendID.ToString())
if (fi.Friend == searchFor)
return (uint)fi.TheirFlags;
}
return 0;
@@ -292,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Inform the friends that this user is online
StatusChange(agentID, true);
// Register that we need to send the list of online friends to this user
lock (m_NeedsListOfFriends)
if (!m_NeedsListOfFriends.Contains(agentID))
@@ -498,7 +499,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
{
if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered)
{
{
// we got a friendship offer
UUID principalID = new UUID(im.fromAgentID);
UUID friendID = new UUID(im.toAgentID);
@@ -730,7 +731,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// we're done
return true;
}
return false;
}

View File

@@ -156,6 +156,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
return;
}
DateTime dt = DateTime.UtcNow;
// Ticks from UtcNow, but make it look like local. Evil, huh?
dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
try
{
// Convert that to the PST timezone
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
}
catch
{
//m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
}
// And make it look local again to fool the unix time util
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
im.timestamp = (uint)Util.ToUnixTime(dt);
// If client is null, this message comes from storage and IS offline
if (client != null)
im.offline = 0;
if (m_TransferModule != null)
{
m_TransferModule.SendInstantMessage(im,

View File

@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
{
UUID toAgentID = new UUID(im.toAgentID);
m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
//m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
// Try root avatar only first
foreach (Scene scene in m_Scenes)
@@ -140,12 +140,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
if (scene.Entities.ContainsKey(toAgentID) &&
scene.Entities[toAgentID] is ScenePresence)
{
m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
// m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
// Local message
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
if (!user.IsChildAgent)
{
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
user.ControllingClient.SendInstantMessage(im);
// Message sent
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// Local message
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
user.ControllingClient.SendInstantMessage(im);
// Message sent

View File

@@ -172,13 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void RetrieveInstantMessages(IClientAPI client)
{
if (m_RestURL != "")
{
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
if (m_RestURL == String.Empty)
return;
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
"POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
if (msglist != null)
{
foreach (GridInstantMessage im in msglist)
{
// client.SendInstantMessage(im);
@@ -189,6 +192,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
// Needed for proper state management for stored group
// invitations
//
im.offline = 1;
// Reconstruct imSessionID
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
{
UUID fromAgentID = new UUID(im.fromAgentID);
UUID sessionID = fromAgentID ^ client.AgentId;
im.imSessionID = new Guid(sessionID.ToString());
}
Scene s = FindScene(client.AgentId);
if (s != null)
s.EventManager.TriggerIncomingInstantMessage(im);
@@ -198,26 +212,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
private void UndeliveredMessage(GridInstantMessage im)
{
if ((im.offline != 0)
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
if (im.dialog != (byte)InstantMessageDialog.MessageFromObject &&
im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
im.dialog != (byte)InstantMessageDialog.GroupNotice &&
im.dialog != (byte)InstantMessageDialog.InventoryOffered)
{
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
"POST", m_RestURL+"/SaveMessage/", im);
return;
}
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
{
IClientAPI client = FindClient(new UUID(im.fromAgentID));
if (client == null)
return;
// It's not delivered. Make sure the scope id is saved
// We don't need the imSessionID here anymore, overwrite it
Scene scene = FindScene(new UUID(im.fromAgentID));
if (scene == null)
scene = m_SceneList[0];
im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString());
client.SendInstantMessage(new GridInstantMessage(
null, new UUID(im.toAgentID),
"System", new UUID(im.fromAgentID),
(byte)InstantMessageDialog.MessageFromAgent,
"User is not logged in. "+
(success ? "Message saved." : "Message not saved"),
false, new Vector3()));
}
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
"POST", m_RestURL+"/SaveMessage/", im);
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
{
IClientAPI client = FindClient(new UUID(im.fromAgentID));
if (client == null)
return;
client.SendInstantMessage(new GridInstantMessage(
null, new UUID(im.toAgentID),
"System", new UUID(im.fromAgentID),
(byte)InstantMessageDialog.MessageFromAgent,
"User is not logged in. "+
(success ? "Message saved." : "Message not saved"),
false, new Vector3()));
}
}
}

View File

@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
{
m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog);
//m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog);
Scene scene = FindClientScene(client.AgentId);
@@ -241,6 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
im.imSessionID = itemID.Guid;
}
im.offline = 1; // Remember these
// Send the IM to the recipient. The item is already
// in their inventory, so it will not be lost if
// they are offline.

View File

@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
// it's actually doing a lot of work.
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
if (endPoint.Address != null)
if (endPoint != null && endPoint.Address != null)
{
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions
@@ -549,6 +549,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (uinfo != null)
{
if (uinfo.HomeRegionID == UUID.Zero)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("You don't have a home position set.");
return;
}
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
if (regionInfo == null)
{
@@ -556,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
client.SendTeleportFailed("Your home region could not be found.");
return;
}
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
@@ -564,6 +570,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
}
else
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
return;
}
}
#endregion
@@ -851,15 +863,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
if (eq != null)
IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint;
if (neighbourExternal != null)
{
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
capsPath, agent.UUID, agent.ControllingClient.SessionId);
}
else
{
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
capsPath);
if (eq != null)
{
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
capsPath, agent.UUID, agent.ControllingClient.SessionId);
}
else
{
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
capsPath);
}
}
if (!WaitForCallback(agent.UUID))
@@ -957,10 +973,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
agent.Viewer = currentAgentCircuit.Viewer;
}
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
IPEndPoint external = region.ExternalEndPoint;
if (external != null)
{
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
d.BeginInvoke(sp, agent, region, external, true,
InformClientOfNeighbourCompleted,
d);
}
}
#endregion
@@ -1089,6 +1109,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
try
{
//neighbour.ExternalEndPoint may return null, which will be caught
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
InformClientOfNeighbourCompleted,
d);

View File

@@ -219,6 +219,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
Vector3 originalPosition = objectGroup.AbsolutePosition;
// Restore attachment data after trip through the sim
if (objectGroup.RootPart.AttachPoint > 0)
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
objectGroup.AbsolutePosition = inventoryStoredPosition;
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
@@ -491,6 +496,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (item != null)
{
if (item.ID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 1");
}
AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
if (rezAsset != null)
@@ -513,17 +523,30 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
itemId = item.ID;
}
if (item.ID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 2");
}
string xmlData = Utils.BytesToString(rezAsset.Data);
SceneObjectGroup group
= SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData);
Vector3 storedPosition = group.AbsolutePosition;
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3");
}
group.RootPart.FromFolderID = item.Folder;
// If it's rezzed in world, select it. Much easier to
// find small items.
//
if (!attachment)
{
group.RootPart.CreateSelected = true;
foreach (SceneObjectPart child in group.Children.Values)
child.CreateSelected = true;
}
if (!m_Scene.Permissions.CanRezObject(
group.Children.Count, remoteClient.AgentId, pos)
@@ -538,9 +561,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
remoteClient.SendBulkUpdateInventory(item);
return null;
}
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 4");
}
group.ResetIDs();
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 5");
}
if (attachment)
{
group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
@@ -572,7 +601,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
group.SetFromItemID(itemID);
}
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 6");
}
SceneObjectPart rootPart = null;
try
{
@@ -587,7 +619,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
}
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 7");
}
// Since renaming the item in the inventory does not affect the name stored
// in the serialization, transfer the correct name from the inventory to the
// object itself before we rez.
@@ -615,7 +650,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
group.ApplyNextOwnerPermissions();
}
}
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 8");
}
foreach (SceneObjectPart part in partList)
{
if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
@@ -628,13 +666,23 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
part.EveryoneMask = item.EveryOnePermissions;
part.NextOwnerMask = item.NextPermissions;
}
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 9");
}
rootPart.TrimPermissions();
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 10");
}
if (!attachment)
{
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
{
// Save attachment data
group.RootPart.AttachPoint = group.RootPart.Shape.State;
group.RootPart.AttachOffset = storedPosition;
group.ClearPartAttachmentData();
}
@@ -660,8 +708,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
}
return rootPart.ParentGroup;
if (group.UUID == UUID.Zero)
{
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 11");
}
return group;
}
}

View File

@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
return urlcode;
}
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString();
UrlData urlData = new UrlData();
urlData.hostID = host.UUID;
@@ -152,10 +152,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
urlData.urlcode = urlcode;
urlData.requests = new Dictionary<UUID, RequestData>();
m_UrlMap[url] = urlData;
string uri = "/lslhttp/" + urlcode.ToString() + "/";
string uri = "/lslhttp/" + urlcode.ToString();
m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll,
new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents,
@@ -386,6 +385,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
return response;
}
public void HttpRequestHandler(UUID requestID, Hashtable request)
{
lock (request)
@@ -400,8 +400,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
int pos1 = uri.IndexOf("/");// /lslhttp
int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
string uri_tmp = uri.Substring(0, pos3 + 1);
int pos3 = pos2 + 37; // /lslhttp/urlcode
string uri_tmp = uri.Substring(0, pos3);
//HTTP server code doesn't provide us with QueryStrings
string pathInfo;
string queryString;

View File

@@ -57,9 +57,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion");
config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion");
config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion");
config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion");
config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion");
config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion");
config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion");
m_LocalConnector = new LocalGridServicesConnector(config);
@@ -128,8 +128,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
Assert.IsNotNull(result, "Retrieved GetRegionByName is null");
Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match");
m_LocalConnector.RegisterRegion(UUID.Zero, r2);
m_LocalConnector.RegisterRegion(UUID.Zero, r3);
m_LocalConnector.RegisterRegion(UUID.Zero, r2);
m_LocalConnector.RegisterRegion(UUID.Zero, r3);
m_LocalConnector.RegisterRegion(UUID.Zero, r4);
result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1));
@@ -154,38 +154,38 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null");
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
results = m_LocalConnector.GetDefaultRegions(UUID.Zero);
Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null");
Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2");
results = m_LocalConnector.GetDefaultRegions(UUID.Zero);
Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null");
Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2");
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY);
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null");
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size");
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2");
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2");
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2");
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");

View File

@@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
public bool CloseChildAgent(GridRegion destination, UUID id)
{
if (destination == null)
return false;
foreach (Scene s in m_sceneList)
{
if (s.RegionInfo.RegionID == destination.RegionID)
{
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
return s.IncomingCloseChildAgent(id);
}
}
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
return false;
}
/**
* Object-related communications
*/

View File

@@ -252,6 +252,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
public bool CloseChildAgent(GridRegion destination, UUID id)
{
if (destination == null)
return false;
// Try local first
if (m_localBackend.CloseChildAgent(destination, id))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
return m_remoteConnector.CloseChildAgent(destination, id);
return false;
}
public bool CloseAgent(GridRegion destination, UUID id)
{

View File

@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
if (account != null)
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d));
m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
// m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
}
public UserAccount Get(UUID userID, out bool inCache)

View File

@@ -261,10 +261,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
// Fix ownership/creator of inventory items
// Not doing so results in inventory items
// being no copy/no mod for everyone
lock (part.TaskInventory)
part.TaskInventory.LockItemsForRead(true);
TaskInventoryDictionary inv = part.TaskInventory;
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
{
TaskInventoryDictionary inv = part.TaskInventory;
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
if (!ResolveUserUuid(kvp.Value.OwnerID))
{
if (!ResolveUserUuid(kvp.Value.OwnerID))
{
@@ -276,6 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
}
}
part.TaskInventory.LockItemsForRead(false);
}
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))

View File

@@ -29,6 +29,7 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Security;
using System.Timers;
using log4net;
using Nini.Config;
using OpenMetaverse;
@@ -45,6 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
private delegate void LookupUUIDS(List<UUID> uuidLst);
private Scene m_scene;
private Timer m_regionChangeTimer = new Timer();
private EstateTerrainXferHandler TerrainUploader;
@@ -250,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if ((estateAccessType & 4) != 0) // User add
{
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
{
m_scene.RegionInfo.EstateSettings.AddEstateUser(user);
m_scene.RegionInfo.EstateSettings.Save();
@@ -265,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
if ((estateAccessType & 8) != 0) // User remove
{
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
{
m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
m_scene.RegionInfo.EstateSettings.Save();
@@ -280,7 +282,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
if ((estateAccessType & 16) != 0) // Group add
{
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
{
m_scene.RegionInfo.EstateSettings.AddEstateGroup(user);
m_scene.RegionInfo.EstateSettings.Save();
@@ -294,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
if ((estateAccessType & 32) != 0) // Group remove
{
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
{
m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
m_scene.RegionInfo.EstateSettings.Save();
@@ -898,6 +900,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
m_scene.RegisterModuleInterface<IEstateModule>(this);
m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
m_regionChangeTimer.AutoReset = false;
m_regionChangeTimer.Interval = 2000;
m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
m_scene.AddCommand(this, "set terrain texture",
"set terrain texture <number> <uuid> [<x>] [<y>]",
@@ -1167,6 +1172,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
protected void TriggerRegionInfoChange()
{
m_regionChangeTimer.Stop();
m_regionChangeTimer.Start();
}
protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e)
{
ChangeDelegate change = OnRegionInfoChange;

View File

@@ -83,6 +83,8 @@ namespace OpenSim.Region.CoreModules.World.Land
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
private bool m_allowedForcefulBans = true;
private UUID DefaultGodParcelGroup;
private string DefaultGodParcelName;
// caches ExtendedLandData
private Cache parcelInfoCache;
@@ -97,6 +99,12 @@ namespace OpenSim.Region.CoreModules.World.Land
public void Initialise(IConfigSource source)
{
IConfig cnf = source.Configs["LandManagement"];
if (cnf != null)
{
DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
}
}
public void AddRegion(Scene scene)
@@ -161,7 +169,7 @@ namespace OpenSim.Region.CoreModules.World.Land
client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
client.OnParcelReclaim += ClientOnParcelReclaim;
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
// client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
@@ -352,7 +360,7 @@ namespace OpenSim.Region.CoreModules.World.Land
{
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
{
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID))
{
SendYouAreBannedNotice(avatar);
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
@@ -649,7 +657,7 @@ namespace OpenSim.Region.CoreModules.World.Land
int x;
int y;
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
if (x_float > Constants.RegionSize || x_float < 0 || y_float > Constants.RegionSize || y_float < 0)
return null;
try
@@ -992,6 +1000,10 @@ namespace OpenSim.Region.CoreModules.World.Land
//Owner Flag
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
}
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
{
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
}
else if (currentParcelBlock.LandData.SalePrice > 0 &&
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
@@ -1292,18 +1304,31 @@ namespace OpenSim.Region.CoreModules.World.Land
public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
{
for (int i = 0; i < data.Count; i++)
lock (m_landList)
{
IncomingLandObjectFromStorage(data[i]);
//Remove all the land objects in the sim and then process our new data
foreach (int n in m_landList.Keys)
{
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
}
m_landIDList.Initialize();
m_landList.Clear();
for (int i = 0; i < data.Count; i++)
{
IncomingLandObjectFromStorage(data[i]);
}
}
}
public void IncomingLandObjectFromStorage(LandData data)
{
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
new_land.LandData = data.Copy();
new_land.SetLandBitmapFromByteArray();
AddLandObject(new_land);
new_land.SendLandUpdateToAvatarsOverMe();
}
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
@@ -1524,5 +1549,321 @@ namespace OpenSim.Region.CoreModules.World.Land
UpdateLandObject(localID, land.LandData);
}
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
{
ILandObject land = null;
List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
foreach (ILandObject landObject in Land)
{
if (landObject.LandData.LocalID == landID)
{
land = landObject;
}
}
land.DeedToGroup(DefaultGodParcelGroup);
land.LandData.Name = DefaultGodParcelName;
land.SendLandUpdateToAvatarsOverMe();
}
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
{
ScenePresence SP;
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
if (SP.GodLevel != 0)
{
if (flags == 0) //All parcels, scripted or not
{
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
{
if (e.OwnerID == targetID)
{
returns.Add(e);
}
}
);
}
if (flags == 4) //All parcels, scripted object
{
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
{
if (e.OwnerID == targetID)
{
if (e.scriptScore >= 0.01)
{
returns.Add(e);
}
}
}
);
}
if (flags == 4) //not target parcel, scripted object
{
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
{
if (e.OwnerID == targetID)
{
ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
if (landobject.LandData.OwnerID != e.OwnerID)
{
if (e.scriptScore >= 0.01)
{
returns.Add(e);
}
}
}
}
);
}
foreach (SceneObjectGroup ol in returns)
{
ReturnObject(ol, client);
}
}
}
public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
{
SceneObjectGroup[] objs = new SceneObjectGroup[1];
objs[0] = obj;
((Scene)client.Scene).returnObjects(objs, client.AgentId);
}
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{
ScenePresence targetAvatar = null;
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
ScenePresence parcelManager = null;
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
System.Threading.Timer Timer;
if (targetAvatar.GodLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
return;
if (flags == 0)
{
targetAvatar.AllowMovement = false;
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
Timers.Add(targetAvatar.UUID, Timer);
}
else
{
targetAvatar.AllowMovement = true;
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
Timers.TryGetValue(targetAvatar.UUID, out Timer);
Timers.Remove(targetAvatar.UUID);
Timer.Dispose();
}
}
}
private void OnEndParcelFrozen(object avatar)
{
ScenePresence targetAvatar = (ScenePresence)avatar;
targetAvatar.AllowMovement = true;
System.Threading.Timer Timer;
Timers.TryGetValue(targetAvatar.UUID, out Timer);
Timers.Remove(targetAvatar.UUID);
targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
}
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
{
ScenePresence targetAvatar = null;
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
ScenePresence parcelManager = null;
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
//Just eject
if (flags == 0)
{
if (targetAvatar.GodLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
return;
Vector3 position = new Vector3(0, 0, 0);
List<ILandObject> allParcels = new List<ILandObject>();
allParcels = AllParcels();
if (allParcels.Count != 1)
{
foreach (ILandObject parcel in allParcels)
{
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
{
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
{
for (int x = 1; x <= Constants.RegionSize; x += 2)
{
for (int y = 1; y <= Constants.RegionSize; y += 2)
{
if (parcel.ContainsPoint(x, y))
{
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
targetAvatar.TeleportWithMomentum(position);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
}
}
}
}
}
Vector3 targetVector;
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
{
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
{
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
else
{
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
else
{
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
else
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
return;
}
}
}
}
//Eject and ban
if (flags == 1)
{
if (targetAvatar.GodLevel == 0)
{
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
return;
Vector3 position = new Vector3(0, 0, 0);
List<ILandObject> allParcels = new List<ILandObject>();
allParcels = AllParcels();
if (allParcels.Count != 1)
{
foreach (ILandObject parcel in allParcels)
{
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
{
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
{
for (int x = 1; x <= Constants.RegionSize; x += 2)
{
for (int y = 1; y <= Constants.RegionSize; y += 2)
{
if (parcel.ContainsPoint(x, y))
{
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
targetAvatar.TeleportWithMomentum(position);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
}
}
}
}
}
Vector3 targetVector;
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
{
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
{
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
else
{
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
else
{
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
else
{
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
targetAvatar.TeleportWithMomentum(targetVector);
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
entry.AgentID = targetAvatar.UUID;
entry.Flags = AccessList.Ban;
entry.Time = new DateTime();
land.LandData.ParcelAccessList.Add(entry);
return;
}
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
public string Name
{
get { return "PermissionsModule"; }
get { return "DefaultPermissionsModule"; }
}
public bool IsSharedModule

View File

@@ -549,6 +549,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
m_scene.SaveTerrain();
m_scene.EventManager.TriggerTerrainUpdate();
// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
//m_scene.CreateTerrainTexture(true);
}

View File

@@ -79,7 +79,7 @@ namespace OpenSim.Region.Examples.SimpleModule
public event DisconnectUser OnDisconnectUser;
public event RequestAvatarProperties OnRequestAvatarProperties;
public event SetAlwaysRun OnSetAlwaysRun;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event DeRezObject OnDeRezObject;
public event Action<IClientAPI> OnRegionHandShakeReply;
public event GenericCall2 OnRequestWearables;
@@ -817,11 +817,20 @@ namespace OpenSim.Region.Examples.SimpleModule
{
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
}

View File

@@ -26,6 +26,7 @@
*/
using System;
using System.Xml;
using OpenMetaverse;
using OpenMetaverse.Packets;
using OpenSim.Framework;
@@ -82,6 +83,10 @@ namespace OpenSim.Region.Framework.Interfaces
UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
// Same as above, but also load script states from a separate doc
UUID RezSingleAttachmentFromInventory(
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
/// <summary>
/// Rez multiple attachments from a user's inventory
/// </summary>
@@ -132,4 +137,4 @@ namespace OpenSim.Region.Framework.Interfaces
/// </param>
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
}
}
}

View File

@@ -0,0 +1,37 @@
/*
* 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 OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces
{
public interface IDwellModule
{
int GetDwell(UUID parcelID);
}
}

View File

@@ -105,6 +105,8 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="stateSource"></param>
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
/// <summary>
/// Stop a script which is in this prim's inventory.
/// </summary>
@@ -214,5 +216,6 @@ namespace OpenSim.Region.Framework.Interfaces
/// A <see cref="Dictionary`2"/>
/// </returns>
Dictionary<UUID, string> GetScriptStates();
Dictionary<UUID, string> GetScriptStates(bool oldIDs);
}
}

View File

@@ -67,6 +67,14 @@ namespace OpenSim.Region.Framework.Interfaces
/// <returns></returns>
bool SendReleaseAgent(ulong regionHandle, UUID id, string uri);
/// <summary>
/// Close chid agent.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="id"></param>
/// <returns></returns>
bool SendCloseChildAgent(ulong regionHandle, UUID id);
/// <summary>
/// Close agent.
/// </summary>

View File

@@ -0,0 +1,27 @@
///////////////////////////////////////////////////////////////////
//
// (c) Careminster LImited, Melanie Thielker and the Meta7 Team
//
// This file is not open source. All rights reserved
// Mod 2
using OpenSim.Region.Framework.Scenes;
public interface ISnmpModule
{
void Trap(int code, string Message, Scene scene);
void Critical(string Message, Scene scene);
void Warning(string Message, Scene scene);
void Major(string Message, Scene scene);
void ColdStart(int step , Scene scene);
void Shutdown(int step , Scene scene);
//
// Node Start/stop events
//
void LinkUp(Scene scene);
void LinkDown(Scene scene);
void BootInfo(string data, Scene scene);
void trapDebug(string Module,string data, Scene scene);
void trapXMRE(int data, string Message, Scene scene);
}

View File

@@ -226,7 +226,8 @@ namespace OpenSim.Region.Framework
"[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e);
// justincc: Right now this is fatal to really get the user's attention
throw e;
// TomMeta: WTF? No, how about we /don't/ throw a fatal exception when there's no need to?
//throw e;
}
}

View File

@@ -53,10 +53,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
{
get { return m_movementAnimation; }
}
protected string m_movementAnimation = "DEFAULT";
// protected string m_movementAnimation = "DEFAULT"; //KF: 'DEFAULT' does not exist!
protected string m_movementAnimation = "CROUCH"; //KF: CROUCH ensures reliable Av Anim. init.
private int m_animTickFall;
private int m_animTickJump;
// private int m_animTickJump;
public int m_animTickJump; // ScenePresence has to see this to control +Z force
/// <value>
/// The scene presence that this animator applies to
@@ -123,8 +124,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
/// </summary>
public void TrySetMovementAnimation(string anim)
{
//m_log.DebugFormat("Updating movement animation to {0}", anim);
if (!m_scenePresence.IsChildAgent)
{
if (m_animations.TrySetDefaultAnimation(
@@ -146,10 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
const float PREJUMP_DELAY = 0.25f;
#region Inputs
if (m_scenePresence.SitGround)
{
return "SIT_GROUND_CONSTRAINED";
}
AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags;
PhysicsActor actor = m_scenePresence.PhysicsActor;
@@ -159,11 +155,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix);
// Check control flags
bool heldForward =
(((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS));
bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG;
bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS;
bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG;
bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS);
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS);
bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG);
//bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
//bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
@@ -266,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
m_animTickJump = Environment.TickCount;
return "PREJUMP";
}
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 1000.0f)
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 800.0f)
{
// Start actual jump
if (m_animTickJump == -1)
@@ -316,7 +311,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void UpdateMovementAnimations()
{
m_movementAnimation = GetMovementAnimation();
if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
{
// This was the previous behavior before PREJUMP

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes
private readonly Dictionary<UUID,EntityBase> m_eb_uuid = new Dictionary<UUID, EntityBase>();
private readonly Dictionary<uint, EntityBase> m_eb_localID = new Dictionary<uint, EntityBase>();
//private readonly Dictionary<UUID, ScenePresence> m_pres_uuid = new Dictionary<UUID, ScenePresence>();
private readonly Object m_lock = new Object();
private System.Threading.ReaderWriterLockSlim m_lock = new System.Threading.ReaderWriterLockSlim();
[Obsolete("Use Add() instead.")]
public void Add(UUID id, EntityBase eb)
@@ -50,7 +50,8 @@ namespace OpenSim.Region.Framework.Scenes
public void Add(EntityBase entity)
{
lock (m_lock)
m_lock.EnterWriteLock();
try
{
try
{
@@ -62,11 +63,16 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("Add Entity failed: {0}", e.Message);
}
}
finally
{
m_lock.ExitWriteLock();
}
}
public void InsertOrReplace(EntityBase entity)
{
lock (m_lock)
m_lock.EnterWriteLock();
try
{
try
{
@@ -78,15 +84,24 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message);
}
}
finally
{
m_lock.ExitWriteLock();
}
}
public void Clear()
{
lock (m_lock)
m_lock.EnterWriteLock();
try
{
m_eb_uuid.Clear();
m_eb_localID.Clear();
}
finally
{
m_lock.ExitWriteLock();
}
}
public int Count
@@ -123,7 +138,8 @@ namespace OpenSim.Region.Framework.Scenes
public bool Remove(uint localID)
{
lock (m_lock)
m_lock.EnterWriteLock();
try
{
try
{
@@ -141,11 +157,16 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
}
finally
{
m_lock.ExitWriteLock();
}
}
public bool Remove(UUID id)
{
lock (m_lock)
m_lock.EnterWriteLock();
try
{
try
{
@@ -163,13 +184,18 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
}
finally
{
m_lock.ExitWriteLock();
}
}
public List<EntityBase> GetAllByType<T>()
{
List<EntityBase> tmp = new List<EntityBase>();
lock (m_lock)
m_lock.EnterReadLock();
try
{
try
{
@@ -187,23 +213,33 @@ namespace OpenSim.Region.Framework.Scenes
tmp = null;
}
}
finally
{
m_lock.ExitReadLock();
}
return tmp;
}
public List<EntityBase> GetEntities()
{
lock (m_lock)
m_lock.EnterReadLock();
try
{
return new List<EntityBase>(m_eb_uuid.Values);
}
finally
{
m_lock.ExitReadLock();
}
}
public EntityBase this[UUID id]
{
get
{
lock (m_lock)
m_lock.EnterReadLock();
try
{
EntityBase entity;
if (m_eb_uuid.TryGetValue(id, out entity))
@@ -211,6 +247,10 @@ namespace OpenSim.Region.Framework.Scenes
else
return null;
}
finally
{
m_lock.ExitReadLock();
}
}
set
{
@@ -222,7 +262,8 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
lock (m_lock)
m_lock.EnterReadLock();
try
{
EntityBase entity;
if (m_eb_localID.TryGetValue(localID, out entity))
@@ -230,6 +271,10 @@ namespace OpenSim.Region.Framework.Scenes
else
return null;
}
finally
{
m_lock.ExitReadLock();
}
}
set
{
@@ -239,18 +284,28 @@ namespace OpenSim.Region.Framework.Scenes
public bool TryGetValue(UUID key, out EntityBase obj)
{
lock (m_lock)
m_lock.EnterReadLock();
try
{
return m_eb_uuid.TryGetValue(key, out obj);
}
finally
{
m_lock.ExitReadLock();
}
}
public bool TryGetValue(uint key, out EntityBase obj)
{
lock (m_lock)
m_lock.EnterReadLock();
try
{
return m_eb_localID.TryGetValue(key, out obj);
}
finally
{
m_lock.ExitReadLock();
}
}
/// <summary>

View File

@@ -55,8 +55,12 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void OnTerrainTickDelegate();
public delegate void OnTerrainUpdateDelegate();
public event OnTerrainTickDelegate OnTerrainTick;
public event OnTerrainUpdateDelegate OnTerrainUpdate;
public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup);
public event OnBackupDelegate OnBackup;
@@ -744,6 +748,26 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
public void TriggerTerrainUpdate()
{
OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
if (handlerTerrainUpdate != null)
{
foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
{
try
{
d();
}
catch (Exception e)
{
m_log.ErrorFormat(
"[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
e.Message, e.StackTrace);
}
}
}
}
public void TriggerTerrainTick()
{

View File

@@ -186,9 +186,9 @@ namespace OpenSim.Region.Framework.Scenes
return 0.0;
// Use group position for child prims
Vector3 entityPos = entity.AbsolutePosition;
Vector3 entityPos;
if (entity is SceneObjectPart)
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
else
entityPos = entity.AbsolutePosition;
@@ -211,12 +211,19 @@ namespace OpenSim.Region.Framework.Scenes
if (entity is SceneObjectPart)
{
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
if (physActor == null || !physActor.IsPhysical)
priority += 100;
if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
{
priority = 1.0;
}
else
{
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
if (physActor == null || !physActor.IsPhysical)
priority += 100;
}
if (((SceneObjectPart)entity).ParentGroup.RootPart != (SceneObjectPart)entity)
priority +=1;
}
return priority;
}

View File

@@ -94,6 +94,22 @@ namespace OpenSim.Region.Framework.Scenes
public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
{
InventoryFolderBase folder;
if (item.Folder == UUID.Zero)
{
folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType);
if (folder == null)
{
folder = InventoryService.GetRootFolder(AgentID);
if (folder == null)
return;
}
item.Folder = folder.ID;
}
if (InventoryService.AddItem(item))
{
int userlevel = 0;
@@ -214,8 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
{
// Needs to determine which engine was running it and use that
//
part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0);
errors = part.Inventory.GetScriptErrors(item.ItemID);
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
}
else
{
@@ -633,6 +648,8 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
if (newName == null) newName = item.Name;
AssetBase asset = AssetService.Get(item.AssetID.ToString());
if (asset != null)
@@ -679,6 +696,24 @@ namespace OpenSim.Region.Framework.Scenes
return asset;
}
/// <summary>
/// Move an item within the agent's inventory, and leave a copy (used in making a new outfit)
/// </summary>
public void MoveInventoryItemsLeaveCopy(IClientAPI remoteClient, List<InventoryItemBase> items, UUID destfolder)
{
List<InventoryItemBase> moveitems = new List<InventoryItemBase>();
foreach (InventoryItemBase b in items)
{
CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null);
InventoryItemBase n = InventoryService.GetItem(b);
n.Folder = destfolder;
moveitems.Add(n);
remoteClient.SendInventoryItemCreateUpdate(n, 0);
}
MoveInventoryItem(remoteClient, moveitems);
}
/// <summary>
/// Move an item within the agent's inventory.
/// </summary>
@@ -913,8 +948,12 @@ namespace OpenSim.Region.Framework.Scenes
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
{
SceneObjectPart part = GetSceneObjectPart(localID);
SceneObjectGroup group = part.ParentGroup;
if (group != null)
SceneObjectGroup group = null;
if (part != null)
{
group = part.ParentGroup;
}
if (part != null && group != null)
{
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
return;
@@ -1489,7 +1528,7 @@ namespace OpenSim.Region.Framework.Scenes
return;
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"),
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
remoteClient.AgentId);
AssetService.Store(asset);
@@ -1684,11 +1723,19 @@ namespace OpenSim.Region.Framework.Scenes
// Invalid id
SceneObjectPart part = GetSceneObjectPart(localID);
if (part == null)
{
//Client still thinks the object exists, kill it
SendKillObject(localID);
continue;
}
// Already deleted by someone else
if (part.ParentGroup == null || part.ParentGroup.IsDeleted)
{
//Client still thinks the object exists, kill it
SendKillObject(localID);
continue;
}
// Can't delete child prims
if (part != part.ParentGroup.RootPart)
@@ -1715,15 +1762,21 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
if (action == DeRezAction.TakeCopy)
{
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
permissionToTakeCopy = false;
}
else
{
permissionToTakeCopy = false;
}
if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
permissionToTake = false;
if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
permissionToDelete = false;
}
}
// Handle god perms

View File

@@ -137,6 +137,7 @@ namespace OpenSim.Region.Framework.Scenes
protected SceneCommunicationService m_sceneGridService;
public bool LoginsDisabled = true;
public bool LoadingPrims = false;
public bool CombineRegions = false;
public new float TimeDilation
{
@@ -150,6 +151,20 @@ namespace OpenSim.Region.Framework.Scenes
public IXfer XferManager;
protected ISnmpModule m_snmpService = null;
public ISnmpModule SnmpService
{
get
{
if (m_snmpService == null)
{
m_snmpService = RequestModuleInterface<ISnmpModule>();
}
return m_snmpService;
}
}
protected IAssetService m_AssetService;
protected IAuthorizationService m_AuthorizationService;
@@ -608,6 +623,8 @@ namespace OpenSim.Region.Framework.Scenes
// Load region settings
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
if (m_storageManager.EstateDataStore != null)
{
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
@@ -709,9 +726,10 @@ namespace OpenSim.Region.Framework.Scenes
//Animation states
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
// TODO: Change default to true once the feature is supported
m_usePreJump = startupConfig.GetBoolean("enableprejump", false);
m_usePreJump = startupConfig.GetBoolean("enableprejump", true);
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
m_log.DebugFormat("[SCENE]: prejump is {0}", m_usePreJump ? "ON" : "OFF");
if (RegionInfo.NonphysPrimMax > 0)
{
m_maxNonphys = RegionInfo.NonphysPrimMax;
@@ -752,6 +770,7 @@ namespace OpenSim.Region.Framework.Scenes
}
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
#region BinaryStats
@@ -1023,6 +1042,15 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
/// <param name="seconds">float indicating duration before restart.</param>
public virtual void Restart(float seconds)
{
Restart(seconds, true);
}
/// <summary>
/// Given float seconds, this will restart the region. showDialog will optionally alert the users.
/// </summary>
/// <param name="seconds">float indicating duration before restart.</param>
public virtual void Restart(float seconds, bool showDialog)
{
// notifications are done in 15 second increments
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
@@ -1044,8 +1072,11 @@ namespace OpenSim.Region.Framework.Scenes
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
m_restartTimer.Start();
m_dialogModule.SendNotificationToUsersInRegion(
if (showDialog)
{
m_dialogModule.SendNotificationToUsersInRegion(
UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
}
}
}
@@ -1403,16 +1434,16 @@ namespace OpenSim.Region.Framework.Scenes
// Check if any objects have reached their targets
CheckAtTargets();
// Update SceneObjectGroups that have scheduled themselves for updates
// Objects queue their updates onto all scene presences
if (m_frame % m_update_objects == 0)
m_sceneGraph.UpdateObjectGroups();
// Run through all ScenePresences looking for updates
// Presence updates and queued object updates for each presence are sent to clients
if (m_frame % m_update_presences == 0)
m_sceneGraph.UpdatePresences();
// Update SceneObjectGroups that have scheduled themselves for updates
// Objects queue their updates onto all scene presences
if (m_frame % m_update_objects == 0)
m_sceneGraph.UpdateObjectGroups();
if (m_frame % m_update_coarse_locations == 0)
{
List<Vector3> coarseLocations;
@@ -1741,6 +1772,7 @@ namespace OpenSim.Region.Framework.Scenes
public void StoreWindlightProfile(RegionLightShareData wl)
{
m_regInfo.WindlightSettings = wl;
wl.Save();
m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
m_eventManager.TriggerOnSaveNewWindlightProfile();
}
@@ -1923,14 +1955,24 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns>
public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
{
float wheight = (float)RegionInfo.RegionSettings.WaterHeight;
Vector3 wpos = Vector3.Zero;
// Check for water surface intersection from above
if ( (RayStart.Z > wheight) && (RayEnd.Z < wheight) )
{
float ratio = (RayStart.Z - wheight) / (RayStart.Z - RayEnd.Z);
wpos.X = RayStart.X - (ratio * (RayStart.X - RayEnd.X));
wpos.Y = RayStart.Y - (ratio * (RayStart.Y - RayEnd.Y));
wpos.Z = wheight;
}
Vector3 pos = Vector3.Zero;
if (RayEndIsIntersection == (byte)1)
{
pos = RayEnd;
return pos;
}
if (RayTargetID != UUID.Zero)
else if (RayTargetID != UUID.Zero)
{
SceneObjectPart target = GetSceneObjectPart(RayTargetID);
@@ -1952,7 +1994,7 @@ namespace OpenSim.Region.Framework.Scenes
EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
// Un-comment out the following line to Get Raytrace results printed to the console.
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
float ScaleOffset = 0.5f;
// If we hit something
@@ -1975,13 +2017,10 @@ namespace OpenSim.Region.Framework.Scenes
//pos.Z -= 0.25F;
}
return pos;
}
else
{
// We don't have a target here, so we're going to raytrace all the objects in the scene.
EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false);
// Un-comment the following line to print the raytrace results to the console.
@@ -1990,13 +2029,12 @@ namespace OpenSim.Region.Framework.Scenes
if (ei.HitTF)
{
pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
} else
}
else
{
// fall back to our stupid functionality
pos = RayEnd;
}
return pos;
}
}
else
@@ -2007,8 +2045,12 @@ namespace OpenSim.Region.Framework.Scenes
//increase height so its above the ground.
//should be getting the normal of the ground at the rez point and using that?
pos.Z += scale.Z / 2f;
return pos;
// return pos;
}
// check against posible water intercept
if (wpos.Z > pos.Z) pos = wpos;
return pos;
}
@@ -2141,13 +2183,22 @@ namespace OpenSim.Region.Framework.Scenes
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
{
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
}
}
/// <summary>
/// Delete every object from the scene. This does not include attachments worn by avatars.
/// </summary>
public void DeleteAllSceneObjects()
{
DeleteAllSceneObjects(false);
}
/// <summary>
/// Delete every object from the scene. This does not include attachments worn by avatars.
/// </summary>
public void DeleteAllSceneObjects(bool exceptNoCopy)
{
List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>();
lock (Entities)
{
ICollection<EntityBase> entities = new List<EntityBase>(Entities);
@@ -2157,11 +2208,24 @@ namespace OpenSim.Region.Framework.Scenes
if (e is SceneObjectGroup)
{
SceneObjectGroup sog = (SceneObjectGroup)e;
if (!sog.IsAttachment)
DeleteSceneObject((SceneObjectGroup)e, false);
if (sog != null && !sog.IsAttachment)
{
if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
{
DeleteSceneObject((SceneObjectGroup)e, false);
}
else
{
toReturn.Add((SceneObjectGroup)e);
}
}
}
}
}
if (toReturn.Count > 0)
{
returnObjects(toReturn.ToArray(), UUID.Zero);
}
}
/// <summary>
@@ -2529,6 +2593,12 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
public bool AddSceneObject(SceneObjectGroup sceneObject)
{
if (sceneObject.OwnerID == UUID.Zero)
{
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID);
return false;
}
// If the user is banned, we won't let any of their objects
// enter. Period.
//
@@ -2578,15 +2648,27 @@ namespace OpenSim.Region.Framework.Scenes
if (AttachmentsModule != null)
AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false);
m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was found, attaching", sceneObject.UUID);
}
else
{
m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was not found, setting to temp", sceneObject.UUID);
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
}
if (sceneObject.OwnerID == UUID.Zero)
{
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID);
return false;
}
}
else
{
if (sceneObject.OwnerID == UUID.Zero)
{
m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID);
return false;
}
AddRestoredSceneObject(sceneObject, true, false);
if (!Permissions.CanObjectEntry(sceneObject.UUID,
@@ -2861,6 +2943,7 @@ namespace OpenSim.Region.Framework.Scenes
client.OnFetchInventory += HandleFetchInventory;
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
client.OnCopyInventoryItem += CopyInventoryItem;
client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
client.OnMoveInventoryItem += MoveInventoryItem;
client.OnRemoveInventoryItem += RemoveInventoryItem;
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
@@ -3148,6 +3231,16 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="flags"></param>
public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
{
//Add half the avatar's height so that the user doesn't fall through prims
ScenePresence presence;
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
if (presence.Appearance != null)
{
position.Z = position.Z + (presence.Appearance.AvatarHeight / 2);
}
}
if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
// FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
@@ -3242,7 +3335,9 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
}
m_log.Debug("[Scene] Beginning ClientClosed");
m_eventManager.TriggerClientClosed(agentID, this);
m_log.Debug("[Scene] Finished ClientClosed");
}
catch (NullReferenceException)
{
@@ -3250,7 +3345,9 @@ namespace OpenSim.Region.Framework.Scenes
// Avatar is already disposed :/
}
m_log.Debug("[Scene] Beginning OnRemovePresence");
m_eventManager.TriggerOnRemovePresence(agentID);
m_log.Debug("[Scene] Finished OnRemovePresence");
ForEachClient(
delegate(IClientAPI client)
{
@@ -3266,8 +3363,11 @@ namespace OpenSim.Region.Framework.Scenes
}
// Remove the avatar from the scene
m_log.Debug("[Scene] Begin RemoveScenePresence");
m_sceneGraph.RemoveScenePresence(agentID);
m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager");
m_clientManager.Remove(agentID);
m_log.Debug("[Scene] Removed the client manager. Firing avatar.close");
try
{
@@ -3281,9 +3381,9 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
}
m_log.Debug("[Scene] Done. Firing RemoveCircuit");
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
m_log.Debug("[Scene] The avatar has left the building");
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
}
@@ -3422,6 +3522,7 @@ namespace OpenSim.Region.Framework.Scenes
{
if (land != null && !TestLandRestrictions(agent, land, out reason))
{
m_log.DebugFormat("[CONNECTION BEGIN]: Denying access to {0} due to no land access", agent.AgentID.ToString());
return false;
}
}
@@ -3535,6 +3636,8 @@ namespace OpenSim.Region.Framework.Scenes
}
}
// Honor parcel landing type and position.
/*
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
if (land != null)
{
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
@@ -3542,6 +3645,7 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos = land.LandData.UserLocation;
}
}
*/// This is now handled properly in ScenePresence.MakeRootAgent
}
return true;
@@ -3904,12 +4008,22 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public bool IncomingCloseAgent(UUID agentID)
{
return IncomingCloseAgent(agentID, false);
}
public bool IncomingCloseChildAgent(UUID agentID)
{
return IncomingCloseAgent(agentID, true);
}
/// <summary>
/// Tell a single agent to disconnect from the region.
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="agentID"></param>
public bool IncomingCloseAgent(UUID agentID)
/// <param name="childOnly"></param>
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
{
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
@@ -3921,7 +4035,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_sceneGraph.removeUserCount(false);
}
else
else if (!childOnly)
{
m_sceneGraph.removeUserCount(true);
}
@@ -3937,9 +4051,12 @@ namespace OpenSim.Region.Framework.Scenes
}
else
presence.ControllingClient.SendShutdownConnectionNotice();
presence.ControllingClient.Close(false);
}
else if (!childOnly)
{
presence.ControllingClient.Close(true);
}
presence.ControllingClient.Close();
return true;
}
@@ -5243,4 +5360,4 @@ namespace OpenSim.Region.Framework.Scenes
return offsets.ToArray();
}
}
}
}

View File

@@ -168,7 +168,7 @@ namespace OpenSim.Region.Framework.Scenes
if (neighbour != null)
{
m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
// m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
m_scene.EventManager.TriggerOnRegionUp(neighbour);
}
else
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
//m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
foreach (GridRegion n in neighbours)
{
InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
@@ -267,14 +267,14 @@ namespace OpenSim.Region.Framework.Scenes
protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle)
{
m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
//m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
// let's do our best, but there's not much we can do if the neighbour doesn't accept.
//m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID);
uint x = 0, y = 0;
Utils.LongToUInts(regionHandle, out x, out y);
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
m_scene.SimulationService.CloseAgent(destination, agentID);
m_scene.SimulationService.CloseChildAgent(destination, agentID);
}
private void SendCloseChildAgentCompleted(IAsyncResult iar)
@@ -293,7 +293,7 @@ namespace OpenSim.Region.Framework.Scenes
d);
}
}
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
{
return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);

View File

@@ -43,6 +43,12 @@ namespace OpenSim.Region.Framework.Scenes
public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone);
public delegate void AttachToBackupDelegate(SceneObjectGroup sog);
public delegate void DetachFromBackupDelegate(SceneObjectGroup sog);
public delegate void ChangedBackupDelegate(SceneObjectGroup sog);
public delegate void ObjectCreateDelegate(EntityBase obj);
public delegate void ObjectDeleteDelegate(EntityBase obj);
@@ -61,6 +67,9 @@ namespace OpenSim.Region.Framework.Scenes
private PhysicsCrash handlerPhysicsCrash = null;
public event ObjectDuplicateDelegate OnObjectDuplicate;
public event AttachToBackupDelegate OnAttachToBackup;
public event DetachFromBackupDelegate OnDetachFromBackup;
public event ChangedBackupDelegate OnChangeBackup;
public event ObjectCreateDelegate OnObjectCreate;
public event ObjectDeleteDelegate OnObjectRemove;
@@ -68,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes
#region Fields
protected object m_presenceLock = new object();
protected OpenMetaverse.ReaderWriterLockSlim m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim();
protected Dictionary<UUID, ScenePresence> m_scenePresenceMap = new Dictionary<UUID, ScenePresence>();
protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>();
@@ -128,13 +137,18 @@ namespace OpenSim.Region.Framework.Scenes
protected internal void Close()
{
lock (m_presenceLock)
m_scenePresencesLock.EnterWriteLock();
try
{
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>();
List<ScenePresence> newlist = new List<ScenePresence>();
m_scenePresenceMap = newmap;
m_scenePresenceArray = newlist;
}
finally
{
m_scenePresencesLock.ExitWriteLock();
}
lock (m_dictionary_lock)
{
@@ -214,27 +228,8 @@ namespace OpenSim.Region.Framework.Scenes
if (sp.IsChildAgent)
return;
if (sp.ParentID != 0)
{
// sitting avatar
SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
if (sop != null)
{
coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
else
{
// we can't find the parent.. ! arg!
coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
}
else
{
coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
}
@@ -264,6 +259,33 @@ namespace OpenSim.Region.Framework.Scenes
protected internal bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
{
if (!m_parentScene.CombineRegions)
{
// KF: Check for out-of-region, move inside and make static.
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
sceneObject.RootPart.GroupPosition.Y,
sceneObject.RootPart.GroupPosition.Z);
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
npos.X > Constants.RegionSize ||
npos.Y > Constants.RegionSize))
{
if (npos.X < 0.0) npos.X = 1.0f;
if (npos.Y < 0.0) npos.Y = 1.0f;
if (npos.Z < 0.0) npos.Z = 0.0f;
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
part.GroupPosition = npos;
}
sceneObject.RootPart.Velocity = Vector3.Zero;
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
sceneObject.RootPart.Acceleration = Vector3.Zero;
sceneObject.RootPart.Velocity = Vector3.Zero;
}
}
if (!alreadyPersisted)
{
sceneObject.ForceInventoryPersistence();
@@ -354,10 +376,14 @@ namespace OpenSim.Region.Framework.Scenes
m_numPrim += sceneObject.Children.Count;
if (attachToBackup)
{
sceneObject.AttachToBackup();
}
if (OnObjectCreate != null)
{
OnObjectCreate(sceneObject);
}
lock (m_dictionary_lock)
{
@@ -424,6 +450,30 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void FireAttachToBackup(SceneObjectGroup obj)
{
if (OnAttachToBackup != null)
{
OnAttachToBackup(obj);
}
}
public void FireDetachFromBackup(SceneObjectGroup obj)
{
if (OnDetachFromBackup != null)
{
OnDetachFromBackup(obj);
}
}
public void FireChangeBackup(SceneObjectGroup obj)
{
if (OnChangeBackup != null)
{
OnChangeBackup(obj);
}
}
/// <summary>
/// Process all pending updates
/// </summary>
@@ -560,7 +610,8 @@ namespace OpenSim.Region.Framework.Scenes
Entities[presence.UUID] = presence;
lock (m_presenceLock)
m_scenePresencesLock.EnterWriteLock();
try
{
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
@@ -584,6 +635,10 @@ namespace OpenSim.Region.Framework.Scenes
m_scenePresenceMap = newmap;
m_scenePresenceArray = newlist;
}
finally
{
m_scenePresencesLock.ExitWriteLock();
}
}
/// <summary>
@@ -598,7 +653,8 @@ namespace OpenSim.Region.Framework.Scenes
agentID);
}
lock (m_presenceLock)
m_scenePresencesLock.EnterWriteLock();
try
{
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
@@ -620,6 +676,10 @@ namespace OpenSim.Region.Framework.Scenes
m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
}
}
finally
{
m_scenePresencesLock.ExitWriteLock();
}
}
protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F)
@@ -1497,10 +1557,13 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="childPrims"></param>
protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
{
SceneObjectGroup parentGroup = root.ParentGroup;
if (parentGroup == null) return;
Monitor.Enter(m_updateLock);
try
{
SceneObjectGroup parentGroup = root.ParentGroup;
parentGroup.areUpdatesSuspended = true;
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
if (parentGroup != null)
@@ -1539,12 +1602,12 @@ namespace OpenSim.Region.Framework.Scenes
// occur on link to invoke this elsewhere (such as object selection)
parentGroup.RootPart.CreateSelected = true;
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
parentGroup.HasGroupChanged = true;
parentGroup.ScheduleGroupForFullUpdate();
}
finally
{
parentGroup.areUpdatesSuspended = false;
parentGroup.HasGroupChanged = true;
parentGroup.ScheduleGroupForFullUpdate();
Monitor.Exit(m_updateLock);
}
}
@@ -1581,11 +1644,22 @@ namespace OpenSim.Region.Framework.Scenes
}
}
foreach (SceneObjectPart child in childParts)
if (childParts.Count > 0)
{
// Unlink all child parts from their groups
//
child.ParentGroup.DelinkFromGroup(child, true);
try
{
childParts[0].ParentGroup.areUpdatesSuspended = true;
foreach (SceneObjectPart child in childParts)
{
// Unlink all child parts from their groups
//
child.ParentGroup.DelinkFromGroup(child, true);
}
}
finally
{
childParts[0].ParentGroup.areUpdatesSuspended = false;
}
}
foreach (SceneObjectPart root in rootParts)
@@ -1609,10 +1683,21 @@ namespace OpenSim.Region.Framework.Scenes
if (numChildren > 1)
sendEventsToRemainder = false;
foreach (SceneObjectPart p in newSet)
if (newSet.Count > 0)
{
if (p != group.RootPart)
group.DelinkFromGroup(p, sendEventsToRemainder);
try
{
newSet[0].ParentGroup.areUpdatesSuspended = true;
foreach (SceneObjectPart p in newSet)
{
if (p != group.RootPart)
group.DelinkFromGroup(p, sendEventsToRemainder);
}
}
finally
{
newSet[0].ParentGroup.areUpdatesSuspended = false;
}
}
// If there is more than one prim remaining, we

View File

@@ -46,12 +46,12 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void ForceInventoryPersistence()
{
lock (m_parts)
lockPartsForRead(true);
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
lockPartsForRead(false);
foreach (SceneObjectPart part in values)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.Inventory.ForceInventoryPersistence();
}
part.Inventory.ForceInventoryPersistence();
}
}
@@ -74,19 +74,17 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Stop the scripts contained in all the prims in this group
/// </summary>
/// <param name="sceneObjectBeingDeleted">
/// Should be true if these scripts are being removed because the scene
/// object is being deleted. This will prevent spurious updates to the client.
/// </param>
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
{
lock (m_parts)
lockPartsForRead(true);
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
lockPartsForRead(false);
foreach (SceneObjectPart part in values)
{
foreach (SceneObjectPart part in m_parts.Values)
{
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
}
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
}
}
/// <summary>

File diff suppressed because it is too large Load Diff

View File

@@ -60,7 +60,8 @@ namespace OpenSim.Region.Framework.Scenes
TELEPORT = 512,
REGION_RESTART = 1024,
MEDIA = 2048,
ANIMATION = 16384
ANIMATION = 16384,
POSITION = 32768
}
// I don't really know where to put this except here.
@@ -149,8 +150,8 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: This needs to be persisted in next XML version update!
[XmlIgnore]
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
public int[] PayPrice = {-2,-2,-2,-2,-2};
[XmlIgnore]
public PhysicsActor PhysActor
{
@@ -193,6 +194,14 @@ namespace OpenSim.Region.Framework.Scenes
[XmlIgnore]
public UUID FromFolderID;
// The following two are to hold the attachment data
// while an object is inworld
[XmlIgnore]
public byte AttachPoint = 0;
[XmlIgnore]
public Vector3 AttachOffset = Vector3.Zero;
[XmlIgnore]
public int STATUS_ROTATE_X;
@@ -288,6 +297,7 @@ namespace OpenSim.Region.Framework.Scenes
private Quaternion m_sitTargetOrientation = Quaternion.Identity;
private Vector3 m_sitTargetPosition;
private string m_sitAnimation = "SIT";
private bool m_occupied; // KF if any av is sitting on this prim
private string m_text = String.Empty;
private string m_touchName = String.Empty;
private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
@@ -377,7 +387,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
Quaternion rotationOffset, Vector3 offsetPosition)
{
m_name = "Primitive";
m_name = "Object";
Rezzed = DateTime.UtcNow;
_creationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
@@ -473,12 +483,16 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <value>
/// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
/// Get the inventory list
/// </value>
public TaskInventoryDictionary TaskInventory
{
get { return m_inventory.Items; }
set { m_inventory.Items = value; }
get {
return m_inventory.Items;
}
set {
m_inventory.Items = value;
}
}
/// <summary>
@@ -611,14 +625,12 @@ namespace OpenSim.Region.Framework.Scenes
set { m_LoopSoundSlavePrims = value; }
}
[XmlIgnore]
public Byte[] TextureAnimation
{
get { return m_TextureAnimation; }
set { m_TextureAnimation = value; }
}
[XmlIgnore]
public Byte[] ParticleSystem
{
get { return m_particleSystem; }
@@ -672,7 +684,6 @@ namespace OpenSim.Region.Framework.Scenes
set
{
m_groupPosition = value;
PhysicsActor actor = PhysActor;
if (actor != null)
{
@@ -692,25 +703,13 @@ namespace OpenSim.Region.Framework.Scenes
// Tell the physics engines that this prim changed.
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
}
catch (Exception e)
{
m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message);
}
}
// TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too
if (m_sitTargetAvatar != UUID.Zero)
{
if (m_parentGroup != null) // TODO can there be a SOP without a SOG?
{
ScenePresence avatar;
if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar))
{
avatar.ParentPosition = GetWorldPosition();
}
}
}
}
}
@@ -719,7 +718,8 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_offsetPosition; }
set
{
StoreUndoState();
Vector3 oldpos = m_offsetPosition;
StoreUndoState(UndoType.STATE_PRIM_POSITION);
m_offsetPosition = value;
if (ParentGroup != null && !ParentGroup.IsDeleted)
@@ -733,7 +733,22 @@ namespace OpenSim.Region.Framework.Scenes
// Tell the physics engines that this prim changed.
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
}
if (!m_parentGroup.m_dupeInProgress)
{
List<ScenePresence> avs = ParentGroup.GetLinkedAvatars();
foreach (ScenePresence av in avs)
{
if (av.LinkedPrim == m_uuid)
{
Vector3 offset = (m_offsetPosition - oldpos);
av.OffsetPosition += offset;
av.SendFullUpdateToAllClients();
}
}
}
}
TriggerScriptChangedEvent(Changed.POSITION);
}
}
@@ -775,7 +790,7 @@ namespace OpenSim.Region.Framework.Scenes
set
{
StoreUndoState();
StoreUndoState(UndoType.STATE_PRIM_ROTATION);
m_rotationOffset = value;
PhysicsActor actor = PhysActor;
@@ -859,7 +874,16 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary></summary>
public Vector3 Acceleration
{
get { return m_acceleration; }
get
{
PhysicsActor actor = PhysActor;
if (actor != null)
{
m_acceleration = actor.Acceleration;
}
return m_acceleration;
}
set { m_acceleration = value; }
}
@@ -964,7 +988,7 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_shape.Scale; }
set
{
StoreUndoState();
StoreUndoState(UndoType.STATE_PRIM_SCALE);
if (m_shape != null)
{
m_shape.Scale = value;
@@ -1034,7 +1058,8 @@ namespace OpenSim.Region.Framework.Scenes
if (IsAttachment)
return GroupPosition;
return m_offsetPosition + m_groupPosition; }
// return m_offsetPosition + m_groupPosition; }
return m_groupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset) ; } //KF: Rotation was ignored!
}
public SceneObjectGroup ParentGroup
@@ -1193,6 +1218,13 @@ namespace OpenSim.Region.Framework.Scenes
_flags = value;
}
}
[XmlIgnore]
public bool IsOccupied // KF If an av is sittingon this prim
{
get { return m_occupied; }
set { m_occupied = value; }
}
[XmlIgnore]
public UUID SitTargetAvatar
@@ -1268,14 +1300,6 @@ namespace OpenSim.Region.Framework.Scenes
}
}
/// <summary>
/// Clear all pending updates of parts to clients
/// </summary>
private void ClearUpdateSchedule()
{
m_updateFlag = 0;
}
private void SendObjectPropertiesToClient(UUID AgentID)
{
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
@@ -1526,14 +1550,21 @@ namespace OpenSim.Region.Framework.Scenes
// or flexible
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
{
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
Name,
Shape,
AbsolutePosition,
Scale,
RotationOffset,
RigidBody);
try
{
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
Name,
Shape,
AbsolutePosition,
Scale,
RotationOffset,
RigidBody);
}
catch
{
m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid);
PhysActor = null;
}
// Basic Physics returns null.. joy joy joy.
if (PhysActor != null)
{
@@ -1561,7 +1592,7 @@ namespace OpenSim.Region.Framework.Scenes
{
m_redo.Clear();
}
StoreUndoState();
StoreUndoState(UndoType.STATE_ALL);
}
public byte ConvertScriptUintToByte(uint indata)
@@ -1673,7 +1704,7 @@ namespace OpenSim.Region.Framework.Scenes
PrimitiveBaseShape shape = PrimitiveBaseShape.Create();
part.Shape = shape;
part.Name = "Primitive";
part.Name = "Object";
part._ownerID = UUID.Random();
return part;
@@ -2033,12 +2064,17 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 GetWorldPosition()
{
Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
Vector3 axPos = OffsetPosition;
axPos *= parentRot;
Vector3 translationOffsetPosition = axPos;
return GroupPosition + translationOffsetPosition;
if(_parentID == 0)
{
return GroupPosition;
}
else
{
return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position
}
}
/// <summary>
@@ -2049,7 +2085,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Quaternion newRot;
if (this.LinkNum == 0)
if (this.LinkNum < 2) //KF Single or root prim
{
newRot = RotationOffset;
}
@@ -2695,17 +2731,18 @@ namespace OpenSim.Region.Framework.Scenes
//Trys to fetch sound id from prim's inventory.
//Prim's inventory doesn't support non script items yet
lock (TaskInventory)
TaskInventory.LockItemsForRead(true);
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
if (item.Value.Name == sound)
{
if (item.Value.Name == sound)
{
soundID = item.Value.ItemID;
break;
}
soundID = item.Value.ItemID;
break;
}
}
TaskInventory.LockItemsForRead(false);
}
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
@@ -2765,7 +2802,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="scale"></param>
public void Resize(Vector3 scale)
{
StoreUndoState();
StoreUndoState(UndoType.STATE_PRIM_SCALE);
m_shape.Scale = scale;
ParentGroup.HasGroupChanged = true;
@@ -2774,38 +2811,7 @@ namespace OpenSim.Region.Framework.Scenes
public void RotLookAt(Quaternion target, float strength, float damping)
{
rotLookAt(target, strength, damping);
}
public void rotLookAt(Quaternion target, float strength, float damping)
{
if (IsAttachment)
{
/*
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
if (avatar != null)
{
Rotate the Av?
} */
}
else
{
APIDDamp = damping;
APIDStrength = strength;
APIDTarget = target;
}
}
public void startLookAt(Quaternion rot, float damp, float strength)
{
APIDDamp = damp;
APIDStrength = strength;
APIDTarget = rot;
}
public void stopLookAt()
{
APIDTarget = Quaternion.Identity;
m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup.
}
/// <summary>
@@ -2817,7 +2823,10 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup != null)
{
m_parentGroup.QueueForUpdateCheck();
if (!m_parentGroup.areUpdatesSuspended)
{
m_parentGroup.QueueForUpdateCheck();
}
}
int timeNow = Util.UnixTimeSinceEpoch();
@@ -3034,8 +3043,8 @@ namespace OpenSim.Region.Framework.Scenes
{
const float ROTATION_TOLERANCE = 0.01f;
const float VELOCITY_TOLERANCE = 0.001f;
const float POSITION_TOLERANCE = 0.05f;
const int TIME_MS_TOLERANCE = 3000;
const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
if (m_updateFlag == 1)
{
@@ -3049,7 +3058,7 @@ namespace OpenSim.Region.Framework.Scenes
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
{
AddTerseUpdateToAllAvatars();
ClearUpdateSchedule();
// This causes the Scene to 'poll' physical objects every couple of frames
// bad, so it's been replaced by an event driven method.
@@ -3067,16 +3076,18 @@ namespace OpenSim.Region.Framework.Scenes
m_lastAngularVelocity = AngularVelocity;
m_lastTerseSent = Environment.TickCount;
}
//Moved this outside of the if clause so updates don't get blocked.. *sigh*
m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
}
else
{
if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
{
AddFullUpdateToAllAvatars();
ClearUpdateSchedule();
m_updateFlag = 0; //Same here
}
}
ClearUpdateSchedule();
m_updateFlag = 0;
}
/// <summary>
@@ -3096,6 +3107,15 @@ namespace OpenSim.Region.Framework.Scenes
UUID ownerID = _ownerID;
UUID objectID = UUID;
UUID parentID = GetRootPartUUID();
if (ParentGroup.IsAttachment && ParentGroup.RootPart.Shape.State > 30)
{
// Use the avatar as the parent for HUDs, since the prims
// are not sent to other avatars
objectID = _ownerID;
parentID = _ownerID;
}
UUID soundID = UUID.Zero;
Vector3 position = AbsolutePosition; // region local
ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
@@ -3103,17 +3123,16 @@ namespace OpenSim.Region.Framework.Scenes
if (!UUID.TryParse(sound, out soundID))
{
// search sound file from inventory
lock (TaskInventory)
TaskInventory.LockItemsForRead(true);
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
{
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
{
soundID = item.Value.ItemID;
break;
}
soundID = item.Value.ItemID;
break;
}
}
TaskInventory.LockItemsForRead(false);
}
if (soundID == UUID.Zero)
@@ -3313,7 +3332,7 @@ namespace OpenSim.Region.Framework.Scenes
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
tex.FaceTextures[face].RGBA = texcolor;
UpdateTexture(tex);
TriggerScriptChangedEvent(Changed.COLOR);
TriggerScriptChangedEvent(Changed.COLOR);
return;
}
else if (face == ALL_SIDES)
@@ -3335,7 +3354,7 @@ namespace OpenSim.Region.Framework.Scenes
tex.DefaultTexture.RGBA = texcolor;
}
UpdateTexture(tex);
TriggerScriptChangedEvent(Changed.COLOR);
TriggerScriptChangedEvent(Changed.COLOR);
return;
}
}
@@ -3550,7 +3569,7 @@ namespace OpenSim.Region.Framework.Scenes
public void StopLookAt()
{
m_parentGroup.stopLookAt();
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
m_parentGroup.ScheduleGroupForTerseUpdate();
}
@@ -3577,10 +3596,9 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.ScheduleGroupForTerseUpdate();
//m_parentGroup.ScheduleGroupForFullUpdate();
}
public void StoreUndoState()
public void StoreUndoState(UndoType type)
{
if (!Undoing)
if (!Undoing && (m_parentGroup == null || m_parentGroup.RootPart == null || !m_parentGroup.RootPart.Undoing))
{
if (!IgnoreUndoUpdate)
{
@@ -3591,17 +3609,25 @@ namespace OpenSim.Region.Framework.Scenes
if (m_undo.Count > 0)
{
UndoState last = m_undo.Peek();
if (last != null)
{
if (last.Compare(this))
return;
}
}
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this);
UndoState lastUndo = m_undo.Peek();
UndoState nUndo = new UndoState(this, type);
if (lastUndo != null)
{
TimeSpan ts = DateTime.Now.Subtract(lastUndo.LastUpdated);
if (ts.TotalMilliseconds < 500)
{
//Delete the last entry since it was less than 500 milliseconds ago
nUndo.Merge(lastUndo);
m_undo.Pop();
}
}
m_undo.Push(nUndo);
}
@@ -4078,11 +4104,13 @@ namespace OpenSim.Region.Framework.Scenes
if (m_undo.Count > 0)
{
UndoState nUndo = null;
UndoState goback = m_undo.Pop();
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
nUndo = new UndoState(this);
nUndo = new UndoState(this, goback.Type);
}
UndoState goback = m_undo.Pop();
if (goback != null)
{
goback.PlaybackState(this);
@@ -4097,13 +4125,13 @@ namespace OpenSim.Region.Framework.Scenes
{
lock (m_redo)
{
UndoState gofwd = m_redo.Pop();
if (m_parentGroup.GetSceneMaxUndo() > 0)
{
UndoState nUndo = new UndoState(this);
UndoState nUndo = new UndoState(this, gofwd.Type);
m_undo.Push(nUndo);
}
UndoState gofwd = m_redo.Pop();
if (gofwd != null)
gofwd.PlayfwdState(this);
}
@@ -4551,8 +4579,9 @@ namespace OpenSim.Region.Framework.Scenes
{
m_shape.TextureEntry = textureEntry;
TriggerScriptChangedEvent(Changed.TEXTURE);
m_updateFlag = 1;
ParentGroup.HasGroupChanged = true;
//This is madness..
//ParentGroup.ScheduleGroupForFullUpdate();
//This is sparta
@@ -4797,5 +4826,17 @@ namespace OpenSim.Region.Framework.Scenes
Color color = Color;
return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A));
}
public void ResetOwnerChangeFlag()
{
List<UUID> inv = Inventory.GetInventoryList();
foreach (UUID itemID in inv)
{
TaskInventoryItem item = Inventory.GetInventoryItem(itemID);
item.OwnerChanged = false;
Inventory.UpdateInventoryItem(item);
}
}
}
}

View File

@@ -46,6 +46,8 @@ namespace OpenSim.Region.Framework.Scenes
private string m_inventoryFileName = String.Empty;
private int m_inventoryFileNameSerial = 0;
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
/// <value>
/// The part to which the inventory belongs.
@@ -82,7 +84,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </value>
protected internal TaskInventoryDictionary Items
{
get { return m_items; }
get {
return m_items;
}
set
{
m_items = value;
@@ -118,22 +122,25 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="linkNum">Link number for the part</param>
public void ResetInventoryIDs()
{
lock (m_items)
m_items.LockItemsForWrite(true);
if (0 == Items.Count)
{
if (0 == m_items.Count)
return;
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = GetInventoryItems();
m_items.Clear();
foreach (TaskInventoryItem item in items)
{
item.ResetIDs(m_part.UUID);
m_items.Add(item.ItemID, item);
}
m_items.LockItemsForWrite(false);
return;
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
Items.Clear();
foreach (TaskInventoryItem item in items)
{
item.ResetIDs(m_part.UUID);
Items.Add(item.ItemID, item);
}
m_items.LockItemsForWrite(false);
}
/// <summary>
@@ -142,12 +149,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="ownerId"></param>
public void ChangeInventoryOwner(UUID ownerId)
{
lock (Items)
m_items.LockItemsForWrite(true);
if (0 == Items.Count)
{
if (0 == Items.Count)
{
return;
}
m_items.LockItemsForWrite(false);
return;
}
HasInventoryChanged = true;
@@ -161,6 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
item.OwnerID = ownerId;
}
}
m_items.LockItemsForWrite(false);
}
/// <summary>
@@ -169,22 +176,24 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="groupID"></param>
public void ChangeInventoryGroup(UUID groupID)
{
lock (Items)
m_items.LockItemsForWrite(true);
if (0 == Items.Count)
{
if (0 == Items.Count)
{
return;
}
m_items.LockItemsForWrite(false);
return;
}
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
List<TaskInventoryItem> items = GetInventoryItems();
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
foreach (TaskInventoryItem item in items)
{
if (groupID != item.GroupID)
{
item.GroupID = groupID;
}
}
m_items.LockItemsForWrite(false);
}
/// <summary>
@@ -192,9 +201,14 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
{
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
Items.LockItemsForRead(true);
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
Items.LockItemsForRead(false);
foreach (TaskInventoryItem item in items)
{
if ((int)InventoryType.LSL == item.InvType)
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
}
}
public ArrayList GetScriptErrors(UUID itemID)
@@ -227,9 +241,18 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
{
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
Items.LockItemsForRead(true);
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
Items.LockItemsForRead(false);
foreach (TaskInventoryItem item in items)
{
if ((int)InventoryType.LSL == item.InvType)
{
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
m_part.RemoveScriptEvents(item.ItemID);
}
}
}
/// <summary>
@@ -245,7 +268,10 @@ namespace OpenSim.Region.Framework.Scenes
// item.Name, item.ItemID, Name, UUID);
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
{
StoreScriptError(item.ItemID, "no permission");
return;
}
m_part.AddFlag(PrimFlags.Scripted);
@@ -254,14 +280,13 @@ namespace OpenSim.Region.Framework.Scenes
if (stateSource == 1 && // Prim crossing
m_part.ParentGroup.Scene.m_trustBinaries)
{
lock (m_items)
{
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
}
m_items.LockItemsForWrite(true);
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
m_items.LockItemsForWrite(false);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
StoreScriptErrors(item.ItemID, null);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
return;
@@ -270,6 +295,8 @@ namespace OpenSim.Region.Framework.Scenes
AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
if (null == asset)
{
string msg = String.Format("asset ID {0} could not be found", item.AssetID);
StoreScriptError(item.ItemID, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
@@ -281,15 +308,17 @@ namespace OpenSim.Region.Framework.Scenes
if (m_part.ParentGroup.m_savedScriptState != null)
RestoreSavedScriptState(item.OldItemID, item.ItemID);
lock (m_items)
{
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
}
m_items.LockItemsForWrite(true);
m_items[item.ItemID].PermsMask = 0;
m_items[item.ItemID].PermsGranter = UUID.Zero;
m_items.LockItemsForWrite(false);
string script = Utils.BytesToString(asset.Data);
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
StoreScriptErrors(item.ItemID, null);
m_part.ParentGroup.AddActiveScriptCount(1);
m_part.ScheduleFullUpdate();
}
@@ -353,21 +382,145 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Start a script which is in this prim's inventory.
/// Some processing may occur in the background, but this routine returns asap.
/// </summary>
/// <param name="itemId">
/// A <see cref="UUID"/>
/// </param>
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
TaskInventoryItem item = GetInventoryItem(itemId);
if (item != null)
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
lock (m_scriptErrors)
{
// Indicate to CreateScriptInstanceInternal() we don't want it to wait for completion
m_scriptErrors.Remove(itemId);
}
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
}
private void CreateScriptInstanceInternal(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemId))
{
if (m_items.ContainsKey(itemId))
{
m_items.LockItemsForRead(false);
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
}
else
{
m_items.LockItemsForRead(false);
string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
StoreScriptError(itemId, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it {1}", itemId, msg);
}
}
else
{
m_items.LockItemsForRead(false);
string msg = String.Format("couldn't be found for prim {0}, {1}", m_part.Name, m_part.UUID);
StoreScriptError(itemId, msg);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
itemId, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
"Couldn't start script with ID {0} since it {1}", itemId, msg);
}
}
/// <summary>
/// Start a script which is in this prim's inventory and return any compilation error messages.
/// </summary>
/// <param name="itemId">
/// A <see cref="UUID"/>
/// </param>
public ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
{
ArrayList errors;
// Indicate to CreateScriptInstanceInternal() we want it to
// post any compilation/loading error messages
lock (m_scriptErrors)
{
m_scriptErrors[itemId] = null;
}
// Perform compilation/loading
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
// Wait for and retrieve any errors
lock (m_scriptErrors)
{
while ((errors = m_scriptErrors[itemId]) == null)
{
if (!System.Threading.Monitor.Wait(m_scriptErrors, 15000))
{
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"timedout waiting for script {0} errors", itemId);
errors = m_scriptErrors[itemId];
if (errors == null)
{
errors = new ArrayList(1);
errors.Add("timedout waiting for errors");
}
break;
}
}
m_scriptErrors.Remove(itemId);
}
return errors;
}
// Signal to CreateScriptInstanceEr() that compilation/loading is complete
private void StoreScriptErrors(UUID itemId, ArrayList errors)
{
lock (m_scriptErrors)
{
// If compilation/loading initiated via CreateScriptInstance(),
// it does not want the errors, so just get out
if (!m_scriptErrors.ContainsKey(itemId))
{
return;
}
// Initiated via CreateScriptInstanceEr(), if we know what the
// errors are, save them and wake CreateScriptInstanceEr().
if (errors != null)
{
m_scriptErrors[itemId] = errors;
System.Threading.Monitor.PulseAll(m_scriptErrors);
return;
}
}
// Initiated via CreateScriptInstanceEr() but we don't know what
// the errors are yet, so retrieve them from the script engine.
// This may involve some waiting internal to GetScriptErrors().
errors = GetScriptErrors(itemId);
// Get a default non-null value to indicate success.
if (errors == null)
{
errors = new ArrayList();
}
// Post to CreateScriptInstanceEr() and wake it up
lock (m_scriptErrors)
{
m_scriptErrors[itemId] = errors;
System.Threading.Monitor.PulseAll(m_scriptErrors);
}
}
// Like StoreScriptErrors(), but just posts a single string message
private void StoreScriptError(UUID itemId, string message)
{
ArrayList errors = new ArrayList(1);
errors.Add(message);
StoreScriptErrors(itemId, errors);
}
/// <summary>
@@ -380,15 +533,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </param>
public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted)
{
bool scriptPresent = false;
lock (m_items)
{
if (m_items.ContainsKey(itemId))
scriptPresent = true;
}
if (scriptPresent)
if (m_items.ContainsKey(itemId))
{
if (!sceneObjectBeingDeleted)
m_part.RemoveScriptEvents(itemId);
@@ -413,14 +558,16 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns></returns>
private bool InventoryContainsName(string name)
{
lock (m_items)
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
if (item.Name == name)
{
if (item.Name == name)
return true;
m_items.LockItemsForRead(false);
return true;
}
}
m_items.LockItemsForRead(false);
return false;
}
@@ -462,8 +609,9 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="item"></param>
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
{
List<TaskInventoryItem> il = GetInventoryItems();
m_items.LockItemsForRead(true);
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_items.Values);
m_items.LockItemsForRead(false);
foreach (TaskInventoryItem i in il)
{
if (i.Name == item.Name)
@@ -501,14 +649,14 @@ namespace OpenSim.Region.Framework.Scenes
item.Name = name;
item.GroupID = m_part.GroupID;
lock (m_items)
m_items.Add(item.ItemID, item);
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
m_items.LockItemsForWrite(true);
m_items.Add(item.ItemID, item);
m_items.LockItemsForWrite(false);
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
m_inventorySerial++;
//m_inventorySerial += 2;
HasInventoryChanged = true;
@@ -524,15 +672,15 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="items"></param>
public void RestoreInventoryItems(ICollection<TaskInventoryItem> items)
{
lock (m_items)
m_items.LockItemsForWrite(true);
foreach (TaskInventoryItem item in items)
{
foreach (TaskInventoryItem item in items)
{
m_items.Add(item.ItemID, item);
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_inventorySerial++;
m_items.Add(item.ItemID, item);
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
}
m_items.LockItemsForWrite(false);
m_inventorySerial++;
}
/// <summary>
@@ -543,10 +691,9 @@ namespace OpenSim.Region.Framework.Scenes
public TaskInventoryItem GetInventoryItem(UUID itemId)
{
TaskInventoryItem item;
lock (m_items)
m_items.TryGetValue(itemId, out item);
m_items.LockItemsForRead(true);
m_items.TryGetValue(itemId, out item);
m_items.LockItemsForRead(false);
return item;
}
@@ -562,15 +709,16 @@ namespace OpenSim.Region.Framework.Scenes
{
IList<TaskInventoryItem> items = new List<TaskInventoryItem>();
lock (m_items)
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Name == name)
items.Add(item);
}
if (item.Name == name)
items.Add(item);
}
m_items.LockItemsForRead(false);
return items;
}
@@ -587,8 +735,9 @@ namespace OpenSim.Region.Framework.Scenes
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
{
TaskInventoryItem it = GetInventoryItem(item.ItemID);
if (it != null)
m_items.LockItemsForWrite(true);
if (m_items.ContainsKey(item.ItemID))
{
item.ParentID = m_part.UUID;
item.ParentPartID = m_part.UUID;
@@ -600,19 +749,15 @@ namespace OpenSim.Region.Framework.Scenes
item.GroupID = m_part.GroupID;
if (item.AssetID == UUID.Zero)
item.AssetID = it.AssetID;
lock (m_items)
{
m_items[item.ItemID] = item;
m_inventorySerial++;
}
item.AssetID = m_items[item.ItemID].AssetID;
m_items[item.ItemID] = item;
m_inventorySerial++;
if (fireScriptEvents)
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
m_items.LockItemsForWrite(false);
return true;
}
else
@@ -623,8 +768,9 @@ namespace OpenSim.Region.Framework.Scenes
item.ItemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
}
return false;
m_items.LockItemsForWrite(false);
return false;
}
/// <summary>
@@ -635,37 +781,53 @@ namespace OpenSim.Region.Framework.Scenes
/// in this prim's inventory.</returns>
public int RemoveInventoryItem(UUID itemID)
{
TaskInventoryItem item = GetInventoryItem(itemID);
if (item != null)
m_items.LockItemsForRead(true);
if (m_items.ContainsKey(itemID))
{
int type = m_items[itemID].InvType;
m_items.LockItemsForRead(false);
if (type == 10) // Script
{
m_part.RemoveScriptEvents(itemID);
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
}
m_items.LockItemsForWrite(true);
m_items.Remove(itemID);
m_items.LockItemsForWrite(false);
m_inventorySerial++;
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
if (!ContainsScripts())
int scriptcount = 0;
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Type == 10)
{
scriptcount++;
}
}
m_items.LockItemsForRead(false);
if (scriptcount <= 0)
{
m_part.RemFlag(PrimFlags.Scripted);
}
m_part.ScheduleFullUpdate();
return type;
}
else
{
m_items.LockItemsForRead(false);
m_log.ErrorFormat(
"[PRIM INVENTORY]: " +
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
itemID, m_part.Name, m_part.UUID,
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
itemID, m_part.Name, m_part.UUID);
}
return -1;
@@ -719,8 +881,9 @@ namespace OpenSim.Region.Framework.Scenes
// isn't available (such as drag from prim inventory to agent inventory)
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
List<TaskInventoryItem> items = GetInventoryItems();
foreach (TaskInventoryItem item in items)
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
UUID ownerID = item.OwnerID;
uint everyoneMask = 0;
@@ -764,6 +927,8 @@ namespace OpenSim.Region.Framework.Scenes
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
invString.AddSectionEnd();
}
int count = m_items.Count;
m_items.LockItemsForRead(false);
fileData = Utils.StringToBytes(invString.BuildString);
@@ -784,10 +949,11 @@ namespace OpenSim.Region.Framework.Scenes
{
if (HasInventoryChanged)
{
HasInventoryChanged = false;
List<TaskInventoryItem> items = GetInventoryItems();
datastore.StorePrimInventory(m_part.UUID, items);
Items.LockItemsForRead(true);
datastore.StorePrimInventory(m_part.UUID, Items.Values);
Items.LockItemsForRead(false);
HasInventoryChanged = false;
}
}
@@ -854,89 +1020,75 @@ namespace OpenSim.Region.Framework.Scenes
{
uint mask=0x7fffffff;
lock (m_items)
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType != (int)InventoryType.Object)
{
if (item.InvType != (int)InventoryType.Object)
{
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
else
{
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify;
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
else
{
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
mask &= ~((uint)PermissionMask.Copy >> 13);
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
mask &= ~((uint)PermissionMask.Transfer >> 13);
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
mask &= ~((uint)PermissionMask.Modify >> 13);
}
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
mask &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
mask &= ~(uint)PermissionMask.Transfer;
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
mask &= ~(uint)PermissionMask.Modify;
}
return mask;
}
public void ApplyNextOwnerPermissions()
{
lock (m_items)
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
{
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
{
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
}
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
item.OwnerChanged = true;
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
}
item.OwnerChanged = true;
item.CurrentPermissions &= item.NextPermissions;
item.BasePermissions &= item.NextPermissions;
item.EveryonePermissions &= item.NextPermissions;
}
}
public void ApplyGodPermissions(uint perms)
{
lock (m_items)
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
{
item.CurrentPermissions = perms;
item.BasePermissions = perms;
}
item.CurrentPermissions = perms;
item.BasePermissions = perms;
}
}
public bool ContainsScripts()
{
lock (m_items)
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (TaskInventoryItem item in m_items.Values)
if (item.InvType == (int)InventoryType.LSL)
{
if (item.InvType == (int)InventoryType.LSL)
{
return true;
}
return true;
}
}
return false;
}
@@ -944,11 +1096,8 @@ namespace OpenSim.Region.Framework.Scenes
{
List<UUID> ret = new List<UUID>();
lock (m_items)
{
foreach (TaskInventoryItem item in m_items.Values)
ret.Add(item.ItemID);
}
foreach (TaskInventoryItem item in m_items.Values)
ret.Add(item.ItemID);
return ret;
}
@@ -978,6 +1127,11 @@ namespace OpenSim.Region.Framework.Scenes
}
public Dictionary<UUID, string> GetScriptStates()
{
return GetScriptStates(false);
}
public Dictionary<UUID, string> GetScriptStates(bool oldIDs)
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
@@ -985,25 +1139,33 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null) // No engine at all
return ret;
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (IScriptModule e in engines)
if (item.InvType == (int)InventoryType.LSL)
{
if (e != null)
foreach (IScriptModule e in engines)
{
string n = e.GetXMLState(item.ItemID);
if (n != String.Empty)
if (e != null)
{
if (!ret.ContainsKey(item.ItemID))
ret[item.ItemID] = n;
break;
string n = e.GetXMLState(item.ItemID);
if (n != String.Empty)
{
if (oldIDs)
{
if (!ret.ContainsKey(item.OldItemID))
ret[item.OldItemID] = n;
}
else
{
if (!ret.ContainsKey(item.ItemID))
ret[item.ItemID] = n;
}
break;
}
}
}
}
}
return ret;
}
@@ -1013,21 +1175,27 @@ namespace OpenSim.Region.Framework.Scenes
if (engines == null)
return;
List<TaskInventoryItem> scripts = GetInventoryScripts();
foreach (TaskInventoryItem item in scripts)
Items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
foreach (IScriptModule engine in engines)
if (item.InvType == (int)InventoryType.LSL)
{
if (engine != null)
foreach (IScriptModule engine in engines)
{
if (item.OwnerChanged)
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
item.OwnerChanged = false;
engine.ResumeScript(item.ItemID);
if (engine != null)
{
if (item.OwnerChanged)
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
item.OwnerChanged = false;
engine.ResumeScript(item.ItemID);
}
}
}
}
Items.LockItemsForRead(false);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
sceneObject.AddPart(part);
part.LinkNum = linkNum;
part.TrimPermissions();
part.StoreUndoState();
part.StoreUndoState(UndoType.STATE_ALL);
reader.Close();
sr.Close();
}
@@ -231,7 +231,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
if (originalLinkNum != 0)
part.LinkNum = originalLinkNum;
part.StoreUndoState();
part.StoreUndoState(UndoType.STATE_ALL);
reader.Close();
sr.Close();
}

View File

@@ -27,48 +27,125 @@
using OpenMetaverse;
using OpenSim.Region.Framework.Interfaces;
using System;
namespace OpenSim.Region.Framework.Scenes
{
[Flags]
public enum UndoType
{
STATE_PRIM_POSITION = 1,
STATE_PRIM_ROTATION = 2,
STATE_PRIM_SCALE = 4,
STATE_PRIM_ALL = 7,
STATE_GROUP_POSITION = 8,
STATE_GROUP_ROTATION = 16,
STATE_GROUP_SCALE = 32,
STATE_GROUP_ALL = 56,
STATE_ALL = 63
}
public class UndoState
{
public Vector3 Position = Vector3.Zero;
public Vector3 Scale = Vector3.Zero;
public Quaternion Rotation = Quaternion.Identity;
public Vector3 GroupPosition = Vector3.Zero;
public Quaternion GroupRotation = Quaternion.Identity;
public Vector3 GroupScale = Vector3.Zero;
public DateTime LastUpdated = DateTime.Now;
public UndoType Type;
public UndoState(SceneObjectPart part)
public UndoState(SceneObjectPart part, UndoType type)
{
Type = type;
if (part != null)
{
if (part.ParentID == 0)
{
Position = part.ParentGroup.AbsolutePosition;
GroupScale = part.ParentGroup.RootPart.Shape.Scale;
//FUBAR WARNING: Do NOT get the group's absoluteposition here
//or you'll experience a loop and/or a stack issue
GroupPosition = part.ParentGroup.RootPart.AbsolutePosition;
GroupRotation = part.ParentGroup.GroupRotation;
Position = part.ParentGroup.RootPart.AbsolutePosition;
Rotation = part.RotationOffset;
Scale = part.Shape.Scale;
LastUpdated = DateTime.Now;
}
else
{
GroupScale = part.Shape.Scale;
//FUBAR WARNING: Do NOT get the group's absoluteposition here
//or you'll experience a loop and/or a stack issue
GroupPosition = part.ParentGroup.RootPart.AbsolutePosition;
GroupRotation = part.ParentGroup.Rotation;
Position = part.OffsetPosition;
Rotation = part.RotationOffset;
Scale = part.Shape.Scale;
LastUpdated = DateTime.Now;
}
}
}
public void Merge(UndoState last)
{
if ((Type & UndoType.STATE_GROUP_POSITION) == 0 || ((last.Type & UndoType.STATE_GROUP_POSITION) >= (Type & UndoType.STATE_GROUP_POSITION)))
{
GroupPosition = last.GroupPosition;
Position = last.Position;
}
if ((Type & UndoType.STATE_GROUP_SCALE) == 0 || ((last.Type & UndoType.STATE_GROUP_SCALE) >= (Type & UndoType.STATE_GROUP_SCALE)))
{
GroupScale = last.GroupScale;
Scale = last.Scale;
}
if ((Type & UndoType.STATE_GROUP_ROTATION) == 0 || ((last.Type & UndoType.STATE_GROUP_ROTATION) >= (Type & UndoType.STATE_GROUP_ROTATION)))
{
GroupRotation = last.GroupRotation;
Rotation = last.Rotation;
}
if ((Type & UndoType.STATE_PRIM_POSITION) == 0 || ((last.Type & UndoType.STATE_PRIM_POSITION) >= (Type & UndoType.STATE_PRIM_POSITION)))
{
Position = last.Position;
}
if ((Type & UndoType.STATE_PRIM_SCALE) == 0 || ((last.Type & UndoType.STATE_PRIM_SCALE) >= (Type & UndoType.STATE_PRIM_SCALE)))
{
Scale = last.Scale;
}
if ((Type & UndoType.STATE_PRIM_ROTATION) == 0 || ((last.Type & UndoType.STATE_PRIM_ROTATION) >= (Type & UndoType.STATE_PRIM_ROTATION)))
{
Rotation = last.Rotation;
}
Type = Type | last.Type;
}
public bool Compare(UndoState undo)
{
if (undo == null || Position == null) return false;
if (undo.Position == Position && undo.Rotation == Rotation && undo.Scale == Scale && undo.GroupPosition == GroupPosition && undo.GroupScale == GroupScale && undo.GroupRotation == GroupRotation)
{
return true;
}
else
{
return false;
}
}
public bool Compare(SceneObjectPart part)
{
if (part != null)
{
if (part.ParentID == 0)
{
if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.ParentGroup.Rotation)
if (Position == part.ParentGroup.RootPart.AbsolutePosition && Rotation == part.ParentGroup.Rotation && GroupPosition == part.ParentGroup.RootPart.AbsolutePosition && part.ParentGroup.Rotation == GroupRotation && part.Shape.Scale == GroupScale)
return true;
else
return false;
}
else
{
if (Position == part.OffsetPosition && Rotation == part.RotationOffset && Scale == part.Shape.Scale)
if (Position == part.OffsetPosition && Rotation == part.RotationOffset && Scale == part.Shape.Scale && GroupPosition == part.ParentGroup.RootPart.AbsolutePosition && part.ParentGroup.Rotation == GroupRotation && part.Shape.Scale == GroupScale)
return true;
else
return false;
@@ -78,62 +155,70 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public void PlaybackState(SceneObjectPart part)
private void RestoreState(SceneObjectPart part)
{
bool GroupChange = false;
if ((Type & UndoType.STATE_GROUP_POSITION) != 0
|| (Type & UndoType.STATE_GROUP_ROTATION) != 0
|| (Type & UndoType.STATE_GROUP_SCALE) != 0)
{
GroupChange = true;
}
if (part != null)
{
part.Undoing = true;
if (part.ParentID == 0)
if (part.ParentID == 0 && GroupChange == false)
{
if (Position != Vector3.Zero)
part.ParentGroup.AbsolutePosition = Position;
part.RotationOffset = Rotation;
part.ParentGroup.UpdateSinglePosition(Position, part.LocalId);
part.ParentGroup.UpdateSingleRotation(Rotation, part.LocalId);
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate();
}
else
{
if (Position != Vector3.Zero)
part.OffsetPosition = Position;
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale); part.ScheduleTerseUpdate();
if (GroupChange)
{
part.ParentGroup.RootPart.Undoing = true;
if (GroupPosition != Vector3.Zero)
{
//Calculate the scale...
Vector3 gs = part.Shape.Scale;
float scale = GroupScale.Z / gs.Z;
//Scale first since it can affect our position
part.ParentGroup.GroupResize(gs * scale, part.LocalId);
part.ParentGroup.AbsolutePosition = GroupPosition;
part.ParentGroup.UpdateGroupRotationR(GroupRotation);
}
part.ParentGroup.RootPart.Undoing = false;
}
else
{
if (Position != Vector3.Zero) //We can use this for all the updates since all are set
{
part.OffsetPosition = Position;
part.UpdateRotation(Rotation);
part.Resize(Scale); part.ScheduleTerseUpdate();
}
}
}
part.Undoing = false;
}
}
public void PlaybackState(SceneObjectPart part)
{
RestoreState(part);
}
public void PlayfwdState(SceneObjectPart part)
{
if (part != null)
{
part.Undoing = true;
if (part.ParentID == 0)
{
if (Position != Vector3.Zero)
part.ParentGroup.AbsolutePosition = Position;
if (Rotation != Quaternion.Identity)
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ParentGroup.ScheduleGroupForTerseUpdate();
}
else
{
if (Position != Vector3.Zero)
part.OffsetPosition = Position;
if (Rotation != Quaternion.Identity)
part.UpdateRotation(Rotation);
if (Scale != Vector3.Zero)
part.Resize(Scale);
part.ScheduleTerseUpdate();
}
part.Undoing = false;
}
RestoreState(part);
}
}
public class LandUndoState
@@ -161,3 +246,4 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}

View File

@@ -815,6 +815,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public event ObjectOwner OnObjectOwner;
public event DirPlacesQuery OnDirPlacesQuery;
public event DirFindQuery OnDirFindQuery;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event DirLandQuery OnDirLandQuery;
public event DirPopularQuery OnDirPopularQuery;
public event DirClassifiedQuery OnDirClassifiedQuery;
@@ -878,12 +879,21 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
Disconnect();
}

View File

@@ -42,17 +42,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
public class XmlRpcRouter : IRegionModule, IXmlRpcRouter
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private bool m_enabled = false;
public void Initialise(Scene scene, IConfigSource config)
{
IConfig startupConfig = config.Configs["Startup"];
IConfig startupConfig = config.Configs["XMLRPC"];
if (startupConfig == null)
return;
if (startupConfig.GetString("XmlRpcRouterModule",
"XmlRpcRouterModule") == "XmlRpcRouterModule")
"") == "XmlRpcRouterModule")
{
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
m_enabled = true;
}
else
{
m_enabled = false;
}
}
@@ -76,7 +81,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
{
scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri});
if (m_enabled)
{
scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] { uri });
}
}
public void ScriptRemoved(UUID itemID)

View File

@@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
#pragma warning disable 67
public event Action<IClientAPI> OnLogout;
public event ObjectPermissions OnObjectPermissions;
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
public event MoneyTransferRequest OnMoneyTransferRequest;
public event ParcelBuy OnParcelBuy;
public event Action<IClientAPI> OnConnectionClosed;
@@ -832,11 +832,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{
}
public void ProcessPendingPackets()
{
}
public void ProcessInPacket(Packet NewPack)
{
}
public void Close()
{
Close(true);
}
public void Close(bool sendStop)
{
}

View File

@@ -624,8 +624,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
{
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }

View File

@@ -996,7 +996,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
{
}
public override void VehicleFlags(int param, bool remove)
{

View File

@@ -0,0 +1,58 @@
/*
* 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.Reflection;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly : AssemblyTitle("OdePlugin")]
[assembly : AssemblyDescription("")]
[assembly : AssemblyConfiguration("")]
[assembly : AssemblyCompany("http://opensimulator.org")]
[assembly : AssemblyProduct("OdePlugin")]
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly : ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// 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.6.5.*")]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,375 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using OpenMetaverse;
using OpenSim.Region.Physics.Manager;
using Ode.NET;
using log4net;
namespace OpenSim.Region.Physics.OdePlugin
{
/// <summary>
/// Processes raycast requests as ODE is in a state to be able to do them.
/// This ensures that it's thread safe and there will be no conflicts.
/// Requests get returned by a different thread then they were requested by.
/// </summary>
public class ODERayCastRequestManager
{
/// <summary>
/// Pending Raycast Requests
/// </summary>
protected List<ODERayCastRequest> m_PendingRequests = new List<ODERayCastRequest>();
/// <summary>
/// Scene that created this object.
/// </summary>
private OdeScene m_scene;
/// <summary>
/// ODE contact array to be filled by the collision testing
/// </summary>
d.ContactGeom[] contacts = new d.ContactGeom[5];
/// <summary>
/// ODE near callback delegate
/// </summary>
private d.NearCallback nearCallback;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private List<ContactResult> m_contactResults = new List<ContactResult>();
public ODERayCastRequestManager(OdeScene pScene)
{
m_scene = pScene;
nearCallback = near;
}
/// <summary>
/// Queues a raycast
/// </summary>
/// <param name="position">Origin of Ray</param>
/// <param name="direction">Ray normal</param>
/// <param name="length">Ray length</param>
/// <param name="retMethod">Return method to send the results</param>
public void QueueRequest(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod)
{
lock (m_PendingRequests)
{
ODERayCastRequest req = new ODERayCastRequest();
req.callbackMethod = retMethod;
req.length = length;
req.Normal = direction;
req.Origin = position;
m_PendingRequests.Add(req);
}
}
/// <summary>
/// Process all queued raycast requests
/// </summary>
/// <returns>Time in MS the raycasts took to process.</returns>
public int ProcessQueuedRequests()
{
int time = System.Environment.TickCount;
lock (m_PendingRequests)
{
if (m_PendingRequests.Count > 0)
{
ODERayCastRequest[] reqs = m_PendingRequests.ToArray();
for (int i = 0; i < reqs.Length; i++)
{
if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast
RayCast(reqs[i]); // if there isn't anyone to send results
}
/*
foreach (ODERayCastRequest req in m_PendingRequests)
{
if (req.callbackMethod != null) // quick optimization here, don't raycast
RayCast(req); // if there isn't anyone to send results to
}
*/
m_PendingRequests.Clear();
}
}
lock (m_contactResults)
m_contactResults.Clear();
return System.Environment.TickCount - time;
}
/// <summary>
/// Method that actually initiates the raycast
/// </summary>
/// <param name="req"></param>
private void RayCast(ODERayCastRequest req)
{
// Create the ray
IntPtr ray = d.CreateRay(m_scene.space, req.length);
d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z);
// Collide test
d.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback);
// Remove Ray
d.GeomDestroy(ray);
// Define default results
bool hitYN = false;
uint hitConsumerID = 0;
float distance = 999999999999f;
Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f);
Vector3 snormal = Vector3.Zero;
// Find closest contact and object.
lock (m_contactResults)
{
foreach (ContactResult cResult in m_contactResults)
{
if (Vector3.Distance(req.Origin, cResult.Pos) < Vector3.Distance(req.Origin, closestcontact))
{
closestcontact = cResult.Pos;
hitConsumerID = cResult.ConsumerID;
distance = cResult.Depth;
hitYN = true;
snormal = cResult.Normal;
}
}
m_contactResults.Clear();
}
// Return results
if (req.callbackMethod != null)
req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal);
}
// This is the standard Near. Uses space AABBs to speed up detection.
private void near(IntPtr space, IntPtr g1, IntPtr g2)
{
//Don't test against heightfield Geom, or you'll be sorry!
/*
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
Stacktrace:
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0x00004>
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0xffffffff>
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0x00280>
at (wrapper native-to-managed) OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0xfff
fffff>
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0x00004>
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0xffffffff>
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.RayCast (OpenSim.Region.Physics.OdePlugin.ODERayCastRequest) <
0x00114>
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.ProcessQueuedRequests () <0x000eb>
at OpenSim.Region.Physics.OdePlugin.OdeScene.Simulate (single) <0x017e6>
at OpenSim.Region.Framework.Scenes.SceneGraph.UpdatePhysics (double) <0x00042>
at OpenSim.Region.Framework.Scenes.Scene.Update () <0x0039e>
at OpenSim.Region.Framework.Scenes.Scene.Heartbeat (object) <0x00019>
at (wrapper runtime-invoke) object.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
mono [0x80d2a42]
[0xb7f5840c]
/lib/i686/cmov/libc.so.6(abort+0x188) [0xb7d1a018]
/usr/lib/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x158) [0xb45fc988]
/usr/lib/libstdc++.so.6 [0xb45fa865]
/usr/lib/libstdc++.so.6 [0xb45fa8a2]
/usr/lib/libstdc++.so.6 [0xb45fa9da]
/usr/lib/libstdc++.so.6(_Znwj+0x83) [0xb45fb033]
/usr/lib/libstdc++.so.6(_Znaj+0x1d) [0xb45fb11d]
libode.so(_ZN13dxHeightfield23dCollideHeightfieldZoneEiiiiP6dxGeomiiP12dContactGeomi+0xd04) [0xb46678e4]
libode.so(_Z19dCollideHeightfieldP6dxGeomS0_iP12dContactGeomi+0x54b) [0xb466832b]
libode.so(dCollide+0x102) [0xb46571b2]
[0x95cfdec9]
[0x8ea07fe1]
[0xab260146]
libode.so [0xb465a5c4]
libode.so(_ZN11dxHashSpace8collide2EPvP6dxGeomPFvS0_S2_S2_E+0x75) [0xb465bcf5]
libode.so(dSpaceCollide2+0x177) [0xb465ac67]
[0x95cf978e]
[0x8ea07945]
[0x95cf2bbc]
[0xab2787e7]
[0xab419fb3]
[0xab416657]
[0xab415bda]
[0xb609b08e]
mono(mono_runtime_delegate_invoke+0x34) [0x8192534]
mono [0x81a2f0f]
mono [0x81d28b6]
mono [0x81ea2c6]
/lib/i686/cmov/libpthread.so.0 [0xb7e744c0]
/lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7dcd6de]
*/
// Exclude heightfield geom
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
return;
if (d.GeomGetClass(g1) == d.GeomClassID.HeightfieldClass || d.GeomGetClass(g2) == d.GeomClassID.HeightfieldClass)
return;
// Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms.
if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
{
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
return;
// Separating static prim geometry spaces.
// We'll be calling near recursivly if one
// of them is a space to find all of the
// contact points in the space
try
{
d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
}
catch (AccessViolationException)
{
m_log.Warn("[PHYSICS]: Unable to collide test a space");
return;
}
//Colliding a space or a geom with a space or a geom. so drill down
//Collide all geoms in each space..
//if (d.GeomIsSpace(g1)) d.SpaceCollide(g1, IntPtr.Zero, nearCallback);
//if (d.GeomIsSpace(g2)) d.SpaceCollide(g2, IntPtr.Zero, nearCallback);
return;
}
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
return;
int count = 0;
try
{
if (g1 == g2)
return; // Can't collide with yourself
lock (contacts)
{
count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf);
}
}
catch (SEHException)
{
m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
}
catch (Exception e)
{
m_log.WarnFormat("[PHYSICS]: Unable to collide test an object: {0}", e.Message);
return;
}
PhysicsActor p1 = null;
PhysicsActor p2 = null;
if (g1 != IntPtr.Zero)
m_scene.actor_name_map.TryGetValue(g1, out p1);
if (g2 != IntPtr.Zero)
m_scene.actor_name_map.TryGetValue(g1, out p2);
// Loop over contacts, build results.
for (int i = 0; i < count; i++)
{
if (p1 != null) {
if (p1 is OdePrim)
{
ContactResult collisionresult = new ContactResult();
collisionresult.ConsumerID = ((OdePrim)p1).m_localID;
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
collisionresult.Depth = contacts[i].depth;
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
contacts[i].normal.Z);
lock (m_contactResults)
m_contactResults.Add(collisionresult);
}
}
if (p2 != null)
{
if (p2 is OdePrim)
{
ContactResult collisionresult = new ContactResult();
collisionresult.ConsumerID = ((OdePrim)p2).m_localID;
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
collisionresult.Depth = contacts[i].depth;
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
contacts[i].normal.Z);
lock (m_contactResults)
m_contactResults.Add(collisionresult);
}
}
}
}
/// <summary>
/// Dereference the creator scene so that it can be garbage collected if needed.
/// </summary>
internal void Dispose()
{
m_scene = null;
}
}
public struct ODERayCastRequest
{
public Vector3 Origin;
public Vector3 Normal;
public float length;
public RaycastCallback callbackMethod;
}
public struct ContactResult
{
public Vector3 Pos;
public float Depth;
public uint ConsumerID;
public Vector3 Normal;
}
}

View File

@@ -26,51 +26,23 @@
*/
using System;
using System.Collections.Generic;
using Nini.Config;
using OpenMetaverse;
using Ode.NET;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using PhysXWrapper;
using Quaternion=OpenMetaverse.Quaternion;
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Region.Physics.OdePlugin;
namespace OpenSim.Region.Physics.PhysXPlugin
namespace OpenSim.Region.Physics.OdePlugin
{
/// <summary>
/// Will be the PhysX plugin but for now will be a very basic physics engine
/// </summary>
public class PhysXPlugin : IPhysicsPlugin
class OdePhysicsJoint : PhysicsJoint
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private PhysXScene _mScene;
public PhysXPlugin()
public override bool IsInPhysicsEngine
{
}
public bool Init()
{
return true;
}
public PhysicsScene GetScene(string sceneIdentifier)
{
if (_mScene == null)
get
{
_mScene = new PhysXScene(sceneIdentifier);
return (jointID != IntPtr.Zero);
}
return (_mScene);
}
public string GetName()
{
return ("RealPhysX");
}
public void Dispose()
{
}
public IntPtr jointID;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,122 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Physics.Manager;
using log4net;
using System.Reflection;
namespace OpenSim.Region.Physics.OdePlugin
{
[TestFixture]
public class ODETestClass
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private OdePlugin cbt;
private PhysicsScene ps;
private IMeshingPlugin imp;
[SetUp]
public void Initialize()
{
// Loading ODEPlugin
cbt = new OdePlugin();
// Loading Zero Mesher
imp = new ZeroMesherPlugin();
// Getting Physics Scene
ps = cbt.GetScene("test");
// Initializing Physics Scene.
ps.Initialise(imp.GetMesher(),null);
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
{
_heightmap[i] = 21f;
}
ps.SetTerrain(_heightmap);
}
[TearDown]
public void Terminate()
{
ps.DeleteTerrain();
ps.Dispose();
}
[Test]
public void CreateAndDropPhysicalCube()
{
PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox();
Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f);
Vector3 size = new Vector3(0.5f, 0.5f, 0.5f);
Quaternion rot = Quaternion.Identity;
PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true);
OdePrim oprim = (OdePrim)prim;
OdeScene pscene = (OdeScene) ps;
Assert.That(oprim.m_taintadd);
prim.LocalID = 5;
for (int i = 0; i < 58; i++)
{
ps.Simulate(0.133f);
Assert.That(oprim.prim_geom != (IntPtr)0);
Assert.That(oprim.m_targetSpace != (IntPtr)0);
//Assert.That(oprim.m_targetSpace == pscene.space);
m_log.Info("TargetSpace: " + oprim.m_targetSpace + " - SceneMainSpace: " + pscene.space);
Assert.That(!oprim.m_taintadd);
m_log.Info("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString());
// Make sure we're above the ground
//Assert.That(prim.Position.Z > 20f);
//m_log.Info("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore);
// Make sure we've got a Body
Assert.That(oprim.Body != (IntPtr)0);
//m_log.Info(
}
// Make sure we're not somewhere above the ground
Assert.That(prim.Position.Z < 21.5f);
ps.RemovePrim(prim);
Assert.That(oprim.m_taintremove);
ps.Simulate(0.133f);
Assert.That(oprim.Body == (IntPtr)0);
}
}
}

View File

@@ -0,0 +1,98 @@
/*
* Copyright ODE
* Ode.NET - .NET bindings for ODE
* Jason Perkins (starkos@industriousone.com)
* Licensed under the New BSD
* Part of the OpenDynamicsEngine
Open Dynamics Engine
Copyright (c) 2001-2007, Russell L. Smith.
All rights reserved.
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 names of ODE's copyright owner 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 COPYRIGHT HOLDERS AND CONTRIBUTORS
"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 COPYRIGHT
OWNER OR 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.Runtime.InteropServices;
using Ode.NET;
namespace Drawstuff.NET
{
#if dDOUBLE
using dReal = System.Double;
#else
using dReal = System.Single;
#endif
public static class ds
{
public const int VERSION = 2;
public enum Texture
{
None,
Wood
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void CallbackFunction(int arg);
[StructLayout(LayoutKind.Sequential)]
public struct Functions
{
public int version;
public CallbackFunction start;
public CallbackFunction step;
public CallbackFunction command;
public CallbackFunction stop;
public string path_to_textures;
}
[DllImport("drawstuff", EntryPoint = "dsDrawBox")]
public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides);
[DllImport("drawstuff", EntryPoint = "dsDrawCapsule")]
public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius);
[DllImport("drawstuff", EntryPoint = "dsDrawConvex")]
public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
[DllImport("drawstuff", EntryPoint = "dsSetColor")]
public static extern void SetColor(float red, float green, float blue);
[DllImport("drawstuff", EntryPoint = "dsSetTexture")]
public static extern void SetTexture(Texture texture);
[DllImport("drawstuff", EntryPoint = "dsSetViewpoint")]
public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr);
[DllImport("drawstuff", EntryPoint = "dsSimulationLoop")]
public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn);
}
}

View File

@@ -1210,7 +1210,6 @@ namespace OpenSim.Region.Physics.OdePlugin
public override float APIDDamping{ set { return; } }
public override void SubscribeEvents(int ms)
{
m_requestedUpdateFrequency = ms;

View File

@@ -2831,7 +2831,7 @@ Console.WriteLine(" JointCreateFixed");
}
public override bool PIDActive { set { m_usePID = value; } }
public override float PIDTau { set { m_PIDTau = value; } }
public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } }
public override bool PIDHoverActive { set { m_useHoverPID = value; } }
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } }

View File

@@ -301,7 +301,7 @@ namespace OpenSim.Region.Physics.POSPlugin
{
set { return; }
}
public override Quaternion APIDTarget
{
set { return; }

View File

@@ -88,89 +88,7 @@ namespace OpenSim.Region.RegionCombinerModule
public void RegionLoaded(Scene scene)
{
if (enabledYN)
{
RegionLoadedDoWork(scene);
scene.EventManager.OnNewPresence += NewPresence;
}
}
private void NewPresence(ScenePresence presence)
{
if (presence.IsChildAgent)
{
byte[] throttleData;
try
{
throttleData = presence.ControllingClient.GetThrottlesPacked(1);
}
catch (NotImplementedException)
{
return;
}
if (throttleData == null)
return;
if (throttleData.Length == 0)
return;
if (throttleData.Length != 28)
return;
byte[] adjData;
int pos = 0;
if (!BitConverter.IsLittleEndian)
{
byte[] newData = new byte[7 * 4];
Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4);
for (int i = 0; i < 7; i++)
Array.Reverse(newData, i * 4, 4);
adjData = newData;
}
else
{
adjData = throttleData;
}
// 0.125f converts from bits to bytes
int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
// State is a subcategory of task that we allocate a percentage to
//int total = resend + land + wind + cloud + task + texture + asset;
byte[] data = new byte[7 * 4];
int ii = 0;
Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4;
Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4);
try
{
presence.ControllingClient.SetChildAgentThrottle(data);
}
catch (NotImplementedException)
{
return;
}
}
}
private void RegionLoadedDoWork(Scene scene)

View File

@@ -248,6 +248,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
public static void StateChange(IScriptEngine engine, uint localID, UUID itemID)
{
// Remove a specific script
// Remove dataserver events
m_Dataserver[engine].RemoveEvents(localID, itemID);
IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>();
if (comms != null)
comms.DeleteListener(itemID);
IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>();
xmlrpc.DeleteChannels(itemID);
xmlrpc.CancelSRDRequests(itemID);
// Remove Sensors
m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
}
public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID)
{
List<Object> data = new List<Object>();

File diff suppressed because it is too large Load Diff

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