Compare commits

...

402 Commits

Author SHA1 Message Date
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
Melanie Thielker
881fcb7def Allow retrieval if admin users in scope mode 2010-04-30 23:32:58 +02: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
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
62 changed files with 13301 additions and 1564 deletions

View File

@@ -125,6 +125,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
@@ -214,9 +215,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (!m_app.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_app.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_app.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)
{
@@ -279,6 +330,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_app.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)
{
@@ -386,13 +484,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
message = "Region is going down now.";
}
m_app.SceneManager.ForEachScene(
if (requestData.ContainsKey("noticetype")
&& ((string) requestData["noticetype"] == "dialog"))
{
m_app.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_app.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

@@ -160,5 +160,36 @@ namespace OpenSim.Data.MySQL
}
}
}
public override bool Store(XInventoryItem item)
{
if (!base.Store(item))
return false;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand())
{
cmd.Connection = dbcon;
cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID");
cmd.Parameters.AddWithValue("?folderID", item.parentFolderID.ToString());
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
return false;
}
cmd.Dispose();
}
dbcon.Close();
}
return true;
}
}
}

View File

@@ -1,3 +1,71 @@
BEGIN;
CREATE TABLE `regionwindlight` (
`region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
`water_color_r` float(9,6) unsigned NOT NULL DEFAULT '4.000000',
`water_color_g` float(9,6) unsigned NOT NULL DEFAULT '38.000000',
`water_color_b` float(9,6) unsigned NOT NULL DEFAULT '64.000000',
`water_fog_density_exponent` float(3,1) unsigned NOT NULL DEFAULT '4.0',
`underwater_fog_modifier` float(3,2) unsigned NOT NULL DEFAULT '0.25',
`reflection_wavelet_scale_1` float(3,1) unsigned NOT NULL DEFAULT '2.0',
`reflection_wavelet_scale_2` float(3,1) unsigned NOT NULL DEFAULT '2.0',
`reflection_wavelet_scale_3` float(3,1) unsigned NOT NULL DEFAULT '2.0',
`fresnel_scale` float(3,2) unsigned NOT NULL DEFAULT '0.40',
`fresnel_offset` float(3,2) unsigned NOT NULL DEFAULT '0.50',
`refract_scale_above` float(3,2) unsigned NOT NULL DEFAULT '0.03',
`refract_scale_below` float(3,2) unsigned NOT NULL DEFAULT '0.20',
`blur_multiplier` float(4,3) unsigned NOT NULL DEFAULT '0.040',
`big_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.05',
`big_wave_direction_y` float(3,2) NOT NULL DEFAULT '-0.42',
`little_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.11',
`little_wave_direction_y` float(3,2) NOT NULL DEFAULT '-1.16',
`normal_map_texture` varchar(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
`horizon_r` float(3,2) unsigned NOT NULL DEFAULT '0.25',
`horizon_g` float(3,2) unsigned NOT NULL DEFAULT '0.25',
`horizon_b` float(3,2) unsigned NOT NULL DEFAULT '0.32',
`horizon_i` float(3,2) unsigned NOT NULL DEFAULT '0.32',
`haze_horizon` float(3,2) unsigned NOT NULL DEFAULT '0.19',
`blue_density_r` float(3,2) unsigned NOT NULL DEFAULT '0.12',
`blue_density_g` float(3,2) unsigned NOT NULL DEFAULT '0.22',
`blue_density_b` float(3,2) unsigned NOT NULL DEFAULT '0.38',
`blue_density_i` float(3,2) unsigned NOT NULL DEFAULT '0.38',
`haze_density` float(3,2) unsigned NOT NULL DEFAULT '0.70',
`density_multiplier` float(3,2) unsigned NOT NULL DEFAULT '0.18',
`distance_multiplier` float(4,1) unsigned NOT NULL DEFAULT '0.8',
`max_altitude` int(4) unsigned NOT NULL DEFAULT '1605',
`sun_moon_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.24',
`sun_moon_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.26',
`sun_moon_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.30',
`sun_moon_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.30',
`sun_moon_position` float(4,3) unsigned NOT NULL DEFAULT '0.317',
`ambient_r` float(3,2) unsigned NOT NULL DEFAULT '0.35',
`ambient_g` float(3,2) unsigned NOT NULL DEFAULT '0.35',
`ambient_b` float(3,2) unsigned NOT NULL DEFAULT '0.35',
`ambient_i` float(3,2) unsigned NOT NULL DEFAULT '0.35',
`east_angle` float(3,2) unsigned NOT NULL DEFAULT '0.00',
`sun_glow_focus` float(3,2) unsigned NOT NULL DEFAULT '0.10',
`sun_glow_size` float(3,2) unsigned NOT NULL DEFAULT '1.75',
`scene_gamma` float(4,2) unsigned NOT NULL DEFAULT '1.00',
`star_brightness` float(3,2) unsigned NOT NULL DEFAULT '0.00',
`cloud_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.41',
`cloud_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.41',
`cloud_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.41',
`cloud_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.41',
`cloud_x` float(3,2) unsigned NOT NULL DEFAULT '1.00',
`cloud_y` float(3,2) unsigned NOT NULL DEFAULT '0.53',
`cloud_density` float(3,2) unsigned NOT NULL DEFAULT '1.00',
`cloud_coverage` float(3,2) unsigned NOT NULL DEFAULT '0.27',
`cloud_scale` float(3,2) unsigned NOT NULL DEFAULT '0.42',
`cloud_detail_x` float(3,2) unsigned NOT NULL DEFAULT '1.00',
`cloud_detail_y` float(3,2) unsigned NOT NULL DEFAULT '0.53',
`cloud_detail_density` float(3,2) unsigned NOT NULL DEFAULT '0.12',
`cloud_scroll_x` float(3,2) unsigned NOT NULL DEFAULT '0.20',
`cloud_scroll_x_lock` tinyint(1) unsigned NOT NULL DEFAULT '0',
`cloud_scroll_y` float(3,2) unsigned NOT NULL DEFAULT '0.01',
`cloud_scroll_y_lock` tinyint(1) unsigned NOT NULL DEFAULT '0',
`draw_classic_clouds` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`region_id`)
);
ALTER TABLE estate_settings AUTO_INCREMENT = 100;
COMMIT;

View File

@@ -29,11 +29,11 @@ namespace OpenSim
{
public class VersionInfo
{
private const string VERSION_NUMBER = "0.7";
private const string VERSION_NUMBER = "0.7CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour
{
{
Unknown,
Dev,
RC1,
@@ -71,4 +71,4 @@ namespace OpenSim
/// </value>
public readonly static int MajorInterfaceVersion = 6;
}
}
}

View File

@@ -27,9 +27,12 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Reflection;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using log4net;
using OpenMetaverse;
namespace OpenSim.Framework
@@ -45,6 +48,111 @@ 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.");
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 +160,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

@@ -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

@@ -343,10 +343,26 @@ namespace OpenSim
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
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(false);
@@ -354,6 +370,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 +382,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);
}
// We need to do this after we've initialized the
// scripting engines.
scene.CreateScriptInstances();
@@ -374,6 +403,11 @@ namespace OpenSim
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
scene.EventManager.TriggerParcelPrimCountUpdate();
if (scene.SnmpService != null)
{
scene.SnmpService.BootInfo("ScriptEngine started", scene);
}
m_sceneManager.Add(scene);
if (m_autoCreateClientStack)
@@ -382,6 +416,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 +431,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 +445,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

@@ -1064,6 +1064,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>
@@ -1076,16 +1080,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)
{
@@ -1093,51 +1094,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
@@ -1157,7 +1142,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)
{
@@ -3429,7 +3414,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
objupdate.ObjectData[0] = CreateAvatarUpdateBlock(data);
OutPacket(objupdate, ThrottleOutPacketType.Task);
}
@@ -3480,8 +3464,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
terse.ObjectData[i] = m_avatarTerseUpdates.Dequeue();
}
// HACK: Using the task category until the tiered reprioritization code is in
OutPacket(terse, ThrottleOutPacketType.Task);
OutPacket(terse, ThrottleOutPacketType.State);
}
public void SendCoarseLocationUpdate(List<UUID> users, List<Vector3> CoarseLocations)
@@ -3971,6 +3954,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;
@@ -4909,6 +4895,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) ||
@@ -5279,7 +5266,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;

View File

@@ -27,6 +27,7 @@
using System.Collections.Generic;
using System.Reflection;
using System.Xml;
using log4net;
using Nini.Config;
using OpenMetaverse;
@@ -35,6 +36,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
{
@@ -190,8 +192,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)
{
@@ -210,7 +218,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)
@@ -236,13 +244,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
// 3 == AttachedRez
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
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
{
@@ -271,7 +285,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*/);
}
@@ -316,6 +331,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 */);
@@ -404,6 +425,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,15 @@ 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)
{
if (Presencecheck.IsEitherBannedOrRestricted(c.SenderUUID) != true)
{
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
}
}
}
);
}
@@ -266,25 +288,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);
}
);
}
}
@@ -313,5 +339,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

@@ -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);

View File

@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
{
// Check if this is ours to handle
//
m_log.Info("OnFridInstantMessage");
//m_log.Info("OnFridInstantMessage");
if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
return;

View File

@@ -263,10 +263,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))
{
@@ -278,6 +279,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
}
}
}
part.TaskInventory.LockItemsForRead(false);
}
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))

View File

@@ -82,6 +82,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;
@@ -96,6 +98,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)
@@ -351,7 +359,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));
@@ -981,6 +989,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))
@@ -1504,5 +1516,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;
}
}
}
}
}
}
}

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

@@ -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

@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////
//
// (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);
}

View File

@@ -53,8 +53,8 @@ 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;
@@ -123,17 +123,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation
/// </summary>
public void TrySetMovementAnimation(string anim)
{
//m_log.DebugFormat("Updating movement animation to {0}", anim);
//Console.WriteLine("Updating movement animation to {0}", anim);
if (!m_scenePresence.IsChildAgent)
{
if (m_animations.TrySetDefaultAnimation(
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
{
//Console.WriteLine("TSMA {0} success.", anim);
// 16384 is CHANGED_ANIMATION
m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 });
SendAnimPack();
}
else
{
//Console.WriteLine("TSMA {0} fail.", anim);
}
}
}
@@ -146,10 +151,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 +161,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;
@@ -316,7 +317,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void UpdateMovementAnimations()
{
m_movementAnimation = GetMovementAnimation();
//Console.WriteLine("UMA got {0}", m_movementAnimation);
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

@@ -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
{
@@ -415,6 +430,25 @@ namespace OpenSim.Region.Framework.Scenes
itemCopy.BasePermissions = item.BasePermissions;
}
if (itemCopy.Folder == UUID.Zero)
{
InventoryFolderBase folder = InventoryService.GetFolderForType(recipient, (AssetType)itemCopy.AssetType);
if (folder != null)
{
itemCopy.Folder = folder.ID;
}
else
{
InventoryFolderBase root = InventoryService.GetRootFolder(recipient);
if (root != null)
itemCopy.Folder = root.ID;
else
return null; // No destination
}
}
itemCopy.GroupID = UUID.Zero;
itemCopy.GroupOwned = false;
itemCopy.Flags = item.Flags;
@@ -815,8 +849,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)
{
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
if (item == null)

View File

@@ -156,6 +156,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;
@@ -602,6 +616,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);
@@ -1015,6 +1031,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
@@ -1036,8 +1061,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)));
}
}
}
@@ -1393,16 +1421,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();
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
m_sceneGraph.UpdatePreparePhysics();
@@ -2102,7 +2130,7 @@ 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
@@ -3412,6 +3440,9 @@ namespace OpenSim.Region.Framework.Scenes
CapsModule.AddCapsHandler(agent.AgentID);
if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0)
System.Threading.Thread.Sleep(2000);
if (!agent.child)
{
if (TestBorderCross(agent.startpos,Cardinals.E))
@@ -3470,6 +3501,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)
@@ -3477,6 +3510,7 @@ namespace OpenSim.Region.Framework.Scenes
agent.startpos = land.LandData.UserLocation;
}
}
*/// This is now handled properly in ScenePresence.MakeRootAgent
}
agent.teleportFlags = teleportFlags;

View File

@@ -300,7 +300,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

@@ -225,6 +225,30 @@ namespace OpenSim.Region.Framework.Scenes
protected internal bool AddRestoredSceneObject(
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
{
// 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();

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

@@ -147,7 +147,7 @@ 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;
@@ -274,6 +274,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);
@@ -452,12 +453,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;
}
}
public uint ObjectFlags
@@ -586,14 +591,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; }
@@ -647,7 +650,6 @@ namespace OpenSim.Region.Framework.Scenes
set
{
m_groupPosition = value;
PhysicsActor actor = PhysActor;
if (actor != null)
{
@@ -816,7 +818,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; }
}
@@ -960,7 +971,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
@@ -1112,6 +1124,13 @@ namespace OpenSim.Region.Framework.Scenes
get { return _flags; }
set { _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
@@ -1187,14 +1206,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)
@@ -1934,12 +1945,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>
@@ -1950,7 +1966,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Quaternion newRot;
if (this.LinkNum == 0)
if (this.LinkNum < 2) //KF Single or root prim
{
newRot = RotationOffset;
}
@@ -2596,17 +2612,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)
@@ -2675,38 +2692,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>
@@ -2939,8 +2925,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)
{
@@ -2954,7 +2940,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.
@@ -2972,16 +2958,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>
@@ -3008,17 +2996,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)
@@ -3453,7 +3440,7 @@ namespace OpenSim.Region.Framework.Scenes
public void StopLookAt()
{
m_parentGroup.stopLookAt();
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
m_parentGroup.ScheduleGroupForTerseUpdate();
}
@@ -4696,5 +4683,17 @@ namespace OpenSim.Region.Framework.Scenes
{
return new Color4((byte)Color.R, (byte)Color.G, (byte)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);
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -26,6 +26,7 @@
*/
using System;
using System.Xml;
using System.Collections.Generic;
using System.Reflection;
using System.Timers;
@@ -73,7 +74,7 @@ namespace OpenSim.Region.Framework.Scenes
// {
// m_log.Debug("[ScenePresence] Destructor called");
// }
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
@@ -89,7 +90,9 @@ namespace OpenSim.Region.Framework.Scenes
/// rotation, prim cut, prim twist, prim taper, and prim shear. See mantis
/// issue #1716
/// </summary>
private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f);
// private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f);
// Value revised by KF 091121 by comparison with SL.
private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f);
public UUID currentParcelUUID = UUID.Zero;
@@ -123,8 +126,11 @@ namespace OpenSim.Region.Framework.Scenes
public Vector3 lastKnownAllowedPosition;
public bool sentMessageAboutRestrictedParcelFlyingDown;
public Vector4 CollisionPlane = Vector4.UnitW;
private Vector3 m_lastPosition;
private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation
private Vector3 m_avUnscriptedSitPos; // for non-scripted prims
private Vector3 m_lastPosition;
private Vector3 m_lastWorldPosition;
private Quaternion m_lastRotation;
private Vector3 m_lastVelocity;
//private int m_lastTerseSent;
@@ -134,7 +140,6 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3? m_forceToApply;
private uint m_requestedSitTargetID;
private UUID m_requestedSitTargetUUID;
public bool SitGround = false;
private SendCourseLocationsMethod m_sendCourseLocationsMethod;
@@ -157,7 +162,6 @@ namespace OpenSim.Region.Framework.Scenes
private int m_perfMonMS;
private bool m_setAlwaysRun;
private bool m_forceFly;
private bool m_flyDisabled;
@@ -183,7 +187,8 @@ namespace OpenSim.Region.Framework.Scenes
protected RegionInfo m_regionInfo;
protected ulong crossingFromRegion;
private readonly Vector3[] Dir_Vectors = new Vector3[9];
private readonly Vector3[] Dir_Vectors = new Vector3[11];
private bool m_isNudging = false;
// Position of agent's camera in world (region cordinates)
protected Vector3 m_CameraCenter;
@@ -208,6 +213,7 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_autopilotMoving;
private Vector3 m_autoPilotTarget;
private bool m_sitAtAutoTarget;
private Vector3 m_initialSitTarget; //KF: First estimate of where to sit
private string m_nextSitAnimation = String.Empty;
@@ -218,6 +224,9 @@ namespace OpenSim.Region.Framework.Scenes
private bool m_followCamAuto;
private int m_movementUpdateCount;
private int m_lastColCount = -1; //KF: Look for Collision chnages
private int m_updateCount = 0; //KF: Update Anims for a while
private static readonly int UPDATE_COUNT = 10; // how many frames to update for
private const int NumMovementsBetweenRayCast = 5;
@@ -246,7 +255,9 @@ namespace OpenSim.Region.Framework.Scenes
DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS,
DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG,
DIR_CONTROL_FLAG_FORWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS,
DIR_CONTROL_FLAG_BACKWARD_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG,
DIR_CONTROL_FLAG_BACK_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG,
DIR_CONTROL_FLAG_LEFT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS,
DIR_CONTROL_FLAG_RIGHT_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG,
DIR_CONTROL_FLAG_DOWN_NUDGE = AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG
}
@@ -453,7 +464,8 @@ namespace OpenSim.Region.Framework.Scenes
get
{
PhysicsActor actor = m_physicsActor;
if (actor != null)
// if (actor != null)
if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting!
m_pos = actor.Position;
return m_parentPosition + m_pos;
@@ -474,7 +486,8 @@ namespace OpenSim.Region.Framework.Scenes
}
}
m_pos = value;
if (m_parentID == 0) // KF Do NOT update m_pos here if Av is sitting!
m_pos = value;
m_parentPosition = Vector3.Zero;
}
}
@@ -693,10 +706,7 @@ namespace OpenSim.Region.Framework.Scenes
m_reprioritization_timer.AutoReset = false;
AdjustKnownSeeds();
// TODO: I think, this won't send anything, as we are still a child here...
Animator.TrySetMovementAnimation("STAND");
// we created a new ScenePresence (a new child agent) in a fresh region.
// Request info about all the (root) agents in this region
// Note: This won't send data *to* other clients in that region (children don't send)
@@ -752,25 +762,47 @@ namespace OpenSim.Region.Framework.Scenes
Dir_Vectors[3] = -Vector3.UnitY; //RIGHT
Dir_Vectors[4] = Vector3.UnitZ; //UP
Dir_Vectors[5] = -Vector3.UnitZ; //DOWN
Dir_Vectors[8] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge
Dir_Vectors[6] = Vector3.UnitX*2; //FORWARD
Dir_Vectors[7] = -Vector3.UnitX; //BACK
Dir_Vectors[6] = new Vector3(0.5f, 0f, 0f); //FORWARD_NUDGE
Dir_Vectors[7] = new Vector3(-0.5f, 0f, 0f); //BACK_NUDGE
Dir_Vectors[8] = new Vector3(0f, 0.5f, 0f); //LEFT_NUDGE
Dir_Vectors[9] = new Vector3(0f, -0.5f, 0f); //RIGHT_NUDGE
Dir_Vectors[10] = new Vector3(0f, 0f, -0.5f); //DOWN_Nudge
}
private Vector3[] GetWalkDirectionVectors()
{
Vector3[] vector = new Vector3[9];
Vector3[] vector = new Vector3[11];
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT
vector[3] = -Vector3.UnitY; //RIGHT
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
vector[8] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_Nudge
vector[6] = (new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z) * 2); //FORWARD Nudge
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK Nudge
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_NUDGE
vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE
return vector;
}
private bool[] GetDirectionIsNudge()
{
bool[] isNudge = new bool[11];
isNudge[0] = false; //FORWARD
isNudge[1] = false; //BACK
isNudge[2] = false; //LEFT
isNudge[3] = false; //RIGHT
isNudge[4] = false; //UP
isNudge[5] = false; //DOWN
isNudge[6] = true; //FORWARD_NUDGE
isNudge[7] = true; //BACK_NUDGE
isNudge[8] = true; //LEFT_NUDGE
isNudge[9] = true; //RIGHT_NUDGE
isNudge[10] = true; //DOWN_Nudge
return isNudge;
}
#endregion
@@ -839,6 +871,22 @@ namespace OpenSim.Region.Framework.Scenes
{
Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N);
pos.Y = crossedBorder.BorderLine.Z - 1;
}
//If they're TP'ing in or logging in, we haven't had time to add any known child regions yet.
//This has the unfortunate consequence that if somebody is TP'ing who is already a child agent,
//they'll bypass the landing point. But I can't think of any decent way of fixing this.
if (KnownChildRegionHandles.Count == 0)
{
ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y);
if (land != null)
{
//Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_userLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
{
pos = land.LandData.UserLocation;
}
}
}
if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f)
@@ -973,9 +1021,10 @@ namespace OpenSim.Region.Framework.Scenes
public void Teleport(Vector3 pos)
{
bool isFlying = false;
if (m_physicsActor != null)
isFlying = m_physicsActor.Flying;
if (m_physicsActor != null)
isFlying = m_physicsActor.Flying;
RemoveFromPhysicalScene();
Velocity = Vector3.Zero;
AbsolutePosition = pos;
@@ -986,7 +1035,8 @@ namespace OpenSim.Region.Framework.Scenes
SetHeight(m_appearance.AvatarHeight);
}
SendTerseUpdateToAllClients();
SendTerseUpdateToAllClients();
}
public void TeleportWithMomentum(Vector3 pos)
@@ -1031,7 +1081,9 @@ namespace OpenSim.Region.Framework.Scenes
{
AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f));
}
m_updateCount = UPDATE_COUNT; //KF: Trigger Anim updates to catch falling anim.
ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
}
@@ -1216,6 +1268,7 @@ namespace OpenSim.Region.Framework.Scenes
m_log.Error("[AVATAR]: NonFinite Avatar position detected... Reset Position. Mantis this please. Error #9999902");
m_pos = m_LastFinitePos;
if (!m_pos.IsFinite())
{
m_pos.X = 127f;
@@ -1282,7 +1335,6 @@ namespace OpenSim.Region.Framework.Scenes
m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(m_CameraCenter - posAdjusted), Vector3.Distance(m_CameraCenter, posAdjusted) + 0.3f, RayCastCameraCallback);
}
}
lock (scriptedcontrols)
{
if (scriptedcontrols.Count > 0)
@@ -1297,12 +1349,8 @@ namespace OpenSim.Region.Framework.Scenes
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0)
{
// TODO: This doesn't prevent the user from walking yet.
// Setting parent ID would fix this, if we knew what value
// to use. Or we could add a m_isSitting variable.
//Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
SitGround = true;
m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.
Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
}
// In the future, these values might need to go global.
@@ -1352,6 +1400,11 @@ namespace OpenSim.Region.Framework.Scenes
update_rotation = true;
}
//guilty until proven innocent..
bool Nudging = true;
//Basically, if there is at least one non-nudge control then we don't need
//to worry about stopping the avatar
if (m_parentID == 0)
{
bool bAllowUpdateMoveToPosition = false;
@@ -1366,9 +1419,12 @@ namespace OpenSim.Region.Framework.Scenes
else
dirVectors = Dir_Vectors;
// The fact that m_movementflag is a byte needs to be fixed
// it really should be a uint
uint nudgehack = 250;
bool[] isNudge = GetDirectionIsNudge();
foreach (Dir_ControlFlags DCF in DIR_CONTROL_FLAGS)
{
if (((uint)flags & (uint)DCF) != 0)
@@ -1378,40 +1434,28 @@ namespace OpenSim.Region.Framework.Scenes
try
{
agent_control_v3 += dirVectors[i];
//m_log.DebugFormat("[Motion]: {0}, {1}",i, dirVectors[i]);
if (isNudge[i] == false)
{
Nudging = false;
}
}
catch (IndexOutOfRangeException)
{
// Why did I get this?
}
if ((m_movementflag & (byte)(uint)DCF) == 0)
if ((m_movementflag & (uint)DCF) == 0)
{
if (DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE)
{
m_movementflag |= (byte)nudgehack;
}
m_movementflag += (byte)(uint)DCF;
update_movementflag = true;
}
}
else
{
if ((m_movementflag & (byte)(uint)DCF) != 0 ||
((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE)
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
) // This or is for Nudge forward
if ((m_movementflag & (uint)DCF) != 0)
{
m_movementflag -= ((byte)(uint)DCF);
m_movementflag -= (byte)(uint)DCF;
update_movementflag = true;
/*
if ((DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_FORWARD_NUDGE || DCF == Dir_ControlFlags.DIR_CONTROL_FLAG_BACKWARD_NUDGE)
&& ((m_movementflag & (byte)nudgehack) == nudgehack))
{
m_log.Debug("Removed Hack flag");
}
*/
}
else
{
@@ -1455,6 +1499,9 @@ namespace OpenSim.Region.Framework.Scenes
// Ignore z component of vector
Vector3 LocalVectorToTarget2D = new Vector3((float)(LocalVectorToTarget3D.X), (float)(LocalVectorToTarget3D.Y), 0f);
LocalVectorToTarget2D.Normalize();
//We're not nudging
Nudging = false;
agent_control_v3 += LocalVectorToTarget2D;
// update avatar movement flags. the avatar coordinate system is as follows:
@@ -1543,13 +1590,13 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat(
// "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3);
AddNewMovement(agent_control_v3, q);
AddNewMovement(agent_control_v3, q, Nudging);
}
}
if (update_movementflag && ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) == 0) && (m_parentID == 0) && !SitGround)
if (update_movementflag)
Animator.UpdateMovementAnimations();
m_scene.EventManager.TriggerOnClientMovement(this);
@@ -1564,7 +1611,6 @@ namespace OpenSim.Region.Framework.Scenes
m_sitAtAutoTarget = false;
PrimitiveBaseShape proxy = PrimitiveBaseShape.Default;
//proxy.PCode = (byte)PCode.ParticleSystem;
proxyObjectGroup = new SceneObjectGroup(UUID, Pos, Rotation, proxy);
proxyObjectGroup.AttachToScene(m_scene);
@@ -1606,7 +1652,7 @@ namespace OpenSim.Region.Framework.Scenes
}
m_moveToPositionInProgress = true;
m_moveToPositionTarget = new Vector3(locx, locy, locz);
}
}
catch (Exception ex)
{
//Why did I get this error?
@@ -1628,7 +1674,7 @@ namespace OpenSim.Region.Framework.Scenes
Velocity = Vector3.Zero;
SendFullUpdateToAllClients();
//HandleAgentSit(ControllingClient, m_requestedSitTargetUUID);
HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); //KF ??
}
//ControllingClient.SendSitResponse(m_requestedSitTargetID, m_requestedSitOffset, Quaternion.Identity, false, Vector3.Zero, Vector3.Zero, false);
m_requestedSitTargetUUID = UUID.Zero;
@@ -1661,55 +1707,84 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void StandUp()
{
if (SitGround)
SitGround = false;
if (m_parentID != 0)
{
m_log.Debug("StandupCode Executed");
SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);
if (part != null)
{
part.TaskInventory.LockItemsForRead(true);
TaskInventoryDictionary taskIDict = part.TaskInventory;
if (taskIDict != null)
{
lock (taskIDict)
foreach (UUID taskID in taskIDict.Keys)
{
foreach (UUID taskID in taskIDict.Keys)
{
UnRegisterControlEventsToScript(LocalId, taskID);
taskIDict[taskID].PermsMask &= ~(
2048 | //PERMISSION_CONTROL_CAMERA
4); // PERMISSION_TAKE_CONTROLS
}
UnRegisterControlEventsToScript(LocalId, taskID);
taskIDict[taskID].PermsMask &= ~(
2048 | //PERMISSION_CONTROL_CAMERA
4); // PERMISSION_TAKE_CONTROLS
}
}
part.TaskInventory.LockItemsForRead(false);
// Reset sit target.
if (part.GetAvatarOnSitTarget() == UUID)
part.SetAvatarOnSitTarget(UUID.Zero);
m_parentPosition = part.GetWorldPosition();
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
}
// part.GetWorldRotation() is the rotation of the object being sat on
// Rotation is the sittiing Av's rotation
if (m_physicsActor == null)
{
AddToPhysicalScene(false);
Quaternion partRot;
// if (part.LinkNum == 1)
// { // Root prim of linkset
// partRot = part.ParentGroup.RootPart.RotationOffset;
// }
// else
// { // single or child prim
// }
if (part == null) //CW: Part may be gone. llDie() for example.
{
partRot = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
}
else
{
partRot = part.GetWorldRotation();
}
m_pos += m_parentPosition + new Vector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
m_parentPosition = Vector3.Zero;
Quaternion partIRot = Quaternion.Inverse(partRot);
m_parentID = 0;
Quaternion avatarRot = Quaternion.Inverse(Quaternion.Inverse(Rotation) * partIRot); // world or. of the av
Vector3 avStandUp = new Vector3(1.0f, 0f, 0f) * avatarRot; // 1M infront of av
if (m_physicsActor == null)
{
AddToPhysicalScene(false);
}
//CW: If the part isn't null then we can set the current position
if (part != null)
{
Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset!
AbsolutePosition = avWorldStandUp; //KF: Fix stand up.
part.IsOccupied = false;
}
else
{
//CW: Since the part doesn't exist, a coarse standup position isn't an issue
AbsolutePosition = m_lastWorldPosition;
}
m_parentPosition = Vector3.Zero;
m_parentID = 0;
SendFullUpdateToAllClients();
m_requestedSitTargetID = 0;
if ((m_physicsActor != null) && (m_avHeight > 0))
{
SetHeight(m_avHeight);
}
}
Animator.TrySetMovementAnimation("STAND");
}
@@ -1740,13 +1815,9 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 avSitOffSet = part.SitTargetPosition;
Quaternion avSitOrientation = part.SitTargetOrientation;
UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
bool SitTargetisSet =
(!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f && avSitOrientation.W == 1f &&
avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f));
if (SitTargetisSet && SitTargetUnOccupied)
bool SitTargetOccupied = (avOnTargetAlready != UUID.Zero);
bool SitTargetisSet = (Vector3.Zero != avSitOffSet); //NB Latest SL Spec shows Sit Rotation setting is ignored.
if (SitTargetisSet && !SitTargetOccupied)
{
//switch the target to this prim
return part;
@@ -1760,84 +1831,153 @@ namespace OpenSim.Region.Framework.Scenes
private void SendSitResponse(IClientAPI remoteClient, UUID targetID, Vector3 offset, Quaternion pSitOrientation)
{
bool autopilot = true;
Vector3 autopilotTarget = new Vector3();
Quaternion sitOrientation = Quaternion.Identity;
Vector3 pos = new Vector3();
Quaternion sitOrientation = pSitOrientation;
Vector3 cameraEyeOffset = Vector3.Zero;
Vector3 cameraAtOffset = Vector3.Zero;
bool forceMouselook = false;
//SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
SceneObjectPart part = FindNextAvailableSitTarget(targetID);
if (part != null)
if (part == null) return;
// TODO: determine position to sit at based on scene geometry; don't trust offset from client
// see http://wiki.secondlife.com/wiki/User:Andrew_Linden/Office_Hours/2007_11_06 for details on how LL does it
// part is the prim to sit on
// offset is the world-ref vector distance from that prim center to the click-spot
// UUID is the UUID of the Avatar doing the clicking
m_avInitialPos = AbsolutePosition; // saved to calculate unscripted sit rotation
// Is a sit target available?
Vector3 avSitOffSet = part.SitTargetPosition;
Quaternion avSitOrientation = part.SitTargetOrientation;
bool SitTargetisSet = (Vector3.Zero != avSitOffSet); //NB Latest SL Spec shows Sit Rotation setting is ignored.
// Quaternion partIRot = Quaternion.Inverse(part.GetWorldRotation());
Quaternion partRot;
// if (part.LinkNum == 1)
// { // Root prim of linkset
// partRot = part.ParentGroup.RootPart.RotationOffset;
// }
// else
// { // single or child prim
partRot = part.GetWorldRotation();
// }
Quaternion partIRot = Quaternion.Inverse(partRot);
//Console.WriteLine("SendSitResponse offset=" + offset + " Occup=" + part.IsOccupied + " TargSet=" + SitTargetisSet);
// Sit analysis rewritten by KF 091125
if (SitTargetisSet) // scipted sit
{
// TODO: determine position to sit at based on scene geometry; don't trust offset from client
// see http://wiki.secondlife.com/wiki/User:Andrew_Linden/Office_Hours/2007_11_06 for details on how LL does it
if (!part.IsOccupied)
{
//Console.WriteLine("Scripted, unoccupied");
part.SetAvatarOnSitTarget(UUID); // set that Av will be on it
offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); // change ofset to the scripted one
sitOrientation = avSitOrientation; // Change rotatione to the scripted one
autopilot = false; // Jump direct to scripted llSitPos()
}
else
{
//Console.WriteLine("Scripted, occupied");
return;
}
}
else // Not Scripted
{
if ( (Math.Abs(offset.X) > 0.5f) || (Math.Abs(offset.Y) > 0.5f) )
{
// large prim & offset, ignore if other Avs sitting
// offset.Z -= 0.05f;
m_avUnscriptedSitPos = offset * partIRot; // (non-zero) sit where clicked
autopilotTarget = part.AbsolutePosition + offset; // World location of clicked point
//Console.WriteLine(" offset ={0}", offset);
//Console.WriteLine(" UnscriptedSitPos={0}", m_avUnscriptedSitPos);
//Console.WriteLine(" autopilotTarget={0}", autopilotTarget);
}
else // small offset
{
//Console.WriteLine("Small offset");
if (!part.IsOccupied)
{
m_avUnscriptedSitPos = Vector3.Zero; // Zero = Sit on prim center
autopilotTarget = part.AbsolutePosition;
//Console.WriteLine("UsSmall autopilotTarget={0}", autopilotTarget);
}
else return; // occupied small
} // end large/small
} // end Scripted/not
cameraAtOffset = part.GetCameraAtOffset();
cameraEyeOffset = part.GetCameraEyeOffset();
forceMouselook = part.GetForceMouselook();
if(cameraAtOffset == Vector3.Zero) cameraAtOffset = new Vector3(0f, 0f, 0.1f); //
if(cameraEyeOffset == Vector3.Zero) cameraEyeOffset = new Vector3(0f, 0f, 0.1f); //
// Is a sit target available?
Vector3 avSitOffSet = part.SitTargetPosition;
Quaternion avSitOrientation = part.SitTargetOrientation;
UUID avOnTargetAlready = part.GetAvatarOnSitTarget();
bool SitTargetUnOccupied = (!(avOnTargetAlready != UUID.Zero));
bool SitTargetisSet =
(!(avSitOffSet.X == 0f && avSitOffSet.Y == 0f && avSitOffSet.Z == 0f &&
(
avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 1f // Valid Zero Rotation quaternion
|| avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 1f && avSitOrientation.W == 0f // W-Z Mapping was invalid at one point
|| avSitOrientation.X == 0f && avSitOrientation.Y == 0f && avSitOrientation.Z == 0f && avSitOrientation.W == 0f // Invalid Quaternion
)
));
if (SitTargetisSet && SitTargetUnOccupied)
{
part.SetAvatarOnSitTarget(UUID);
offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z);
sitOrientation = avSitOrientation;
autopilot = false;
}
pos = part.AbsolutePosition + offset;
//if (Math.Abs(part.AbsolutePosition.Z - AbsolutePosition.Z) > 1)
//{
// offset = pos;
//autopilot = false;
//}
if (m_physicsActor != null)
{
// If we're not using the client autopilot, we're immediately warping the avatar to the location
// We can remove the physicsActor until they stand up.
m_sitAvatarHeight = m_physicsActor.Size.Z;
if (autopilot)
{
if (Util.GetDistanceTo(AbsolutePosition, pos) < 4.5)
{
autopilot = false;
RemoveFromPhysicalScene();
AbsolutePosition = pos + new Vector3(0.0f, 0.0f, m_sitAvatarHeight);
}
}
else
if (m_physicsActor != null)
{
// If we're not using the client autopilot, we're immediately warping the avatar to the location
// We can remove the physicsActor until they stand up.
m_sitAvatarHeight = m_physicsActor.Size.Z;
if (autopilot)
{ // its not a scripted sit
// if (Util.GetDistanceTo(AbsolutePosition, autopilotTarget) < 4.5)
if( (Math.Abs(AbsolutePosition.X - autopilotTarget.X) < 2.0f) && (Math.Abs(AbsolutePosition.Y - autopilotTarget.Y) < 2.0f) )
{
autopilot = false; // close enough
m_lastWorldPosition = m_pos; /* CW - This give us a position to return the avatar to if the part is killed before standup.
Not using the part's position because returning the AV to the last known standing
position is likely to be more friendly, isn't it? */
RemoveFromPhysicalScene();
}
AbsolutePosition = autopilotTarget + new Vector3(0.0f, 0.0f, (m_sitAvatarHeight / 2.0f)); // Warp av to over sit target
} // else the autopilot will get us close
}
else
{ // its a scripted sit
m_lastWorldPosition = part.AbsolutePosition; /* CW - This give us a position to return the avatar to if the part is killed before standup.
I *am* using the part's position this time because we have no real idea how far away
the avatar is from the sit target. */
RemoveFromPhysicalScene();
}
cameraAtOffset = part.GetCameraAtOffset();
cameraEyeOffset = part.GetCameraEyeOffset();
forceMouselook = part.GetForceMouselook();
}
else return; // physactor is null!
ControllingClient.SendSitResponse(targetID, offset, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook);
m_requestedSitTargetUUID = targetID;
Vector3 offsetr; // = offset * partIRot;
// KF: In a linkset, offsetr needs to be relative to the group root! 091208
// offsetr = (part.OffsetPosition * Quaternion.Inverse(part.ParentGroup.RootPart.RotationOffset)) + (offset * partIRot);
// if (part.LinkNum < 2) 091216 All this was necessary because of the GetWorldRotation error.
// { // Single, or Root prim of linkset, target is ClickOffset * RootRot
offsetr = offset * partIRot;
//
// else
// { // Child prim, offset is (ChildOffset * RootRot) + (ClickOffset * ChildRot)
// offsetr = //(part.OffsetPosition * Quaternion.Inverse(part.ParentGroup.RootPart.RotationOffset)) +
// (offset * partRot);
// }
//Console.WriteLine(" ");
//Console.WriteLine("link number ={0}", part.LinkNum);
//Console.WriteLine("Prim offset ={0}", part.OffsetPosition );
//Console.WriteLine("Root Rotate ={0}", part.ParentGroup.RootPart.RotationOffset);
//Console.WriteLine("Click offst ={0}", offset);
//Console.WriteLine("Prim Rotate ={0}", part.GetWorldRotation());
//Console.WriteLine("offsetr ={0}", offsetr);
//Console.WriteLine("Camera At ={0}", cameraAtOffset);
//Console.WriteLine("Camera Eye ={0}", cameraEyeOffset);
ControllingClient.SendSitResponse(part.UUID, offsetr, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook);
m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target
// This calls HandleAgentSit twice, once from here, and the client calls
// HandleAgentSit itself after it gets to the location
// It doesn't get to the location until we've moved them there though
// which happens in HandleAgentSit :P
m_autopilotMoving = autopilot;
m_autoPilotTarget = pos;
m_autoPilotTarget = autopilotTarget;
m_sitAtAutoTarget = autopilot;
m_initialSitTarget = autopilotTarget;
if (!autopilot)
HandleAgentSit(remoteClient, UUID);
}
@@ -2132,31 +2272,66 @@ namespace OpenSim.Region.Framework.Scenes
{
if (part != null)
{
//Console.WriteLine("Link #{0}, Rot {1}", part.LinkNum, part.GetWorldRotation());
if (part.GetAvatarOnSitTarget() == UUID)
{
//Console.WriteLine("Scripted Sit");
// Scripted sit
Vector3 sitTargetPos = part.SitTargetPosition;
Quaternion sitTargetOrient = part.SitTargetOrientation;
//Quaternion vq = new Quaternion(sitTargetPos.X, sitTargetPos.Y+0.2f, sitTargetPos.Z+0.2f, 0);
//Quaternion nq = new Quaternion(-sitTargetOrient.X, -sitTargetOrient.Y, -sitTargetOrient.Z, sitTargetOrient.w);
//Quaternion result = (sitTargetOrient * vq) * nq;
m_pos = new Vector3(sitTargetPos.X, sitTargetPos.Y, sitTargetPos.Z);
m_pos += SIT_TARGET_ADJUSTMENT;
m_bodyRot = sitTargetOrient;
//Rotation = sitTargetOrient;
m_parentPosition = part.AbsolutePosition;
//SendTerseUpdateToAllClients();
part.IsOccupied = true;
Console.WriteLine("Scripted Sit ofset {0}", m_pos);
}
else
{
m_pos -= part.AbsolutePosition;
// if m_avUnscriptedSitPos is zero then Av sits above center
// Else Av sits at m_avUnscriptedSitPos
// Non-scripted sit by Kitto Flora 21Nov09
// Calculate angle of line from prim to Av
Quaternion partIRot;
// if (part.LinkNum == 1)
// { // Root prim of linkset
// partIRot = Quaternion.Inverse(part.ParentGroup.RootPart.RotationOffset);
// }
// else
// { // single or child prim
partIRot = Quaternion.Inverse(part.GetWorldRotation());
// }
Vector3 sitTargetPos= part.AbsolutePosition + m_avUnscriptedSitPos;
float y_diff = (m_avInitialPos.Y - sitTargetPos.Y);
float x_diff = ( m_avInitialPos.X - sitTargetPos.X);
if(Math.Abs(x_diff) < 0.001f) x_diff = 0.001f; // avoid div by 0
if(Math.Abs(y_diff) < 0.001f) y_diff = 0.001f; // avoid pol flip at 0
float sit_angle = (float)Math.Atan2( (double)y_diff, (double)x_diff);
// NOTE: when sitting m_ pos and m_bodyRot are *relative* to the prim location/rotation, not 'World'.
// Av sits at world euler <0,0, z>, translated by part rotation
m_bodyRot = partIRot * Quaternion.CreateFromEulers(0f, 0f, sit_angle); // sit at 0,0,inv-click
m_parentPosition = part.AbsolutePosition;
}
part.IsOccupied = true;
m_pos = new Vector3(0f, 0f, 0.05f) + // corrections to get Sit Animation
(new Vector3(0.0f, 0f, 0.61f) * partIRot) + // located on center
(new Vector3(0.34f, 0f, 0.0f) * m_bodyRot) +
m_avUnscriptedSitPos; // adds click offset, if any
//Set up raytrace to find top surface of prim
Vector3 size = part.Scale;
float mag = 2.0f; // 0.1f + (float)Math.Sqrt((size.X * size.X) + (size.Y * size.Y) + (size.Z * size.Z));
Vector3 start = part.AbsolutePosition + new Vector3(0f, 0f, mag);
Vector3 down = new Vector3(0f, 0f, -1f);
//Console.WriteLine("st={0} do={1} ma={2}", start, down, mag);
m_scene.PhysicsScene.RaycastWorld(
start, // Vector3 position,
down, // Vector3 direction,
mag, // float length,
SitAltitudeCallback); // retMethod
} // end scripted/not
}
else
else // no Av
{
return;
}
@@ -2168,11 +2343,36 @@ namespace OpenSim.Region.Framework.Scenes
Animator.TrySetMovementAnimation(sitAnimation);
SendFullUpdateToAllClients();
// This may seem stupid, but Our Full updates don't send avatar rotation :P
// So we're also sending a terse update (which has avatar rotation)
// [Update] We do now.
//SendTerseUpdateToAllClients();
}
public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
{
// KF: 091202 There appears to be a bug in Prim Edit Size - the process sometimes make a prim that RayTrace no longer
// sees. Take/re-rez, or sim restart corrects the condition. Result of bug is incorrect sit height.
if(hitYN)
{
// m_pos = Av offset from prim center to make look like on center
// m_parentPosition = Actual center pos of prim
// collisionPoint = spot on prim where we want to sit
// collisionPoint.Z = global sit surface height
SceneObjectPart part = m_scene.GetSceneObjectPart(localid);
Quaternion partIRot;
// if (part.LinkNum == 1)
/// { // Root prim of linkset
// partIRot = Quaternion.Inverse(part.ParentGroup.RootPart.RotationOffset);
// }
// else
// { // single or child prim
partIRot = Quaternion.Inverse(part.GetWorldRotation());
// }
float offZ = collisionPoint.Z - m_initialSitTarget.Z;
Vector3 offset = new Vector3(0.0f, 0.0f, offZ) * partIRot; // Altitude correction
//Console.WriteLine("sitPoint={0}, offset={1}", sitPoint, offset);
m_pos += offset;
// ControllingClient.SendClearFollowCamProperties(part.UUID);
}
} // End SitAltitudeCallback KF.
/// <summary>
/// Event handler for the 'Always run' setting on the client
@@ -2202,7 +2402,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
/// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
/// <param name="rotation">The direction in which this avatar should now face.
public void AddNewMovement(Vector3 vec, Quaternion rotation)
public void AddNewMovement(Vector3 vec, Quaternion rotation, bool Nudging)
{
if (m_isChildAgent)
{
@@ -2279,7 +2479,7 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Add the force instead of only setting it to support multiple forces per frame?
m_forceToApply = direc;
m_isNudging = Nudging;
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
@@ -2294,7 +2494,7 @@ namespace OpenSim.Region.Framework.Scenes
const float POSITION_TOLERANCE = 0.05f;
//const int TIME_MS_TOLERANCE = 3000;
SendPrimUpdates();
if (m_newCoarseLocations)
{
@@ -2330,6 +2530,9 @@ namespace OpenSim.Region.Framework.Scenes
CheckForBorderCrossing();
CheckForSignificantMovement(); // sends update to the modules.
}
//Sending prim updates AFTER the avatar terse updates are sent
SendPrimUpdates();
}
#endregion
@@ -3146,6 +3349,7 @@ namespace OpenSim.Region.Framework.Scenes
m_callbackURI = cAgent.CallbackURI;
m_pos = cAgent.Position;
m_velocity = cAgent.Velocity;
m_CameraCenter = cAgent.Center;
//m_avHeight = cAgent.Size.Z;
@@ -3234,14 +3438,25 @@ namespace OpenSim.Region.Framework.Scenes
{
if (m_forceToApply.HasValue)
{
Vector3 force = m_forceToApply.Value;
Vector3 force = m_forceToApply.Value;
m_updateflag = true;
// movementvector = force;
Velocity = force;
m_forceToApply = null;
}
else
{
if (m_isNudging)
{
Vector3 force = Vector3.Zero;
m_updateflag = true;
Velocity = force;
m_isNudging = false;
m_updateCount = UPDATE_COUNT; //KF: Update anims to pickup "STAND"
}
}
}
public override void SetText(string text, Vector3 color, double alpha)
@@ -3292,18 +3507,29 @@ namespace OpenSim.Region.Framework.Scenes
{
if (e == null)
return;
//if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f))
// The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents(
// The Physics Scene will send (spam!) updates every 500 ms grep: m_physicsActor.SubscribeEvents(
// as of this comment the interval is set in AddToPhysicalScene
if (Animator!=null)
Animator.UpdateMovementAnimations();
{
if (m_updateCount > 0) //KF: DO NOT call UpdateMovementAnimations outside of the m_updateCount wrapper,
{ // else its will lock out other animation changes, like ground sit.
Animator.UpdateMovementAnimations();
m_updateCount--;
}
}
CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList;
CollisionPlane = Vector4.UnitW;
if (m_lastColCount != coldata.Count)
{
m_updateCount = UPDATE_COUNT;
m_lastColCount = coldata.Count;
}
if (coldata.Count != 0 && Animator != null)
{
switch (Animator.CurrentMovementAnimation)
@@ -3738,6 +3964,32 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
XmlDocument doc = new XmlDocument();
string stateData = String.Empty;
IAttachmentsService attServ = m_scene.RequestModuleInterface<IAttachmentsService>();
if (attServ != null)
{
m_log.DebugFormat("[ATTACHMENT]: Loading attachment data from attachment service");
stateData = attServ.Get(ControllingClient.AgentId.ToString());
doc.LoadXml(stateData);
}
Dictionary<UUID, string> itemData = new Dictionary<UUID, string>();
XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
if (nodes.Count > 0)
{
foreach (XmlNode n in nodes)
{
XmlElement elem = (XmlElement)n;
string itemID = elem.GetAttribute("ItemID");
string xml = elem.InnerXml;
itemData[new UUID(itemID)] = xml;
}
}
List<int> attPoints = m_appearance.GetAttachedPoints();
foreach (int p in attPoints)
{
@@ -3757,9 +4009,26 @@ namespace OpenSim.Region.Framework.Scenes
try
{
// Rez from inventory
UUID asset
= m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p);
string xmlData;
XmlDocument d = new XmlDocument();
UUID asset;
if (itemData.TryGetValue(itemID, out xmlData))
{
d.LoadXml(xmlData);
m_log.InfoFormat("[ATTACHMENT]: Found saved state for item {0}, loading it", itemID);
// Rez from inventory
asset
= m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p, true, d);
}
else
{
// Rez from inventory (with a null doc to let
// CHANGED_OWNER happen)
asset
= m_scene.AttachmentsModule.RezSingleAttachmentFromInventory(ControllingClient, itemID, (uint)p, true, null);
}
m_log.InfoFormat(
"[ATTACHMENT]: Rezzed attachment in point {0} from item {1} and asset {2} ({3})",
@@ -3910,5 +4179,16 @@ namespace OpenSim.Region.Framework.Scenes
m_reprioritization_called = false;
}
}
private Vector3 Quat2Euler(Quaternion rot){
float x = Utils.RAD_TO_DEG * (float)Math.Atan2((double)((2.0f * rot.X * rot.W) - (2.0f * rot.Y * rot.Z)) ,
(double)(1 - (2.0f * rot.X * rot.X) - (2.0f * rot.Z * rot.Z)));
float y = Utils.RAD_TO_DEG * (float)Math.Asin ((double)((2.0f * rot.X * rot.Y) + (2.0f * rot.Z * rot.W)));
float z = Utils.RAD_TO_DEG * (float)Math.Atan2(((double)(2.0f * rot.Y * rot.W) - (2.0f * rot.X * rot.Z)) ,
(double)(1 - (2.0f * rot.Y * rot.Y) - (2.0f * rot.Z * rot.Z)));
return(new Vector3(x,y,z));
}
}
}

View File

@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (EntityBase e in m_presence.Scene.Entities)
{
if (e is SceneObjectGroup)
if (e != null && e is SceneObjectGroup)
m_pendingObjects.Enqueue((SceneObjectGroup)e);
}
}

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

@@ -112,6 +112,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
}
/// <summary>
/// Like osGetAgents but returns enough info for a radar
/// </summary>
/// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
public LSL_List cmGetAvatarList()
{
LSL_List result = new LSL_List();
World.ForEachScenePresence(delegate (ScenePresence avatar)
{
if (avatar.UUID != m_host.OwnerID)
{
if (avatar.IsChildAgent == false)
{
result.Add(avatar.UUID);
result.Add(avatar.PhysicsActor.Position);
result.Add(avatar.Name);
}
}
});
return result;
}
/// <summary>
/// Get the current Windlight scene
/// </summary>

View File

@@ -719,18 +719,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (target != null)
{
UUID animID=UUID.Zero;
lock (m_host.TaskInventory)
m_host.TaskInventory.LockItemsForRead(true);
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
if (inv.Value.Name == animation)
{
if (inv.Value.Name == animation)
{
if (inv.Value.Type == (int)AssetType.Animation)
animID = inv.Value.AssetID;
continue;
}
if (inv.Value.Type == (int)AssetType.Animation)
animID = inv.Value.AssetID;
continue;
}
}
m_host.TaskInventory.LockItemsForRead(false);
if (animID == UUID.Zero)
target.Animator.AddAnimation(animation, m_host.UUID);
else
@@ -752,18 +751,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (target != null)
{
UUID animID=UUID.Zero;
lock (m_host.TaskInventory)
m_host.TaskInventory.LockItemsForRead(true);
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
{
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
if (inv.Value.Name == animation)
{
if (inv.Value.Name == animation)
{
if (inv.Value.Type == (int)AssetType.Animation)
animID = inv.Value.AssetID;
continue;
}
if (inv.Value.Type == (int)AssetType.Animation)
animID = inv.Value.AssetID;
continue;
}
}
m_host.TaskInventory.LockItemsForRead(false);
if (animID == UUID.Zero)
target.Animator.RemoveAnimation(animation);
@@ -1532,6 +1530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(name, out assetID))
{
m_host.TaskInventory.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
{
if (item.Type == 7 && item.Name == name)
@@ -1539,6 +1538,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
assetID = item.AssetID;
}
}
m_host.TaskInventory.LockItemsForRead(false);
}
if (assetID == UUID.Zero)
@@ -1585,6 +1585,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(name, out assetID))
{
m_host.TaskInventory.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
{
if (item.Type == 7 && item.Name == name)
@@ -1592,6 +1593,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
assetID = item.AssetID;
}
}
m_host.TaskInventory.LockItemsForRead(false);
}
if (assetID == UUID.Zero)
@@ -1642,6 +1644,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(name, out assetID))
{
m_host.TaskInventory.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
{
if (item.Type == 7 && item.Name == name)
@@ -1649,6 +1652,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
assetID = item.AssetID;
}
}
m_host.TaskInventory.LockItemsForRead(false);
}
if (assetID == UUID.Zero)

View File

@@ -204,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// Is the sensor type is AGENT and not SCRIPTED then include agents
if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0)
{
sensedEntities.AddRange(doAgentSensor(ts));
sensedEntities.AddRange(doAgentSensor(ts));
}
// If SCRIPTED or PASSIVE or ACTIVE check objects
@@ -309,6 +309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
// in mouselook.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
fromRegionPos = avatar.AbsolutePosition;
q = avatar.Rotation;
}
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
@@ -422,6 +423,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
SceneObjectPart SensePoint = ts.host;
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
Quaternion q = SensePoint.RotationOffset;
if (SensePoint.ParentGroup.RootPart.IsAttachment)
{
// In attachments, the sensor cone always orients with the
// avatar rotation. This may include a nonzero elevation if
// in mouselook.
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
fromRegionPos = avatar.AbsolutePosition;
q = avatar.Rotation;
}
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);

View File

@@ -109,25 +109,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
if (Timers.Count == 0)
return;
Dictionary<string, TimerClass>.ValueCollection tvals;
lock (TimerListLock)
{
// Go through all timers
Dictionary<string, TimerClass>.ValueCollection tvals = Timers.Values;
foreach (TimerClass ts in tvals)
{
// Time has passed?
if (ts.next < DateTime.Now.Ticks)
{
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
// Add it to queue
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
new EventParams("timer", new Object[0],
new DetectParams[0]));
// set next interval
tvals = Timers.Values;
}
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
ts.next = DateTime.Now.Ticks + ts.interval;
}
foreach (TimerClass ts in tvals)
{
// Time has passed?
if (ts.next < DateTime.Now.Ticks)
{
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
// Add it to queue
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
new EventParams("timer", new Object[0],
new DetectParams[0]));
// set next interval
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
ts.next = DateTime.Now.Ticks + ts.interval;
}
}
}

View File

@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_List cmGetWindlightScene(LSL_List rules);
int cmSetWindlightScene(LSL_List rules);
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
LSL_List cmGetAvatarList();
}
}

View File

@@ -80,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
// Avatar Info Commands
string osGetAgentIP(string agent);
LSL_List osGetAgents();
// Teleport commands
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);

View File

@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
}
public LSL_List cmGetAvatarList()
{
return m_CM_Functions.cmGetAvatarList();
}
}
}

View File

@@ -27,6 +27,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Reflection;
using System.Runtime.Remoting.Lifetime;
using OpenSim.Region.ScriptEngine.Shared;
@@ -132,6 +133,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return (eventFlags);
}
[DebuggerNonUserCode]
public void ExecuteEvent(string state, string FunctionName, object[] args)
{
// IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.

View File

@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public const int CHANGED_ALLOWED_DROP = 64;
public const int CHANGED_OWNER = 128;
public const int CHANGED_REGION_RESTART = 256;
public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART
public const int CHANGED_REGION = 512;
public const int CHANGED_TELEPORT = 1024;
public const int CHANGED_ANIMATION = 16384;

View File

@@ -26,6 +26,7 @@
*/
using System;
using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Runtime.Remoting.Lifetime;
using System.Threading;
using System.Reflection;
@@ -309,6 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
}
[DebuggerNonUserCode]
public void llDie()
{
m_LSL_Functions.llDie();

View File

@@ -33,6 +33,7 @@ using System.Threading;
using System.Reflection;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics; //for [DebuggerNonUserCode]
using OpenSim.Region.ScriptEngine.Interfaces;
using OpenSim.Region.ScriptEngine.Shared;
using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
@@ -90,6 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return (int)m_Executor.GetStateEventFlags(state);
}
[DebuggerNonUserCode]
public void ExecuteEvent(string state, string FunctionName, object[] args)
{
m_Executor.ExecuteEvent(state, FunctionName, args);

View File

@@ -27,6 +27,7 @@
using System;
using System.IO;
using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Runtime.Remoting;
using System.Runtime.Remoting.Lifetime;
using System.Threading;
@@ -238,13 +239,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
if (part != null)
{
lock (part.TaskInventory)
part.TaskInventory.LockItemsForRead(true);
if (part.TaskInventory.ContainsKey(m_ItemID))
{
if (part.TaskInventory.ContainsKey(m_ItemID))
{
m_thisScriptTask = part.TaskInventory[m_ItemID];
}
m_thisScriptTask = part.TaskInventory[m_ItemID];
}
part.TaskInventory.LockItemsForRead(false);
}
ApiManager am = new ApiManager();
@@ -429,14 +429,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
{
int permsMask;
UUID permsGranter;
lock (part.TaskInventory)
part.TaskInventory.LockItemsForRead(true);
if (!part.TaskInventory.ContainsKey(m_ItemID))
{
if (!part.TaskInventory.ContainsKey(m_ItemID))
return;
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
permsMask = part.TaskInventory[m_ItemID].PermsMask;
part.TaskInventory.LockItemsForRead(false);
return;
}
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
permsMask = part.TaskInventory[m_ItemID].PermsMask;
part.TaskInventory.LockItemsForRead(false);
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
{
@@ -545,6 +546,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
return true;
}
[DebuggerNonUserCode] //Prevents the debugger from farting in this function
public void SetState(string state)
{
if (state == State)
@@ -556,7 +558,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
new DetectParams[0]));
PostEvent(new EventParams("state_entry", new Object[0],
new DetectParams[0]));
throw new EventAbortException();
}
@@ -639,14 +641,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
/// <returns></returns>
public object EventProcessor()
{
if (m_Suspended)
return 0;
EventParams data = null;
lock (m_Script)
lock (m_EventQueue)
{
EventParams data = null;
if (m_Suspended)
return 0;
lock (m_EventQueue)
lock (m_Script)
{
data = (EventParams) m_EventQueue.Dequeue();
if (data == null) // Shouldn't happen
@@ -672,6 +674,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
if (data.EventName == "collision")
m_CollisionInQueue = false;
}
}
lock(m_Script)
{
//m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this);
@@ -828,6 +833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
new Object[0], new DetectParams[0]));
}
[DebuggerNonUserCode] //Stops the VS debugger from farting in this function
public void ApiResetScript()
{
// bool running = Running;

View File

@@ -30,6 +30,7 @@ using System.IO;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics; //for [DebuggerNonUserCode]
using System.Security;
using System.Security.Policy;
using System.Reflection;
@@ -102,6 +103,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private Dictionary<UUID, IScriptInstance> m_Scripts =
new Dictionary<UUID, IScriptInstance>();
private OpenMetaverse.ReaderWriterLockSlim m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
// Maps the asset ID to the assembly
private Dictionary<UUID, string> m_Assemblies =
@@ -123,6 +126,71 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue();
IWorkItemResult m_CurrentCompile = null;
private void lockScriptsForRead(bool locked)
{
if (locked)
{
if (m_scriptsLock.RecursiveReadCount > 0)
{
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
m_scriptsLock.ExitReadLock();
}
if (m_scriptsLock.RecursiveWriteCount > 0)
{
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
m_scriptsLock.ExitWriteLock();
}
while (!m_scriptsLock.TryEnterReadLock(60000))
{
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire READ lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
if (m_scriptsLock.IsWriteLockHeld)
{
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
}
}
}
else
{
if (m_scriptsLock.RecursiveReadCount > 0)
{
m_scriptsLock.ExitReadLock();
}
}
}
private void lockScriptsForWrite(bool locked)
{
if (locked)
{
if (m_scriptsLock.RecursiveReadCount > 0)
{
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
m_scriptsLock.ExitReadLock();
}
if (m_scriptsLock.RecursiveWriteCount > 0)
{
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
m_scriptsLock.ExitWriteLock();
}
while (!m_scriptsLock.TryEnterWriteLock(60000))
{
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire WRITE lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
if (m_scriptsLock.IsWriteLockHeld)
{
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
}
}
}
else
{
if (m_scriptsLock.RecursiveWriteCount > 0)
{
m_scriptsLock.ExitWriteLock();
}
}
}
public string ScriptEngineName
{
get { return "XEngine"; }
@@ -262,43 +330,45 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public void RemoveRegion(Scene scene)
{
lock (m_Scripts)
lockScriptsForRead(true);
foreach (IScriptInstance instance in m_Scripts.Values)
{
foreach (IScriptInstance instance in m_Scripts.Values)
// Force a final state save
//
if (m_Assemblies.ContainsKey(instance.AssetID))
{
// Force a final state save
//
if (m_Assemblies.ContainsKey(instance.AssetID))
{
string assembly = m_Assemblies[instance.AssetID];
instance.SaveState(assembly);
}
// Clear the event queue and abort the instance thread
//
instance.ClearQueue();
instance.Stop(0);
// Release events, timer, etc
//
instance.DestroyScriptInstance();
// Unload scripts and app domains
// Must be done explicitly because they have infinite
// lifetime
//
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
string assembly = m_Assemblies[instance.AssetID];
instance.SaveState(assembly);
}
// Clear the event queue and abort the instance thread
//
instance.ClearQueue();
instance.Stop(0);
// Release events, timer, etc
//
instance.DestroyScriptInstance();
// Unload scripts and app domains
// Must be done explicitly because they have infinite
// lifetime
//
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
m_Scripts.Clear();
m_PrimObjects.Clear();
m_Assemblies.Clear();
m_DomainScripts.Clear();
}
lockScriptsForRead(false);
lockScriptsForWrite(true);
m_Scripts.Clear();
lockScriptsForWrite(false);
m_PrimObjects.Clear();
m_Assemblies.Clear();
m_DomainScripts.Clear();
lock (m_ScriptEngines)
{
m_ScriptEngines.Remove(this);
@@ -357,22 +427,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
List<IScriptInstance> instances = new List<IScriptInstance>();
lock (m_Scripts)
{
foreach (IScriptInstance instance in m_Scripts.Values)
lockScriptsForRead(true);
foreach (IScriptInstance instance in m_Scripts.Values)
instances.Add(instance);
}
lockScriptsForRead(false);
foreach (IScriptInstance i in instances)
{
string assembly = String.Empty;
lock (m_Scripts)
{
if (!m_Assemblies.ContainsKey(i.AssetID))
continue;
assembly = m_Assemblies[i.AssetID];
}
i.SaveState(assembly);
}
@@ -684,170 +752,181 @@ namespace OpenSim.Region.ScriptEngine.XEngine
}
}
lock (m_Scripts)
ScriptInstance instance = null;
// Create the object record
lockScriptsForRead(true);
if ((!m_Scripts.ContainsKey(itemID)) ||
(m_Scripts[itemID].AssetID != assetID))
{
ScriptInstance instance = null;
// Create the object record
lockScriptsForRead(false);
if ((!m_Scripts.ContainsKey(itemID)) ||
(m_Scripts[itemID].AssetID != assetID))
UUID appDomain = assetID;
if (part.ParentGroup.IsAttachment)
appDomain = part.ParentGroup.RootPart.UUID;
if (!m_AppDomains.ContainsKey(appDomain))
{
UUID appDomain = assetID;
if (part.ParentGroup.IsAttachment)
appDomain = part.ParentGroup.RootPart.UUID;
if (!m_AppDomains.ContainsKey(appDomain))
try
{
try
{
AppDomainSetup appSetup = new AppDomainSetup();
// appSetup.ApplicationBase = Path.Combine(
// "ScriptEngines",
// m_Scene.RegionInfo.RegionID.ToString());
AppDomainSetup appSetup = new AppDomainSetup();
// appSetup.ApplicationBase = Path.Combine(
// "ScriptEngines",
// m_Scene.RegionInfo.RegionID.ToString());
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
Evidence evidence = new Evidence(baseEvidence);
AppDomain sandbox;
if (m_AppDomainLoading)
sandbox = AppDomain.CreateDomain(
m_Scene.RegionInfo.RegionID.ToString(),
evidence, appSetup);
else
sandbox = AppDomain.CurrentDomain;
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
//sandbox.SetAppDomainPolicy(sandboxPolicy);
m_AppDomains[appDomain] = sandbox;
AppDomain sandbox;
if (m_AppDomainLoading)
sandbox = AppDomain.CreateDomain(
m_Scene.RegionInfo.RegionID.ToString(),
evidence, appSetup);
else
sandbox = AppDomain.CurrentDomain;
m_AppDomains[appDomain].AssemblyResolve +=
new ResolveEventHandler(
AssemblyResolver.OnAssemblyResolve);
m_DomainScripts[appDomain] = new List<UUID>();
}
catch (Exception e)
{
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
m_ScriptErrorMessage += "Exception creating app domain:\n";
m_ScriptFailCount++;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
return false;
}
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
//sandbox.SetAppDomainPolicy(sandboxPolicy);
m_AppDomains[appDomain] = sandbox;
m_AppDomains[appDomain].AssemblyResolve +=
new ResolveEventHandler(
AssemblyResolver.OnAssemblyResolve);
m_DomainScripts[appDomain] = new List<UUID>();
}
m_DomainScripts[appDomain].Add(itemID);
instance = new ScriptInstance(this, part,
itemID, assetID, assembly,
m_AppDomains[appDomain],
part.ParentGroup.RootPart.Name,
item.Name, startParam, postOnRez,
stateSource, m_MaxScriptQueue);
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
if (presence != null)
catch (Exception e)
{
ShowScriptSaveResponse(item.OwnerID,
assetID, "Compile successful", true);
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
m_ScriptErrorMessage += "Exception creating app domain:\n";
m_ScriptFailCount++;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
return false;
}
instance.AppDomain = appDomain;
instance.LineMap = linemap;
m_Scripts[itemID] = instance;
}
m_DomainScripts[appDomain].Add(itemID);
lock (m_PrimObjects)
instance = new ScriptInstance(this, part,
itemID, assetID, assembly,
m_AppDomains[appDomain],
part.ParentGroup.RootPart.Name,
item.Name, startParam, postOnRez,
stateSource, m_MaxScriptQueue);
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
if (presence != null)
{
if (!m_PrimObjects.ContainsKey(localID))
m_PrimObjects[localID] = new List<UUID>();
if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
ShowScriptSaveResponse(item.OwnerID,
assetID, "Compile successful", true);
}
if (!m_Assemblies.ContainsKey(assetID))
m_Assemblies[assetID] = assembly;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
if (instance!=null)
instance.Init();
instance.AppDomain = appDomain;
instance.LineMap = linemap;
lockScriptsForWrite(true);
m_Scripts[itemID] = instance;
lockScriptsForWrite(false);
}
else
{
lockScriptsForRead(false);
}
lock (m_PrimObjects)
{
if (!m_PrimObjects.ContainsKey(localID))
m_PrimObjects[localID] = new List<UUID>();
if (!m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Add(itemID);
}
if (!m_Assemblies.ContainsKey(assetID))
m_Assemblies[assetID] = assembly;
lock (m_AddingAssemblies)
{
m_AddingAssemblies[assembly]--;
}
if (instance!=null)
instance.Init();
return true;
}
public void OnRemoveScript(uint localID, UUID itemID)
{
lock (m_Scripts)
lockScriptsForRead(true);
// Do we even have it?
if (!m_Scripts.ContainsKey(itemID))
{
// Do we even have it?
if (!m_Scripts.ContainsKey(itemID))
return;
lockScriptsForRead(false);
return;
}
IScriptInstance instance=m_Scripts[itemID];
m_Scripts.Remove(itemID);
instance.ClearQueue();
instance.Stop(0);
IScriptInstance instance=m_Scripts[itemID];
lockScriptsForRead(false);
lockScriptsForWrite(true);
m_Scripts.Remove(itemID);
lockScriptsForWrite(false);
instance.ClearQueue();
instance.Stop(0);
// bool objectRemoved = false;
lock (m_PrimObjects)
lock (m_PrimObjects)
{
// Remove the script from it's prim
if (m_PrimObjects.ContainsKey(localID))
{
// Remove the script from it's prim
if (m_PrimObjects.ContainsKey(localID))
{
// Remove inventory item record
if (m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Remove(itemID);
// Remove inventory item record
if (m_PrimObjects[localID].Contains(itemID))
m_PrimObjects[localID].Remove(itemID);
// If there are no more scripts, remove prim
if (m_PrimObjects[localID].Count == 0)
{
m_PrimObjects.Remove(localID);
// If there are no more scripts, remove prim
if (m_PrimObjects[localID].Count == 0)
{
m_PrimObjects.Remove(localID);
// objectRemoved = true;
}
}
}
instance.RemoveState();
instance.DestroyScriptInstance();
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
instance = null;
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
if (handlerObjectRemoved != null)
{
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
handlerObjectRemoved(part.UUID);
}
CleanAssemblies();
}
instance.RemoveState();
instance.DestroyScriptInstance();
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
if (m_DomainScripts[instance.AppDomain].Count == 0)
{
m_DomainScripts.Remove(instance.AppDomain);
UnloadAppDomain(instance.AppDomain);
}
instance = null;
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
if (handlerObjectRemoved != null)
{
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
handlerObjectRemoved(part.UUID);
}
CleanAssemblies();
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
if (handlerScriptRemoved != null)
handlerScriptRemoved(itemID);
@@ -1099,12 +1178,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
private IScriptInstance GetInstance(UUID itemID)
{
IScriptInstance instance;
lock (m_Scripts)
lockScriptsForRead(true);
if (!m_Scripts.ContainsKey(itemID))
{
if (!m_Scripts.ContainsKey(itemID))
return null;
instance = m_Scripts[itemID];
lockScriptsForRead(false);
return null;
}
instance = m_Scripts[itemID];
lockScriptsForRead(false);
return instance;
}
@@ -1128,6 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return false;
}
[DebuggerNonUserCode]
public void ApiResetScript(UUID itemID)
{
IScriptInstance instance = GetInstance(itemID);
@@ -1179,6 +1261,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return UUID.Zero;
}
[DebuggerNonUserCode]
public void SetState(UUID itemID, string newState)
{
IScriptInstance instance = GetInstance(itemID);
@@ -1199,11 +1282,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
{
List<IScriptInstance> instances = new List<IScriptInstance>();
lock (m_Scripts)
{
foreach (IScriptInstance instance in m_Scripts.Values)
lockScriptsForRead(true);
foreach (IScriptInstance instance in m_Scripts.Values)
instances.Add(instance);
}
lockScriptsForRead(false);
foreach (IScriptInstance i in instances)
{

View File

@@ -0,0 +1,17 @@
////////////////////////////////////////////////////////////////
//
// (c) 2009, 2010 Careminster Limited and Melanie Thielker
//
// All rights reserved
//
using System;
using Nini.Config;
namespace OpenSim.Services.Interfaces
{
public interface IAttachmentsService
{
string Get(string id);
void Store(string id, string data);
}
}

View File

@@ -57,6 +57,7 @@ namespace OpenSim.Services.LLLoginService
public static LLFailedLoginResponse InventoryProblem;
public static LLFailedLoginResponse DeadRegionProblem;
public static LLFailedLoginResponse LoginBlockedProblem;
public static LLFailedLoginResponse UnverifiedAccountProblem;
public static LLFailedLoginResponse AlreadyLoggedInProblem;
public static LLFailedLoginResponse InternalError;
@@ -80,6 +81,10 @@ namespace OpenSim.Services.LLLoginService
LoginBlockedProblem = new LLFailedLoginResponse("presence",
"Logins are currently restricted. Please try again later.",
"false");
UnverifiedAccountProblem = new LLFailedLoginResponse("presence",
"Your account has not yet been verified. Please check " +
"your email and click the provided link.",
"false");
AlreadyLoggedInProblem = new LLFailedLoginResponse("presence",
"You appear to be already logged in. " +
"If this is not the case please wait for your session to timeout. " +

View File

@@ -164,6 +164,12 @@ namespace OpenSim.Services.LLLoginService
return LLFailedLoginResponse.UserProblem;
}
if (account.UserLevel < 0)
{
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: Unverified account");
return LLFailedLoginResponse.UnverifiedAccountProblem;
}
if (account.UserLevel < m_MinLoginLevel)
{
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel);

View File

@@ -403,6 +403,9 @@
; Distance in meters that shouts should travel. Default is 100m
shout_distance = 100
; Append a prefix to the god avatar names appearing in chat whilst in god mode
; admin_prefix = "@"
[Messaging]
@@ -934,6 +937,9 @@
; Allow the use of os* functions (some are dangerous)
AllowOSFunctions = false
; Allow the user of Careminster functions
AllowCareminsterFunctions = false
; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe
OSFunctionThreatLevel = VeryLow
@@ -1228,6 +1234,9 @@
; For example- http://127.0.0.1:9000/SStats/
; enabled=false
[LandManagement]
; DefaultAdministratorGroupUUID = "";
; DefaultAdministratorParcelName = "";
;;
;; These are defaults that are overwritten below in [Architecture].

View File

@@ -544,6 +544,36 @@
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.ChOdePlugin" path="OpenSim/Region/Physics/ChOdePlugin" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../../../../bin/Physics/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../../../../bin/Physics/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../../../../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Core"/>
<Reference name="OpenMetaverseTypes.dll"/>
<Reference name="Nini.dll" />
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="OpenSim.Region.Physics.Manager"/>
<Reference name="Ode.NET.dll" />
<Reference name="log4net.dll"/>
<Files>
<Match pattern="*.cs" recurse="true">
<Exclude name="Tests" pattern="Tests"/>
</Match>
</Files>
</Project>
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.BulletXPlugin" path="OpenSim/Region/Physics/BulletXPlugin" type="Library">
<Configuration name="Debug">
<Options>