Compare commits

...

1159 Commits

Author SHA1 Message Date
UbitUmarov
4c2523b1c2 Use faster any contact point collision detection for Volumedetect, plus
some clean up
2012-07-12 20:05:00 +01:00
Melanie
906ac4adc4 Revert "Add instrumentation to log finalizer being called. Suppressed for backup"
This reverts commit ea91a36483.
2012-07-12 01:01:43 +02:00
Melanie
bae35ad97e Revert "Place instrumentation in the proper place. This needs reverting, too!"
This reverts commit d9b0b03aa3.
2012-07-12 01:01:29 +02:00
Melanie
c66367e619 Add "gc collect" console command for debugging memleaks 2012-07-12 00:16:19 +02:00
Melanie
d9b0b03aa3 Place instrumentation in the proper place. This needs reverting, too! 2012-07-11 23:54:45 +02:00
Melanie
ea91a36483 Add instrumentation to log finalizer being called. Suppressed for backup
interim copies to avoid spammage. Not for release to the grid, must be
reverted first!
2012-07-11 23:33:13 +02:00
Melanie
59cd0a2419 Change order of operations on backup to ensure keyframe motions are backed
up properly
2012-07-11 23:32:12 +02:00
UbitUmarov
065046845d be paranoic (?) 2012-07-11 21:10:46 +01:00
UbitUmarov
236b5a0298 Replace a Multicast Delegate by a simple list of delegates in access Get
Can't seen more than one evocation on the multicast on this case, even expanding its evocation list (as it should be used in case one fails). With the list i
 do see what we want.
2012-07-11 20:54:55 +01:00
UbitUmarov
6252114ea0 remove expensive and leaked ( in Xengine at least) SayShout timer and
replace it by a simpler function that should do the same (?) (don't like
 much those 10 + 1 bursts)
2012-07-11 09:03:18 +01:00
UbitUmarov
84ab4c4462 ubitODE leaks 2012-07-11 08:13:57 +01:00
UbitUmarov
bb78b327c0 stop keeping references to objects on released items 2012-07-11 06:43:03 +01:00
UbitUmarov
ffececaa81 Merge branch 'avination' into ubitwork 2012-07-11 04:34:44 +01:00
UbitUmarov
7c973235ab Merge branch 'avination' into ubitwork 2012-07-11 04:27:18 +01:00
UbitUmarov
7836933133 Melanie fix: detach SOGs from backup on linking 2012-07-11 03:58:58 +01:00
UbitUmarov
7676ae6f74 clear released minheap items so they don't keep holding references to
objects.
2012-07-11 03:56:39 +01:00
Melanie
b3910a44fa Merge branch 'ubitwork' into avination 2012-07-11 04:03:28 +02:00
Melanie
ac3a2296fa Make sure handles stay intact when removing from the MinHeap 2012-07-11 04:01:20 +02:00
UbitUmarov
b5b763f7e1 add some more memory information to StatsCollector 2012-07-10 19:13:24 +01:00
UbitUmarov
6b8b7007c4 console region restart: Let Xengine not cry all over the place with
errors also. May not be that good, but is not in use in AVN (i hope). Still safer to do a full shutdown and refire the region from a OS tool like a script, monit, etc etc
2012-07-10 18:23:38 +01:00
UbitUmarov
4a91c65dbc Merge branch 'avination' into ubitwork 2012-07-10 17:40:55 +01:00
Melanie
b346e36016 Merge branch 'ubitwork' into avination 2012-07-10 17:14:42 +02:00
UbitUmarov
df55de5b3d lltargetomega efective spinrate now multiplied by gain ( need check ) 2012-07-10 05:51:41 +01:00
UbitUmarov
acec9da95c let SOP AngularVelocity set physics actor angular velocity if it's
physical root prim and not a vehicle. With this llSetAngularVelocity
should work and also llTargetOmega will do the same in this case.
but for now this llTargetOmega is being a normal physical rotation with
damping, and stops with selection. Thats not like SL apparently
2012-07-10 05:37:41 +01:00
UbitUmarov
652ac5f66b more work on llSetAngularVelocity() 2012-07-10 05:28:47 +01:00
UbitUmarov
ca41ec9eb4 let rotationVelocity or AngularVelocity be setted on prims. Limited to
12rad/s
2012-07-10 05:11:06 +01:00
UbitUmarov
0d60568564 changed ODE lib for win32 to version 0.12 2012-07-10 01:29:44 +01:00
ubit
34f4dc29a1 change linux 32bit libode.so to ode version 0.12 2012-07-10 02:24:09 +02:00
ubit
45a6d67db8 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-09 18:23:09 +02:00
UbitUmarov
3a1d46ad44 retry fixing ode getconfiguration() 2012-07-09 17:21:54 +01:00
ubit
e44c735fab Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-09 18:02:27 +02:00
UbitUmarov
a709768085 fix ode getconfiguration 2012-07-09 17:01:52 +01:00
ubit
6dab81aa7b Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-09 17:53:26 +02:00
UbitUmarov
0ac161c9a8 log ODE lib configuration 2012-07-09 16:51:56 +01:00
ubit
e858c19a9a Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-09 14:29:32 +02:00
UbitUmarov
fb8e8dcbce fix ODE dispose plus minor clean. On regions restart ode.dispose seems
to be called with scene still calling simulation, that should be changed,
 for now added a check for a valid world in ode simulation
2012-07-09 13:25:17 +01:00
Melanie
1077d7b6f5 Reinstate parallel fetching of residents and remove a left over return from debugging 2012-07-08 21:53:23 +02:00
ubit
eeca3db642 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-08 15:03:13 +02:00
UbitUmarov
b74d4711bb Merge branch 'avination' into ubitwork 2012-07-08 13:09:32 +01:00
Melanie
1e4c656497 Revamp map block sending to eliminate overload of the grid server connection
and the sim's http client
2012-07-08 10:44:53 +02:00
Melanie
73c5a6e666 Instead of sending 20 records in 2 packets, send just one as we intended in the first place. 2012-07-08 07:42:40 +02:00
Melanie
d3b778ebbe Address map lag issue seen with non-avination viewers 2012-07-08 06:06:33 +02:00
Melanie
470019b52a Change semantics of FromXML on vehicle data to make the serializer a bit cleaner 2012-07-07 19:59:55 +02:00
Melanie
6d5693a866 Merge branch 'ubitwork' into avination 2012-07-07 19:18:20 +02:00
ubit
6090140077 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-07 08:43:56 +02:00
UbitUmarov
09c4c11063 Merge branch 'avination' into ubitwork 2012-07-07 07:43:29 +01:00
UbitUmarov
afa02aa104 fix vehicle to XML string 2012-07-07 07:41:11 +01:00
ubit
5b6d31f268 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-07 04:54:58 +02:00
UbitUmarov
d0f7fb1d35 Merge branch 'avination' into ubitwork 2012-07-07 03:49:31 +01:00
ubit
6a1ccbfef3 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-07 04:20:39 +02:00
UbitUmarov
d50b852d53 ODE turn off material dependent friction while vehicle linear motor is Effective. Increase a bit world damping of velocities 2012-07-07 03:16:41 +01:00
Melanie
de01c0df26 Merge branch 'ubitwork' into avination 2012-07-07 03:17:32 +02:00
Melanie
3024bdd097 Fix storing vehicle data 2012-07-07 02:29:21 +02:00
Melanie
6535f23e4b Add saving vehicle physics data to the database 2012-07-07 02:05:01 +02:00
ubit
d4640f8569 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-06 18:15:58 +02:00
UbitUmarov
ce7864632b added llSetVelocity. will refuse to work on vehicles and on attachments ( this last may need fix) added also some code for llSetAngularVelocity but not working still 2012-07-06 17:13:11 +01:00
ubit
a2c0de4c10 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-06 02:10:05 +02:00
UbitUmarov
ba91d4ba93 Changed GetTexture error code RequestedRangeNotSatisfiable to NotFound, since viewers don't seem to handle that and keep retrying 2012-07-06 01:06:48 +01:00
Melanie
b8c2efa49c Convert the slow request queue into a regular queue and add some cleanup
and locking.
2012-07-06 00:23:05 +02:00
Melanie
bf292ce26f Fix the boo-boo 2012-07-05 23:24:15 +02:00
Melanie
4854d77904 Add an EventType enum and Type field to the poll service event args. This allows
the manager to tell what type of event it is. All events except for lsl http in
go to the "slow queue" which is run once per second as before.
2012-07-05 23:09:20 +02:00
ubit
21ecc1a695 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-04 18:59:42 +02:00
UbitUmarov
bc5d554f54 use the pollEvent timeout paramenter on pooling 2012-07-04 17:58:32 +01:00
ubit
c5d2151674 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-04 18:41:36 +02:00
UbitUmarov
02cb0bf80a added a timeout paramenter to PollServiceEventArgs, so each type can define it's timeout 2012-07-04 17:40:02 +01:00
ubit
5a09964c25 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-04 16:11:47 +02:00
UbitUmarov
e533eef962 *test2* http poll: increased again the pool rate do 10/s but increased timeout to 1s. So data there is less delay when there is new data, but enought waiting time for it to be avaiable 2012-07-04 15:07:10 +01:00
ubit
47170ba753 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-04 07:16:27 +02:00
UbitUmarov
b2fa20001f *test* slow http retries pool rate to original 1s 2012-07-04 06:14:47 +01:00
ubit
a5247448c5 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-04 05:19:44 +02:00
Melanie
13640a256a Merge branch 'ubitwork' into avination 2012-07-02 02:09:15 +02:00
Melanie
4f04ec5fc2 Implement the buggy version of llXorBase64Strings() for compatibility's sake 2012-07-02 02:04:56 +02:00
Melanie
7eb95c9ed9 Bring casing of llSHA1String in line with SL 2012-07-01 18:05:35 +02:00
ubit
c5d4918b34 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-07-01 02:42:10 +02:00
UbitUmarov
d3f1fc79e5 *TO CHECK/REVIEW/REVERT/TEST whatever* pollService new requests get enqueued to unified requests queue directly. Retries get into that every 100ms. 3 working threads as before plus another that only does retries timming. 2012-07-01 01:33:20 +01:00
UbitUmarov
96270b1b28 Merge branch 'avination' into ubitwork 2012-07-01 00:08:31 +01:00
UbitUmarov
ec7c7fe5f8 ubitode: create and use 4 off world collision spaces for offworld static prims 2012-06-30 08:49:07 +01:00
Melanie
e9e409a794 Remove spammy debug 2012-06-29 22:37:16 +02:00
ubit
1d628ebaa3 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-29 04:45:38 +02:00
UbitUmarov
38cdf77cef in CreateAvatarUpdateBlock() change updateflags to 0. Original flags seem prim related only. This does fix the wrong viewer side move of a avatar in prim edition mode (anv mantis 854), with no apparent side effects .. may need more testing 2012-06-29 03:41:04 +01:00
Melanie
2870659b5c Merge branch 'ubitwork' into avination 2012-06-29 04:03:24 +02:00
ubit
8ebc6e9090 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-29 02:20:54 +02:00
UbitUmarov
7ab8bc0a60 don't recoil attachments doing llRezObject() 2012-06-29 01:17:53 +01:00
UbitUmarov
58b4417140 Merge branch 'avination' into ubitwork 2012-06-29 01:00:38 +01:00
Melanie
f0f928dce1 Merge branch 'ubitwork' into avination 2012-06-29 01:04:48 +02:00
Melanie
0d26e271c9 stop chat being sent to child avs again. 2012-06-29 01:02:22 +02:00
Melanie
498820a74f Merge branch 'ubitwork' into avination 2012-06-28 22:06:02 +02:00
Melanie
c87f0ac226 Fix llRegionSayTo the right way 2012-06-28 21:23:42 +02:00
Melanie
8a03c153d5 Return NPC instead of AGENT in the detect parameters for touch, collision and
sensor.
2012-06-28 20:29:37 +02:00
ubit
46d1ea9e97 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-28 13:26:46 +02:00
UbitUmarov
29abb7d62a reactivate physics raycasts on llCastRay() until it's clear what is its problem if any... 2012-06-28 12:20:55 +01:00
UbitUmarov
de10a16546 Merge branch 'avination' into ubitwork 2012-06-28 10:57:47 +01:00
Melanie
625041f1db Comment out a spammy message that will spew 4 lines for each request to a
nonexistent URL for http-in
2012-06-27 00:10:51 +02:00
Melanie
9a8de52940 Add an event to the poll service manager thread to allow starting it
when needed rather than once per second. That is just too slow!
2012-06-26 10:49:37 +02:00
Melanie
2548d15878 Disable physics raycast until it can be seen to. Fix distance calculation
for some results.
2012-06-26 10:48:52 +02:00
Melanie
2ea8d820b0 Correct a wrong error constant 2012-06-26 10:48:27 +02:00
Melanie
fcb34efa95 Prevent bad prim in the database from crashing the sim, list affected
ids and skip them.
2012-06-26 10:47:35 +02:00
UbitUmarov
9ca9770cf6 fix a seg fault in sp.cs 2012-06-25 00:44:09 +01:00
ubit
b3d88f545d Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-22 19:31:04 +02:00
UbitUmarov
1468b01afc coment out some of previus debug messaged before forgetting about them... 2012-06-22 18:29:46 +01:00
ubit
a1a765d2dd Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-22 19:18:33 +02:00
UbitUmarov
0de3ad5307 more debug 2012-06-22 18:18:12 +01:00
ubit
dc25d9e6d3 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-22 19:11:26 +02:00
UbitUmarov
646b7fb8f2 i more debug 2012-06-22 18:10:53 +01:00
ubit
de26ea4643 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-22 19:05:03 +02:00
UbitUmarov
ba58d7a9b2 add a temp debug message 2012-06-22 18:04:12 +01:00
ubit
25e4fda7a1 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-21 20:07:56 +02:00
UbitUmarov
c8f7cd60cd fix turning off phanton always decreasing number of physical parts 2012-06-21 19:05:36 +01:00
ubit
9b5f840d19 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-21 10:43:00 +02:00
UbitUmarov
909572ed86 fix SceneGraph Add/Remove PhysicalPrim counters 2012-06-21 09:40:51 +01:00
UbitUmarov
ca22feb09a don't send a lot of avatar data when we are just changing position or rotation ( SendTerseUpdateToAllClients() in place of SendAvatarDataToAllAgents() ) 2012-06-17 13:28:33 +01:00
ubit
d068468f53 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-17 12:52:10 +02:00
UbitUmarov
8cf414ba32 *CHECK/REVIEW* comented out not used sp.ParentPosition. Comented out SOG.AbsolutePosition changing 'linked' avatars positions ( reason in code coment ) 2012-06-17 11:38:40 +01:00
ubit
e535f51fec Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-17 10:10:57 +02:00
UbitUmarov
e7aceae3e0 split ugly expression in a if making it simpler to read 2012-06-17 09:06:25 +01:00
UbitUmarov
e2b9a5d7aa Don't let scripts rotate root part of physical linksets like SL, Update client rotation of avatars 'linked' to child parts. (put back some 'cosmetics' from previus commit). Still let lsl api use physics engine ideia of part Physical state on this where it should be SOP ideia, so is that is clear that sync with engine is SOP responsability. 2012-06-17 08:54:39 +01:00
Melanie
ffc0badaf4 Reapply the one change that was in the revert that was actually function, not
form
2012-06-15 15:18:57 +02:00
UbitUmarov
5d32979170 Revert changes...
This reverts commit c8227e1bb7.
2012-06-15 14:31:35 +01:00
UbitUmarov
db2dcbbe2d SL doesn't let scripts rotate root part of physical linksets also fix sitting avatars rotations broken in previus commit, forcing send of updates. 2012-06-15 14:10:16 +01:00
UbitUmarov
065cda3711 Add sop IsPhysical and IsPhantom to be used gradually in core in place of asking physics engines all the time. Some engines delays may make them give wrong answers. 2012-06-15 12:19:42 +01:00
UbitUmarov
c8227e1bb7 only rotation of root part change parts positions, so only call ResetChildPrimPhysicsPositions() if root part. Plus 'cosmetics' 2012-06-15 11:24:37 +01:00
ubit
9b9332782d Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-13 06:19:40 +02:00
UbitUmarov
aac80550e0 Merge branch 'avination' into ubitwork 2012-06-13 05:16:18 +01:00
ubit
88438c097a Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-13 06:13:22 +02:00
UbitUmarov
7bd274b3d3 Changed t adding the avatar dependent sit offset and not subtracting, so not to break inworld contents. SL ported scripts will show a sit error around 0.1m. Added respective compensation in LSL api to maintain coerence. Fixed several bugs still on SET/GET[link]PrimitiveParams[fast] and llGetObjectDetails() 2012-06-13 04:59:09 +01:00
UbitUmarov
b30c23eba4 convert a LSL rotation of <0,0,0,0> to <0,0,0,1> and not <0,0,1,0> in SitTarget. Something seems to be doing that before this gets called, but just in case... 2012-06-13 02:50:39 +01:00
ubit
cbeb7c8aef Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-13 03:07:54 +02:00
UbitUmarov
4027c8e9c9 Fixed llGetObjectDetails(), OBJECT_ROT for sitting avatars case, plus 'cosmetics' and added some parts costs information. 2012-06-13 01:51:22 +01:00
UbitUmarov
b4ab9a7350 *TEST this will affect inworld sittargets by +-0.1m, so may be very BAD *. Changed the sign of the sitoffset dependent on avatar size in SP.cs. Removed that offset correction from SET/GET..primitiveParams in LSL api. If the sign needs to be the previus one, then all references to avatar positions on LSL api need to be fixed with that correction, not only SET/GETprimitiveParams. 2012-06-13 01:26:15 +01:00
Melanie
ff450d29da Add detecting non-physical phantoms back into raycast 2012-06-13 01:59:54 +02:00
ubit
bbad68a65a Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-12 09:09:05 +02:00
UbitUmarov
f51ef99bd5 try to replicate SL bug of PRIM_ROTATION also for avas, est a fix to other cases 2012-06-12 08:05:40 +01:00
ubit
9997466632 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-12 07:02:14 +02:00
UbitUmarov
5784b3eb31 fix the try.. finally in SetPrimitiveParams i did mess and add one for the avatars case, so to optimize a bit 'warp' scripts. 2012-06-12 05:57:28 +01:00
UbitUmarov
8b5342f613 more changes to Get and Get primitiveparams: Let Get remove avatarheight adjust,add Get PRIM_LINK_TARGET handling, changed avatar Set positions code... 2012-06-12 05:21:49 +01:00
ubit
aad7b4a192 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-12 03:22:19 +02:00
UbitUmarov
5fd6f678a4 Moved auxiliar funtions of last commit from sop to lsl api since they are only used on one place each 2012-06-12 02:20:47 +01:00
ubit
6ccf746226 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-12 02:29:06 +02:00
UbitUmarov
24e8e5d818 *UNTESTED* extended llGet*PrimitiveParam() to support avatars. Some auxiliar code in SOP.cs 2012-06-12 01:26:03 +01:00
ubit
124bf79658 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-12 00:17:18 +02:00
UbitUmarov
cd49949478 change object drag so it applies a impulse and not a push force so it works as before my fix to impulse/forces 2012-06-11 22:43:35 +01:00
UbitUmarov
0e045ea3d5 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-11 19:45:15 +01:00
UbitUmarov
d151b334fa Merge branch 'avination' into ubitwork 2012-06-11 19:39:00 +01:00
Melanie
853449d5bc Make llTeleportAgent conform to Magnum SL Server and add llTeleportAgentGlobalCoords() 2012-06-08 23:37:25 +02:00
Melanie
efff5a7c0d Fix a corner case where checking for region corssing may cross an avatar back if
it's pending to be sat onto a vehicle that is in the process of crossing.
2012-06-08 18:25:36 +02:00
ubit
2992fc0e72 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-08 16:55:03 +02:00
Melanie
1eee525c88 Revert "Add a frame based watchdog function to keyframed motion"
This reverts commit 2d98d6354c.
2012-06-08 16:54:47 +02:00
UbitUmarov
22437af26a *UNTESTED* fix PRIM_LINK_TARGET. Make it work on avatars, set any pending position change on others; don't assume m_host is in same grp that part (possible always is)... 2012-06-08 15:48:46 +01:00
UbitUmarov
f0a6ec151a *UNTESTED* let SetPrimParams for avatars parse even unsupported parameters so that if a supported one is in the middle of then it still works. 2012-06-08 15:27:21 +01:00
UbitUmarov
9d878591c8 *UNTESTED* added PRIM_POS_LOCAL and PRIM_ROT_LOCAL in SetPrimParams for avatars. Stopped setting position twice in normal SetPrimParams 2012-06-08 14:29:02 +01:00
Melanie
21c3cf3dc3 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-08 15:16:20 +02:00
Melanie
dadac6816b Merge branch 'ubitwork' into avination 2012-06-08 15:15:17 +02:00
Melanie
2d98d6354c Add a frame based watchdog function to keyframed motion 2012-06-08 15:14:38 +02:00
ubit
e7731961a8 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-08 14:55:17 +02:00
Melanie
22906386b4 Replace the stock libomv with our home grown 0.9.1 with the texture bug fixed. 2012-06-08 03:25:51 +02:00
Melanie
038acc39be Cut off collision sounds with avatar at 3.2. This makes most walkig collisions
with walls and stairs silent. Falls from greater height and running into things
will still be heard. a CollisionSound defined for the object will override this
so one can still script a soccer ball with sounds.
2012-06-08 00:09:30 +02:00
Melanie
ad1df33006 Further limit the amount of avatar collisions that will actually trigger
sounds. They are distracting.
2012-06-07 23:41:10 +02:00
Melanie
b700f58d5e Typo fix 2012-06-07 23:41:00 +02:00
Melanie
26c5b32988 Add the ability to query the MYSQL databse for a list of the stored prim UUIDs 2012-06-07 22:39:03 +02:00
Melanie
4942314435 Implement playing of the real collision sounds, change scaling for avatar
collisions to make them really soft because otherwise climbing stairs
makes an unbearable amount of noise.
2012-06-07 20:51:03 +02:00
Melanie
095dbf0ece Fix not sending TransferInfo when an asset is not found. This clogs
up the sound pipeline in the viewer.
2012-06-07 19:51:32 +02:00
Melanie
354ac8c978 Add collision sounds to the asset set 2012-06-07 19:02:43 +02:00
Melanie
f5cbe56c56 Make not_at_target stop when the target is reached even if the script
is not listening to at_target
2012-06-07 19:01:33 +02:00
Melanie
31bc9c3ad3 Typo correction 2012-06-07 18:04:09 +02:00
Melanie
64aefe9c28 Disable default collision sounds until they can be uploaded, but enable custom ones 2012-06-07 17:59:38 +02:00
Melanie
91557f18cd Set collision sound type so custom sound types are recognized 2012-06-07 17:59:20 +02:00
Melanie
e93308072e Make the "delay restart" button delay restart for 1 hour rather than aborting
it altogether. Allow a maximum of three uses before the restart goes through.
2012-06-07 16:32:07 +02:00
Melanie
a945105003 Make timed bans / timed passes work as expected. Prevent transmission of media
URLs to banned clients.
2012-06-07 00:24:33 +02:00
Melanie
5876a4d392 Prevent a null ref when getting the velocity of an avatar during login or
logout.
2012-06-07 00:24:07 +02:00
ubit
b5a908033c Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-05 06:55:15 +02:00
UbitUmarov
bdc62144ae fix the real cause of double velocity 2012-06-05 05:53:44 +01:00
UbitUmarov
372b76031b revert last bad commit but fix recoil direction 2012-06-05 05:52:25 +01:00
ubit
d9cbe6a16e Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-05 05:50:22 +02:00
UbitUmarov
768447e41b Stop llRezAtRoot() from applying velocity setting impulse in World.RezObject, doing it only in itself, so its applyed after resuming scripts etc. It was giving twice the requested velocity. 2012-06-05 04:43:23 +01:00
ubit
fd8cb45664 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-05 04:00:34 +02:00
Melanie
170b820a11 Fix land collisions to work like SL. 2012-06-05 01:53:25 +02:00
ubit
454445fe6a Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-05 00:50:24 +02:00
Melanie
fd176aab8f Actually trigger land collisions in the root even when a child collides 2012-06-04 22:41:29 +02:00
ubit
b0f6c9330a Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-06-04 21:38:40 +02:00
UbitUmarov
401b97788f fix addforce/impulse. 2012-06-04 20:35:12 +01:00
Melanie
1d75220fcc Merge branch 'ubitwork' into avination 2012-06-04 21:09:42 +02:00
Melanie
28e5abd917 Fix llAttachToAvatar and "Attach" viewer option to preserve saved attach positions. 2012-06-04 21:05:56 +02:00
Melanie
207a5f17b5 When regions are set to shut down the instance, always send notifications to
all affected regions and disregard the region id parameter.
2012-06-03 13:43:39 +02:00
Melanie
928e3e9e21 Fix LSL animation state reporting and animation state transitions on crossing 2012-06-01 23:04:28 +02:00
Melanie
d8f6faa89e Fix impersonation, it got broken in a merge 2012-06-01 23:04:13 +02:00
Melanie
4b3cb91ce8 Remove the kill record. Core has removed it long ago and it really does more harm than good these days 2012-06-01 00:12:04 +02:00
ubit
40c0f6a688 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-30 22:37:56 +02:00
UbitUmarov
cc903992dd ubitode prim: if makebody() is called already having a body, do a full destrution so there are no 'leaks'. 2012-05-30 21:32:15 +01:00
Melanie
c548f48791 Guard setting the building flag 2012-05-30 19:32:02 +02:00
Melanie
0587079115 Whitespace fix 2012-05-30 19:25:52 +02:00
Melanie
86f786d673 Prevent multiple requests to go physical from reaching the physics plugin 2012-05-30 16:10:01 +02:00
Melanie
4358bb8f85 Fix the log standing attach-from-world bug. 2012-05-30 00:50:47 +02:00
ubit
927e026b6d Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-29 20:14:39 +02:00
UbitUmarov
3e9a831e87 fix physics not reporting collisions only with terrain 2012-05-29 19:13:27 +01:00
Melanie
100d2968c4 Add advanced collision processing into ScenePresence 2012-05-29 17:24:17 +02:00
Melanie
10e9ad0086 Fix collision filtering 2012-05-29 16:56:04 +02:00
ubit
4f08dae24b Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-28 23:25:51 +02:00
UbitUmarov
dbbfe0cdd7 fix avatars collisions on sim crossings and other few cases where freemove() is called 2012-05-28 22:23:32 +01:00
UbitUmarov
2122c336b0 a bit cleaner code (?) on sculpts/meshs meshing checking 2012-05-28 14:44:06 +01:00
UbitUmarov
60cebe9a5b let meshs work indenpendently of mesh_sculpted_prim config option 2012-05-28 14:32:16 +01:00
ubit
657dbb51af Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-28 14:17:28 +02:00
UbitUmarov
5141f4075f Merge branch 'avination' into ubitwork
Conflicts:
	OpenSim/Region/Framework/Scenes/CollisionSounds.cs
2012-05-28 13:13:01 +01:00
UbitUmarov
121433d03a disable collision sounds for now 2012-05-28 13:10:02 +01:00
UbitUmarov
20baa6334c revert making sculpts phanton if sculpt meshing option is off 2012-05-28 13:05:50 +01:00
Melanie
b70fb7df78 Place the return back into collision sounds. 2012-05-28 11:28:46 +02:00
Melanie
ca3b229e94 If a region is not found on a simulator, make the health query return
0 to indicate it's still starting rather than an error. There are other
methods that can discover the presence of a region and slow starting regions
may cause the watchdog to kill them while they start,
2012-05-28 09:15:24 +02:00
Melanie
c5e73c0cb8 Merge branch 'ubitwork' into avination 2012-05-28 02:19:29 +02:00
Melanie
bbaf450c30 Modify SceneManeger to use a DoubleDictionary and work without locks.
Changes to the scenes dictionary are exceedingly rare and using atomic
operations makes the chance of collisions nearly nil in any case.
2012-05-28 02:14:14 +02:00
UbitUmarov
f740c9522a Let OOB information usable outside ubitode 2012-05-27 14:01:42 +01:00
UbitUmarov
d2260423e5 also don't collide sculps or meshs if meshing is OFF 2012-05-21 17:11:19 +01:00
UbitUmarov
b92ecc5382 Merge branch 'avination' into ubitwork 2012-05-21 12:47:28 +01:00
ubit
4bbd5fa800 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-21 13:37:34 +02:00
UbitUmarov
85f5789993 try to let avas climb higher steps. Will only work in some cases, may have bad effects, so needs some more testing 2012-05-21 12:35:17 +01:00
Melanie
7305d2e0ef Merge branch 'ubitwork' into avination 2012-05-21 07:32:27 +02:00
UbitUmarov
32e63fc04f missing update script events call 2012-05-20 17:30:01 +01:00
UbitUmarov
11f582b26d minor changes 2012-05-20 13:18:15 +01:00
ubit
e6d228dc0d Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 19:16:17 +02:00
UbitUmarov
2767574d0f fix m_sitAvatarHeight to be half size.z, reduced default to a more resonable value ( 1m); 2012-05-19 18:10:44 +01:00
ubit
944f2c57fa Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 17:37:56 +02:00
UbitUmarov
10889c86d9 reduce useless waste of cpu. Make character collision events be done similiar to parts. Let same thread do it all ( like in parts ) ( to change this some structs copies must be added) 2012-05-19 16:35:48 +01:00
ubit
51f6456442 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 14:55:43 +02:00
UbitUmarov
2c498baf58 a bit faster collision sound type verification plus a few fixes/changes 2012-05-19 13:53:49 +01:00
ubit
cfbd37a4b0 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 13:28:29 +02:00
UbitUmarov
a2c64d9795 temp work: sounds simetric acording to materials, still 'window close' test sound. Included in coment full assimetric ( since seems we have files for it now ) case with some uuids 2012-05-19 12:25:31 +01:00
Melanie
d69f197a5d Fix setting positions of attachments. The recent security fix regarding
prim entry messed it up.
2012-05-19 12:35:07 +02:00
ubit
b94ed8e1cf Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 03:05:16 +02:00
UbitUmarov
9ecdef2686 modulate collision sound intensity with collision relative velocity for parts also 2012-05-19 02:04:10 +01:00
ubit
3a07220111 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 02:11:56 +02:00
UbitUmarov
98a2c7bfee modulate collision sounds intensity with relative collision speed 2012-05-19 01:10:39 +01:00
UbitUmarov
deb87e7890 fix character IsPhysical 2012-05-19 01:01:46 +01:00
ubit
294cbca5e6 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-19 01:21:39 +02:00
UbitUmarov
a7ece8c688 add colliders relative velocity projected in collision direction to collisions report information. 2012-05-19 00:17:37 +01:00
UbitUmarov
0d0c472181 removed redundant colision sounds. Temporary muted sounds ( returns at top of funtions ). 2012-05-17 23:15:07 +01:00
Melanie
24b35b7e93 Merge branch 'ubitwork' into avination
Conflicts:
	OpenSim/Region/Framework/Scenes/CollisionSounds.cs
2012-05-17 22:29:44 +02:00
Melanie
511fc663a2 Temprorarily disable collision sounds until we have some sound bites 2012-05-17 21:36:27 +02:00
ubit
6bee67aca0 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 14:23:00 +02:00
UbitUmarov
7652b3a957 udp transfer: make number packets estimation coerent with number actually sent. Use the safer lower max packet size defined in os source (600) and not OMV one (1100). 2012-05-17 13:13:31 +01:00
ubit
7ba34f29ef Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 13:21:20 +02:00
UbitUmarov
6af78836a5 trigger collision sounds on active agent position for better spatial effect without using the detailed collision position. (current error will be half max physical prim size). Moved some checks from sop to collisionSound code 2012-05-17 12:17:29 +01:00
ubit
b8a71c1195 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 05:43:24 +02:00
UbitUmarov
e4231e95a9 increase avatars collisions report to 10 per sec, Stopped sound on avatar to volumedetect collision 2012-05-17 04:41:46 +01:00
ubit
8411d7f356 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 05:16:51 +02:00
UbitUmarov
038986baff add avatar colision sounds. Changed test sound UUID 2012-05-17 04:14:13 +01:00
ubit
1a32d27879 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 02:37:57 +02:00
UbitUmarov
b743835f9e default colisionVolume is 0, use it only for user specified sound 2012-05-17 01:36:42 +01:00
ubit
845f8423e4 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-17 02:05:46 +02:00
UbitUmarov
7cbc54d92a default collision sounds. Incomplete, untested, needs revision 2012-05-17 01:04:30 +01:00
UbitUmarov
0de7219485 collision sounds: simplify send code a bit and limit sending rate to 5 per sec per part ??? 2012-05-16 23:36:37 +01:00
UbitUmarov
ea47b03625 Added a invalidCollisionSoundUUID so that scripts can stop all collision sounds with llCollisionSound("",...). UUID.Zero means defaults should be used. In case part has several scripts with confliting llCollisionSound result depende on exec order. Specially on reset the efect of "" depends on reset order, it should override the others. This is intermediate improve(?) since collisions sounds seem to need a deaper revision. 2012-05-16 12:27:49 +01:00
ubit
ac718fb805 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-15 18:02:49 +02:00
UbitUmarov
81d7844f51 use part VolumeDetectActive and not rootPart.VolumeDetectActive to be coerent with other places in case of future changes. Should be equivalent if all is well. 2012-05-15 17:01:00 +01:00
UbitUmarov
accab1e086 sop colisions don't play sounds on volume detectors 2012-05-15 16:56:43 +01:00
ubit
9ee6afb887 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-15 17:05:14 +02:00
UbitUmarov
ca14534b91 sop: - added UpdatePhysicsSubscribedEvents() to update physics ator collision events subcription where needed. Made it consider also VolumeDtc and phantom cases. - added extra calls to it on physics ator proprieties changes. - Fixed land collisions reports. - Handle the case of physics sending a last zero colisions reports to trigger collision_end. - Made the physics collisions report rate be 20 per second. (needs review/testing) 2012-05-15 15:54:02 +01:00
UbitUmarov
9d67523235 ubitODE: if stopped having collisions do report zero colisions once, so collision_end event can be triggered. Changed reports rate to the requested rate and not full ode rate. 2012-05-15 15:45:01 +01:00
UbitUmarov
338be76e0a ubitODE: fix not reporting land collisions on same cases. 2012-05-15 13:41:13 +01:00
Melanie
995cd25f30 Port the mel/dahlia fix 2012-05-15 02:36:11 +02:00
UbitUmarov
325973d36f don't send colision events to volume detectors 2012-05-15 01:40:46 +01:00
ubit
2b8231b8b7 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-15 01:09:29 +02:00
ubit
493108be11 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-15 01:08:59 +02:00
UbitUmarov
1b81ce303e Merge branch 'avination' into ubitwork 2012-05-15 00:04:40 +01:00
UbitUmarov
0fb663272a make llGetCameraPos and llGetCameraRot apply to avatar that granted permission and not owner 2012-05-14 23:42:45 +01:00
Melanie
ebdbaba615 Merge branch 'ubitwork' into avination 2012-05-15 00:17:52 +02:00
Melanie
e9e797b681 Fix an omission 2012-05-15 00:15:44 +02:00
Melanie
e3c376156c Completely revamp collision handling. Now works as it is supposed to. 2012-05-14 22:45:54 +02:00
Melanie
e78043cb70 Check parcel entry permissions when moving objects 2012-05-14 01:32:22 +02:00
Melanie
59826c15ce Allow non-gods to deed no-mod objects 2012-05-14 01:21:10 +02:00
ubit
81ec1ab169 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-13 02:29:49 +02:00
UbitUmarov
9870d7e4e7 ubitODE fix force in case of mlinear motor offset present 2012-05-13 01:28:20 +01:00
ubit
56b9d1ff46 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-12 21:09:27 +02:00
UbitUmarov
9b7023a159 display a sleep time of zero if forced spare time to zero, when sim fps is lower than desired, for better display coerence. 2012-05-12 17:58:36 +01:00
ubit
5108f4edf5 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-12 16:33:19 +02:00
UbitUmarov
7461fe4554 TEST MESS* reduce animation packets send. Added onchangeanim event with parameters to define if to add or remove, and if to send anims pack on that evocation, etc 2012-05-12 15:27:37 +01:00
UbitUmarov
cf8b7c8aff Merge branch 'avination' into ubitwork 2012-05-12 14:10:15 +01:00
ubit
d099b4dff9 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-12 15:02:16 +02:00
UbitUmarov
4d98a291a2 ubitODE let vehicles responde faster to changes of some parameters like motors decay times 2012-05-12 14:00:08 +01:00
UbitUmarov
792e8db456 ubitODE reduced again a bit the max allowed correction velocity on colisions, to reduce a bit bouncing inerent to colisions. 2012-05-12 13:44:47 +01:00
ubit
67ee100f2f Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-12 13:19:57 +02:00
UbitUmarov
46095c963c ubitODE: trial workaround for avatar colisions 2012-05-12 12:17:28 +01:00
UbitUmarov
8dd5f08b6e revert terminal vel reduction. It helped but not efective 2012-05-11 15:53:31 +01:00
Talun
e618194143 Mantis 6015 new LSL function llGetAgentList.
Details in the lsl wiki
2012-05-11 02:25:52 +01:00
ubit
08b51a94ac Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-10 23:49:38 +02:00
UbitUmarov
3c37bc2851 reduce avatars terminal velocity to less than 30m/s or colisions with basic boxs fail badly. (ode lib problem. chode just may support a bit higher velocity due to the use of tilt). 2012-05-10 22:44:12 +01:00
ubit
e00c1ec264 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-05-10 19:24:15 +02:00
ubit
9d184c103a direct upload of odedynamics.cs for testing ( ubitode ) 2012-05-10 18:01:35 +02:00
UbitUmarov
d0c0d37d24 ubitode: changes to vehicles servos 2012-05-10 16:17:02 +01:00
Melanie
d3844d142d Merge branch 'ubitwork' into avination 2012-05-07 23:03:57 +02:00
Melanie
74eafb78eb Fix moving no-mod objects. Fixes a regression introduced with the undo fix 2012-05-07 23:03:07 +02:00
UbitUmarov
75c51f33c4 minor change to linear motor decay 2012-05-07 21:44:24 +01:00
UbitUmarov
2ab9588c9a UbitODE: reduced the diference btw dinamic and static friction, making dinamic larger more identical to static. 2012-05-05 11:03:38 +01:00
UbitUmarov
e3226aecd9 SOG: tell physics about when we want a force or a impulse. (sorry add to change here also) 2012-05-05 10:47:51 +01:00
UbitUmarov
3b78e33d16 ubitODE prims: - moved outbounds checking back to UpdatePositionAndVelocity() from move() so it's done at end of each ode step and when it reports positions to core. There should be no need to check in both places. - Addforce() and AddAngularForce now apply a force if parameter pushforce is true or apply a impulse if false as it's actually needed (the prims grab case should be a force) 2012-05-05 10:40:03 +01:00
UbitUmarov
163a86517a force lower avatar density for testing 2012-05-05 03:28:35 +01:00
UbitUmarov
6b3135aa4d UbitODE: leave avatar 'freemove' state (entered on setmomentum) on any significant change like new 'velocity' or new position, etc, requests 2012-05-04 22:24:04 +01:00
Melanie
197163e12a Fix teleporting from older to newer regions 2012-05-04 21:00:41 +02:00
Melanie
333d013b5c Add the default animation to the child agent data update 2012-05-04 20:33:48 +02:00
Melanie
b5b21013da Reverse the order of physics event unsubscription to allow GC. Adapted from Unit's reverted patch 2012-05-04 20:06:42 +02:00
Melanie
1183310a05 Retain velocity on walking crossing - adapted from Ubit's reverted patch 2012-05-04 20:05:51 +02:00
Melanie
88c4c7283f Revert "*TO TEST/REVIEW* added current default animation in animationSet.cs to/fromArray in array element 0. This may cause compatibilities issues, but think this information is needed for proper crossings. OSG regions did survived tps in/out with this. ALso added velocity in crossings cases, for now detected by Teleport flag equal to Default (0);"
This reverts commit 12c9916193.
2012-05-04 20:02:14 +02:00
UbitUmarov
12c9916193 *TO TEST/REVIEW* added current default animation in animationSet.cs to/fromArray in array element 0. This may cause compatibilities issues, but think this information is needed for proper crossings. OSG regions did survived tps in/out with this. ALso added velocity in crossings cases, for now detected by Teleport flag equal to Default (0); 2012-05-04 19:19:54 +01:00
UbitUmarov
58a1a0710c SOG copy bug fix, now new group has own empty list of sitted avatars. Also changed crossing code to restore sitting avas in case of group cross fail 2012-05-04 11:32:37 +01:00
Melanie
2af7f50f26 Stabilize sit position on region crossing 2012-05-03 02:07:55 +02:00
Melanie
9f9693dab8 Clear permissions given to the object we stand up from 2012-05-03 01:18:51 +02:00
UbitUmarov
a135e51d23 Improved sitted avatars crossings ( plus tests on vehicles) 2012-05-02 22:08:09 +01:00
Melanie
8ef2a2b7de Bogus change to get a version number 2012-05-02 00:35:52 +02:00
Melanie
82197c87a2 Merge branch 'ubitwork' into avination 2012-05-02 00:33:37 +02:00
Melanie
98e9f22544 Preserve attachment rotation on objects rezzed via a script. Makes toasters
work right, finally.
2012-05-02 00:29:56 +02:00
Melanie
fc3cf2b5a3 Fix saving of attachment positions 2012-05-01 23:21:28 +02:00
UbitUmarov
303739622c ubitODE fix applyROtationImpulse, let vehicle hover be relative to root prim and not center of mass ( as SL docs said) updated some flags to current ones 2012-04-29 11:46:16 +01:00
UbitUmarov
be176b1e49 ubitode fix inertia for same cases. Added a nasty lock on llGetCenterOfMass and simulate 2012-04-29 08:24:41 +01:00
UbitUmarov
84b5b3e89b llGetGeometricCenter... 2012-04-29 06:39:09 +01:00
UbitUmarov
c7c0d5558b remove repeated set of group rotation to physics 2012-04-29 01:00:46 +01:00
UbitUmarov
df9935273f SOG bug fix in group rotations updates 2012-04-29 00:41:51 +01:00
UbitUmarov
dd745f60c2 fix llGetCenterOfMass ( checked with ubitODE only) 2012-04-28 21:36:38 +01:00
UbitUmarov
e48fa38ff5 Oooops don't hover underground but do hover 2012-04-27 23:18:54 +01:00
UbitUmarov
f5cb403e7e reorder priority of vehicle hover flags 2012-04-27 22:59:57 +01:00
UbitUmarov
ee237fc5df test 2012-04-27 12:19:22 +01:00
UbitUmarov
8ef7df5a56 test 2012-04-27 11:01:34 +01:00
UbitUmarov
2006188ee5 test 2012-04-27 10:49:32 +01:00
UbitUmarov
2419de2b6d test 2012-04-27 10:10:31 +01:00
UbitUmarov
fedc9eb105 itest 2012-04-27 09:50:53 +01:00
UbitUmarov
1c735facee test 2012-04-27 09:23:20 +01:00
UbitUmarov
cadbfcc011 itest 2012-04-27 09:15:31 +01:00
UbitUmarov
b948826b7e test 2012-04-27 09:09:29 +01:00
UbitUmarov
7a7f4b7722 testing 2012-04-27 09:00:30 +01:00
UbitUmarov
03450dee39 testing.... 2012-04-27 08:11:18 +01:00
UbitUmarov
6edbbdc83a ubitODE fix don't report colisions with a volume detector ( only report to it ) 2012-04-27 06:00:50 +01:00
UbitUmarov
e974d493c6 testing 2012-04-27 03:44:15 +01:00
UbitUmarov
d8f691664a testing 2012-04-27 03:36:49 +01:00
UbitUmarov
76d9040ed4 testing 2012-04-27 02:54:39 +01:00
UbitUmarov
911bc81b00 testing 2012-04-27 02:13:54 +01:00
UbitUmarov
a64a9e48de TESTING 2012-04-27 01:43:27 +01:00
UbitUmarov
30ab9647ba TEST more changes 2012-04-27 01:24:44 +01:00
UbitUmarov
61e99fba87 TEST more options to avnLocalTeleport 2012-04-27 01:18:30 +01:00
UbitUmarov
2cf6023892 TEST added avnLocalTeleport(Vector3 newpos, Quaternion? newrot, bool Stopped) to scenepresence.cs 2012-04-27 01:06:07 +01:00
UbitUmarov
fc576df273 revert last add commit 2012-04-26 18:24:36 +01:00
UbitUmarov
f194c48cd3 add wearable type PHYSICS 2012-04-26 17:42:11 +01:00
UbitUmarov
fd19601c6b Help big boobies to dance (avatar visualParams). May not persist and need more lobe ? 2012-04-26 16:17:46 +01:00
UbitUmarov
22ea2ef9a0 set PIDHoverTau and not PIDTau since all physics need that 2012-04-25 17:11:32 +01:00
UbitUmarov
3da613adf5 fix chODE loosing some part positions when doing isPhysical false 2012-04-24 23:13:57 +01:00
UbitUmarov
816a44d6da SOG bug fix in UI object changes 2012-04-24 21:48:12 +01:00
UbitUmarov
f0ba6c84e4 fix animations if sited in ground also 2012-04-24 07:27:14 +01:00
UbitUmarov
a4b76a42cc let objects/avas push avas 2012-04-24 06:56:34 +01:00
UbitUmarov
1848ceac95 "save the catgirls" 2012-04-24 05:42:47 +01:00
UbitUmarov
1cfee4e84c display heatbeat sleep time in stats. This may not be good for general use, but for testing/debug 2012-04-24 04:57:59 +01:00
UbitUmarov
95bb2049a0 fix Simulation time report 2012-04-24 04:01:29 +01:00
UbitUmarov
f1d6b3e710 some reduction on time resolution efects on spare time report 2012-04-24 03:38:13 +01:00
UbitUmarov
b019b20eb8 *testing* changed stats time reports to be per reported frame and not acumulated in about 1second. Total Frame Time is not just 1/reported sim fps 2012-04-24 03:05:29 +01:00
UbitUmarov
5a8fdc8a0b ubitODE - do own timing control (as chODE does) until heartbeat does it right 2012-04-23 20:16:53 +01:00
UbitUmarov
e0f81e2400 ubitODE - several changes... 2012-04-23 01:47:11 +01:00
UbitUmarov
26fd1e3a0c fix a bug i added fixing another.... 2012-04-22 03:08:47 +01:00
UbitUmarov
190e7a4334 ubitODE: - don't try to hover underground unless volumedetector (that doesn't colide with it) 2012-04-21 05:16:54 +01:00
UbitUmarov
3b56c44453 changed seletion code. SOP now knows about parts selection. UI actions are sent to SOP and this reports to SOG. Group is selected if any part is selected.sop.isSelect get() is only used in SOG. Will need to be improved for better performance on largelinksets. *UNTESTED* NEEDS CHECKING for side efects 2012-04-20 18:51:32 +01:00
UbitUmarov
2c7f035925 ubitODE: - Change triangles used in terrain height estimation 2012-04-20 04:49:23 +01:00
UbitUmarov
ec6347f987 ubitODE - again avatar/terrain collision. Reduce new viewers interpolators efects reporting null velocity and aceleration when stopped near the right position, where they can still have instantanius large values that can get magnified by interpolators, specially using diferent timing estimation. 2012-04-20 03:17:36 +01:00
UbitUmarov
aeb5aed5b7 changed - VolumeDetect and phantom setting interaction. Script VD(true) forces phantom ON. UI phantom off turns off VD. Other transitions should only change specific parameter. This is not as current SL. - Fixed volumedetect prims being wrongly removed from physics. 2012-04-19 23:01:22 +01:00
UbitUmarov
9b02e1cf4a Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-04-19 01:52:23 +01:00
Melanie
411bd0574d Allow setting a specific target velocity on TeleportWithMomentum 2012-04-18 22:16:59 +02:00
Melanie
5936e0c376 Allow scripts in attachments owned by the NPC to control the NPC 2012-04-18 19:51:27 +02:00
UbitUmarov
08714a0d38 ubitODE still retouching character pid 2012-04-18 03:59:38 +01:00
UbitUmarov
7f42069295 ubitODE - retouch character PIDs 2012-04-18 03:02:28 +01:00
Melanie
0fe0b2ceec Prevent objects rezzed in sim from being seen as attachments and becoming uneditable or crashers. (Foxtail of death) 2012-04-17 23:39:41 +02:00
UbitUmarov
9464fcebcd ubitODE: prims - update managed dinamic parameters from unmanaged at ODE rate and not heartbeat. 2012-04-17 16:49:08 +01:00
UbitUmarov
9132c9e499 ubitODE: - character managed ode was only getting position etc from unmanaged at heartbeat rate like core ode. Now do it at ODE rate in move(..). UpdatePositionAndVelocity() called once per heartbeat is now empty. 2012-04-17 15:50:14 +01:00
UbitUmarov
d7e2454281 ubitODE: - made avatar/ground collision pid servo a bit softer since seems a bit unstable with small avas in AVI even if fine on my testsite - Removed reading of PID parameters from config files since that only serves to mess things up and adds more unknowns 2012-04-17 14:24:13 +01:00
UbitUmarov
36207b88ff ubitODE: bug fix let avatars colide with volume detectors 2012-04-17 01:00:50 +01:00
Melanie
d30b18b1de Merge branch 'ubitwork' 2012-04-17 00:09:04 +02:00
UbitUmarov
723015e4f0 fix (http://opensimulator.org/mantis/view.php?id=5965) llGetObjectMass was bad for sitted avatars not checking for the null physicsactor 2012-04-16 21:58:25 +01:00
UbitUmarov
6480b72eda ubitODE: - fix remove characters from default raycasts filters as older code (or camera is very odd) - Slow down avatar if velocity is higher than 50m/s as in chODE 2012-04-16 19:44:02 +01:00
Melanie
adb629a416 Merge branch 'ubitwork' 2012-04-16 20:02:15 +02:00
UbitUmarov
fff5c61ae8 chODE: if character velocity > 50m/s apply breaks. In free fall this will give a terminal velocity +- 60m/s 2012-04-16 17:47:17 +01:00
UbitUmarov
04ed5519a5 chODE bug fix 2012-04-16 17:14:31 +01:00
UbitUmarov
f05a977afa Let llCastRay use ubitODE raycast if avaiable plus a few changes/fixes that should be checked. PROBLEM: it will not detect nonphysical phantons :( 2012-04-16 16:35:35 +01:00
UbitUmarov
25a2f97bc2 added suport funtions for ubitODE raycastFiltered 2012-04-16 16:33:57 +01:00
Melanie
03139f07d7 Downgrade an error log message to info because there is nothing we can do if
an asset is damaged so it should not spew red ink.
2012-04-16 17:32:30 +02:00
UbitUmarov
86a2169d73 ubitODE + physmanager: - Revised use of ODE collisions categories and bits(flags) for better use as filters together with top spaces (for example physical prims are on topactivespace and not physical are on topstaticspace) - Added new world raycast with filters. This blocks calling thread with a timeout of 500ms waiting for heartbeat ode thread signal job done. - Don't let ode bodies being disabled for 2 long except for vehicles. This is necessary to detect when the object is at rest at top of other and that is removed. Assume that vehicles can be enabled by used action. 2012-04-16 16:16:55 +01:00
UbitUmarov
3999822e13 Use chode character actor.SetMomentum() to force full restore Velocity in scenepresence TeleportWithMomentum(), since actor.Velocity was selected by original coders as the input of a desired velocity (even 'forces') that is modified by character conditions, like not changing velocity.Z if it is in free fall. 2012-04-14 05:07:52 +01:00
UbitUmarov
b574d43c5d Use presence absolute position to request raycast to camera. Used m_pos maybe a sitting offset. For reasons i don't understand that also seems to crash ode more when i let this rays colide with heighmaps (ubitODE with normal ode lib). 2012-04-13 20:34:56 +01:00
UbitUmarov
5da77e047a don't do Animator.UpdateMovementAnimations() in scenepresence RegionHeartbeatEnd if agent is sitting. Also restore Velocity in teleportWithMomentum() 2012-04-13 17:50:03 +01:00
UbitUmarov
c4a9eae961 make llGetGeometricCenter() work as in current SL. Now this is not real geom center but a average of positions relative to root prim ignoring prims details, so no need to use physics engine. 2012-04-09 23:33:42 +01:00
UbitUmarov
39079a62c0 chODE and ubitODE always return prim mass (they where returning object mass on physical prims) so SOG can do the total add. (ubitODE as more code to use a simpler terrain geom on a modified ode lib but should do autodetect and work with normal lib). 2012-04-09 20:58:40 +01:00
UbitUmarov
87fdb2ed7e llGetMass and llGetObjectMass (and push estimation) always use object mass as in current SL ( push is what makes sense or impulse will depend on what prim it is and not object). Added llGetMassMKS() that just returns 100 x llGetMass() as it seems to be in SL. 2012-04-09 20:53:29 +01:00
UbitUmarov
ad544bdd3d sop.AddToPhysics(..) fixed and in use. For now it seems it needs to set sop.PhysActor, so made it return void. 2012-04-09 18:03:37 +01:00
Melanie
6b5b73bfae Fix a LSL merge artefact 2012-04-08 13:18:03 +02:00
Melanie
b39de2425c Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
	OpenSim/Region/CoreModules/World/Land/LandObject.cs
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-04-07 04:52:14 +01:00
Diva Canto
806082cd6e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-04-06 20:35:01 -07:00
Diva Canto
9637e50956 Moved the inventory manipulation from HGEntityTransferModule to HGInventoryAccessModule where it belongs. They need to exchange some events, so added those to EventManager. Those events (TeleportStart and TeleportFail) are nice to have anyway. 2012-04-06 20:34:31 -07:00
Justin Clark-Casey (justincc)
cce760dbfc Rather than having a FromFolderID property on every single prim and only ever using the root prim one, store on SOG instead.
This reduces pointless memory usage.
2012-04-07 00:40:55 +01:00
Justin Clark-Casey (justincc)
7d8bb33c5b Store FromItemID for attachments once on SOG instead of on every SOP and only ever using the root part entry.
This eliminates some pointless memory use.
2012-04-07 00:33:02 +01:00
Justin Clark-Casey (justincc)
70b5a2dace refactor: Eliminate unnecessary SOP.m_physActor 2012-04-06 23:49:23 +01:00
Justin Clark-Casey (justincc)
33e91f1088 Implement PRIM_POS_LOCAL on llSetPrimitiveParams() and other prim params LSL functions.
This is the same as PRIM_POSITION
2012-04-06 23:43:03 +01:00
Justin Clark-Casey (justincc)
4a58d4c5a4 refactor: Use clearer part.ParentGroup.IsAttachment in LSL_Api.GetPartLocalPos() 2012-04-06 23:36:13 +01:00
Justin Clark-Casey (justincc)
3af1cd65f9 Fix llGetLinkPrimParams for PRIM_POS_LOCAL for child prims whether in scene or attachments.
Return relative position to root prim rather than 0,0,0.
Should fix same issue with llGetLocalPos()
http://opensimulator.org/mantis/view.php?id=5951
2012-04-06 22:41:35 +01:00
Justin Clark-Casey (justincc)
47108bb351 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-04-06 21:15:31 +01:00
Justin Clark-Casey (justincc)
f2903db390 For llGetMass(), return the mass of the avatar is the object is attached.
As per http://lslwiki.net/lslwiki/wakka.php?wakka=llGetMass
This is the mass as used by the physics engine (ODE or Bullet).
2012-04-06 21:14:19 +01:00
Talun
c3a8c00ce0 Addition of missing constants for llGetObjectDetails including for Mantis 5502
Signed-off-by: nebadon <michael@osgrid.org>
2012-04-06 12:42:46 -07:00
Justin Clark-Casey (justincc)
627efc172b Make llGetMass() return total mass of object when called on root prim.
As per http://lslwiki.net/lslwiki/wakka.php?wakka=llGetMass
Aims to resolve http://opensimulator.org/mantis/view.php?id=5954
2012-04-06 20:32:39 +01:00
Justin Clark-Casey (justincc)
908cebbea8 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-04-06 20:29:54 +01:00
Diva Canto
6a9f36788d Deleted the unused and commented code from 2 commits ago. 2012-04-06 12:28:15 -07:00
Diva Canto
4c32f79c10 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-04-06 11:52:38 -07:00
Diva Canto
7435582b70 If an AddItem fails, try adding it to the right folder type. 2012-04-06 11:52:05 -07:00
Diva Canto
25b3edc21c WARNING: LOTS OF COMMENTED AND UNUSED CODE IN THIS COMMIT. This is on purpose; it's an historical record of what works and what doesn't wrt manipulating inventory at the viewer. I'll remove the unused code in a subsequent commit, but wanted to place it in history. The uncommented code works. 2012-04-06 11:51:12 -07:00
Diva Canto
953fe46811 A few minor tweaks here and there in XInventoryService. 2012-04-06 11:48:41 -07:00
Diva Canto
6eaff18961 Finish the implementation of GetUserInventory, even though it's still not used. 2012-04-06 11:38:47 -07:00
Diva Canto
8fd86c9156 Packing of folder in SendBulkUpdateInventory always set the folder type to -1. Not sure if there's a reason for it, but I'm changing it to the given folder type. 2012-04-06 11:24:34 -07:00
Diva Canto
e324fb2415 Guard against null inventory contents. 2012-04-06 11:22:30 -07:00
Diva Canto
cdbe34716f Thank you, BaseHttpServer, for telling me where things go wrong. 2012-04-06 11:21:27 -07:00
Snoopy Pfeffer
67537f3596 Added missing refresh of group membership client side cache to the groups module. Before memberships of non active groups often were not stored in the cache (n_groupPowers). 2012-04-05 13:03:57 +02:00
Snoopy Pfeffer
8f45eb913c Revert last commit 2012-04-05 11:10:05 +02:00
Snoopy Pfeffer
e4406c846d Group based access restrictions to parcels require group membership, but not that this group is active for that user. 2012-04-05 10:25:54 +02:00
Snoopy Pfeffer
600a86bcae Little bug fix in HasGroupAccess, to properly store the case "true" in the cache. 2012-04-05 10:02:18 +02:00
Melanie
a5d6b624f6 Simplify group access checks and break them out into a separate method.
Use existing cache if the avatar is within the region and use an
ExpiringCache to cache status if the avatar is not in the region. The
30 second delay now applies to scripted objects ony and only when the owner
is not present.
2012-04-05 00:45:58 +01:00
Snoopy Pfeffer
36c8fa16c0 Implements group based access restrictions for parcels of land. Because of caching there can be a delay of up to 30 seconds until the access rights are effectively changed for a user. 2012-04-05 00:53:40 +02:00
Melanie
6378abb966 Merge branch 'ubitwork' 2012-04-04 23:57:09 +02:00
Melanie
51d7bffb46 Merge branch 'master' into careminster 2012-04-05 00:48:27 +01:00
Melanie
77caa286a4 Remove some unneeded parens 2012-04-04 23:48:37 +02:00
Melanie
c7419a4d61 Adjust Snoopy's contribution for AVN 2012-04-05 00:36:30 +01:00
Melanie
3a0aac97b4 Merge branch 'master' into careminster 2012-04-04 23:57:50 +01:00
UbitUmarov
016079ef27 minor changes.. a few physicsactor -> pa and a use a constant with |'ed bit fields in place of 6 individual checks ||'ed 2012-04-04 18:24:56 +01:00
UbitUmarov
867d50d14c remove more merge artefacts 2012-04-04 17:01:29 +01:00
UbitUmarov
787cc0d076 reverted changes to llApplyRotationalImpulse execution in SOP/SOG. This functions naming is misleading, Here Apply means to apply a instante impulse that may add to previus unprocessed ones and not setting a permanente torque (that is done by llSetTorque). 2012-04-04 16:38:29 +01:00
UbitUmarov
823895b997 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-04-04 15:43:07 +01:00
Melanie
726915e9ef Fix the last merge artefacts 2012-04-03 23:38:12 +02:00
Melanie
1bded840b9 More artefact 2012-04-03 23:25:34 +02:00
Melanie
dbec5e9859 Fix more merge artefacts 2012-04-03 23:22:47 +02:00
Melanie
7154d480b9 Remove duplicate implementation of Material { get; set; } 2012-04-03 23:18:07 +02:00
Melanie
1c4bcf3fed Fix merge artefacts 2012-04-03 23:13:48 +02:00
Melanie
63c44719f7 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-04-03 23:52:53 +01:00
Garmin Kawaguichi
9a9923405a terrain save-tile extensions Signed-off-by: Garmin Kawaguichi <garmin.kawaguichi@magalaxie.com>
Signed-off-by: Melanie <melanie@t-data.com>
2012-04-03 20:06:03 +01:00
Justin Clark-Casey (justincc)
633f4bb3d8 remove possible PhysActor unexpectedly null race conditions when changing prim collision status
factor out common SOP physics scene adding code into a common SOP.AddToPhysics() that is the counterpart to the existing RemoveFromPhysics()
2012-04-03 09:28:17 +01:00
Justin Clark-Casey (justincc)
e480e25d8b Fix more SOP.PhysActor race conditions in LSL_Api 2012-04-03 06:01:05 +01:00
Justin Clark-Casey (justincc)
7468299673 Eliminate race condition where many callers would check SOP.PhysicsActor != null then assume it was still not null in later code.
Another thread could come and turn off physics for a part (null PhysicsActor) at any point.
Had to turn off localCopy on warp3D CoreModules section in prebuild.xml since on current nant this copies all DLLs in bin/ which can be a very large number with compiled DLLs
No obvious reason for doing that copy - nothing else does it.
2012-04-03 05:51:38 +01:00
UbitUmarov
d5e123c106 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-04-01 11:20:11 +01:00
Melanie
1d8aefd22d Merge branch 'master' into careminster 2012-03-31 02:33:16 +01:00
Melanie
6e7f13a72d Implement bulk inventory update over CAPS (not recursive by design,
do NOT CHANGE THIS, needed for HG 2.0)
2012-03-31 02:32:47 +01:00
Melanie
a6c26b093c Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-31 02:31:57 +01:00
Melanie
f3132c45d9 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
	OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Tests/Common/Mock/TestClient.cs
2012-03-31 02:18:02 +01:00
Justin Clark-Casey (justincc)
32a953fed7 refactor: Rename SOG.GetChildPart() to GetPart() since it can also return the 'root' part. 2012-03-31 01:52:06 +01:00
Justin Clark-Casey (justincc)
f0406f9fe2 Rename SOG.HasChildPrim(uint) to SOG.ContainsPart(uint) to match existing ContainsPart method and remove method duplication.
HasChildPrim is also misleading since the 'root' prim can also be returned.
2012-03-31 01:45:37 +01:00
Justin Clark-Casey (justincc)
387d7fdad5 Allow llRegionSayTo() to work on the PUBLIC_CHANNEL, as per http://wiki.secondlife.com/wiki/LlRegionSayTo
Addresses http://opensimulator.org/mantis/view.php?id=5950
2012-03-31 01:29:13 +01:00
Justin Clark-Casey (justincc)
38d241a317 Add MSSQL login processing fix for servers run on different locales.
This may no longer be an issue with better locale enforcement in OpenSimulator but it doesn't hurt to have this patch.
http://opensimulator.org/mantis/view.php?id=4680
Thanks to controlbreak for this
2012-03-31 01:12:04 +01:00
Justin Clark-Casey (justincc)
69fc8c4985 minor: small message adjustment and unnecessary code elimination when notifying client of no build permission 2012-03-31 01:07:14 +01:00
Justin Clark-Casey (justincc)
c2b98cfd4e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-31 01:04:38 +01:00
PixelTomsen
874140f950 fix Infinite loading on No Rez http://opensimulator.org/mantis/view.php?id=5932 2012-03-31 01:01:59 +01:00
Melanie
8728b9ea81 Implement bulk inventory update over CAPS (not recursive by design,
do NOT CHANGE THIS, needed for HG 2.0)
2012-03-31 01:34:39 +02:00
UbitUmarov
c4e4e04eee reduced instability in vertical atractor with eficiency of 1 and banking
this will need a nicer solution sometime...
2012-03-31 00:03:45 +01:00
Diva Canto
5a8ed50639 Added missing dependency for MS 2008. I hope. (I don't have 2008 to test this) mantis #5949 2012-03-30 12:39:45 -07:00
Justin Clark-Casey (justincc)
e5343bccdf Add Extended flavour option to opensim version information.
This flavour is for changes in addition to the 0.7.3-post-fixes branch that are too large to be considered fixes but should be reasonably stable.
This flavour will almost certainly never see a formal release.
2012-03-30 02:11:32 +01:00
Justin Clark-Casey (justincc)
269e479cdc minor: remove some now unneeded code from FriendsCommandsModule 2012-03-30 02:00:01 +01:00
Justin Clark-Casey (justincc)
3525c876c8 Make default "show friends" console command show friends fetched from the friends service.
There is no a --cache option which will show friends from the local cache if available.
2012-03-30 01:57:38 +01:00
Justin Clark-Casey (justincc)
1ef62ca75e Lock NullFriendsData.m_Data for consistency and against concurrent read/write 2012-03-30 01:23:34 +01:00
Justin Clark-Casey (justincc)
bce7964ac2 refactor: Move "friends show cache" console command out into separate FriendsCommandsModule.
Expose required methods on IFriendsModule.  Rename GetFriends() -> GetFriendsFromCache() for self-documentation
2012-03-30 01:05:29 +01:00
Justin Clark-Casey (justincc)
59157d9d63 Add simple login test with online friends. Add IFriendsModule.GrantRights() for granting rights via a module call.
Rename IFriendsModule.GetFriendPerms() -> GetRightsGrantedByFriend() to be more self-documenting and consistent with friends module terminology.
Add some method doc.
2012-03-30 00:42:55 +01:00
Justin Clark-Casey (justincc)
b8d383da0a Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-30 00:38:23 +01:00
Diva Canto
30db0ac5e2 Finish up the SuitcaseInventory service. 2012-03-29 16:25:55 -07:00
Melanie
5e3999c84c Cache the last maptile and return the cachrd tile if the last request is
less than an hour ago. Avoids generating the maptile twice on startup.
2012-03-29 22:34:33 +02:00
Justin Clark-Casey (justincc)
bf09d6a22b refactor: Stop passing both IClientAPI and agentID to friend event listeners, these are redundant. Replace a few magic numbers with FriendRights enum already used elsewhere. 2012-03-29 18:31:57 +01:00
Melanie
b9d61d5413 Allow the map tile module to be enabled without also eabling refresh 2012-03-29 15:38:12 +02:00
Melanie
807bb85ac2 Allow llTeleportAgent to work in attachments 2012-03-29 14:45:56 +02:00
Justin Clark-Casey (justincc)
012b01f224 Add simple regression test for logging in with offline friends. Don't expect to receive any in this instance. 2012-03-29 03:19:45 +01:00
Justin Clark-Casey (justincc)
cd3f3cbdde Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-29 01:29:00 +01:00
Justin Clark-Casey (justincc)
22a85b947a Add back parts of reverted changes that were not concerned with child agent caching.
This adds ScenePresence to IClientAPI.SceneAgent earlier on in the add client process so that its information is available to EventManager.OnNewClient() and OnClientLogin()
Also add a code comment as to why we're caching friend information for child agents.
2012-03-29 01:26:30 +01:00
Melanie
62b1c807c2 Also add OSS header to interface 2012-03-29 01:14:50 +01:00
Melanie
bd83676d6c Change namespace on CallingCardModule and correct interface file placemant. Also ass OpenSource header 2012-03-29 01:13:08 +01:00
Justin Clark-Casey (justincc)
93ac47f0d3 Revert "Simplify friends caching by only doing this for root agents - no functions require caching for child agents."
We need to cache child agents so that friends object edit/delete permissions will work across boarders on regions hosted by different simulators.

This reverts commit d9f7b8549b.
2012-03-29 01:08:47 +01:00
Justin Clark-Casey (justincc)
a1de9bc33f Revert "Add comment about setting client.SceneAgent in AddNewClient()"
This reverts commit 964cae4f37.
2012-03-29 01:08:37 +01:00
Melanie
b8abd92fc7 Merge branch 'master' into careminster 2012-03-29 00:47:45 +01:00
Melanie
c52ff5cf7b Committing the Avination calling card module 2012-03-29 00:47:09 +01:00
Melanie
5a82d939e6 Adding the Avination calling card interface 2012-03-29 00:34:28 +01:00
Melanie
532e3dad26 Pushing the Avination Calling card hooks. Module to follow. 2012-03-29 00:31:11 +01:00
Justin Clark-Casey (justincc)
964cae4f37 Add comment about setting client.SceneAgent in AddNewClient() 2012-03-29 00:21:14 +01:00
Justin Clark-Casey (justincc)
d9f7b8549b Simplify friends caching by only doing this for root agents - no functions require caching for child agents.
This allows us to avoid unnecessary multiple calls to the friends service.
All friends functions originate from the root agent and only go to other root agents in existing code.
This also allows us to eliminate complex ref counting.
2012-03-28 23:40:25 +01:00
Justin Clark-Casey (justincc)
7aa0c05fba Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-28 23:38:04 +01:00
Justin Clark-Casey (justincc)
33df0c2efd Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-28 23:36:30 +01:00
Robert Adams
4138880464 BulletSim: update 64 bit libraries and change Linux configuration to use the files in the lib32 and lib64 directories as needed. 2012-03-28 15:36:20 -07:00
Diva Canto
6bf4d88397 HG 2.0 Suitcase inventory: proof of concept now working properly with the heavy SendBulkInventoryUpdate message. Waiting for Melanie to finish the light-weight version of that message. 2012-03-28 15:32:19 -07:00
Justin Clark-Casey (justincc)
874bf1f8e5 Enable voice by default on parcels to weaken effects of viewer 2/3 ParcelVoiceInfoRequest bug
Viewer 2/3 contains a bug where the viewer will constantly retry ParcelVoiceInfoRequest requests on voice-disabled parcels where voice is otherwise available.
Attempts to fix this server-side have not been successful - sending a non-OK http code (e.g. a 404) just makes the viewer request again immediately.
Dropping the request entirely is a bit better but the viewer still retries after a minute.
Estate settings already enabled voice by default so doing the same for parcels.  This only has an effect if you have any voice system active at all.
Ultimately, the re-request bug needs to be fixed viewer-side (LL suffers from the same issue!) but it might be worth implementing the drop request hack.
2012-03-28 23:30:28 +01:00
Diva Canto
51dc1e709c HG 2.0: added the beginning of HGSuitcaseInventoryService. Plus moved the hack away from ScenePresence. This is better but it still doesn't restore the inventory upon arrival. 2012-03-28 15:01:37 -07:00
Melanie
a85876bc17 Committing the Avination calling card module 2012-03-28 23:51:44 +02:00
Melanie
7dad1ded2e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
2012-03-29 00:27:35 +01:00
UbitUmarov
1888e174cd Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-28 17:51:56 +01:00
Melanie
e73023b90b Merge branch 'master' into careminster 2012-03-28 04:45:05 +01:00
Diva Canto
03766c010f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 20:38:02 -07:00
Diva Canto
af96b99356 More on switching the root folder from under the viewer. More experiments. 2012-03-27 20:36:54 -07:00
Melanie
614c404923 Typo fix 2012-03-28 03:45:52 +01:00
Diva Canto
4007f62158 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 19:09:03 -07:00
Diva Canto
300968e933 HG: Switch root folders from under the viewer. Towards HG 2.0. This is guarded by an obscure config that no one but me should be using at this point. 2012-03-27 19:08:29 -07:00
Melanie
b24605d526 Fix typos 2012-03-28 02:55:29 +01:00
Justin Clark-Casey (justincc)
514a9fdf8e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-28 02:52:11 +01:00
Justin Clark-Casey (justincc)
12d3ea3029 Add "friends show cache <first-name> <last-name>" command for debugging purposes.
This adds a reverse lookup (name -> ID) to IUserManagement instead of hitting the UserAccountService directly.
2012-03-28 02:51:34 +01:00
Melanie
a43e804e59 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-03-28 02:46:31 +01:00
Melanie
0463a00d34 Start on Bulk inventory update via CAPS. Not functional yet. HG v2 2012-03-28 02:45:50 +01:00
Melanie
8c0f1e9058 Add a corresponding method for items. HG v2 2012-03-28 02:10:07 +01:00
Melanie
710c14fb57 Add SendRemoveInventoryFolders which allows to remove one or more
folders from the viewer's inventory view. For HG v2.0. More to come
2012-03-28 01:49:06 +01:00
Melanie
4ab63bfe97 Typo fix 2012-03-28 02:33:15 +02:00
Melanie
caaf25c326 Merge branch 'master' into careminster 2012-03-28 02:56:31 +01:00
Melanie
300488f862 Merge branch 'master' into careminster 2012-03-28 02:46:54 +01:00
Melanie
b519cf6383 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/Client/IClientInventory.cs
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
	OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
2012-03-28 02:20:40 +01:00
Justin Clark-Casey (justincc)
445e8bc560 minor: Add some documentation to OnNewClient and OnClientClosed events 2012-03-28 01:08:56 +01:00
Justin Clark-Casey (justincc)
cb41fb64be Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-28 01:06:18 +01:00
Melanie
2a8b9a47b2 Add SendRemoveInventoryFolders which allows to remove one or more
folders from the viewer's inventory view. For HG v2.0. More to come
2012-03-28 01:15:56 +02:00
Melanie
b18b1b1d70 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-03-27 23:14:43 +01:00
Melanie
37603ca6da Reverse a conditional in XInventory that made updating system folder evrsion numbers impossible 2012-03-27 23:11:06 +01:00
Diva Canto
db5f46fa23 Let grided simulators retrieve the user's inventory skeleton 2012-03-27 15:24:55 -07:00
Justin Clark-Casey (justincc)
b74a89bc12 minor: clean up some code formatting in VivoxVoiceModule.cs 2012-03-27 22:33:42 +01:00
Diva Canto
5e07336672 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 14:25:36 -07:00
Diva Canto
91950b3147 Amend to previous commit regarding the config name. Bugs bite. 2012-03-27 14:24:59 -07:00
UbitUmarov
de45fe7515 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-27 21:58:25 +01:00
Snoopy Pfeffer
19837ff4dd Two new scripting functions osInviteToGroup(userID) and osEjectFromGroup(userID) that invite/eject users to/from groups the object containing the script is set to. These functions also work for closed groups. 2012-03-27 22:30:02 +02:00
Snoopy Pfeffer
5d37a31436 Merge branch 'master' of ssh://snoopy@opensimulator.org/var/git/opensim 2012-03-27 22:16:25 +02:00
Snoopy Pfeffer
7223b63563 User level based restrictions for HyperGrid teleports, asset uploads, group creations and getting contacted from other grids. Incoming HyperGrid teleports can also be restricted to local users. 2012-03-27 22:09:58 +02:00
Dan Lake
971d32fda3 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 12:51:58 -07:00
Dan Lake
0247d738e2 When loading objects from DB, first add to scene, then call TriggerOnSceneObjectLoaded. 2012-03-27 12:50:58 -07:00
Melanie
a619621c60 Merge branch 'master' into careminster 2012-03-27 20:03:41 +01:00
Diva Canto
de242a29ca HG: beginning of a more restrictive inventory access procedure (optional). Experimental: we'll try switching the root folder from under the viewer. 2012-03-27 11:54:13 -07:00
Melanie
6b5f3b49e7 Merge branch 'master' into careminster 2012-03-27 18:11:05 +01:00
Diva Canto
2e2634896d Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 10:09:08 -07:00
Diva Canto
8131a24cde Send the config section name up to the service classes themselves (XInventory and Assets). 2012-03-27 10:08:13 -07:00
UbitUmarov
9efabe5e1e Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-27 12:07:52 +01:00
Justin Clark-Casey (justincc)
b78224176e Add Garmin Kawaguichi to CONTRIBUTORS.txt 2012-03-27 02:10:39 +01:00
Justin Clark-Casey (justincc)
09c85a6a6c Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-27 02:10:02 +01:00
Garmin Kawaguichi
1aa1a9eb3d In TerrainModule.cs, the command terrain save-tile is modified to remove an unnecessary double argument "minimum Y tile" 2012-03-27 02:05:57 +01:00
Melanie
0964af41be Replace HG linker with core version 2012-03-27 01:46:02 +01:00
Robert Adams
872d513daa BulletSim: make avatar animations update properly.
It seems that ODE calls the avatar collision handling routine even
if there are no collisions. This causes the animation to be updated.
So, for instance, going from HOVER to FLY is caused by the physics engine
calling the collision routine each frame with 0 collisions.
2012-03-26 17:36:33 -07:00
UbitUmarov
caeaa03a69 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-26 23:04:07 +01:00
Robert Adams
84c9bd52d3 BulletSim: update BulletSim binaries and configuration fixing a crash which happens when there are more than a few hundred physical objects. 2012-03-26 13:48:15 -07:00
Melanie
0bd0514e81 Merge branch 'master' into careminster 2012-03-26 16:47:02 +01:00
Melanie
ad865ab4fc Add some more overloads to allow registering overloaded methods and lists
of methods.
2012-03-26 16:46:07 +01:00
Robert Adams
2fcdecf090 BulletSim: fix typo introducted by previous checkins (git merge sometimes makes mistakes) 2012-03-26 08:57:40 -07:00
Robert Adams
f8879e06d2 Merge branch 'bulletsim1' 2012-03-26 08:49:12 -07:00
Robert Adams
3691e39178 BulletSim: update BulletSim.dll and libBulletSim.so with latest versions 2012-03-26 08:48:51 -07:00
Melanie
da9743d1d7 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
2012-03-26 14:22:49 +01:00
Melanie
3810e98474 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Conflicts:
	OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
2012-03-26 14:21:15 +01:00
Melanie
7e0936e4b6 Add a hust UUID to the script invocations 2012-03-26 14:19:55 +01:00
Mic Bowman
055269805d Fix compile error in ScriptModuelComms and add some debugging into the modInvoke
routines to simplify finding method registration issues.
2012-03-25 22:59:06 -07:00
Melanie
98a6c78943 Fix the omission on the interface declaration 2012-03-26 03:33:39 +01:00
Melanie
5f1f956d17 Fix the omission on the interface declaration 2012-03-26 03:32:30 +01:00
Melanie
2c42dafe56 Fix Typo 2012-03-26 03:26:02 +01:00
Melanie
e05c72d32f Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
2012-03-26 03:22:26 +01:00
Melanie
c9c01d5226 Further simplify ScriptComms 2012-03-26 03:20:40 +01:00
Melanie
ac0f1ff0a6 Dynamically create the delegate type to reduce complexity in the caller 2012-03-26 01:47:20 +01:00
Melanie
d7cc194e83 Correct the design error I introduced into ScriptComms. Untested but about to
be.
2012-03-26 01:47:14 +01:00
Melanie
5e8d64c943 Dynamically create the delegate type to reduce complexity in the caller 2012-03-26 01:21:44 +01:00
Melanie
4b76c52c41 Correct the design error I introduced into ScriptComms. Untested but about to
be.
2012-03-26 00:30:52 +01:00
Melanie
44f1f87656 Merge branch 'master' into careminster 2012-03-25 20:07:43 +01:00
Melanie
cb44808504 Simplify the module invocation registration. The types and method name
can be pulled fromt he delegate so we don't need to pass them explicitly
2012-03-25 19:52:38 +01:00
Mic Bowman
a07fa0395f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-24 22:45:17 -07:00
Mic Bowman
a14437ad5a Add support for key, vector, rotation and list types for both
arguments and return values to the modInvoke family of functions.

See http://opensimulator.org/wiki/OSSL_Script_Library/ModInvoke
2012-03-24 22:43:42 -07:00
UbitUmarov
88d5cb6eef UbitOde let caller try to build meshs like done in chode. Changing this was a bad move i made. Variable colisions softness. 2012-03-24 16:04:13 +00:00
UbitUmarov
21a97408d4 Avatars have no bounce 2012-03-24 11:30:29 +00:00
Justin Clark-Casey (justincc)
4f17537555 Allow the user to enter help topics in upper or lowercase.
Forcing uppercase (e.g. help Assets) is too annoying.
Thanks to WhiteStar for pointing this out.
2012-03-24 03:07:01 +00:00
Justin Clark-Casey (justincc)
f03c3c062e Hack example on to "terrain save-tile" extended help.
Thanks to Garmin Kawaguichi for the initially suggested text.
2012-03-24 02:41:45 +00:00
Justin Clark-Casey (justincc)
f53c6b2594 Use system provided temporary file in "terrain save-tile" to avoid problems with drive letters on windows
Thanks to Garmin Kawaguichi for picking up on this and providing an initial solution (which I adapted).
2012-03-24 02:30:43 +00:00
Justin Clark-Casey (justincc)
cf61c74e90 Give feedback when "terrain save-tile" is not successfully invoked. 2012-03-24 02:16:44 +00:00
Robert Adams
07388071d4 Merge branch 'bulletsim1' of ssh://island.sciencesim.com/home/sceneapi/radams1/bs-opensim into bulletsim1
Conflicts:
	OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
2012-03-23 16:20:53 -07:00
Robert Adams
ff54b3c366 BulletSim: change default of shouldDisableContactPoolDynamicAllocation from False to True. It seems that collisions don't happen well when it is False (things fall through terrain). 2012-03-23 15:50:32 -07:00
Robert Adams
3f53b7bc91 BulletSim: Add new configuration parameters to get and set console commands 2012-03-23 13:15:24 -07:00
Robert Adams
142de1d02f BulletSim: add a bunch of internal Bullet configuration parameters to OpenSimDefaults.ini and the code. 2012-03-23 13:15:23 -07:00
Robert Adams
1273f259e4 BulletSim: remove confusion between angularVelocity and rotationalVelocity (there is still confusion in the rest of OpenSim). Enhance some debug statements to include the object ID. 2012-03-23 13:15:22 -07:00
Robert Adams
2f6e8564fe BulletSim: add updated (but not working) BulletSim dlls 2012-03-23 13:15:20 -07:00
Robert Adams
1a738caeca BulletSim: update TODO list. Rearrange code for readability. Add per object friction and restitution runtime settable parameters. 2012-03-23 13:15:18 -07:00
Robert Adams
de24feb275 BulletSim: Add AvatarRestitution parameter. Centralize computation of buoyancy for flying. Tweek avatar default friction and resititution 2012-03-23 13:15:17 -07:00
Robert Adams
6ecdadb329 BulletSim: set buoyancy in only one place 2012-03-23 13:15:16 -07:00
Robert Adams
b22d040169 BulletSim: add some new runtime setable parameters to match the dll. 2012-03-23 13:15:14 -07:00
Robert Adams
6c50442625 BulletSim: update BulletSim.dll to Bullet 2.80 and add libBulletSim.so to the new lib32 and lib64 binary directories 2012-03-23 13:15:13 -07:00
Robert Adams
975184b3f9 BulletSim: Update list of TODO tasks 2012-03-23 13:15:11 -07:00
Robert Adams
164706043d Have the PhysicsParameters module output console command responses
directly to the console rather than logging at INFO (which doesn't
output anything for WARN).

There should really be a WriteLine method on ICommandConsole so all
of the different commands don't have to figure out where the command
output should go.
2012-03-23 13:11:58 -07:00
Melanie
9a67baae21 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-23 14:24:55 +00:00
nebadon
6b87a29c86 fix yield prolog so it compiles with mono 2.11 there has been a bugzilla
report files with mono project in regards to this change, this simply
lets us move forward with using mono 2.11 for now :
https://bugzilla.xamarin.com/show_bug.cgi?id=4052
2012-03-23 02:22:57 -07:00
Melanie
1ae9ab685a Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-23 03:49:22 +00:00
UbitUmarov
4db05a98c2 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-23 03:41:48 +00:00
Justin Clark-Casey (justincc)
d4beb2f5bc Comment out log message about sending periodic appearance updates. 2012-03-23 03:39:39 +00:00
Justin Clark-Casey (justincc)
e5b182fb41 Add information about SendPeriodicAppearanceUpdates to OpenSimDefaults.ini for now.
Default remains false.
2012-03-23 03:38:33 +00:00
Justin Clark-Casey (justincc)
54887bf386 Add experimental SendPeriodicAppearanceUpdates = true/false setting to [Startup] in OpenSim.ini
On osgrid and other places, I have observed that manually sending appearance updates from the console often relieves grey avatar syndrome.
Despite hunting high and low, I haven't been able to find where this packet is sometimes being lost - it might be a persistent viewer bug for all I know.
Therefore, this experimental setting resends appearance data for everybody in the scene every 60 seconds.  These packets are small and the viewer only fetches texture
data if it doesn't already have it.
Default is false.
2012-03-23 03:33:07 +00:00
Justin Clark-Casey (justincc)
4ed833bc9d Add a scene maintenance thread in parallel to the heartbeat thread. The maintenance thread will end up running regular jobs that don't need to be in the main scene loop.
The idea is to make the critical main scene loop as skinny as possible - it doesn't need to run things that aren't time critical and don't depend on update ordering.
This will be done gradually over time to try and uncover any issues.  Many non-criticial scene loop activities are being launched on separate threadpool threads anyway.
This may also allow modules to register their own maintenance jobs without having to maintain their own timers and threads.
Currently the maintenance loop runs once a second, as opposed to the 89ms scene loop.
2012-03-23 02:49:29 +00:00
Melanie
fac89b6671 Merge branch 'master' into careminster 2012-03-23 02:46:49 +00:00
Melanie
2190a62366 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Application/OpenSimBase.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-23 02:44:22 +00:00
Melanie
ade164667f Make anims way more snappy. Decouple SP animation handling from physics frame
time.
2012-03-23 03:16:07 +01:00
Justin Clark-Casey (justincc)
349454ca27 Remove unnecessary shutting down check in Scene.Heartbeat(). Add some method doc. Rename HeartbeatThread, shuttingdown to conform to code standards. 2012-03-23 01:46:11 +00:00
BlueWall
c0672cb7db Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-22 21:27:03 -04:00
BlueWall
176bba4f67 Merge branch 'master' of /home/opensim/src/opensim 2012-03-22 21:26:30 -04:00
Justin Clark-Casey (justincc)
18b3f1132e Rename Scene.StartTimer() to Start() - this method no longer uses a timer. Comment out more effectively unused old heartbeat code. 2012-03-23 01:21:43 +00:00
Justin Clark-Casey (justincc)
4ee8b3e23e Fix build break 2012-03-23 01:11:43 +00:00
Justin Clark-Casey (justincc)
a9995ede65 Fix bug in ScenePresenceAnimator.RemoveAnimation() introduced in commit 1a8769e
Forgot to uppercase the animation name for default animations, since for some reason we store and use them in upper rather than lowercase.
2012-03-23 01:08:13 +00:00
Justin Clark-Casey (justincc)
bc2963d42a Comment out unused scene loop restart code.
This has actually been unused since at least 0.7.2 due to earlier changes.
2012-03-23 01:03:10 +00:00
Justin Clark-Casey (justincc)
08b8ebcc7e Use m_lastFrameTick instead of m_lastUpdate in Scene.GetHealth(). m_lastUpdate is no longer properly updated and is redundant anyway. 2012-03-23 00:55:11 +00:00
BlueWall
c903813e00 RegionReady logging
Some maintenance to clean up logging messages
2012-03-22 20:49:45 -04:00
Justin Clark-Casey (justincc)
40b9b519b8 Add commented out section on collisions switch in Scene.SetSceneCoreDebug().
This was not implemented before the recent changes but should be at some point.
2012-03-23 00:12:14 +00:00
Robert Adams
efe61b2481 BulletSim: remove confusion between angularVelocity and rotationalVelocity (there is still confusion in the rest of OpenSim). Enhance some debug statements to include the object ID. 2012-03-22 17:04:06 -07:00
Justin Clark-Casey (justincc)
15c2499ccd Comment out login parameters debug output accidentally included with c4b2d24 2012-03-22 23:31:41 +00:00
Justin Clark-Casey (justincc)
c1d064e1ca Comment out a terrain save-tile debugging message that accidentally crept in with c4b2d24 2012-03-22 23:16:52 +00:00
Melanie
dfd7068864 Merge branch 'master' into careminster 2012-03-22 23:06:25 +00:00
Melanie
ed67b698d3 Merge commit '760010d6fb6aac313d79ce0a4d0016d3809246a0' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
2012-03-22 23:05:58 +00:00
Melanie
9edf99703a Merge commit 'df624c13c98b06d57311c1d93ecbd4790553f3b3' into careminster 2012-03-22 23:01:50 +00:00
Justin Clark-Casey (justincc)
5bf45b9b98 refactor: simplify code for checks when part.OwnerID != destPart.OwnerID in MoveTaskInventoryItem() 2012-03-22 22:40:38 +00:00
Justin Clark-Casey (justincc)
760010d6fb Fix llGiveInventory() so that it checks the destination part for AllowInventoryDrop, not the source.
This allows llAllowInventoryDrop() to work.
Regression test added for this case.
2012-03-22 22:33:37 +00:00
Justin Clark-Casey (justincc)
3bcf71c647 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-22 22:33:16 +00:00
Justin Clark-Casey (justincc)
c4b2d24f33 Add llGiveInventory() test from object to object where both objects are owned by the same user. 2012-03-22 22:17:07 +00:00
Diva Canto
df624c13c9 HG Friends: don't notify if the server isn't there. 2012-03-22 15:08:57 -07:00
Diva Canto
25e5b6a76c Added new simple_build_permissions config to the .ini and .example files. 2012-03-22 14:21:07 -07:00
Melanie
53b4551b58 Fix merge issue from core 2012-03-22 20:48:31 +00:00
Melanie
76a54f4680 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/World/Land/LandObject.cs
2012-03-22 20:42:06 +00:00
Melanie
6bc1ccf234 Change a false false to be truly true - or is this statement false?
Fixes perms boo-boo
2012-03-22 20:39:18 +00:00
Melanie
3381899481 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/World/Land/LandObject.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-03-22 20:38:49 +00:00
Melanie
b5d0bc2488 Rework Diva's patch to simplify it 2012-03-22 20:25:20 +00:00
Melanie
45b588cf00 Revert "Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEFAULT. Turns out that this can't be expressed by cascading Permission modules, so I did it as per this patch."
This reverts commit 6146e7ef25.
2012-03-22 20:10:38 +00:00
Diva Canto
6146e7ef25 Simple build permissions feature. NOTE: EXPERIMENTAL, DISABLED BY DEFAULT. Turns out that this can't be expressed by cascading Permission modules, so I did it as per this patch. 2012-03-22 12:57:12 -07:00
Justin Clark-Casey (justincc)
a8c87bab64 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-22 01:56:07 +00:00
BlueWall
c98e3a6422 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-21 20:34:51 -04:00
BlueWall
06c81a2afe Fix typo
Add enclosing " to urls
2012-03-21 20:33:45 -04:00
Robert Adams
4bfd9e28ca BulletSim: add updated (but not working) BulletSim dlls 2012-03-21 17:24:17 -07:00
UbitUmarov
b383690b96 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
Conflicts:
	OpenSim/Framework/PriorityQueue.cs
2012-03-22 00:19:28 +00:00
Justin Clark-Casey (justincc)
9949ac2f9f refactor: Rename AvatarAnimations -> DefaultAvatarAnimations for code clarity since non-default animations are handled completely separately from this class 2012-03-22 00:10:41 +00:00
Justin Clark-Casey (justincc)
71ec84d77f Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-22 00:00:05 +00:00
Justin Clark-Casey (justincc)
1a8769e6ef Instead of loading default avatar animations in both SLUtil and AvatarAnimations, load just in AvatarAnimations instead.
This lets us remove the dependency of OpenSim.Framework.dll on data/avataranimations.xml, which is not necessary for ROBUST.
This commit also takes care of the odd situation where animations are stored and used internally with uppercase names (e.g. "STAND")
but scripts refer to them with lowercase names (e.g. "sit").
2012-03-21 23:57:39 +00:00
Robert Adams
7783c93802 BulletSim: update TODO list. Rearrange code for readability. Add per object friction and restitution runtime settable parameters. 2012-03-21 16:16:47 -07:00
Robert Adams
cb2727cf6e BulletSim: Add AvatarRestitution parameter. Centralize computation of buoyancy for flying. Tweek avatar default friction and resititution 2012-03-21 16:16:46 -07:00
Robert Adams
6c55fd93a3 BulletSim: set buoyancy in only one place 2012-03-21 16:16:45 -07:00
Robert Adams
898a16802b BulletSim: add some new runtime setable parameters to match the dll. 2012-03-21 16:16:44 -07:00
Robert Adams
3e7e166124 BulletSim: update BulletSim.dll to Bullet 2.80 and add libBulletSim.so to the new lib32 and lib64 binary directories 2012-03-21 16:16:42 -07:00
Robert Adams
eafc3d6c47 BulletSim: Update list of TODO tasks 2012-03-21 16:16:41 -07:00
UbitUmarov
dc90c53596 reverted priorityQueue changes 2012-03-21 23:15:32 +00:00
Melanie
8652f277df Revert "Stop messing order of updates, destroing the defined order of the selected priority (by distance being the one that makes sense(?). So called fairness serves no usefull purpose. If a region is lagged or user has bad comms, and far objects updates don't arrive, at least nearby thinks do have a chance to keep ticking. Just test on a big region and observe rez order on arrival. lower viewer bandwith helps seeing the diference. No use to put in core since cmic loves the priority scrambling code i comented out."
This reverts commit 68981d01f0.
2012-03-21 22:45:34 +01:00
UbitUmarov
68981d01f0 Stop messing order of updates, destroing the defined order of the selected priority (by distance being the one that makes sense(?). So called fairness serves no usefull purpose. If a region is lagged or user has bad comms, and far objects updates don't arrive, at least nearby thinks do have a chance to keep ticking. Just test on a big region and observe rez order on arrival. lower viewer bandwith helps seeing the diference. No use to put in core since cmic loves the priority scrambling code i comented out. 2012-03-21 21:19:29 +00:00
UbitUmarov
4f593fa8c3 minor clean 2012-03-21 21:17:00 +00:00
Diva Canto
5170cd7577 Updated the UserAccountsClient a little bit, plus some more sanity checks on the service connector. 2012-03-21 11:22:39 -07:00
Diva Canto
4a9ca3ca8f HG Friends: reroute the status notifications to the HGFriends service, so that they can scale better. They were previously being handled by the UAS; that is still there, but it's now obsolete and will be removed in a future release. 2012-03-21 10:35:06 -07:00
Diva Canto
d8bcb78b10 HG Friends: pulled sim-bound notification code to HGStatusNotifier, so that we can better manage this traffic. 2012-03-21 09:14:17 -07:00
UbitUmarov
68736aa460 fix a bad reset of shapetype on pbshape change, added missing checksculpload ( to reload mesh on change ) 2012-03-21 15:27:33 +00:00
Diva Canto
8ad426f329 Removed extraneous debug message 2012-03-21 08:08:43 -07:00
Diva Canto
1089e9b842 Removed extraneous debug message 2012-03-21 08:08:12 -07:00
UbitUmarov
a03c55fee7 missed a creatMesh in chODE. temporary removed m_meshfailed test since it may colide with how meshs and sculpts are loaded. This needs a good revision.. 2012-03-21 14:03:50 +00:00
UbitUmarov
316f272b62 shapetype support on chOde so it can also request a simple convex hull 'mesh' 2012-03-21 12:57:46 +00:00
Diva Canto
5abe1b4fce Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-20 21:36:46 -07:00
Diva Canto
91cc09b7bf HG Friends config for Robust.HG.ini.example 2012-03-20 21:36:24 -07:00
Diva Canto
d49dd5573b Removed extraneous debug messages. Added a check for UUID.Zero. 2012-03-20 21:36:02 -07:00
UbitUmarov
312f0c6970 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-21 02:45:33 +00:00
UbitUmarov
f6cbafcaf0 Changes of PrimShapeType should now work with UbitOde ( almost untested ) 2012-03-21 02:39:16 +00:00
Justin Clark-Casey (justincc)
54a8a5baba If "debug scene updates true" then print out to log when a garbage collection occurs. 2012-03-21 02:02:14 +00:00
UbitUmarov
11ed932263 Tell physics about physics shape when creating. Added some virtual methods to get/set density,gravmod, frition,bounce and shape type ( not in use ). UbitOde now should do convex type on creation or everytime the mesh is changed ( as in change size, shape, etc ) 2012-03-21 01:46:41 +00:00
Justin Clark-Casey (justincc)
de53aa32e0 Add Scene.DebugUpdates switch which, if turned on, will print out a warning when a frame updates takes longer than twice the desired time
This is controlled via "debug scene updates true|false" on the region console.
Also fix an oversight with "debug scene teleport true|false"
2012-03-21 01:27:09 +00:00
UbitUmarov
2e41294da9 add convex state to mesh key, so a change is detected. 2012-03-21 01:24:30 +00:00
Justin Clark-Casey (justincc)
ab243f4a57 Incorporate scene teleporting debugging into "debug scene teleport true|false" command 2012-03-21 01:13:44 +00:00
Justin Clark-Casey (justincc)
9671e43497 Replace "scene debug true false true" console command with "scene debug scripting true" or other parameters as appropriate.
This is to allow individual switching of scene debug settings and to provide flexibiltiy for additional settings.
2012-03-21 01:02:58 +00:00
Melanie
ee9210f656 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
2012-03-21 00:26:02 +00:00
Melanie
7a0d7be44c Refix the fixed fix! 2012-03-21 00:17:58 +00:00
Diva Canto
69a9a6993e Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-20 17:33:26 -07:00
Justin Clark-Casey (justincc)
91a001d3cf fix compile error from last commit 2012-03-21 00:31:31 +00:00
Diva Canto
9e8b194356 Fixed borkness with map search introduce by my last changes to it. 2012-03-20 17:29:34 -07:00
Diva Canto
742acc0a3c Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-20 17:26:18 -07:00
Diva Canto
f7c61790b7 Fixed borkness with previous merge. 2012-03-20 17:25:52 -07:00
Justin Clark-Casey (justincc)
022366a074 refactor: simplify EstateManagementModule.handleEstateDebugRegionRequest() 2012-03-21 00:23:46 +00:00
Diva Canto
841b4232f6 Line endings 2012-03-20 17:19:55 -07:00
Diva Canto
3fa51f66ec Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Conflicts:
	OpenSim/Framework/Util.cs
2012-03-20 17:19:14 -07:00
Diva Canto
d08ad6459a HG Friends: allow the establishment of HG friendships without requiring co-presence in the same sim. Using avatar picker, users can now search for names such as "first.last@grid.com:9000", find them, and request friendship. Friendship requests are stored if target user is offline. TESTED ON STANDALONE ONLY. 2012-03-20 17:14:19 -07:00
Melanie
d3a5cdd7c2 Merge branch 'master' into careminster 2012-03-21 00:09:18 +00:00
Melanie
250b75f03b Merge branch 'master' into careminster 2012-03-21 00:03:03 +00:00
Justin Clark-Casey (justincc)
7bf628ab31 Add ability to log warn if a frame takes longer than twice the expected time. Currently commented out. 2012-03-21 00:02:08 +00:00
Melanie
117a862769 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-21 00:01:11 +00:00
Melanie
5233e335e9 Move the health monitoring stuff where it will do some good 2012-03-21 00:00:32 +00:00
Melanie
80a3b43e69 Merge branch 'master' into careminster 2012-03-20 23:59:49 +00:00
Melanie
35c3124c3b Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-20 23:39:02 +00:00
Justin Clark-Casey (justincc)
4c41b53a4b Add prim name to "[MESH]: No recognized physics mesh..." log message 2012-03-20 23:35:50 +00:00
Justin Clark-Casey (justincc)
02f9caf6ce remove some mono compiler warnings 2012-03-20 23:34:10 +00:00
Justin Clark-Casey (justincc)
3701f893d3 remove unnecessary tmpFrameMS, use maintc instead for frame time calculation 2012-03-20 23:31:57 +00:00
Justin Clark-Casey (justincc)
c39fba8f9d minor: remove some mono compiler warnings 2012-03-20 23:19:11 +00:00
Justin Clark-Casey (justincc)
8bdd38b804 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-20 23:14:15 +00:00
Justin Clark-Casey (justincc)
30b2a8c778 Move frame loop entirely within Scene.Update() for better future performance analysis and stat accuracy.
Update() now accepts a frames parameter which can control the number of frames updated.
-1 will update until shutdown.
The watchdog updating moves above the maintc recalculation for any required sleep since it should be accounted for within the frame.
2012-03-20 23:12:21 +00:00
Melanie
4e4a3e8d22 Update prebuild 2012-03-20 23:22:49 +01:00
Melanie
3d258d2688 Merge branch 'ubitwork' 2012-03-20 23:09:34 +01:00
UbitUmarov
8817b6e74c let convex be a parameter to createMesh so it can be used. Was forced to add it also to original mesher code and zeromesher 2012-03-21 00:02:41 +00:00
UbitUmarov
23e6a31aa5 added convex decomposition hulls support. Hardcoded to use mesh or this. (so no simple hull of convex prims for now). 2012-03-20 23:38:04 +00:00
nebadon
bd1f848bf6 slight increase in jump power to make running jump slightly better. 2012-03-20 14:17:15 -07:00
Melanie
fdd4d787a4 Merge branch 'master' into careminster 2012-03-20 20:48:55 +00:00
nebadon
9ed3532c1b reduce avatar verticle jump from the absurd 5 meter jump to a less
absurd 3m vertical jump to better match what you would see in Second
Life and be more in line with what users would expect.
2012-03-20 13:45:38 -07:00
Justin Clark-Casey (justincc)
86bd287b53 refactor: precalculate the fixed movement factor for avatar tilting (sqrt(2)) rather than doing it multiple times on every move. 2012-03-20 20:39:33 +00:00
Justin Clark-Casey (justincc)
5f2a65c976 refactor: Eliminate unnecessary duplicate avCapsuleTilted 2012-03-20 20:28:58 +00:00
UbitUmarov
8c1550b58e WORK in progress!! Now it reads the simple hull shape to use if convex shape is selected for a prim. Due to ODE limitations on convex hulls colisions, it creates a mesh. Being work in progress it is hardcoded to only read that simple convex hull for now. It writes a file named "lixo_lixo.raw" that can be imported into blender for examination of the created mesh (the last one loaded and also hardcoded). To play with put in opensim.ini "meshing = UbitMeshmerizer" 2012-03-20 19:24:45 +00:00
Melanie
70c0d6cf0b Merge branch 'ubitwork'
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
2012-03-20 18:07:24 +01:00
Melanie
7f7801ecb9 Cover the case where prims are loaded and ParentGroup is not yet set 2012-03-20 18:02:43 +01:00
UbitUmarov
efd7ff3146 add some more notifications about changes on physical parameters ( still incomple and there should be a better away ) 2012-03-20 16:46:16 +00:00
Melanie
f2d17433bb Cause prims to be saved if extra physics parameters are changed 2012-03-20 12:34:06 +01:00
Melanie
abd9957198 Fix an invalid cast that only showed at runtime 2012-03-20 12:24:42 +01:00
Melanie
7779b1eabc Store and reload extra physics from database 2012-03-20 12:04:55 +01:00
Melanie
5768a151ff Merge branch 'master' into careminster
Conflicts:
	OpenSim/Data/MySQL/MySQLXAssetData.cs
2012-03-20 02:48:11 +00:00
Justin Clark-Casey (justincc)
a3abd65e3d Remove pointless ThreadAbortException catching in a test that isn't run anyway. 2012-03-20 01:41:32 +00:00
Justin Clark-Casey (justincc)
8c911ddaf0 Remove some pointless catching/throwing in the scene loop. 2012-03-20 01:39:19 +00:00
Justin Clark-Casey (justincc)
4cbaf053cf Fix small typo 2012-03-20 00:53:33 +00:00
Justin Clark-Casey (justincc)
1c0f3a1f21 Fix crash where two scene loop threads could changes m_MeshToTriMeshMap at the same time.
Have to lock m_MeshToTriMeshMap as property is static and with more than one region two scene loops could try to manipulate at the same time.
2012-03-20 00:40:03 +00:00
Justin Clark-Casey (justincc)
e9271ec653 Add some doc about the EventManager.OnLoginsEnabled event. 2012-03-19 22:48:26 +00:00
Justin Clark-Casey (justincc)
e2b1c569da Fix a bug where logins to standalones would fail if the RegionReady module was not active
Unfortunately, the OnLoginsEnabled event is currently only guaranteed to fire if the RegionReady module is active.
However, we can instantiate the AuthorizationService in the module RegionLoaded method since by this time all other modules will have been loaded
2012-03-19 22:45:03 +00:00
Justin Clark-Casey (justincc)
437f18bc41 Stop console command "xengine status" throwing an exception if there are no scripts in a region.
Addresses http://opensimulator.org/mantis/view.php?id=5940
2012-03-19 21:43:23 +00:00
Melanie
618244f285 Remove debug output using Console.WriteLine and trim excessive whitespace 2012-03-19 14:39:19 +01:00
Melanie
808995fb68 Merge branch 'ubitwork' 2012-03-19 14:25:11 +01:00
Justin Clark-Casey (justincc)
4972491efb Move startup/shutdown command .txt files to .txt.example files to avoid clobbering on updates.
Thanks to Whitestar in http://opensimulator.org/mantis/view.php?id=5938 for pointing out this problem.
2012-03-19 00:29:02 +00:00
Justin Clark-Casey (justincc)
ab54ce1907 Fix configuration problems where XAssetDatabasePlugin was picked up accidentally.
The asset data plugin now implements IXAssetData rather than IAssetData so the ordinary AssetService should no longer pick it up.
This replaces the changes in 92b1ade.  There is no longer any need to adjust your StandaloneCommon.ini/Robust.ini/Robust.HG.ini files.
This may explain very recent issues in the last few weeks where textures have been disappearing or turning white (as they were going to different places).
Unfortunately, you will need to rollback to an earlier database backup or reupload the textures.
2012-03-19 00:18:04 +00:00
Melanie
c7e302864a Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs
	OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-18 20:44:56 +00:00
Diva Canto
d1256536b5 Added GetUUID(first, last) on UserAgentsService so that we can finally make direct user connections. 2012-03-17 21:27:28 -07:00
Diva Canto
441ef301a3 Amend to previous commit: normalize strings ToLower. 2012-03-17 19:41:47 -07:00
Diva Canto
7dfa0309c6 More on HG access control. This commit splits the UserManagementModule into the Basic one and the HG one, so that we can do everything that needs to be done for HG ACLs to work without interfering with the vanilla opensim. For the moment, it finds foreign users who have left a trace in the region, e.g. an object. This makes it possible to ban/IM/etc these users using the regular avatar picker. TODO: contact the UAS directly given a name of the form First.Last @foo.com. 2012-03-17 15:36:20 -07:00
Diva Canto
92b1ade78e BAD JUSTIN!
People using standalone in master, please update your StandaloneCommon.ini according to this change.
People using robust in master, please update your Robust.HG.ini.example[.HG].ini according to this change.
2012-03-17 15:01:10 -07:00
Diva Canto
1a4fdd2666 Moved HandleAvatarPickerRequest from the generic Scene.PacketHandlers to the UserManagementModule where it belongs. No functional changes. 2012-03-17 10:48:22 -07:00
Diva Canto
d87a5758fb Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-17 10:00:43 -07:00
Diva Canto
33c14cb107 Region access control! Region operators can now specify things like DisallowForeigners (means what it says) and DisallowResidents (means that only admins and managers can get into the region). This puts the never-completed AuthorizationService to good use. Note that I didn't implement a grid-wide Authorization service; this service implementation is done entirely locally on the simulator. This can be changed as usual by pluging in a different AuthorizationServicesConnector. 2012-03-17 10:00:11 -07:00
UbitUmarov
41a0c850f8 added a new UbitMeshing module so i can mess it... 2012-03-17 09:27:56 +00:00
Justin Clark-Casey (justincc)
4a57112f19 Add osGetInventoryDesc() as per http://opensimulator.org/mantis/view.php?id=5927
This allows one to get description data for a given prim inventory item.
Thanks MarcelEdward and GuduleLapointe!
2012-03-17 04:02:23 +00:00
Justin Clark-Casey (justincc)
1e4180fc93 Clean up "save iar" help 2012-03-17 02:54:19 +00:00
Diva Canto
a4dca88a57 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-16 13:08:27 -07:00
Diva Canto
a2009ffe2e Terrain: added [Terrain] section with an option to load an initial flat terrain. Default is still pinhead island. I much rather have a flat land in the beginning. 2012-03-16 13:08:05 -07:00
UbitUmarov
ae8e089b9c some more work on costs 2012-03-16 15:33:49 +00:00
Justin Clark-Casey (justincc)
59b6f6a6e0 minor: reuse threadpool count we just fetched instead of fetching it again 2012-03-16 03:56:56 +00:00
Justin Clark-Casey (justincc)
bece2023e7 Add total scripts count to "show threads"
However, this returns 0 on Mono (at least on 2.6.7)!  So not showing if it is zero.
2012-03-16 03:52:13 +00:00
Justin Clark-Casey (justincc)
9497a7c7bd refactor: separate out console and status report generation parts of XEngine 2012-03-16 03:32:14 +00:00
Justin Clark-Casey (justincc)
922d8c9312 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-16 03:28:17 +00:00
Justin Clark-Casey (justincc)
6e8f80f1ab Improve threadpool reporting to "show threads" console command (also gets printed out periodically) 2012-03-16 03:26:47 +00:00
Diva Canto
05bb2e4275 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-15 20:22:59 -07:00
Diva Canto
05a1493fff More on map search: send extra messages to the user regarding the region being found or not, because the UI is horribly confusing -- places profile is always "loading..." whether the region exists or not. 2012-03-15 20:22:26 -07:00
Justin Clark-Casey (justincc)
421b562a04 Add process working memory to "show stats" memory statistics.
This shows the actual amount of RAM being taken up by OpenSimulator (objects + vm overhead)
2012-03-16 02:43:33 +00:00
Justin Clark-Casey (justincc)
78e992dbd0 Move startup_commands.txt.example to startup_commands.txt for consistency with the existing shutdown_commands.txt.
Add comments to both files saying what they are (files that can contain console commands to execute on sim startup/shutdown) with an example.
2012-03-16 02:13:45 +00:00
Justin Clark-Casey (justincc)
b19be657b6 Remove unnecessary "backup" command in shutdown_commands.txt
The simulator is already doing this internally.
2012-03-16 02:10:59 +00:00
Justin Clark-Casey (justincc)
aa881e8065 Allow comments to appear in command scripts (e.g. shutdown_commands.txt).
These can start with ; # or //
2012-03-16 02:07:26 +00:00
Justin Clark-Casey (justincc)
34f6f87b6c Remove unused bin/ScriptEngines/Default.lsl
It would certainly be nice to change the default script on disk, but this is currently unused and isn't a suitable default.
At this location it would also stop an easy manual deletion of script engine compiles and state.
2012-03-16 01:51:16 +00:00
Justin Clark-Casey (justincc)
8550a4a07e In Top Scripts report, don't show scripts with no or less than 1 microsecond of execution time.
This is to make the report clearer and less confusing.
2012-03-16 01:46:21 +00:00
Justin Clark-Casey (justincc)
c386b68373 Aggregate script execution times by linksets rather than individual prims.
This is for the top scripts report.
2012-03-16 01:31:53 +00:00
Justin Clark-Casey (justincc)
7df4a544fe Fix owner name display in "Top Colliders" and "Top Script" region reports. 2012-03-16 00:53:36 +00:00
Justin Clark-Casey (justincc)
a4b01ef38a Replace script-lines-per-second with the script execution time scaled by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute.
Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100.
The actual measurement value should be script execution time per frame but XEngine does not work this way.
Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time.
This is still not ideal but gives reasonable results and allows scripts to be compared.
This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
2012-03-16 00:34:30 +00:00
Diva Canto
0548eeb571 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-15 16:03:33 -07:00
Diva Canto
18d1d6d3b4 More on SLURLs and V3. This is hacky, but it works. Basically, we have to redefine the encoding of HG URLs because the viewer messes them up. Examples of what works and doesn't work:
- secondlife://ucigrid00.nacs.uci.edu|8002/128/128 <-- works throughout the viewer
- secondlife://http|!!ucigrid00.nacs.uci.edu|8002+Test+Zone+1/128/128 <-- works throughout the viewer
- secondlife://http|!!grid.sciencesim.com!grid!hypergrid.php+Yellowstone01+74/128/128 <-- works throughout
- secondlife://http%3A%2F%2Fucigrid00.nacs.uci.edu%3A8002%20UCI%20Central%201/128/128 <-- works in chat, but not as URLs in the webkit
2012-03-15 16:03:09 -07:00
Diva Canto
df144eb9e2 Revert "Revert "More hacking around viewer bug""
This reverts commit e5612553ce.
2012-03-15 14:55:25 -07:00
Diva Canto
f52917288a These SLURLs are very confusing! -- reverting the revert. Hack is, indeed, needed.
Revert "Revert "Hack around https://jira.secondlife.com/browse/VWR-28570""

This reverts commit 5a9560db28.
2012-03-15 14:54:25 -07:00
Diva Canto
5a9560db28 Revert "Hack around https://jira.secondlife.com/browse/VWR-28570"
This reverts commit 697ac7fd9d.
2012-03-15 14:36:48 -07:00
Diva Canto
e5612553ce Revert "More hacking around viewer bug"
This reverts commit 10731732b4.
2012-03-15 14:36:29 -07:00
Mic Bowman
8b5298a62e Protect the scriptmodulecomms interface. 2012-03-15 13:37:43 -07:00
Mic Bowman
402ff75d78 Adds a new script command 'modInvoke' to invoke registered functions
from region modules. The LSL translator is extended to generate the
modInvoke format of commands for directly inlined function calls.

A region module can register a function Test() with the name "Test".
LSL code can call that function as "Test()". The compiler will translate
that invocation into modInvoke("Test", ...)
2012-03-15 13:16:02 -07:00
Diva Canto
fd4ad82367 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-15 11:06:08 -07:00
Diva Canto
10731732b4 More hacking around viewer bug 2012-03-15 11:05:43 -07:00
Diva Canto
697ac7fd9d Hack around https://jira.secondlife.com/browse/VWR-28570 2012-03-15 10:17:02 -07:00
Melanie
b4adf652e7 Merge branch 'ubitwork' 2012-03-15 10:24:40 +01:00
Melanie
897dc5e77e Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-03-15 10:55:44 +00:00
UbitUmarov
15ad5f492b Playing with object costs CAPS ... 2012-03-15 10:25:18 +00:00
UbitUmarov
051ea18a4f Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-15 04:20:19 +00:00
UbitUmarov
84ca09f7c5 added ObjectPhysicsProperties http event message to send viewer that data. For now on caps/EventQueue, and still only used on a material change... 2012-03-15 02:24:13 +00:00
Justin Clark-Casey (justincc)
acb1355ff2 Remove property/field duplication in ScriptInstance where it's unnecessary. 2012-03-15 02:02:31 +00:00
Justin Clark-Casey (justincc)
2d32401e23 Simplify some logic in the ScriptInstance constructor - running is set to false in both if/else branches 2012-03-15 01:32:16 +00:00
Justin Clark-Casey (justincc)
f0c1746063 minor: correct indentation levels 2012-03-15 01:26:38 +00:00
Justin Clark-Casey (justincc)
5ddda89238 Remove duplication of m_RunEvents and Running 2012-03-15 00:48:44 +00:00
Justin Clark-Casey (justincc)
2f81e53f63 Fix a problem where multiple near simultaneous calls to llDie() from multiple scripts in the same linkset can cause unnecessary thread aborts.
The first llDie() could lock Scene.m_deleting_scene_object.
The second llDie() would then wait at this lock.
The first llDie() would go on to remove the second script but always abort it since the second script's WorkItem would not go away.
Easiest solution here is to remove the m_deleting_scene_object since it's no longer justified - we no longer lock m_parts but take a copy instead.
This also requires an adjustment in XEngine.OnRemoveScript not to use instance.ObjectID instead when firing the OnObjectRemoved event.
2012-03-15 00:20:47 +00:00
Justin Clark-Casey (justincc)
12cebb12d5 Alleviate an issue where calling Thread.Abort() on script WorkItems can fail to release locks, resulting in a crippled simulator.
This seems to be a particular problem with ReaderWriterLockSlim, though other locks can be affected as well.
It has been seen to happen when llDie() is called in a linkset running more than one script.
Alleviation here means supplying a ScriptInstance.Stop() timeout of 1000ms rather than 0ms, to give events a chance to complete.
Also, we check the IsRunning status at the top of the ScriptInstance.EventProcessor() so that another event doesn't start in the mean time.
Ultimately, a better solution may have to be found since a long-running event would still exceed the timeout and be aborted.
2012-03-15 00:06:52 +00:00
UbitUmarov
cf9ebd301c bug fixs, added a default physics shape estimator based on being a mesh or not and use it on unlink if new root part as type none. Viewer doesn't get updated even with fullupdates we are missing something still 2012-03-14 18:24:04 +00:00
Melanie
d1daea0108 Allow llTeleportAgent to teleport gods when not in god mode 2012-03-14 19:21:25 +01:00
Melanie
c0f70d17fc Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
	OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
2012-03-14 11:33:51 +00:00
Diva Canto
d6dd3c42d1 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-13 20:16:19 -07:00
Diva Canto
479dd65a63 Teleports: bounce off repeated requests of teleporting the same agent. Some scripts do that, and that fails the whole thing. 2012-03-13 20:15:38 -07:00
Diva Canto
5a09572393 Minor sanity check on simulation agent handler (content type) 2012-03-13 20:14:51 -07:00
Justin Clark-Casey (justincc)
95ec96bf86 refactor: rename ScriptInstance.m_CurrentResult to m_CurrentWorkItem to make it more understandable as to what it is and what it does (hold a thread pool work item for a waiting of in-progress event)
Also add other various illustrative comments
2012-03-14 00:29:36 +00:00
Melanie
8388182707 Implement llSetPrimitiveParams for physics shape and material. Add
llSetPhysicsMaterial support.
2012-03-13 22:20:12 +01:00
Melanie
d4e6834f99 Hook up the new cap to the SOP changes 2012-03-13 20:49:16 +01:00
Melanie
f53c322b7e Merge branch 'ubitwork' 2012-03-13 20:21:26 +01:00
UbitUmarov
577d07aa44 missed commit of extraphysics parameters serialization.. 2012-03-13 19:51:41 +00:00
UbitUmarov
741badc4fa let PhysicsShapeType none remove physics remove physics on child parts **UnTested** 2012-03-13 19:24:41 +00:00
UbitUmarov
bf2a5508de bug fix 2012-03-13 19:17:32 +00:00
Melanie
f415eb84e1 Implement the cap to send extra physics params to the viewer. Not functional
yet because the parameters are not actually stored anywhere yet.
2012-03-13 20:06:39 +01:00
UbitUmarov
923db53975 let checkheartbeat work ( bad ideia :p ) commited by mistake my local copy with it disabled... 2012-03-13 18:10:43 +00:00
UbitUmarov
5086fe9176 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-13 18:00:27 +00:00
UbitUmarov
3de3b9e63c initial suport for ExtraPhysical parts parameters. Reading from llclientView to SOP including SOPserialization (not to databases). No action on physics still. No send to viewer, etc 2012-03-13 17:56:32 +00:00
Diva Canto
37828c9b9a Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-13 08:07:11 -07:00
Diva Canto
4eb2605c79 Datasnapshot: added "secret" to the registration/deregistration query so that data providers can verify authenticity if they want. 2012-03-13 08:06:30 -07:00
Melanie
22e0cc09ac Ensure child prims of a phantom prim are marked as phantom 2012-03-13 13:12:14 +01:00
Melanie
ebcd4910a2 Refactor, move OjectChangeData into it's own file and rename
ObjectChnageWhat what into ObjectChangeType change. What is
no name for a variable or type!
2012-03-13 13:08:32 +01:00
Justin Clark-Casey (justincc)
25592bbd85 Add max thread and min thread information to "xengine status" region console command 2012-03-12 21:16:05 +00:00
Robert Adams
e0dd38f672 Rename the stream extension method WebUtil.CopyTo() to WebUtil.CopyStream().
.NET 4.0 added the method Stream.CopyTo(stream, bufferSize). For .NET 3.5
and before, WebUtil defined an extension method for Stream with the signature
Stream.CopyTo(stream, maxBytesToCopy). The meaning of the second parameter
is different in the two forms and depending on which compiler and/or
runtime you use, you could get one form or the other. Crashes ensue.
This change renames the WebUtil stream copy method to something that
cannot be confused with the new CopyTo method defined in .NET 4.0.
2012-03-12 10:07:04 -07:00
Melanie
1547fe959e Change OpenSim.ini.example to reflect how to actually enable prim limits,
as opposed to how it was first designed.
2012-03-12 16:06:35 +00:00
Diva Canto
13fb582c12 DataSnapshot: renamed gridserverURL to gatekeeperURL, and normalimzed the capitalization of 'name' to lower case, also in the same <grid> section. 2012-03-12 07:55:17 -07:00
Melanie
edc8a15487 Restore duplication of the SL bug where linking phantom to solid lets the
child prim remain phantom
2012-03-12 14:06:39 +01:00
Melanie
bfd38ecad4 Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-12 11:45:38 +01:00
Melanie
139c0665cf Add AVATAR_MALE flag to return values of llGetAgentInfo 2012-03-12 11:44:07 +01:00
UbitUmarov
a35e00e81e allocate UndoRedoStore only on demand 2012-03-12 07:50:14 +00:00
UbitUmarov
b5e172677d ubitode prim select was not doing phantom case 2012-03-12 07:46:20 +00:00
UbitUmarov
6c4c500ee4 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-12 06:58:38 +00:00
UbitUmarov
2a17dafa04 missing file in ubitODE 2012-03-12 06:52:03 +00:00
Melanie
44ce068d6c Allow RLV to redirect received folders to #RLV folder 2012-03-11 18:21:47 +01:00
UbitUmarov
925295f3ab ubitOde also knows a bit more about physical phantom 2012-03-11 12:33:59 +00:00
UbitUmarov
7832889437 Physical phantoms testable with chOde. Volume detection was changed and also needs testing. Started making it more independent of phantom acording to new sl. ** 99.999...% UNTESTED *** 2012-03-11 11:01:38 +00:00
UbitUmarov
dab7e03584 bug fix (??) in sog copy() 2012-03-11 08:43:53 +00:00
UbitUmarov
43dc0ee020 more phantom physics ( chODE and a fix in manager physicsactor 2012-03-11 07:44:34 +00:00
UbitUmarov
21a76a619f initial steps to support physical phantoms 2012-03-11 06:32:06 +00:00
UbitUmarov
b0f01cec98 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-11 03:57:59 +00:00
Diva Canto
824eb7ed20 Added osGetGridGatekeeperURI() 2012-03-10 19:51:28 -08:00
UbitUmarov
1f7c0c2ea0 cleanup + comments 2012-03-11 03:28:17 +00:00
UbitUmarov
53bda83cc2 cleanup + comments 2012-03-11 03:14:15 +00:00
UbitUmarov
80160c128d coments change.. 2012-03-11 02:58:56 +00:00
UbitUmarov
dba0d79833 minor changes on updates control on doChangeObject(..) 2012-03-11 02:55:39 +00:00
Melanie
4f7ec1d691 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-03-11 01:55:36 +01:00
Melanie
f292e19689 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Application/OpenSimBase.cs
2012-03-11 02:29:43 +00:00
UbitUmarov
e4e6f781a6 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-11 00:53:53 +00:00
Melanie
0a4056ad22 Merge branch 'ubitwork' 2012-03-11 01:47:36 +01:00
UbitUmarov
ab235abc46 Changed undo redo internals. moved exec code to UndoState.cs from sop that now only sees a unified UndoRedoStore class, added size limit on buffers so only last 5 undo/redo are kept. (5 is hardcode like it was ) ***UNTESTED*** 2012-03-11 00:36:34 +00:00
UbitUmarov
908abb1c3d BIG MESS. changed Iclient interface so only one event is used to inform scene about position scale or rotation change by client (others can be added). Its served at SceneGraph that does permition checks, undostore and sends down to SOG. changed values are stored in a class (ObjectChangeData) and what is changed as a enum (ObjectChangeWhat) with bit fields and 'macros' of this for better readability (at top of scenegraph.cs lasy to find better place for now) this can be extended for other things clients changes and need undo/redo. SOG process acording to what is changed. Changed UNDO/redo to use this also (warning is only storing what is changed, previus stored all, this must be checked for side efects. to save all PRS change commented line in scenegraph). Still have excessive calls to ScheduleGroupForTerseUpdate. **** UNTESTED **** 2012-03-10 20:32:19 +00:00
Diva Canto
291dc39691 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-10 08:09:43 -08:00
Justin Clark-Casey (justincc)
05e821c444 Fix TestSaveOarNoAssets() by not launch a no-assets request on a separate thread.
This was previous behaviour anyway.
2012-03-10 03:11:28 +00:00
Justin Clark-Casey (justincc)
6e26f17923 minor: In IAR save, log when we start adding the control file rather than saying afterwards that we added it. 2012-03-10 02:13:17 +00:00
Justin Clark-Casey (justincc)
5507752dc5 minor: rearrange some save oar messages so they say what they're about to do rather than what they've just done. 2012-03-10 02:11:30 +00:00
Justin Clark-Casey (justincc)
1693799623 On OAR saving, try fetch assets serially rather than firing all the requests at the asset service at once.
This may (or may not) improve reliability for http://opensimulator.org/mantis/view.php?id=5898
Quick tests show that save time is the same.
2012-03-10 02:03:07 +00:00
Justin Clark-Casey (justincc)
3a5928f813 Add satguru and Fernando to contributors 2012-03-10 01:31:27 +00:00
Justin Clark-Casey (justincc)
d6ebf2d6ca Add ability to specify a default estate to be used when creating regions.
This is configured in the new [Estates] section of OpenSim.ini.
If a default estate is configured then all new regions are automatically joined to it instead of asking the user.
If the default estate does not already exist then it is created.
Current default behaviour remains the same - the user is asked for estate details when necessary.
Thanks to Frenando Oliveira for the patch which I adapated further.
2012-03-10 01:27:05 +00:00
Mic Bowman
7b8e9d88e3 Serialize all web requests to a particular host:port pair; only applied to the PostToService variants. 2012-03-09 16:53:51 -08:00
Justin Clark-Casey (justincc)
bdc968f1fc Factor out common default animations code into SLUtil. LLClientView now makes use of the SLUtil copy via a method rather than each LLClientView loading a separate copy.
As per opensim-users mailing list discussion.
2012-03-09 23:57:24 +00:00
Melanie
3dbf754651 Merge branch 'master' into careminster 2012-03-09 23:00:24 +00:00
Melanie
5c5a493791 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-03-09 22:59:23 +00:00
satguru srivastava
35f2479858 fix for NPC not playing internal animations 2012-03-09 22:58:59 +00:00
Diva Canto
a58152bd2a More on inventory transfer hold ups:
- Added an inventory cache for caching root and system folders
- Synchronized the remote inventory connector, so that all the remote inventory calls are serialized
This will not make much difference in the hold ups. We'd have to move the FireAndForget high up to AddInventoryItem, but that opens up a can of worms regarding the notification of the recipient... the recipient would be notified of the offer before the items are effectively in his inventory, which could lead to surprises.
2012-03-09 12:59:24 -08:00
Diva Canto
81869c4a3f More on HG inventory transfers. Move the FireAndForget higher up. 2012-03-09 09:48:12 -08:00
UbitUmarov
0e5e324a2c ubitOde bug 2012-03-09 17:20:49 +00:00
UbitUmarov
e83a2181d0 on linking update linked parts physical flags acording to new parent ones ( untested ) 2012-03-09 17:19:10 +00:00
Melanie
09d99cb222 Merge branch 'ubitwork' 2012-03-09 09:47:09 +01:00
UbitUmarov
13f340077c let chode and ubitode find ode.dll on windows 2012-03-09 04:19:39 +00:00
UbitUmarov
eaef84ad1d Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-09 03:32:49 +00:00
Diva Canto
f545d669de Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-08 19:32:21 -08:00
Diva Canto
7db5ba7702 More on the freeze on HG inventory transfers: spawn a threadlet on the functional asset posts so that the client threads doesn't freeze (but the network posts are serialized). 2012-03-08 19:31:53 -08:00
UbitUmarov
fc4dc7708d Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-09 03:00:31 +00:00
UbitUmarov
e5786ba043 more changes on undo/redo group scaling seems to work better 2012-03-09 02:56:14 +00:00
Justin Clark-Casey (justincc)
06dda14505 Simplify minimap coarse location code by just reference SP.AbsolutePosition
This is rather than checking whether the avatar is sitting and doing its own calculation.
2012-03-09 02:50:57 +00:00
Justin Clark-Casey (justincc)
205c36d3a4 Get rid of unnecessary ParentID == 0 check on SP.Get_AbsolutePosition since this is handled by the necessary ParentPart check 2012-03-09 02:44:08 +00:00
Melanie
dc5f831ca8 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
2012-03-09 02:39:14 +00:00
Justin Clark-Casey (justincc)
94e58ff6b9 Use SP.ParentPart instead of ParentID in places where it's more efficient (saving extra null checks, etc.)
However, it looks like we should retain SP.ParentID since it's much easier to use that in places where another thread could change ParentPart to null.
Otherwise one has to clumsily put ParentPart in a reference, etc. to avoid a race.
2012-03-09 02:38:11 +00:00
Justin Clark-Casey (justincc)
b454326273 refactor: cleanup SP.HandleAgentSit so that everything is done within one if (part != null), rather than having unnecessary multiple checks 2012-03-09 02:33:48 +00:00
Diva Canto
c22446ede0 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-08 18:29:08 -08:00
Diva Canto
8a34d1b710 HG inventory/asset transfers: serialize asset posts. I'm using the same pattern as suggested in the patch mantis #5921. Testing it in this smaller context to see how it works. 2012-03-08 18:28:46 -08:00
Justin Clark-Casey (justincc)
73c47f7205 Remove a race condition from SP.Set_AbsolutePosition where we assume the ParentPart is still not null if the ParentID != 0
Another thread could come in and stand the avatar between those two instructions.
2012-03-09 02:22:22 +00:00
UbitUmarov
05cdf9bda9 more changes in undo/redo. Basicly moved control to llclientview.cs. later we can move back to a dispatcher function on SOG that handles the several cases( in a viwer independent way (?)) and calls current exec funtions. made cosmetic changes replacing decimals by hexs so bits are easier to read. Changed behavour of case 12 and 28 ( 0x0c and 0x1c) to make identical to 0x0d and 0x1d ( scale only and scale plus position). DOn't see 12 and 28 in use... cases 1c and 1d still broken 2012-03-09 01:53:58 +00:00
Melanie
c521f3b348 Fix UbitODE dll mappping by simply copying the one from ODE.Net 2012-03-09 02:39:02 +01:00
Melanie
e1be1c5263 Merge branch 'ubitwork' 2012-03-09 02:11:25 +01:00
Melanie
99c64f0645 Fix a merge artefact 2012-03-09 02:45:53 +00:00
Melanie
3ae0ae0659 Merge branch 'master' into careminster 2012-03-09 00:59:27 +00:00
Melanie
42a7a85062 FireAndForget scripted rez - port from Avination 2012-03-09 00:57:49 +00:00
Melanie
ac577bf606 Merge branch 'master' into careminster 2012-03-09 00:56:52 +00:00
Justin Clark-Casey (justincc)
df4b06aed1 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-09 00:20:10 +00:00
Justin Clark-Casey (justincc)
034c9d6bcc Merge branch 'xassetservice' 2012-03-09 00:19:42 +00:00
Justin Clark-Casey (justincc)
3c5bd7c35a minor: move some compression related var setup inside compression if/then switch 2012-03-09 00:16:49 +00:00
Justin Clark-Casey (justincc)
0cbdf9dad2 Put big fat EXPERIMENTAL warning in xassetservice database plugin
This should not currently be used in any circumstances except for experimentation.
Database tables used by this plugin can still change at any time with no migration path.
2012-03-09 00:05:34 +00:00
Diva Canto
9c8ef96301 Fixes mantis #5923 2012-03-08 15:55:43 -08:00
Melanie
6d1888792b Merge branch 'master' into careminster 2012-03-08 19:14:45 +00:00
Melanie
675d40357c Hold a ref to the prim we're sat on rather than querying scene each time
the check for significant is carried out. Prevents a deadlock condition.
2012-03-08 19:14:34 +00:00
Melanie
b0fc96c17d Merge branch 'master' into careminster 2012-03-08 19:10:22 +00:00
Melanie
3089344114 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-08 19:09:11 +00:00
Melanie
b8c27252c1 Hold a ref to the prim we're sat on rather than querying scene each time
the check for significant is carried out. Prevents a deadlock condition.
2012-03-08 18:31:58 +01:00
Justin Clark-Casey (justincc)
fa2a64564a Move "change region" command into general category 2012-03-08 02:24:37 +00:00
Justin Clark-Casey (justincc)
dfdb0e140c Uses shorter AddCommand form for "show estates" 2012-03-08 02:23:52 +00:00
Justin Clark-Casey (justincc)
650d761c06 Display help commander topics in capitalized form - the commands themselves are still lowercase.
Also convert the estate commands to simply AddCommand() calls so that commands from two different modules can be placed in the same category
2012-03-08 02:17:45 +00:00
Justin Clark-Casey (justincc)
430304c176 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-08 01:59:00 +00:00
Justin Clark-Casey (justincc)
749c3fef8a Change "help" to display categories/module list then "help <category/module>" to display commands in a category.
This is to deal with the hundred lines of command splurge when one previously typed "help"
Modelled somewhat on the mysql console
One can still type help <command> to get per command help at any point.
Categories capitalized to avoid conflict with the all-lowercase commands (except for commander system, as of yet).
Does not affect command parsing or any other aspects of the console apart from the help system.
Backwards compatible with existing modules.
2012-03-08 01:51:37 +00:00
UbitUmarov
3d3b81e676 changes on undo/redo (untested/incomplete). Think we may consider moving this mfrom SOP to client side. At least does seem to work a bit better ( again there wwas a issue on sop.copy ) 2012-03-07 07:31:26 +00:00
Justin Clark-Casey (justincc)
6bdea15ecf minor: make NPC tests run in a given order, comment out log lines in mock region data plugins, null out scene in script and npc torture tests, add other doc comments to torture tests 2012-03-07 01:11:37 +00:00
Melanie
f8b1b86c3a Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
2012-03-07 01:05:32 +00:00
Melanie
a1b28a61a6 Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-03-07 01:04:09 +00:00
Melanie
7769362687 Always zero the PhysActor on dupes to prevent side effects on the orignal prim 2012-03-07 01:03:26 +00:00
Melanie
5884d08062 Fix merge issue 2012-03-07 00:58:01 +00:00
Melanie
caa19862fa Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.cs
2012-03-07 00:51:59 +00:00
Melanie
f3e04beb2e Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-07 00:51:24 +00:00
Justin Clark-Casey (justincc)
f3678d217f Stop individually deleting objects at the end of each ObjectTortureTest.
We can now do this since the entire scene and all objects within it are now successfully gc'd at the end of these tests.
This greatly improves the time taken to run each test (by reducing teardown time, not the time to actually do the test work that we're interested in).
Slightly simplifies config read in Scene constructor to help facilitate this.
2012-03-07 00:31:18 +00:00
Justin Clark-Casey (justincc)
23aba007dd Add documentation to make more explicit the difference between OnRezScript and OnNewScript in the event manager
OnNewScript fires when a script is added to a scene
OnRezScript fires when the script actually runs (i.e. after permission checks, state retrieval, etc.)
2012-03-07 00:04:24 +00:00
Justin Clark-Casey (justincc)
3376979923 Remove static m_MainInstance in LocalGridServiceConnector.
I believe this was originally required back when there could be two LocalGridServiceConnectors but this is no longer the case.
Having such statics makes performance testing much more difficult since they prevent GC of objects unless static references are explicitly nulled.
2012-03-06 23:51:50 +00:00
Justin Clark-Casey (justincc)
98251cdab3 Add sensor, dataserver requests, timer and listener counts to "xengine status" command.
This is for diagnostic purposes.
2012-03-06 23:21:17 +00:00
Justin Clark-Casey (justincc)
e9d8eb5a27 Remove unnecessary explicit ElapsedEventHandler in SimReporter 2012-03-06 22:31:25 +00:00
Melanie
0be4ed3df4 Prevent scripted region crossings from crashing with prim limits enabled 2012-03-06 22:27:01 +01:00
Melanie
17b1454d6f Null PhysActor on SOP.Copy() to prevent clobbering the original one 2012-03-06 20:20:12 +01:00
Justin Clark-Casey (justincc)
0f4cdc0c5b Explictly close down the StatsReporter so that we can shutdown its timer
This is another step necessary for the scene to be garbage collected between performance tests
2012-03-06 19:05:32 +00:00
Melanie
de03d1ece0 Removed some whitespace errors - don't be naughty, don't use hard tabs!
Also removed commented code block.
2012-03-06 09:56:19 +01:00
UbitUmarov
cca94aaefc make copied parts have diferent LocalIds than original. More building control for ubitODE. for all let physics know about linking of physical parts. Assume UNTESTED 2012-03-06 05:13:39 +00:00
UbitUmarov
f33654b62f Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-06 03:07:48 +00:00
Justin Clark-Casey (justincc)
b3449e998a Fix TestSyntaxError() and TestSyntaxErrorDeclaringVariableInForLoop()
They were all failing assertions but the exceptions these threw were caught as expected Exceptions.
I don't think we can easily distinguish these from the Exceptions that we're expecting.
So for now we'll do some messy manually checking with boolean setting instead.
This patch also corrects the assertions themselves.
2012-03-06 02:30:22 +00:00
Justin Clark-Casey (justincc)
a92153ed88 Get all test methods in OpenSim.Region.ScriptEngine.Tests.dll to report that they're running 2012-03-06 02:21:19 +00:00
Justin Clark-Casey (justincc)
85198a45cb Fix off by one error in script error reporting. 2012-03-06 02:01:47 +00:00
Justin Clark-Casey (justincc)
1dc03e5c4f Simplify NPCModuleTests code by putting the NPCModule in an instance variable rather than making each test fetch it seperately.
Also rename instance variables in the test to conform to naming standards and for understandability
2012-03-06 01:47:43 +00:00
Melanie
5004d0ad09 Merge branch 'master' into careminster 2012-03-06 01:45:20 +00:00
Justin Clark-Casey (justincc)
d44b7c486a Go back to setting appearance directly in NPCModule.SetAppearance() to fix mantis 5914
The part reverted is from commit 2ebb421.
Unfortunately, IAvatarFactoryModule.SetAppearance() does not transfer attachments.
I'm not sure how to do this separately, unfortunately I'll need to leave it to Dan :)
Regression test added for this case.
Mantis ref: http://opensimulator.org/mantis/view.php?id=5914
2012-03-06 01:27:30 +00:00
Melanie
af46650bae Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
2012-03-06 01:18:37 +00:00
Melanie
aa613dab1f Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-06 00:29:43 +00:00
Melanie
5e77973667 Merge branch 'master' into careminster 2012-03-06 00:29:25 +00:00
Chris Hart
413bc1e77e Updates to MSSQL store for 0.7.3 to include:
* Telehub support
* Bugfix to Friends lookups
* Updates to Creator fields to store up to 255 characters for HG item creator storage
2012-03-06 00:27:49 +00:00
Justin Clark-Casey (justincc)
441449e240 Switch to sha256 from sha1 in order to avoid future asset hash collisions.
Some successful collision attacks have been carried out on sha1 with speculation that more are possible.
http://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms
No successful attacks have been shown on sha256, which makes it less likely that anybody will be able to engineer an asset hash collision in the future.
Tradeoff is more storage required for hashes, and more cpu to hash, though this is neglible compared to db operations and network access.
2012-03-06 00:14:21 +00:00
Justin Clark-Casey (justincc)
fd2b285b1b remove unnecessary hash local variable 2012-03-05 23:50:41 +00:00
Melanie
a7b61add99 Allow NPC to be removed by the owner of the parcel they're over.
Don't allow NPC creation unless the prim owner has rez rights.
2012-03-05 22:22:28 +01:00
Melanie
f2653b9b8e Teleport users to the cornfield when they are teleported with
llTeleportAgentHome(). Don't try to teleport NPCs.
2012-03-05 21:52:24 +01:00
UbitUmarov
7377e633c7 update ubitOde 2012-03-05 12:37:21 +00:00
Melanie
97f0cff388 llListSort SL compatibility: When sorting strided list and the list
length is not a multiple of the stride, return the original list.
Also, enforce that sort is ascending only when the ascending
parameter is 1, and not when it is != 0
2012-03-05 11:54:06 +01:00
UbitUmarov
a647a37683 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-05 04:03:37 +00:00
Melanie
c2a73a26b5 SL compatibility - return only points on segemtn, not ray in llCastRay 2012-03-05 02:37:51 +01:00
Melanie
0ed4f24b34 A stab at making llEjectFromLand work in all cases 2012-03-05 02:14:27 +01:00
Melanie
182f5efbe9 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-03-04 16:23:46 +00:00
Melanie
6338996f87 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs
2012-03-04 16:23:19 +00:00
BlueWall
ac934e2dbb Add WebProfiles config to other config example 2012-03-04 11:11:01 -05:00
BlueWall
33a154e446 Merge branch 'master' of /home/opensim/var/repo/opensim into v3_support 2012-03-04 10:42:37 -05:00
UbitUmarov
01fcd400d7 update UbitOde 2012-03-04 04:26:05 +00:00
UbitUmarov
99bb3ccb3d Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-04 04:11:38 +00:00
UbitUmarov
7c931037bd update UbitODE 2012-03-04 01:40:12 +00:00
Melanie
6dc4a6dfb1 Zero velocity when drag-copying 2012-03-04 00:06:07 +01:00
UbitUmarov
fc781f0894 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-03-03 17:08:01 +00:00
Melanie
1f32730798 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Framework/Servers/VersionInfo.cs
	OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
2012-03-03 09:58:57 +00:00
Justin Clark-Casey (justincc)
3780df8a32 Make asset compression optional. Currently set to false and not configurable from outside MySQLXAssetData. 2012-03-03 01:43:36 +00:00
Justin Clark-Casey (justincc)
75dc8b1aed Implement basic gzip compression for xassetdata
Whether this is worthwhile is debatable since here we are not transmitting data over a network
In addition, jpeg2000 (the biggest data hog) is already a compressed image format.
May not remain.
2012-03-03 01:28:58 +00:00
Justin Clark-Casey (justincc)
2535a4cafc If asset data already exists with the required hash then don't rewrite it 2012-03-03 00:05:02 +00:00
Justin Clark-Casey (justincc)
94b323d1d8 Perform asset storage transactionally 2012-03-02 23:41:54 +00:00
Justin Clark-Casey (justincc)
7113b44bdd Merge branch 'master' into xassetservice 2012-03-02 23:30:19 +00:00
Justin Clark-Casey (justincc)
98ad6ed255 comment out "[CAPS]: ScriptTaskInventory Request" log spam 2012-03-02 23:29:35 +00:00
Justin Clark-Casey (justincc)
e81b3502ef Make xassetservice execute one query to retrieve the asset, not two 2012-03-02 23:26:03 +00:00
Justin Clark-Casey (justincc)
c2c102d33e Remove outdated comment about checking attachment prims in Scene.PipeEventsForScript() 2012-03-02 22:52:26 +00:00
Justin Clark-Casey (justincc)
089fd61a3b Allow a script to receive events if its root prim is in an area where it's allowed to run rather than checking its own prim.
This allows scripts to run in child prims that are outside region boundaries.
This is an interim patch applied from http://opensimulator.org/mantis/view.php?id=5899 though it does not resolve that bug
Thanks tglion!
2012-03-02 22:43:24 +00:00
Melanie
bfcba0a417 This still causes terrain artefacts
Revert " fix my bug on ChODE terrain heightmap build"

This reverts commit aa77d1d486.
2012-03-02 22:20:02 +01:00
Melanie
458f295fdb This still causes terrain artefacts
Revert " fix the last fix. Regions are square but... Also remove the 0.5 offset in map position. It was apparently needed to fix we having nsamples = size and not size + 1."

This reverts commit 15bc539bd4.
2012-03-02 22:19:28 +01:00
BlueWall
d242d47e5c OpenID auth needs hashing before authenticating 2012-03-02 15:05:06 -05:00
BlueWall
6fc350725d Merge branch 'master' into v3_support 2012-03-02 15:02:09 -05:00
Dan Lake
64a036b4cf Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-03-02 09:19:35 -08:00
Dan Lake
8d249f8456 ScenePresence line endings and fix AllowMovement default to true. 2012-03-02 09:19:13 -08:00
UbitUmarov
f42fd7fb77 update ubitODE 2012-03-02 15:05:30 +00:00
Justin Clark-Casey (justincc)
6e3523e25e minor: remove mono compiler warning 2012-03-02 04:08:07 +00:00
Justin Clark-Casey (justincc)
2a2656f629 Merge branch 'master' into xassetservice 2012-03-02 04:01:53 +00:00
Justin Clark-Casey (justincc)
be4199c3bc Make XAssetService a de-duplicating asset service.
This is an extremely crude implemenation which almost works by accident.  Nevertheless it does work.
It can be tested with the instructions at http://opensimulator.org/wiki/Feature_Proposals/Deduplicating_Asset_Service#Testing
It does not interact at all with the existing asset service or any data stored there.
This code is subject to change without notice and should not be used for anything other than gawking.
2012-03-02 03:57:55 +00:00
Diva Canto
8fccd2b555 Send the right name and creation date on the BasicProfileModule. 2012-03-01 19:55:51 -08:00
Dan Lake
e8779cd9e5 In ScenePresence, removed several private variables used to store public parameters. They were only used by the get/set and make code harder to refactor. 2012-03-01 19:22:05 -08:00
Justin Clark-Casey (justincc)
dd63cd1656 Start by adding XAssetService as a copy of the existing AssetService.
This is the start of exploring the creation of a bundled OpenSimulator asset service that does de-duplication and possibly file storage of assets.
Along the lines of coyled's SRAS, but not intended to replace, merely to act as a more performant bundled default.
Might end up nicking stuff from kcozen's patch at http://opensimulator.org/mantis/view.php?id=5429
More details at http://opensimulator.org/wiki/Feature_Proposals/Deduplicating_Asset_Service
Feedback and discussion welcome as commits are made.
2012-03-02 02:23:35 +00:00
Justin Clark-Casey (justincc)
ec48a2f32b minor: Rename pCampbot console prompt to "pCampbot" rather than "Region" 2012-03-02 01:54:48 +00:00
Justin Clark-Casey (justincc)
94971bf3b9 Provide feedback on bot login states in pCampbot 2012-03-02 01:31:28 +00:00
Justin Clark-Casey (justincc)
d8c4985527 Move SenseRepeaters.Count check inside the SenseRepeatListLock.
No methods in the List class are thread safe in the MS specification/documentation
2012-03-02 00:28:37 +00:00
Justin Clark-Casey (justincc)
dcfd05c8ea lock SenseRepeatListLock when added a new sensor during script reconstitution.
This is already being done in the other place where a sensor is added.
Adding a sensor whilst another thread is iterating over the sensor list can cause a concurrency exception.
2012-03-02 00:22:23 +00:00
Mic Bowman
8a375f3c30 Adds an OSSL command for regular expression-based string replacement. Parameters
are osReplaceString(string source, string patter, string replace, integer count, integer start)
The count parameter specifies the total number of replacements to make, -1 makes
all replacements.
2012-03-01 14:49:49 -08:00
BlueWall
7a88d21e59 Merge branch 'master' of /home/opensim/src/opensim 2012-03-01 14:20:46 -05:00
BlueWall
a2b0ed537e Fix indexing on string trim
Thanks to zadark for pointing this out,
	smxy for deciphering the ?: operator and
	Plugh for the fix \o/ yay for IRC
2012-03-01 14:18:48 -05:00
Justin Clark-Casey (justincc)
0007711eb5 Use a fully stubbed out MockConsole for unit tests rather than inheriting from CommandConsole.
This is so that the static MainConsole.Instance doesn't retain references to methods registered by scene and other modules to service commands.
This prevents the scene from being garbage collected at the end of a test.
This is not the final thing preventing GC - next up is the timer started by SimStatsReporter that holds a reference to Scene that prevents end of test gc.
2012-03-01 03:23:10 +00:00
Justin Clark-Casey (justincc)
255afbf08a Remove more now unused third party libraries. 2012-03-01 02:11:15 +00:00
Justin Clark-Casey (justincc)
aabbbb32ff Flick master up to 0.7.4 2012-02-29 23:45:14 +00:00
Justin Clark-Casey (justincc)
1e95b01f13 Extend distsrc target to cleanup the files generated by running prebuild 2012-02-29 21:51:46 +00:00
BlueWall
69c999033b Revert "Fix authentication for OpenID provider"
This reverts commit 9f597c2d42. Fixing OpenID causes issues with other parts of the code.
2012-02-29 15:52:15 -05:00
BlueWall
1a54e76948 Trigger a build 2012-02-29 14:54:06 -05:00
BlueWall
df75f5ae37 Merge branch 'master' of /home/opensim/src/opensim 2012-02-29 14:42:36 -05:00
BlueWall
afc9a7d3f9 Merge branch 'master' of /home/opensim/src/opensim into v3_support 2012-02-29 14:39:51 -05:00
BlueWall
9f597c2d42 Fix authentication for OpenID provider 2012-02-29 14:39:07 -05:00
UbitUmarov
ee4d3bfad2 ubitODE bug fix 2012-02-29 19:36:16 +00:00
UbitUmarov
a8f1cd7e86 update ubitODE to current working state 2012-02-29 19:32:23 +00:00
UbitUmarov
a0d75be56b fix 2012-02-29 05:14:29 +00:00
UbitUmarov
42ddb0e88f Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-29 05:08:13 +00:00
UbitUmarov
5534cf8b57 chODE: bad meshs get a a basic box or sphere geom with setted prim size. They will not colide if non-physical and Will collide with land if physical. assume UNTESTED 2012-02-29 05:03:26 +00:00
Justin Clark-Casey (justincc)
a181fae722 Don't start pCampbot if the user doesn't supply bot firstname, lastname stub and password 2012-02-29 03:00:56 +00:00
Justin Clark-Casey (justincc)
40c838896c Use correct casing of RegionSettings.Sandbox in the various database modules.
MySQL and MSSQL have it as Sandbox, sqlite as sandbox.
In various different places in every plugin the wrong casing is used...
Consistency, who needs it?  Or one day sqlite can change to Sandbox.
2012-02-29 00:33:17 +00:00
Justin Clark-Casey (justincc)
670c7842a4 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-29 00:03:55 +00:00
Justin Clark-Casey (justincc)
2fce7dd593 Call Dispose() via using() on SqliteCommands in WebStatsModule after use. 2012-02-28 22:54:21 +00:00
Kevin Cozens
a813e7ffdd Fixed two typos. White space cleanups.
Signed-off-by: nebadon <michael@osgrid.org>
2012-02-28 14:12:39 -07:00
UbitUmarov
a8a7bb549d made box a little larger 2012-02-28 20:24:03 +00:00
UbitUmarov
1c7700db88 A few blind changes to go try to go around bad mesh little box replacement fail 2012-02-28 20:14:26 +00:00
Melanie
f11ab97747 Fix and hook up llTeleportAgent 2012-02-28 20:51:19 +01:00
Melanie
0fb50a8a9e Implement llTeleportAgent 2012-02-28 20:48:31 +01:00
Melanie
9bad3b846f Really dirty hack to make sims start. Causes errors but the ting runs. Remove
when fixed right.
2012-02-28 10:37:46 +01:00
Mic Bowman
4268427ac3 Some clean up in WebUtil, remove unused ServiceRequest function. 2012-02-27 15:15:03 -08:00
UbitUmarov
a725b5e01e Let inworld meshs colide as such and not as basic prim all the time. Removed also LOD, and outerskin on colision meshs. 2012-02-27 20:08:43 +00:00
Melanie
960c575dd2 Merge branch 'ubitwork' 2012-02-27 10:35:38 +01:00
Melanie
aee4ca2f1c Fix vehicles going physical stopping llTargetOmega parts (boat radar) 2012-02-27 08:50:19 +01:00
Melanie
d342008e5b Fix NPC appearance setting to include attachments again 2012-02-27 08:49:19 +01:00
UbitUmarov
0d51c42f59 update ubitODE to my current working state 2012-02-27 02:10:03 +00:00
UbitUmarov
f451f67213 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-27 01:31:29 +00:00
Melanie
d46235f5a3 Merge branch 'ubitwork' 2012-02-26 21:17:31 +01:00
Melanie
e5e5b94cbe Make llSetKeyframedMotion prims waut at the borders of down sims and try again
periodically.
2012-02-26 21:16:24 +01:00
UbitUmarov
d8ecc28df5 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-26 18:43:56 +00:00
UbitUmarov
118986f150 added in chODE GeomTriMeshDataDestroy to explicity release internal trimesh data. 2012-02-26 17:51:43 +00:00
Melanie
fca8c82232 Move KeyframeMotion from SOG to SOP because we can't persist it any
other way because SOG doesn't technically exist in the DB
2012-02-26 18:11:38 +01:00
Melanie
356603fff9 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/KeyframeMotion.cs
2012-02-26 15:15:47 +01:00
Melanie
ac1e30156a Implement proper selection behavior 2012-02-26 15:09:00 +01:00
Melanie
416f39a561 Implement KeyframedMotion selection behavior 2012-02-26 15:06:05 +01:00
Melanie
8cdc115c91 Fix deserialization of Buoyancy, Force and Torque. Remove debug from the new
code.
2012-02-26 14:30:24 +01:00
Melanie
9a15bba99b Fix an infinite recursion caused by checking the wrong values for
Buoyancy, Force and Torque
2012-02-26 13:31:29 +01:00
Melanie
aa552d0526 Serialize Keyframe motion for region crossings 2012-02-26 12:29:35 +01:00
Diva Canto
142f8a4aec HG: Remove async in posting assets to foreign grid. Mono hates concurrency there. 2012-02-25 21:00:19 -08:00
Melanie
edc78defed Zero force and torque on take so that items don't run away when rezzed 2012-02-26 02:52:08 +01:00
Melanie
e9120890a2 Merge branch 'ubitwork' 2012-02-26 02:41:41 +01:00
Melanie
c82709c0d6 Implement llSetKeyframedMotion. No persistence, no region crossing. Yet. 2012-02-26 02:36:34 +01:00
UbitUmarov
e07440d0c5 changed SOP Force and Torque, adding XML (de/)serialization, also changed Buoyance. PLEASE trap deserialization from inventory etc, making force and torque vector3.Zero, unless we want then to rez moving. (needs checking/testing as usual) 2012-02-25 22:20:25 +00:00
BlueWall
4177571a78 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim into v3_support 2012-02-25 14:33:56 -05:00
UbitUmarov
7b6649177e Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-25 17:51:12 +00:00
Melanie
6386fdcda7 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
	OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
2012-02-25 16:24:01 +00:00
PixelTomsen
01f454242d PRIM_SCULPT_FLAG_INVERT, PRIM_SCULPT_FLAG_MIRROR implemented
http://opensimulator.org/mantis/view.php?id=5763
2012-02-25 15:33:33 +00:00
Melanie
5eb1679367 Delay the sending of the initial werables update until the inventory and
VFS in the viewer are ready. We're much faster than SL and that exposes this
race condition. Also reinstate the extra avatar data send on login
2012-02-25 12:25:16 +01:00
Justin Clark-Casey (justincc)
4a5f9fe6a2 Move libopenjpeg native libraries into lib32 and lib64 as appropriate. 2012-02-25 04:26:32 +00:00
Justin Clark-Casey (justincc)
6159110258 Remove some more unused Bullet libraries. 2012-02-25 04:22:59 +00:00
Justin Clark-Casey (justincc)
ca19b9078f Remove old libbulletnet native libraries. These are not used in the current generation bullet physics plugin. 2012-02-25 03:36:43 +00:00
Justin Clark-Casey (justincc)
6138662716 Move other sqlite and ode 32-bit and 64-bit libraries into lib32 or lib64 as appropriate. 2012-02-25 03:25:56 +00:00
Justin Clark-Casey (justincc)
3fbcd21916 Remove xunit.dll, Fadd.Globalization.Yaml.dll and Fadd.dll. It looks like these were once connected with HttpServer.dll but are now unused. 2012-02-25 03:12:41 +00:00
Justin Clark-Casey (justincc)
b48b0b1e58 Remove EXPERIMENTAL tags from load iar/save iar commands. 2012-02-25 00:48:41 +00:00
Justin Clark-Casey (justincc)
f9066e7d86 Establish a distsrc nant target for producing the source distribution.
This is in addition to the distbin target.  The distbin target now needs distsrc to be run first.
Still needs some extra tweaking that I shall eventually put in as sed invocations or similar.
2012-02-25 00:36:28 +00:00
PixelTomsen
7b5e42c744 llGetLinkMedia, llSetLinkMedia, llClearLinkMedia implementation mantis: http://opensimulator.org/mantis/view.php?id=5756 http://opensimulator.org/mantis/view.php?id=5755 http://opensimulator.org/mantis/view.php?id=5754 2012-02-24 23:10:41 +00:00
UbitUmarov
efbfa832bb Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-24 22:25:13 +00:00
UbitUmarov
23679c3808 replace bad meshs by a small cube and log it. 2012-02-24 20:34:11 +00:00
Melanie
70b4bc8cf5 Merge branch 'ubitwork' 2012-02-24 19:48:39 +01:00
Melanie
991826ca76 Try not to send the avatar updates on login. This may mean loggin in with
invisible attachments again but could help the appearance issues.
2012-02-24 19:31:27 +01:00
UbitUmarov
ec94b82f51 stop using useless geom tricallback. 2012-02-24 18:25:43 +00:00
Melanie
95f43ab73e Add a cache on GridService requests 2012-02-24 18:17:30 +01:00
Melanie
37068d17c5 Merge branch 'master' into careminster 2012-02-24 09:56:06 +00:00
Justin Clark-Casey (justincc)
bafef292f4 Take watchdog alarm calling back outside the m_threads lock.
This is how it was originally.  This stops a very long running alarm callback from causing a problem.
2012-02-24 05:25:18 +00:00
Justin Clark-Casey (justincc)
9e6ffe7798 Rename Watchdog.GetThreads() to GetThreadsInfo() to reflect what it actually returns and for consistency. 2012-02-24 05:15:47 +00:00
Justin Clark-Casey (justincc)
84735b644c Get rid of some of the identical exception catching in Scene.Update(). 2012-02-24 05:12:56 +00:00
Justin Clark-Casey (justincc)
f67f37074f Stop spurious scene loop startup timeout alarms for scenes with many prims.
On the first frame, all startup scene objects are added to the physics scene.
This can cause a considerable delay, so we don't start raising the alarm on scene loop timeouts until the second frame.
This commit also slightly changes the behaviour of timeout reporting.
Previously, a report was made for the very first timed out thread, ignoring all others until the next watchdog check.
Instead, we now report every timed out thread, though we still only do this once no matter how long the timeout.
2012-02-24 05:02:33 +00:00
Justin Clark-Casey (justincc)
fe229f10e6 In osSetSpeed(), if no avatar for a uuid is found then don't attempt to set speed. 2012-02-24 04:08:59 +00:00
UbitUmarov
5145980c74 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-24 02:13:43 +00:00
PixelTomsen
0b9f4d7e74 llLinkSitTarget implementation http://wiki.secondlife.com/wiki/LlLinkSitTarget 2012-02-24 00:58:11 +00:00
Justin Clark-Casey (justincc)
f034958bdc Load appropriate 32-bit/64-bit Windows sqlite dll if using WebStatsModule.
This should resolve http://opensimulator.org/mantis/view.php?id=5901
2012-02-23 23:11:47 +00:00
Melanie
daf58575f8 Partially apply the core banlines fix 2012-02-23 23:05:04 +00:00
Justin Clark-Casey (justincc)
90ea00a109 Try to resolve some problems with viewers crashing after hitting parcel banlines or freezing on the banline.
This involves
1) On forcible teleport, call m_scene.RequestTeleportLocation() rather than ScenePresence.Teleport() - only EntityTransferModule now should call SP.Teleport()
2) When avatar is being forcibly moved due to banlines, use a 'stop movement' tolerance of 0.2 to requested position rather than 1
This prevents the avatar sometimes being stuck to banlines until they teleport somewhere else.
This aims to fix some problems in http://opensimulator.org/mantis/view.php?id=5822
2012-02-23 22:56:42 +00:00
Melanie
e7cebaa4bd Merge branch 'master' into careminster 2012-02-23 22:50:31 +00:00
Melanie
e74bf46007 Prevent a nullref when nonphysical motion objects cross sim boundaries 2012-02-23 23:18:01 +01:00
Melanie
7c520cf531 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-02-23 22:27:20 +01:00
Melanie
1c0adfa6e0 Correct sit position calculations 2012-02-23 22:26:17 +01:00
Melanie
f3ea2bde61 Fix preserving the animation state of a crossing seated avatar 2012-02-23 20:32:35 +01:00
UbitUmarov
8994ab1336 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-23 14:50:49 +00:00
Melanie
dc835717d6 Properly sequence updates of avatars and attachments so that we don't
update attachments on child avatars or intermingle agent and attachment
updates, which would render the root prim of huds invisible
2012-02-23 14:08:35 +01:00
Melanie
f266c54f82 Merge branch 'ubitwork' 2012-02-23 13:10:02 +01:00
Melanie
56cc573d2f Show avatars as sitting on proot prims only to avoid motion jitter
for passengers
2012-02-23 12:20:20 +01:00
BlueWall
af377470e1 Merge branch 'master' into v3_support 2012-02-22 22:29:30 -05:00
UbitUmarov
e827bcaf2b Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-23 02:04:16 +00:00
Melanie
f1a76195ea Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
2012-02-23 01:49:14 +00:00
Melanie
9ed4245d9e Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim 2012-02-23 01:42:08 +00:00
Melanie
1dfc990264 Add a position parameter to region crossing of objects. This avoids the
potential bad update that places an object at the opposite side of the
origin sim for a moment before actually crossing it. Especially important in
grids like OSG where lag between sims is high.
2012-02-23 01:40:30 +00:00
UbitUmarov
15bc539bd4 fix the last fix. Regions are square but... Also remove the 0.5 offset in map position. It was apparently needed to fix we having nsamples = size and not size + 1. 2012-02-23 00:50:07 +00:00
UbitUmarov
aa77d1d486 fix my bug on ChODE terrain heightmap build 2012-02-23 00:22:44 +00:00
Melanie
c0b8f3d0bc Add permission checks to scripted object movements, which didn't respect bans
and parcel settings until now. Add llSetRegionPos() function according to
LL spec
2012-02-23 00:08:31 +01:00
Melanie
3796e08b59 Count agents for LSL instead of relying on SceneGraph to have the correct
value. Fixes a reported glitch.
2012-02-22 23:14:29 +01:00
BlueWall
165ae251ec V3 Support
The V3 webapps need SSO capability and use OpenID. We need to send both our OpenID server url and a token for the user in the login response.
2012-02-22 16:36:28 -05:00
Melanie
1e1270166f Adjust sit target and the llSetLinkPrimitiveParams sit position hack
to match SL.
2012-02-22 20:40:44 +01:00
BlueWall
67bea681e2 Add web profile url setting to ini 2012-02-21 23:04:49 -05:00
Justin Clark-Casey (justincc)
5d31267185 Remove two spurious m_sceneGraph != null checks in Scene.cs. It's set in constructor and never subsequent set to null. 2012-02-22 00:55:16 +00:00
Melanie
65f5f60317 Merge branch 'master' into careminster 2012-02-21 23:43:39 +00:00
Justin Clark-Casey (justincc)
cf9b3e7708 Restore the taskItem null check that I accidentally blatted in 5397a6d
This is a valid check because the caller could supply an invalid uuid.
2012-02-21 23:41:48 +00:00
Melanie
1273ec6c7d Merge branch 'master' into careminster 2012-02-21 23:17:39 +00:00
PixelTomsen
1c533eb520 Fix:LINK_ROOT flag for llGetLinkName() by SinglePrim 2012-02-21 23:15:33 +00:00
Justin Clark-Casey (justincc)
5397a6d4c6 Fix problem with dragging child part inventory item to user inventory.
This fixes the problem by fixing the permissions module to look at root part permissions rather than having to do this for every caller.
Resolves http://opensimulator.org/mantis/view.php?id=5569
2012-02-21 22:54:30 +00:00
Melanie
24a49011cb Merge branch 'master' into careminster 2012-02-21 22:54:00 +00:00
Justin Clark-Casey (justincc)
76f411147d Revert "Fix:Cannot drag inventory from child prim into inventory http://opensimulator.org/mantis/view.php?id=5569"
This reverts commit 15ce73caca.

As per the COMMENTS in http://opensimulator.org/mantis/view.php?id=5569, I was going to fix this in a more general way.
2012-02-21 22:49:06 +00:00
PixelTomsen
15ce73caca Fix:Cannot drag inventory from child prim into inventory http://opensimulator.org/mantis/view.php?id=5569 2012-02-21 22:07:12 +00:00
Melanie
cb4509f3b8 Reverse the changed to ODE heightmap. It results in SERIOUS issues like an
irreversible y-flip and holes in the map.
2012-02-21 21:34:02 +01:00
Melanie
dede31174e Merge branch 'master' into careminster 2012-02-21 22:08:34 +00:00
BlueWall
7cf970fb27 V3 Support:
This starts V3 support by adding a profile server url to the login response. This requires viewer support - which is also being worked on.
2012-02-21 14:21:03 -05:00
Melanie
0e4d5a4d3c Also preserve angular velocity on crossing. 2012-02-21 10:10:04 +01:00
Melanie
03e7bc1526 Merge branch 'master' into careminster
Conflicts:
2012-02-21 10:20:56 +00:00
Justin Clark-Casey (justincc)
a27e5a9c95 Both 32-bit and 64-bit BulletSim.dll must have the same name. Rename the 64 bit one in lib64 2012-02-21 04:12:17 +00:00
Justin Clark-Casey (justincc)
daee2eda93 Load 32-bit or 64-bit BulletSim Windows library automatically as appropriate.
This uses the same approach as ODE.
radams, if this doesn't work for you please feel free to revert.
2012-02-21 04:10:39 +00:00
Justin Clark-Casey (justincc)
a15b00d3ef Replace previous windows 64-bit sqlite3.dll with one from http://system.data.sqlite.org/downloads/1.0.79.0/sqlite-netFx35-binary-bundle-x64-2008-1.0.79.0.zip
In this zip, it's called System.Data.SQLite.dll.  We rename it to lib64/sqlite3.dll
This is a little unexpected but it works.  For some reason my hand-rolled one in Visual Studio 2008 did not.
This is sqlite 3.7.10.  Other libraries are still currently 3.7.6 but this should make no difference.
This should make it possible to use OpenSim.exe on 64-bit Windows now, though currently the bullet physics plugin will still complain (can be ignored if you are not using bullet).
2012-02-21 04:01:27 +00:00
Justin Clark-Casey (justincc)
1b906ef2ad Replace win 64-bit sqlite3.dll with another version, though I suspect this one won't work either. 2012-02-21 03:24:01 +00:00
Justin Clark-Casey (justincc)
68a4ef5ef6 Add 64 bit Windows sqlite3.dll and use this if running a 64-bit windows process. 2012-02-21 02:52:20 +00:00
Justin Clark-Casey (justincc)
90dc5f47e7 Fix bug where NPCs would establish child agents on other neighbour regions that had come up after the NPC was created. 2012-02-21 01:57:19 +00:00
Justin Clark-Casey (justincc)
19d271d3fc Remove PhysXPlugin and wrappers.
In over 4 years this never progressed beyond an unimplemented stub.
This doesn't mean that it can't come back if someone is interested in implementing PhysX support.
2012-02-21 01:45:17 +00:00
Melanie
ee62bf3c69 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-02-20 20:23:14 +01:00
Melanie
3b2900e884 Merge branch 'master' into careminster 2012-02-20 19:48:28 +00:00
Diva Canto
4a329098e8 Amend to last commit: synchronize access to queues. 2012-02-20 11:12:02 -08:00
Diva Canto
99b9c1a9d5 More improvements on agent position updates: if the target sims fail, blacklist them for 2 min, so that we don't keep doing remote calls that fail. 2012-02-20 10:58:07 -08:00
Melanie
d6b8febbf4 Make vehicles retain velocity when crossing between regions. 2012-02-20 19:49:01 +01:00
Melanie
8f8206f478 Add an override to make SOG.Velocity work as expected 2012-02-20 16:55:12 +01:00
Diva Canto
1c3ee5d1ce One more tweak related to the previous 2 commits. 2012-02-19 16:42:01 -08:00
Diva Canto
b489c85226 Amend to last commit. This should have been committed too. 2012-02-19 15:37:37 -08:00
Diva Canto
dcea23906b Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-19 12:28:47 -08:00
Diva Canto
20c65ac438 A few more tweaks on position updates and create child agents. Mono hates concurrent uses of the same TCP connection, and even of the connections to the same server. So let's stop doing it. This patch makes movement much smoother when there are lots of neighbours. 2012-02-19 12:28:07 -08:00
Melanie
77575ec51b Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-02-19 20:36:26 +01:00
Melanie
756baff86a Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
2012-02-19 21:14:18 +00:00
Melanie
4bc3a0ecf4 Uncomment serialization 2012-02-19 20:25:20 +01:00
Melanie
433d5f1d3e Merge branch 'ubitwork' 2012-02-19 20:24:00 +01:00
UbitUmarov
3c9b7f2c0c simplified vehicle fromXml. Use still comented on SceneObjectSerialized.cs 2012-02-19 19:27:01 +00:00
Melanie
d6f212059e Fix merge issues in prebuild 2012-02-19 20:17:47 +01:00
Melanie
96409cc2ee Merge branch 'ubitwork'
Conflicts:
	OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
	OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
2012-02-19 20:08:01 +01:00
UbitUmarov
60d68ee312 Vehicle XML serialization more complete. Inactived by coments in SceneObjectSerializar.cs until proper testing 2012-02-19 18:10:00 +00:00
BlueWall
bcb9577495 Use localy defined name, TPFlags, for Constants.TeleportFlags 2012-02-19 12:09:57 -05:00
Melanie
488ec59408 Merge branch 'master' into careminster 2012-02-19 14:57:51 +00:00
UbitUmarov
b77d354e6d moved vehicle from SOG to SOP 2012-02-19 13:21:01 +00:00
Melanie
185bf55804 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster 2012-02-19 14:20:53 +01:00
PixelTomsen
d22715126c Fix:Fly setting for Parcel dosen't work http://opensimulator.org/mantis/view.php?id=5887
Signed-off-by: nebadon <michael@osgrid.org>
2012-02-19 01:58:28 -07:00
PixelTomsen
a114367b9b Fix:OmegaX, OmegaY and OmegaZ not saved for child prims http://opensimulator.org/mantis/view.php?id=5893
Signed-off-by: nebadon <michael@osgrid.org>
2012-02-19 01:00:01 -07:00
Diva Canto
2ffc055f7e This should smooth movement in heteregeneous networks by a lot: cache the region by position instead of looking it up all the time -- this was being done during the main update loop! 2012-02-18 21:59:42 -08:00
UbitUmarov
736fb0b41d minor fix to chODE terrain heighmap scale 2012-02-19 02:07:43 +00:00
Melanie
985526b662 Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
	OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
2012-02-18 22:21:10 +00:00
UbitUmarov
7a1ab03b75 missing paramenters init plus some cleaning 2012-02-18 19:31:36 +00:00
UbitUmarov
a62baf8ea4 added a EnUsCulture whatever that is.. 2012-02-18 18:37:29 +00:00
UbitUmarov
028dc1f4ed a bit less human readable xml 2012-02-18 18:33:41 +00:00
UbitUmarov
70b3b599bc added some ToXml2 to SOGVehicle ( unused untested ) 2012-02-18 18:25:48 +00:00
UbitUmarov
3aee642190 changed how vehicle data is stored and passed to physics. use unsafe in serializer, tried to control m_dupeInProgress 2012-02-18 17:42:14 +00:00
UbitUmarov
91a326331f vehicle parameters do cross (i hope) on regions in same instance ( others need xml) 2012-02-18 16:16:48 +00:00
UbitUmarov
5351ff925c let SOG know about vehicles. Still needs serialization and applyphyscis on deserialize, etc 2012-02-18 14:08:42 +00:00
BlueWall
14e9bf894c Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-18 00:51:23 -05:00
BlueWall
f4cd35322f Route logins according to Estate, Telehub and TeleportFlags 2012-02-18 00:45:43 -05:00
BlueWall
7bdcf9eb26 Propagate our teleport flags on logins 2012-02-18 00:32:09 -05:00
Justin Clark-Casey (justincc)
9846a1e56e Report an error if the required native Windows ODE library can't be found. 2012-02-18 02:52:29 +00:00
Justin Clark-Casey (justincc)
4cc97df8f3 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-18 02:46:44 +00:00
Justin Clark-Casey (justincc)
0ef64fbe03 Actually add the Windows 64-bit ode.dll file.
This might be why it didn't work.
2012-02-18 02:46:07 +00:00
BlueWall
fbccff4994 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-17 21:15:18 -05:00
Justin Clark-Casey (justincc)
84184708de Fix a bug where changing shape parameters of a child prim in a linkset would not persist.
Resolves http://opensimulator.org/mantis/view.php?id=5819
2012-02-18 01:15:43 +00:00
BlueWall
8f8b478d36 Parcel sales support to SQLite 2012-02-17 20:04:38 -05:00
Justin Clark-Casey (justincc)
b817c337dc On Windows automatically load the correct native ODE library depending on whether the process is 32-bit or 64-bit
In theory, this means that a 64-bit Windows OS user can now run OpenSim.exe with ODE and use more than 2 (or 3) GB of memory.
However, this is completely untested since I don't currently own a 64-bit Windows box.  Feedback appreciated.
Using OpenSim.32BitLaunch.exe should continue to work.  Other platforms are unaffected.
This will currently not work with sqlite - I will add that too if this works.
2012-02-18 00:33:52 +00:00
BlueWall
d03e878d53 Fillin missing SQLite support for Telehubs 2012-02-17 17:31:20 -05:00
Dan Lake
b313d16493 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-17 13:51:54 -08:00
Dan Lake
784263f5e3 Added the TriggerAvatarAppearanceChanged to EventManager. It's triggered by AvatarFactoryModule after an avatar's appearance has been succesfully changed and persisted (if the persist option is set). 2012-02-17 13:45:45 -08:00
UbitUmarov
7d77ccc659 Added simple binary serializer/deserializer to chODE. 100% untested and most like still broken 2012-02-17 21:09:00 +00:00
Robert Adams
6baa13ab7a Add new and updated script events 2012-02-17 09:12:41 -08:00
BlueWall
0e16e0fb6a Merge branch 'master' of /home/opensim/src/opensim 2012-02-17 08:21:33 -05:00
BlueWall
ba98d6fffe Fix missing telehub handling on login 2012-02-17 08:03:53 -05:00
Justin Clark-Casey (justincc)
972f73ed2b Make osNpcStopAnimation() call AvatarStopAnimation() rather than AvatarPlayAnimation() 2012-02-17 02:53:12 +00:00
BlueWall
c5ff37bf3e Merge branch 'master' of /home/opensim/src/opensim 2012-02-16 09:01:02 -05:00
BlueWall
6b867773a8 Remove some debugging output form the logger 2012-02-16 08:59:34 -05:00
Justin Clark-Casey (justincc)
912aac3447 minor formatting changes from last commit (4486n7d) 2012-02-16 03:37:40 +00:00
PixelTomsen
4486b7d8e8 Fix: Object owned by the group does not return to the last owner http://opensimulator.org/mantis/view.php?id=5404 2012-02-16 03:35:18 +00:00
Justin Clark-Casey (justincc)
1267094a51 Turn off logging on test in last commit (2b84295). 2012-02-16 03:02:11 +00:00
Justin Clark-Casey (justincc)
2b842958cc If shape properties fail SOP parsing (e.g. due to commas instead of decimal points) print out one short message listing the failing node names rather than lots of exceptions.
Adds skeleton bad float values deserialization test
2012-02-16 02:58:00 +00:00
Justin Clark-Casey (justincc)
80ec2ac167 Correct a bug introduced in 1f402fdf (Feb 7 2012) where the delete friends grid call would try and contact the wrong uri. Also fixes the build from df960d5 2012-02-16 01:39:12 +00:00
Justin Clark-Casey (justincc)
df960d5767 Add known identity informatio nto log message if an exception is thrown during LLUDPServer.HandleUseCircuitCode() 2012-02-16 01:25:54 +00:00
Melanie
0c1074537b Merge branch 'master' into careminster
Conflicts:
	OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
2012-02-16 00:38:04 +00:00
Justin Clark-Casey (justincc)
c0760f9f91 Comment out "experimental" log message printed out whenever a physics mesh was generated for a mesh
Also adds prim name to the "no asset data" error log message
2012-02-16 00:28:57 +00:00
Justin Clark-Casey (justincc)
c906128191 Fix some logic mistakes where firstly osNpcCreate() without options was creating npcs sensed as agents and secondly the OS_NPC_SENSE_AS_AGENT option was having the opposite effect.
Hopefully makes progress on addressing http://opensimulator.org/mantis/view.php?id=5872
2012-02-16 00:22:39 +00:00
UbitUmarov
819fcdaee1 Now if chode prim.cs detects out of bounds it requests a update and blocks movement and colisions. Base code must do a PhysActor.CrossingFailure() to make it move again inside sim or delete it. 2012-02-15 22:04:26 +01:00
UbitUmarov
3bffdddc9d don't freeze with a sitted avatar in a border without other sim. Still messy :( 2012-02-15 22:04:17 +01:00
UbitUmarov
f6c35cf26f Now if chode prim.cs detects out of bounds it requests a update and blocks movement and colisions. Base code must do a PhysActor.CrossingFailure() to make it move again inside sim or delete it. 2012-02-15 20:33:31 +00:00
UbitUmarov
b59275355e don't freeze with a sitted avatar in a border without other sim. Still messy :( 2012-02-15 19:44:54 +00:00
UbitUmarov
a758abaa9f try to make crossings work better. chode no longer prevents crossings i hope 2012-02-15 17:08:33 +00:00
UbitUmarov
f6f0d884bd try to make crossings work better. chode no longer prevents crossings i hope 2012-02-15 16:44:15 +01:00
UbitUmarov
04279e36d1 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork 2012-02-15 03:51:30 +00:00
Justin Clark-Casey (justincc)
f574d3c8fc Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-15 01:50:57 +00:00
Justin Clark-Casey (justincc)
ebe5e1731d In ObjectTortureTests, run garbage collector on Teardown and run scene loop update when scene objects have been deleted.
At least on mono 2.6.4, running GC.Collect() is not guaranteed to force gc of all objects when run in the same method where those objects had references.
Therefore, GC.Collect() is now being done in the per-script teardown of ObjectTortureTests.
In addition, scene loop update is being run after garbage collection in order to clean out the viewer update list of scene objects in the SceneGraph.
These measures mean that scene objects/parts are now garbage collected after a test run if deleted from the scene, resulting in a much better memory usage report (though probably still not very accurate).
However, deletion takes a very long time - what's really needed is to find out now why the entire scene isn't being GC'd by this measure.
This change hasn't yet been applied to the other stress tests.
2012-02-15 01:45:25 +00:00
Dan Lake
2ebb421331 Refactor appearance saving for NPC to use AvatarFactoryModule interface. 2012-02-14 17:20:34 -08:00
Melanie
7be9ba5564 Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster 2012-02-15 01:11:35 +00:00
Melanie
272ba5a741 Merge branch 'master' into careminster 2012-02-15 01:11:17 +00:00
Melanie
2d3381b795 Implement region crossing of sitting avatars. Edit mode and llSetPos work
but unscripted default sit anim is lost. Still some Gfx glitching. Physical
crossing doesn't work yet.
2012-02-14 23:16:20 +01:00
Mic Bowman
a9e8bd59a3 Fix a race condition in the simian groups connector. When requests were
too slow they would circumvent the cache (piling up on the network service
and making the problem even worse). This condition happens frequently
during permission checks.
2012-02-13 19:38:22 -08:00
PixelTomsen
4589ce61bc Fix: get embedded objects from Notecard fails with activated FreeSwitchVoiceModul
http://opensimulator.org/mantis/view.php?id=2607
2012-02-14 02:12:12 +00:00
PixelTomsen
33e66107be Fix: Lightshare Module(Windlight)-Region settings are not applicable for database sqlite mantis: http://opensimulator.org/mantis/view.php?id=5888 2012-02-14 02:06:42 +00:00
PixelTomsen
db90dea9bd Fix: MSSQLDB Grid - unable to register region http://opensimulator.org/mantis/view.php?id=5886 2012-02-14 02:04:02 +00:00
Justin Clark-Casey (justincc)
04544b4510 Revert "Add GridStore migration for MSSQL."
This reverts commit 0b17a66e68.
2012-02-14 02:03:23 +00:00
Justin Clark-Casey (justincc)
0b17a66e68 Add GridStore migration for MSSQL.
This is done blind since I don't use MSSQL.  If this doesn't work, then one will have to wait for it to be updated for the 0.7.3 opensim release.
2012-02-14 02:02:11 +00:00
Justin Clark-Casey (justincc)
04986bbb15 Add some more data to the new user connection logging for debug purposes. 2012-02-14 01:50:51 +00:00
Justin Clark-Casey (justincc)
b0d02adeee Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-14 00:01:24 +00:00
Justin Clark-Casey (justincc)
48b962c401 Update [XEngine] AppDomainLoading advice in OpenSim.ini.example 2012-02-14 00:00:49 +00:00
Mic Bowman
04a195266b short circuit the expensive parts of the permission checking code
if the current user is the owner of an object. none of the later
checks can reverse the outcome.
2012-02-13 13:21:42 -08:00
Justin Clark-Casey (justincc)
21393af631 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-13 20:48:50 +00:00
Justin Clark-Casey (justincc)
189c67db95 On object deserialization, go back to logging errors at DEBUG level rather than ERROR. Restore extra log message if shape processing fails.
Logging level was DEBUG before 312e145 (Fri Feb 3 2012).
312e145 also accidentally removed the 'general error' log message if any shape deserialization failed.
This commit restores it, though this has no functional impact.
2012-02-13 20:43:26 +00:00
UbitUmarov
6fd6919a0b remove drawstuff from ubitode 2012-02-11 19:25:41 +00:00
UbitUmarov
f168fefb79 removed outdated coments. 2012-02-11 19:14:27 +00:00
UbitUmarov
bcf59a574f remove forgotten taints code 2012-02-11 19:12:04 +00:00
UbitUmarov
09f6647aa3 scenepresence change! in standup() give avatar a physical actor after deciding the new position. This reduces a bit the odds of it being still coliding with object. 2012-02-11 17:48:49 +00:00
UbitUmarov
022ae33ed5 UbitODE: replace 'taints' by 'changes' for avatars also. This provides better time order with changes in prims. 2012-02-11 17:35:38 +00:00
UbitUmarov
d4e28ed113 vehicle changes done by simulation thread and not calling one 2012-02-11 15:18:13 +00:00
UbitUmarov
3f9c390b4d changes to vehicle banking 2012-02-11 14:29:36 +00:00
UbitUmarov
33a9f0f1c5 a bit better vertical attractor and banking 2012-02-11 04:42:45 +00:00
UbitUmarov
f415256e0b Use mesh to estimate real center of prims if avaiable. Let sculpt map textures with alpha channel work. On linux J2DecodeCache folder must be deleted to remove bad entries. Corrently this can't be cached on linux (mono/ cairo/? problem) 2012-02-11 03:25:17 +00:00
UbitUmarov
b617411b97 scale avatar push force with avatar density 2012-02-11 02:48:38 +00:00
Justin Clark-Casey (justincc)
b92b9228ef correct the default avatar_terminal_velocity value that I accidentally left in whilst testing 2012-02-11 02:29:07 +00:00
Justin Clark-Casey (justincc)
f49897a419 Clamp ODE character velocity. Make ODE falling character 54m/s by default.
If velocity reaches 256 in any vector then bad things happen with ODE, so we now clamp this value.
In addition, a falling avatar is clamped by default at 54 m/s, which is the same as a falling skydiver.
This also appears to be the value used on the linden lab grid.
This should resolve http://opensimulator.org/mantis/view.php?id=5882
2012-02-11 02:28:40 +00:00
UbitUmarov
83868c0387 revert project name to OpenSim and not Careminster 2012-02-11 01:07:57 +00:00
Justin Clark-Casey (justincc)
aab30f5e67 Merge branch 'master' of ssh://opensimulator.org/var/git/opensim 2012-02-11 00:11:28 +00:00
Justin Clark-Casey (justincc)
e7fd732209 Make ScenePresence.MovementFlag a private only settable value to reduce complexity of code analysis 2012-02-11 00:10:59 +00:00
UbitUmarov
43a74d8481 test on git 2012-02-10 23:51:55 +00:00
UbitUmarov
e3f5fd81f1 Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
Conflicts:
	prebuild.xml
2012-02-10 23:03:30 +00:00
UbitUmarov
7cf73cb92a Changes to vehicles code etc. Includes some debug aids to remove later. 2012-02-10 22:43:51 +00:00
UbitUmarov
6af01f6767 initial introdution of physics actor building control. 2012-02-08 23:14:53 +00:00
UbitUmarov
6cc9aa30ac first change in SOP. in AddPrimShape(..) give physics the world rotation and not local offset. Currently physics interface only knows about world frame 2012-02-08 15:45:44 +00:00
UbitUmarov
754129b903 files need to run UbitODE in linux ( untested ) 2012-02-08 15:33:51 +00:00
UbitUmarov
12c3239666 changes needed to compile UbitODE, also changes project name to "Careminter". untested on linux 2012-02-08 15:29:48 +00:00
UbitUmarov
c75fa8b8a1 changes in physics manager, needed for UbitODE 2012-02-08 15:28:13 +00:00
UbitUmarov
815f3af1d7 UbitODE plugin initial commit 2012-02-08 15:24:10 +00:00
465 changed files with 65459 additions and 32403 deletions

View File

@@ -2,13 +2,37 @@
<!-- please leave the top comment for us emacs folks -->
<property name="nunitcmd" value="nunit-console" />
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
trying to copy across only the essential ones -->
<property name="distbindir" value="distbin" />
<target name="distbin">
<!-- This target produces a source distribution of OpenSimulator -->
<!-- TODO: A few parameters still need to be tweaked after running this - need to do this automatically with sed or similar -->
<target name="distsrc">
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
<copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/>
<!-- delete files generated by runprebuild.sh which had to be run in order to generate the build file for this target-->
<delete>
<fileset basedir="OpenSim">
<include name="**/*.build"/>
<include name="**/*.csproj*"/>
<include name="**/*.dll.build"/>
<include name="**/*.pidb"/>
<exclude name="Tools/OpenSim.32BitLaunch/**"/>
<exclude name="Tools/Robust.32BitLaunch/**"/>
<exclude name="Tools/LaunchSLClient/**"/>
</fileset>
</delete>
<delete>
<fileset>
<include name="OpenSim.build"/>
<include name="OpenSim.sln"/>
</fileset>
</delete>
</target>
<property name="distbindir" value="distbin" />
<!-- This target produces a binary directory called distbin/ in OpenSim/bin which contains everything needed for binary distribution -->
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
trying to copy across only the essential ones -->
<target name="distbin">
<delete dir="${distbindir}"/>
<copy todir="${distbindir}">
<fileset>

View File

@@ -1,4 +1,4 @@
The following people have contributed to OpenSim (Thank you
<<<>>>>The following people have contributed to OpenSim (Thank you
for your effort!)
= Current OpenSim Developers (in very rough order of appearance) =
@@ -71,6 +71,7 @@ what it is today.
* CharlieO
* ChrisDown
* Chris Yeoh (IBM)
* controlbreak
* coyled
* Daedius
* Dong Jun Lan (IBM)
@@ -86,8 +87,10 @@ what it is today.
* Grumly57
* GuduleLapointe
* Ewe Loon
* Fernando Oliveira
* Fly-Man
* Flyte Xevious
* Garmin Kawaguichi
* Imaze Rhiano
* Intimidated
* Jeremy Bongio (IBM)
@@ -106,6 +109,7 @@ what it is today.
* M.Igarashi
* maimedleech
* Mana Janus
* MarcelEdward
* Mic Bowman
* Michelle Argus
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
@@ -135,6 +139,7 @@ what it is today.
* Ruud Lathorp
* SachaMagne
* Salahzar Stenvaag
* satguru p srivastava
* sempuki
* SignpostMarv
* SpotOn3D

View File

@@ -258,10 +258,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
m_log.Info("[RADMIN]: Request to restart Region.");
CheckRegionParams(requestData, responseData);
Scene rebootedScene = null;
GetSceneFromRegionParams(requestData, responseData, out rebootedScene);
bool restartAll = false;
IConfig startupConfig = m_configSource.Configs["Startup"];
if (startupConfig != null)
{
if (startupConfig.GetBoolean("InworldRestartShutsDown", false))
{
rebootedScene = m_application.SceneManager.CurrentOrFirstScene;
restartAll = true;
}
}
if (rebootedScene == null)
{
CheckRegionParams(requestData, responseData);
GetSceneFromRegionParams(requestData, responseData, out rebootedScene);
}
IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
@@ -324,11 +339,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController
notice = false;
}
if (restartModule != null)
List<Scene> restartList;
if (restartAll)
restartList = m_application.SceneManager.Scenes;
else
restartList = new List<Scene>() { rebootedScene };
foreach (Scene s in m_application.SceneManager.Scenes)
{
restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice);
responseData["success"] = true;
restartModule = s.RequestModuleInterface<IRestartModule>();
if (restartModule != null)
restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice);
}
responseData["success"] = true;
}
catch (Exception e)
{
@@ -1673,16 +1697,25 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = (Hashtable)response.Value;
Hashtable requestData = (Hashtable)request.Params[0];
int flags = 0;
string text = String.Empty;
int health = 0;
responseData["success"] = true;
CheckRegionParams(requestData, responseData);
Scene scene = null;
GetSceneFromRegionParams(requestData, responseData, out scene);
try
{
GetSceneFromRegionParams(requestData, responseData, out scene);
health = scene.GetHealth(out flags, out text);
}
catch (Exception e)
{
responseData["error"] = null;
}
int flags;
string text;
int health = scene.GetHealth(out flags, out text);
responseData["success"] = true;
responseData["health"] = health;
responseData["flags"] = flags;
responseData["message"] = text;

View File

@@ -226,7 +226,9 @@ namespace OpenSim.Capabilities.Handlers
// sending back the last byte instead of an error status
if (start >= texture.Data.Length)
{
response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
// viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters
response.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
}
else
{

View File

@@ -162,7 +162,7 @@ namespace OpenSim.Capabilities.Handlers
invFetch.owner_id, invFetch.folder_id, invFetch.owner_id,
invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version);
if (inv.Folders != null)
if (inv != null && inv.Folders != null)
{
foreach (InventoryFolderBase invFolder in inv.Folders)
{
@@ -170,7 +170,7 @@ namespace OpenSim.Capabilities.Handlers
}
}
if (inv.Items != null)
if (inv != null && inv.Items != null)
{
foreach (InventoryItemBase invItem in inv.Items)
{

View File

@@ -0,0 +1,47 @@
/*
* 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.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Data
{
/// <summary>
/// This interface exists to distinguish between the normal IAssetDataPlugin and the one used by XAssetService
/// for now.
/// </summary>
public interface IXAssetDataPlugin : IPlugin
{
AssetBase GetAsset(UUID uuid);
void StoreAsset(AssetBase asset);
bool ExistsAsset(UUID uuid);
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
void Initialise(string connect);
bool Delete(string id);
}
}

View File

@@ -89,5 +89,11 @@ namespace OpenSim.Data.MSSQL
return DoQuery(cmd);
}
}
public FriendsData[] GetFriends(Guid principalID)
{
return GetFriends(principalID.ToString());
}
}
}

View File

@@ -813,7 +813,7 @@ namespace OpenSim.Data.MSSQL
{
try
{
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID", connection))
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID and type=-1", connection))
{
command.Parameters.Add(database.CreateParameter("folderID", folderID));

View File

@@ -104,6 +104,11 @@ namespace OpenSim.Data.MSSQL
{
return SqlDbType.BigInt;
}
if (type == typeof(DateTime))
{
return SqlDbType.DateTime;
}
return SqlDbType.VarChar;
}

View File

@@ -675,7 +675,7 @@ VALUES
cmd.ExecuteNonQuery();
}
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags]) VALUES (@LandUUID,@AccessUUID,@Flags)";
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags],[Expires]) VALUES (@LandUUID,@AccessUUID,@Flags,@Expires)";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
@@ -1215,6 +1215,8 @@ VALUES
//Store new values
StoreNewRegionSettings(regionSettings);
LoadSpawnPoints(regionSettings);
return regionSettings;
}
@@ -1252,7 +1254,7 @@ VALUES
,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se
,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit
,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id, [map_tile_id] = @TerrainImageID, [telehubobject] = @telehubobject, [parcel_tile_id] = @ParcelImageID
WHERE [regionUUID] = @regionUUID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
@@ -1263,6 +1265,7 @@ VALUES
cmd.ExecuteNonQuery();
}
}
SaveSpawnPoints(regionSettings);
}
public void Shutdown()
@@ -1367,7 +1370,7 @@ VALUES
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
newSettings.SunVector = new Vector3(
@@ -1383,6 +1386,11 @@ VALUES
newSettings.LoadedCreationID = "";
else
newSettings.LoadedCreationID = (String)row["loaded_creation_id"];
newSettings.TerrainImageID = new UUID((string)row["map_tile_ID"]);
newSettings.ParcelImageID = new UUID((Guid)row["parcel_tile_ID"]);
newSettings.TelehubObject = new UUID((Guid)row["TelehubObject"]);
return newSettings;
}
@@ -1454,6 +1462,13 @@ VALUES
}
newData.ParcelAccessList = new List<LandAccessEntry>();
newData.MediaDescription = (string)row["MediaDescription"];
newData.MediaType = (string)row["MediaType"];
newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
return newData;
}
@@ -1468,7 +1483,7 @@ VALUES
LandAccessEntry entry = new LandAccessEntry();
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
entry.Expires = 0;
entry.Expires = Convert.ToInt32(row["Expires"]);
return entry;
}
@@ -1497,7 +1512,8 @@ VALUES
prim.TouchName = (string)primRow["TouchName"];
// permissions
prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
//prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
prim.CreatorIdentification = (string)primRow["CreatorID"];
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
@@ -1691,7 +1707,8 @@ VALUES
taskItem.Name = (string)inventoryRow["name"];
taskItem.Description = (string)inventoryRow["description"];
taskItem.CreationDate = Convert.ToUInt32(inventoryRow["creationDate"]);
taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
//taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
taskItem.CreatorIdentification = (string)inventoryRow["creatorID"];
taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]);
taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]);
taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]);
@@ -1782,7 +1799,7 @@ VALUES
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun));
parameters.Add(_Database.CreateParameter("sandbox", settings.Sandbox));
parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox));
parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun));
parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition));
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));
@@ -1792,6 +1809,9 @@ VALUES
parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID));
parameters.Add(_Database.CreateParameter("TerrainImageID", settings.TerrainImageID));
parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID));
parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject));
return parameters.ToArray();
}
@@ -1859,6 +1879,7 @@ VALUES
parameters.Add(_Database.CreateParameter("LandUUID", parcelID));
parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID));
parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags));
parameters.Add(_Database.CreateParameter("Expires", parcelAccessEntry.Expires));
return parameters.ToArray();
}
@@ -2063,5 +2084,62 @@ VALUES
#endregion
#endregion
private void LoadSpawnPoints(RegionSettings rs)
{
rs.ClearSpawnPoints();
string sql = "SELECT Yaw, Pitch, Distance FROM spawn_points WHERE RegionUUID = @RegionUUID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID.ToString()));
conn.Open();
using (SqlDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
SpawnPoint sp = new SpawnPoint();
sp.Yaw = (float)reader["Yaw"];
sp.Pitch = (float)reader["Pitch"];
sp.Distance = (float)reader["Distance"];
rs.AddSpawnPoint(sp);
}
}
}
}
private void SaveSpawnPoints(RegionSettings rs)
{
string sql = "DELETE FROM spawn_points WHERE RegionUUID = @RegionUUID";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
conn.Open();
cmd.ExecuteNonQuery();
}
foreach (SpawnPoint p in rs.SpawnPoints())
{
sql = "INSERT INTO spawn_points (RegionUUID, Yaw, Pitch, Distance) VALUES (@RegionUUID, @Yaw, @Pitch, @Distance)";
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
cmd.Parameters.Add(_Database.CreateParameter("@Yaw", p.Yaw));
cmd.Parameters.Add(_Database.CreateParameter("@Pitch", p.Pitch));
cmd.Parameters.Add(_Database.CreateParameter("@Distance", p.Distance));
conn.Open();
cmd.ExecuteNonQuery();
}
}
}
public UUID[] GetObjectIDs(UUID regionID)
{
return new UUID[0];
}
}
}

View File

@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
regionName
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
COMMIT
:VERSION 9
BEGIN TRANSACTION
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
COMMIT

View File

@@ -1044,10 +1044,93 @@ ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL
COMMIT
:VERSION 29 #---------------------
:VERSION 29 #----------------- Region Covenant changed time
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0
COMMIT
:VERSION 30 #------------------Migrate creatorID storage to varchars instead of UUIDs for HG support
BEGIN TRANSACTION
EXECUTE sp_rename N'dbo.prims.creatorid', N'creatoridold', 'COLUMN'
EXECUTE sp_rename N'dbo.primitems.creatorid', N'creatoridold', 'COLUMN'
COMMIT
:VERSION 31 #---------------------
BEGIN TRANSACTION
ALTER TABLE prims ADD CreatorID varchar(255)
ALTER TABLE primitems ADD CreatorID varchar(255)
COMMIT
:VERSION 32 #---------------------
BEGIN TRANSACTION
UPDATE prims SET prims.CreatorID = CONVERT(varchar(255), creatoridold)
UPDATE primitems SET primitems.CreatorID = CONVERT(varchar(255), creatoridold)
COMMIT
:VERSION 33 #---------------------
BEGIN TRANSACTION
ALTER TABLE prims
ADD CONSTRAINT DF_prims_CreatorIDNew
DEFAULT '00000000-0000-0000-0000-000000000000'
FOR CreatorID
ALTER TABLE prims ALTER COLUMN CreatorID varchar(255) NOT NULL
ALTER TABLE primitems
ADD CONSTRAINT DF_primitems_CreatorIDNew
DEFAULT '00000000-0000-0000-0000-000000000000'
FOR CreatorID
ALTER TABLE primitems ALTER COLUMN CreatorID varchar(255) NOT NULL
COMMIT
:VERSION 34 #--------------- Telehub support
BEGIN TRANSACTION
CREATE TABLE [dbo].[Spawn_Points](
[RegionUUID] [uniqueidentifier] NOT NULL,
[Yaw] [float] NOT NULL,
[Pitch] [float] NOT NULL,
[Distance] [float] NOT NULL,
PRIMARY KEY CLUSTERED
(
[RegionUUID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE regionsettings ADD TelehubObject uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT
:VERSION 35 #---------------- Parcels for sale
BEGIN TRANSACTION
ALTER TABLE regionsettings ADD parcel_tile_ID uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT
:VERSION 36 #---------------- Timed bans/access
BEGIN TRANSACTION
ALTER TABLE landaccesslist ADD Expires integer NOT NULL DEFAULT 0;
COMMIT

View File

@@ -119,8 +119,10 @@ namespace OpenSim.Data.MySQL
// Eligibility check
//
if ((flags & (uint)PrimFlags.Temporary) != 0)
return;
// PrimFlags.Temporary is not used in OpenSim code and cannot
// be guaranteed to always be clear. Don't check it.
// if ((flags & (uint)PrimFlags.Temporary) != 0)
// return;
if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0)
return;
@@ -170,7 +172,11 @@ namespace OpenSim.Data.MySQL
"ParticleSystem, ClickAction, Material, " +
"CollisionSound, CollisionSoundVolume, " +
"PassTouches, " +
"LinkNumber, MediaURL) values (" + "?UUID, " +
"PassCollisions, " +
"LinkNumber, MediaURL, KeyframeMotion, " +
"PhysicsShapeType, Density, GravityModifier, " +
"Friction, Restitution, Vehicle " +
") values (" + "?UUID, " +
"?CreationDate, ?Name, ?Text, " +
"?Description, ?SitName, ?TouchName, " +
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
@@ -201,7 +207,10 @@ namespace OpenSim.Data.MySQL
"?SaleType, ?ColorR, ?ColorG, " +
"?ColorB, ?ColorA, ?ParticleSystem, " +
"?ClickAction, ?Material, ?CollisionSound, " +
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
"?CollisionSoundVolume, ?PassTouches, ?PassCollisions, " +
"?LinkNumber, ?MediaURL, ?KeyframeMotion, " +
"?PhysicsShapeType, ?Density, ?GravityModifier, " +
"?Friction, ?Restitution, ?Vehicle)";
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
@@ -446,7 +455,11 @@ namespace OpenSim.Data.MySQL
foreach (SceneObjectPart prim in prims.Values)
{
if (prim.ParentUUID == UUID.Zero)
{
objects[prim.UUID] = new SceneObjectGroup(prim);
if (prim.KeyframeMotion != null)
prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]);
}
}
// Add all of the children objects to the SOGs
@@ -1222,11 +1235,40 @@ namespace OpenSim.Data.MySQL
prim.CollisionSoundVolume = (float)(double)row["CollisionSoundVolume"];
prim.PassTouches = ((sbyte)row["PassTouches"] != 0);
prim.PassCollisions = ((sbyte)row["PassCollisions"] != 0);
prim.LinkNum = (int)row["LinkNumber"];
if (!(row["MediaURL"] is System.DBNull))
prim.MediaUrl = (string)row["MediaURL"];
if (!(row["KeyframeMotion"] is DBNull))
{
Byte[] data = (byte[])row["KeyframeMotion"];
if (data.Length > 0)
prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
else
prim.KeyframeMotion = null;
}
else
{
prim.KeyframeMotion = null;
}
prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString());
prim.Density = (float)(double)row["Density"];
prim.GravityModifier = (float)(double)row["GravityModifier"];
prim.Friction = (float)(double)row["Friction"];
prim.Bounciness = (float)(double)row["Restitution"];
SOPVehicle vehicle = null;
if (row["Vehicle"].ToString() != String.Empty)
{
vehicle = SOPVehicle.FromXml2(row["Vehicle"].ToString());
if (vehicle != null)
prim.VehicleParams = vehicle;
}
return prim;
}
@@ -1237,32 +1279,40 @@ namespace OpenSim.Data.MySQL
/// <returns></returns>
private static TaskInventoryItem BuildItem(IDataReader row)
{
TaskInventoryItem taskItem = new TaskInventoryItem();
try
{
TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ItemID = DBGuid.FromDB(row["itemID"]);
taskItem.ParentPartID = DBGuid.FromDB(row["primID"]);
taskItem.AssetID = DBGuid.FromDB(row["assetID"]);
taskItem.ParentID = DBGuid.FromDB(row["parentFolderID"]);
taskItem.ItemID = DBGuid.FromDB(row["itemID"]);
taskItem.ParentPartID = DBGuid.FromDB(row["primID"]);
taskItem.AssetID = DBGuid.FromDB(row["assetID"]);
taskItem.ParentID = DBGuid.FromDB(row["parentFolderID"]);
taskItem.InvType = Convert.ToInt32(row["invType"]);
taskItem.Type = Convert.ToInt32(row["assetType"]);
taskItem.InvType = Convert.ToInt32(row["invType"]);
taskItem.Type = Convert.ToInt32(row["assetType"]);
taskItem.Name = (String)row["name"];
taskItem.Description = (String)row["description"];
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
taskItem.CreatorIdentification = (String)row["creatorID"];
taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]);
taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]);
taskItem.GroupID = DBGuid.FromDB(row["groupID"]);
taskItem.Name = (String)row["name"];
taskItem.Description = (String)row["description"];
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
taskItem.CreatorIdentification = (String)row["creatorID"];
taskItem.OwnerID = DBGuid.FromDB(row["ownerID"]);
taskItem.LastOwnerID = DBGuid.FromDB(row["lastOwnerID"]);
taskItem.GroupID = DBGuid.FromDB(row["groupID"]);
taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
taskItem.Flags = Convert.ToUInt32(row["flags"]);
taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
taskItem.Flags = Convert.ToUInt32(row["flags"]);
return taskItem;
return taskItem;
}
catch
{
m_log.ErrorFormat("[MYSQL DB]: Error reading task inventory: itemID was {0}, primID was {1}", row["itemID"].ToString(), row["primID"].ToString());
throw;
}
}
private static RegionSettings BuildRegionSettings(IDataReader row)
@@ -1299,7 +1349,7 @@ namespace OpenSim.Data.MySQL
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
newSettings.SunVector = new Vector3 (
Convert.ToSingle(row["sunvectorx"]),
Convert.ToSingle(row["sunvectory"]),
@@ -1577,8 +1627,29 @@ namespace OpenSim.Data.MySQL
else
cmd.Parameters.AddWithValue("PassTouches", 0);
if (prim.PassCollisions)
cmd.Parameters.AddWithValue("PassCollisions", 1);
else
cmd.Parameters.AddWithValue("PassCollisions", 0);
cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
if (prim.KeyframeMotion != null)
cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize());
else
cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]);
cmd.Parameters.AddWithValue("PhysicsShapeType", prim.PhysicsShapeType);
cmd.Parameters.AddWithValue("Density", (double)prim.Density);
cmd.Parameters.AddWithValue("GravityModifier", (double)prim.GravityModifier);
cmd.Parameters.AddWithValue("Friction", (double)prim.Friction);
cmd.Parameters.AddWithValue("Restitution", (double)prim.Bounciness);
if (prim.VehicleParams != null)
cmd.Parameters.AddWithValue("Vehicle", prim.VehicleParams.ToXml2());
else
cmd.Parameters.AddWithValue("Vehicle", String.Empty);
}
/// <summary>
@@ -1865,6 +1936,37 @@ namespace OpenSim.Data.MySQL
}
}
public UUID[] GetObjectIDs(UUID regionID)
{
List<UUID> uuids = new List<UUID>();
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "select UUID from prims where RegionUUID = ?RegionUUID";
cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString());
using (IDataReader reader = ExecuteReader(cmd))
{
while (reader.Read())
{
UUID id = new UUID(reader["UUID"].ToString());
uuids.Add(id);
}
}
}
}
}
return uuids.ToArray();
}
private void LoadSpawnPoints(RegionSettings rs)
{
rs.ClearSpawnPoints();

View File

@@ -0,0 +1,500 @@
/*
* 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.Data;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Security.Cryptography;
using System.Text;
using log4net;
using MySql.Data.MySqlClient;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
namespace OpenSim.Data.MySQL
{
public class MySQLXAssetData : IXAssetDataPlugin
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected virtual Assembly Assembly
{
get { return GetType().Assembly; }
}
private bool m_enableCompression = false;
private string m_connectionString;
private object m_dbLock = new object();
/// <summary>
/// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
/// </summary>
private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
#region IPlugin Members
public string Version { get { return "1.0.0.0"; } }
/// <summary>
/// <para>Initialises Asset interface</para>
/// <para>
/// <list type="bullet">
/// <item>Loads and initialises the MySQL storage plugin.</item>
/// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item>
/// <item>Check for migration</item>
/// </list>
/// </para>
/// </summary>
/// <param name="connect">connect string</param>
public void Initialise(string connect)
{
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_log.ErrorFormat("[MYSQL XASSETDATA]: THIS PLUGIN IS STRICTLY EXPERIMENTAL.");
m_log.ErrorFormat("[MYSQL XASSETDATA]: DO NOT USE FOR ANY DATA THAT YOU DO NOT MIND LOSING.");
m_log.ErrorFormat("[MYSQL XASSETDATA]: DATABASE TABLES CAN CHANGE AT ANY TIME, CAUSING EXISTING DATA TO BE LOST.");
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
m_connectionString = connect;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
Migration m = new Migration(dbcon, Assembly, "XAssetStore");
m.Update();
}
}
public void Initialise()
{
throw new NotImplementedException();
}
public void Dispose() { }
/// <summary>
/// The name of this DB provider
/// </summary>
public string Name
{
get { return "MySQL XAsset storage engine"; }
}
#endregion
#region IAssetDataPlugin Members
/// <summary>
/// Fetch Asset <paramref name="assetID"/> from database
/// </summary>
/// <param name="assetID">Asset UUID to fetch</param>
/// <returns>Return the asset</returns>
/// <remarks>On failure : throw an exception and attempt to reconnect to database</remarks>
public AssetBase GetAsset(UUID assetID)
{
// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID);
AssetBase asset = null;
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand(
"SELECT name, description, asset_type, local, temporary, asset_flags, creator_id, data FROM xassetsmeta JOIN xassetsdata ON xassetsmeta.hash = xassetsdata.hash WHERE id=?id",
dbcon))
{
cmd.Parameters.AddWithValue("?id", assetID.ToString());
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
{
if (dbReader.Read())
{
asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["asset_type"], dbReader["creator_id"].ToString());
asset.Data = (byte[])dbReader["data"];
asset.Description = (string)dbReader["description"];
string local = dbReader["local"].ToString();
if (local.Equals("1") || local.Equals("true", StringComparison.InvariantCultureIgnoreCase))
asset.Local = true;
else
asset.Local = false;
asset.Temporary = Convert.ToBoolean(dbReader["temporary"]);
asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
if (m_enableCompression)
{
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
{
MemoryStream outputStream = new MemoryStream();
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
// int compressedLength = asset.Data.Length;
asset.Data = outputStream.ToArray();
// m_log.DebugFormat(
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
}
}
}
}
}
catch (Exception e)
{
m_log.Error("[MYSQL XASSET DATA]: MySql failure fetching asset " + assetID + ": " + e.Message);
}
}
}
}
return asset;
}
/// <summary>
/// Create an asset in database, or update it if existing.
/// </summary>
/// <param name="asset">Asset UUID to create</param>
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
public void StoreAsset(AssetBase asset)
{
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlTransaction transaction = dbcon.BeginTransaction())
{
string assetName = asset.Name;
if (asset.Name.Length > 64)
{
assetName = asset.Name.Substring(0, 64);
m_log.Warn("[XASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add");
}
string assetDescription = asset.Description;
if (asset.Description.Length > 64)
{
assetDescription = asset.Description.Substring(0, 64);
m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add");
}
if (m_enableCompression)
{
MemoryStream outputStream = new MemoryStream();
using (GZipStream compressionStream = new GZipStream(outputStream, CompressionMode.Compress, false))
{
// Console.WriteLine(WebUtil.CopyTo(new MemoryStream(asset.Data), compressionStream, int.MaxValue));
// We have to close the compression stream in order to make sure it writes everything out to the underlying memory output stream.
compressionStream.Close();
byte[] compressedData = outputStream.ToArray();
asset.Data = compressedData;
}
}
byte[] hash = hasher.ComputeHash(asset.Data);
// m_log.DebugFormat(
// "[XASSET DB]: Compressed data size for {0} {1}, hash {2} is {3}",
// asset.ID, asset.Name, hash, compressedData.Length);
try
{
using (MySqlCommand cmd =
new MySqlCommand(
"replace INTO xassetsmeta(id, hash, name, description, asset_type, local, temporary, create_time, access_time, asset_flags, creator_id)" +
"VALUES(?id, ?hash, ?name, ?description, ?asset_type, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?creator_id)",
dbcon))
{
// create unix epoch time
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
cmd.Parameters.AddWithValue("?id", asset.ID);
cmd.Parameters.AddWithValue("?hash", hash);
cmd.Parameters.AddWithValue("?name", assetName);
cmd.Parameters.AddWithValue("?description", assetDescription);
cmd.Parameters.AddWithValue("?asset_type", asset.Type);
cmd.Parameters.AddWithValue("?local", asset.Local);
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
cmd.Parameters.AddWithValue("?create_time", now);
cmd.Parameters.AddWithValue("?access_time", now);
cmd.Parameters.AddWithValue("?creator_id", asset.Metadata.CreatorID);
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
cmd.ExecuteNonQuery();
}
}
catch (Exception e)
{
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset metadata {0} with name \"{1}\". Error: {2}",
asset.FullID, asset.Name, e.Message);
transaction.Rollback();
return;
}
if (!ExistsData(dbcon, transaction, hash))
{
try
{
using (MySqlCommand cmd =
new MySqlCommand(
"INSERT INTO xassetsdata(hash, data) VALUES(?hash, ?data)",
dbcon))
{
cmd.Parameters.AddWithValue("?hash", hash);
cmd.Parameters.AddWithValue("?data", asset.Data);
cmd.ExecuteNonQuery();
}
}
catch (Exception e)
{
m_log.ErrorFormat("[XASSET DB]: MySQL failure creating asset data {0} with name \"{1}\". Error: {2}",
asset.FullID, asset.Name, e.Message);
transaction.Rollback();
return;
}
}
transaction.Commit();
}
}
}
}
// private void UpdateAccessTime(AssetBase asset)
// {
// lock (m_dbLock)
// {
// using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
// {
// dbcon.Open();
// MySqlCommand cmd =
// new MySqlCommand("update assets set access_time=?access_time where id=?id",
// dbcon);
//
// // need to ensure we dispose
// try
// {
// using (cmd)
// {
// // create unix epoch time
// int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
// cmd.Parameters.AddWithValue("?id", asset.ID);
// cmd.Parameters.AddWithValue("?access_time", now);
// cmd.ExecuteNonQuery();
// cmd.Dispose();
// }
// }
// catch (Exception e)
// {
// m_log.ErrorFormat(
// "[ASSETS DB]: " +
// "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString()
// + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
// }
// }
// }
//
// }
/// <summary>
/// We assume we already have the m_dbLock.
/// </summary>
/// TODO: need to actually use the transaction.
/// <param name="dbcon"></param>
/// <param name="transaction"></param>
/// <param name="hash"></param>
/// <returns></returns>
private bool ExistsData(MySqlConnection dbcon, MySqlTransaction transaction, byte[] hash)
{
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
bool exists = false;
using (MySqlCommand cmd = new MySqlCommand("SELECT hash FROM xassetsdata WHERE hash=?hash", dbcon))
{
cmd.Parameters.AddWithValue("?hash", hash);
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
{
if (dbReader.Read())
{
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
exists = true;
}
}
}
catch (Exception e)
{
m_log.ErrorFormat(
"[XASSETS DB]: MySql failure in ExistsData fetching hash {0}. Exception {1}{2}",
hash, e.Message, e.StackTrace);
}
}
return exists;
}
/// <summary>
/// Check if the asset exists in the database
/// </summary>
/// <param name="uuid">The asset UUID</param>
/// <returns>true if it exists, false otherwise.</returns>
public bool ExistsAsset(UUID uuid)
{
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
bool assetExists = false;
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand("SELECT id FROM xassetsmeta WHERE id=?id", dbcon))
{
cmd.Parameters.AddWithValue("?id", uuid.ToString());
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
{
if (dbReader.Read())
{
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
assetExists = true;
}
}
}
catch (Exception e)
{
m_log.ErrorFormat(
"[XASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString(), uuid);
}
}
}
}
return assetExists;
}
/// <summary>
/// Returns a list of AssetMetadata objects. The list is a subset of
/// the entire data set offset by <paramref name="start" /> containing
/// <paramref name="count" /> elements.
/// </summary>
/// <param name="start">The number of results to discard from the total data set.</param>
/// <param name="count">The number of rows the returned list should contain.</param>
/// <returns>A list of AssetMetadata objects.</returns>
public List<AssetMetadata> FetchAssetMetadataSet(int start, int count)
{
List<AssetMetadata> retList = new List<AssetMetadata>(count);
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
MySqlCommand cmd = new MySqlCommand("SELECT name,description,asset_type,temporary,id,asset_flags,creator_id FROM xassetsmeta LIMIT ?start, ?count", dbcon);
cmd.Parameters.AddWithValue("?start", start);
cmd.Parameters.AddWithValue("?count", count);
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader())
{
while (dbReader.Read())
{
AssetMetadata metadata = new AssetMetadata();
metadata.Name = (string)dbReader["name"];
metadata.Description = (string)dbReader["description"];
metadata.Type = (sbyte)dbReader["asset_type"];
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
metadata.CreatorID = dbReader["creator_id"].ToString();
// We'll ignore this for now - it appears unused!
// metadata.SHA1 = dbReader["hash"]);
retList.Add(metadata);
}
}
}
catch (Exception e)
{
m_log.Error("[XASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
}
}
}
return retList;
}
public bool Delete(string id)
{
// m_log.DebugFormat("[XASSETS DB]: Deleting asset {0}", id);
lock (m_dbLock)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand("delete from xassetsmeta where id=?id", dbcon))
{
cmd.Parameters.AddWithValue("?id", id);
cmd.ExecuteNonQuery();
}
// TODO: How do we deal with data from deleted assets? Probably not easily reapable unless we
// keep a reference count (?)
}
}
return true;
}
#endregion
}
}

View File

@@ -0,0 +1,27 @@
# -----------------
:VERSION 1
BEGIN;
CREATE TABLE `xassetsmeta` (
`id` char(36) NOT NULL,
`hash` binary(32) NOT NULL,
`name` varchar(64) NOT NULL,
`description` varchar(64) NOT NULL,
`asset_type` tinyint(4) NOT NULL,
`local` tinyint(1) NOT NULL,
`temporary` tinyint(1) NOT NULL,
`create_time` int(11) NOT NULL,
`access_time` int(11) NOT NULL,
`asset_flags` int(11) NOT NULL,
`creator_id` varchar(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
CREATE TABLE `xassetsdata` (
`hash` binary(32) NOT NULL,
`data` longblob NOT NULL,
PRIMARY KEY (`hash`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
COMMIT;

View File

@@ -28,6 +28,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using log4net;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
@@ -36,12 +39,26 @@ namespace OpenSim.Data.Null
{
public class NullFriendsData : IFriendsData
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static List<FriendsData> m_Data = new List<FriendsData>();
public NullFriendsData(string connectionString, string realm)
{
}
/// <summary>
/// Clear all friends data
/// </summary>
/// <remarks>
/// This is required by unit tests to clear the static data between test runs.
/// </remarks>
public static void Clear()
{
lock (m_Data)
m_Data.Clear();
}
public FriendsData[] GetFriends(UUID principalID)
{
return GetFriends(principalID.ToString());
@@ -56,20 +73,30 @@ namespace OpenSim.Data.Null
/// <returns></returns>
public FriendsData[] GetFriends(string userID)
{
List<FriendsData> lst = m_Data.FindAll(fdata =>
lock (m_Data)
{
return fdata.PrincipalID == userID.ToString();
});
if (lst != null)
{
lst.ForEach(f =>
List<FriendsData> lst = m_Data.FindAll(fdata =>
{
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
if (f2 != null) { f.Data["TheirFlags"] = f2.Data["Flags"]; }
return fdata.PrincipalID == userID.ToString();
});
return lst.ToArray();
if (lst != null)
{
lst.ForEach(f =>
{
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
if (f2 != null)
f.Data["TheirFlags"] = f2.Data["Flags"];
// m_log.DebugFormat(
// "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}",
// f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID);
});
// m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID);
return lst.ToArray();
}
}
return new FriendsData[0];
@@ -80,7 +107,11 @@ namespace OpenSim.Data.Null
if (data == null)
return false;
m_Data.Add(data);
// m_log.DebugFormat(
// "[NULL FRIENDS DATA]: Storing {0} {1} {2}", data.PrincipalID, data.Friend, data.Data["Flags"]);
lock (m_Data)
m_Data.Add(data);
return true;
}
@@ -92,14 +123,21 @@ namespace OpenSim.Data.Null
public bool Delete(string userID, string friendID)
{
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID.ToString(); });
if (lst != null)
lock (m_Data)
{
FriendsData friend = lst.Find(delegate(FriendsData fdata) { return fdata.Friend == friendID; });
if (friendID != null)
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID.ToString(); });
if (lst != null)
{
m_Data.Remove(friend);
return true;
FriendsData friend = lst.Find(delegate(FriendsData fdata) { return fdata.Friend == friendID; });
if (friendID != null)
{
// m_log.DebugFormat(
// "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}",
// friend.Friend, friend.Data["Flags"], friend.PrincipalID);
m_Data.Remove(friend);
return true;
}
}
}

View File

@@ -110,7 +110,6 @@ namespace OpenSim.Data.Null
return false;
}
public PresenceData[] Get(string field, string data)
{
if (Instance != this)

View File

@@ -133,5 +133,10 @@ namespace OpenSim.Data.Null
public void Shutdown()
{
}
public UUID[] GetObjectIDs(UUID regionID)
{
return new UUID[0];
}
}
}

View File

@@ -472,3 +472,95 @@ COMMIT;
BEGIN;
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
COMMIT;
:VERSION 23
BEGIN;
CREATE TABLE regionwindlight (
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
horizon_r FLOAT NOT NULL DEFAULT '0.25',
horizon_g FLOAT NOT NULL DEFAULT '0.25',
horizon_b FLOAT NOT NULL DEFAULT '0.32',
horizon_i FLOAT NOT NULL DEFAULT '0.32',
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
haze_density FLOAT NOT NULL DEFAULT '0.70',
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
max_altitude INTEGER NOT NULL DEFAULT '1605',
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
ambient_r FLOAT NOT NULL DEFAULT '0.35',
ambient_g FLOAT NOT NULL DEFAULT '0.35',
ambient_b FLOAT NOT NULL DEFAULT '0.35',
ambient_i FLOAT NOT NULL DEFAULT '0.35',
east_angle FLOAT NOT NULL DEFAULT '0.00',
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
star_brightness FLOAT NOT NULL DEFAULT '0.00',
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
cloud_x FLOAT NOT NULL DEFAULT '1.00',
cloud_y FLOAT NOT NULL DEFAULT '0.53',
cloud_density FLOAT NOT NULL DEFAULT '1.00',
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
COMMIT;
:VERSION 24
BEGIN;
CREATE TABLE IF NOT EXISTS `spawn_points` (
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
`Yaw` float NOT NULL,
`Pitch` float NOT NULL,
`Distance` float NOT NULL
);
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;
:VERSION 25
BEGIN;
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;

View File

@@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
/// <param name="dbconnect">connect string</param>
override public void Initialise(string dbconnect)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
if (dbconnect == string.Empty)
{
dbconnect = "URI=file:Asset.db,version=3";

View File

@@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
if (!m_initialized)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
m_Connection = new SqliteConnection(connectionString);
m_Connection.Open();

View File

@@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
public void Initialise(string connectionString)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
m_connectionString = connectionString;
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);

View File

@@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
protected SQLiteFramework(string connectionString)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
}
//////////////////////////////////////////////////////////////

View File

@@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
{
m_Initialized = true;
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
if (dbconnect == string.Empty)
{
dbconnect = "URI=file:inventoryStore.db,version=3";

File diff suppressed because it is too large Load Diff

View File

@@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
public SQLiteXInventoryData(string conn, string realm)
{
if (Util.IsWindows())
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
conn, "inventoryfolders", "XInventoryStore");
m_Items = new SqliteItemHandler(

View File

@@ -244,10 +244,10 @@ namespace OpenSim.Data.Tests
SceneObjectPart[] newparts = newsog.Parts;
Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))");
Assert.That(newsog.HasChildPrim(tmp1), "Assert.That(newsog.HasChildPrim(tmp1))");
Assert.That(newsog.HasChildPrim(tmp2), "Assert.That(newsog.HasChildPrim(tmp2))");
Assert.That(newsog.HasChildPrim(tmp3), "Assert.That(newsog.HasChildPrim(tmp3))");
Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))");
Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))");
Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))");
Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))");
}
[Test]
@@ -632,7 +632,6 @@ namespace OpenSim.Data.Tests
.IgnoreProperty(x=>x.RegionUUID)
.IgnoreProperty(x=>x.Scene)
.IgnoreProperty(x=>x.Parts)
.IgnoreProperty(x=>x.PassCollision)
.IgnoreProperty(x=>x.RootPart));
}

View File

@@ -42,6 +42,8 @@ namespace OpenSim.Framework
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// this is viewer capabilities and weared things dependent
// should be only used as initial default value ( V1 viewers )
public readonly static int VISUALPARAM_COUNT = 218;
public readonly static int TEXTURE_COUNT = 21;
@@ -319,19 +321,30 @@ namespace OpenSim.Framework
// made. We determine if any of the visual parameters actually
// changed to know if the appearance should be saved later
bool changed = false;
for (int i = 0; i < AvatarAppearance.VISUALPARAM_COUNT; i++)
int newsize = visualParams.Length;
if (newsize != m_visualparams.Length)
{
if (visualParams[i] != m_visualparams[i])
changed = true;
m_visualparams = (byte[])visualParams.Clone();
}
else
{
for (int i = 0; i < newsize; i++)
{
// DEBUG ON
// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
// i,m_visualparams[i],visualParams[i]);
// DEBUG OFF
m_visualparams[i] = visualParams[i];
changed = true;
if (visualParams[i] != m_visualparams[i])
{
// DEBUG ON
// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
// i,m_visualparams[i],visualParams[i]);
// DEBUG OFF
m_visualparams[i] = visualParams[i];
changed = true;
}
}
}
// Reset the height if the visual parameters actually changed
if (changed)
SetHeight();
@@ -389,7 +402,8 @@ namespace OpenSim.Framework
}
s += "Visual Params: ";
for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++)
// for (uint j = 0; j < AvatarAppearance.VISUALPARAM_COUNT; j++)
for (uint j = 0; j < m_visualparams.Length; j++)
s += String.Format("{0},",m_visualparams[j]);
s += "\n";

View File

@@ -62,9 +62,14 @@ namespace OpenSim.Framework
public static readonly int UNDERSHIRT = 10;
public static readonly int UNDERPANTS = 11;
public static readonly int SKIRT = 12;
public static readonly int MAX_BASICWEARABLES = 13;
public static readonly int ALPHA = 13;
public static readonly int TATTOO = 14;
// public static readonly int PHYSICS = 15;
// public static readonly int MAX_WEARABLES = 16;
public static readonly int MAX_WEARABLES = 15;
public static readonly UUID DEFAULT_BODY_ITEM = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
@@ -219,7 +224,7 @@ namespace OpenSim.Framework
{
get
{
AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES]; //should be 15 of these
AvatarWearable[] defaultWearables = new AvatarWearable[MAX_WEARABLES];
for (int i = 0; i < MAX_WEARABLES; i++)
{
defaultWearables[i] = new AvatarWearable();
@@ -242,10 +247,13 @@ namespace OpenSim.Framework
// // Alpha
// defaultWearables[ALPHA].Add(DEFAULT_ALPHA_ITEM, DEFAULT_ALPHA_ASSET);
// // Tattoo
// defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET);
// // Tattoo
// defaultWearables[TATTOO].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET);
// // Physics
// defaultWearables[PHYSICS].Add(DEFAULT_TATTOO_ITEM, DEFAULT_TATTOO_ASSET);
return defaultWearables;
}
}

View File

@@ -229,12 +229,14 @@ namespace OpenSim.Framework
public class ControllerData
{
public UUID ObjectID;
public UUID ItemID;
public uint IgnoreControls;
public uint EventControls;
public ControllerData(UUID item, uint ignore, uint ev)
public ControllerData(UUID obj, UUID item, uint ignore, uint ev)
{
ObjectID = obj;
ItemID = item;
IgnoreControls = ignore;
EventControls = ev;
@@ -248,6 +250,7 @@ namespace OpenSim.Framework
public OSDMap PackUpdateMessage()
{
OSDMap controldata = new OSDMap();
controldata["object"] = OSD.FromUUID(ObjectID);
controldata["item"] = OSD.FromUUID(ItemID);
controldata["ignore"] = OSD.FromInteger(IgnoreControls);
controldata["event"] = OSD.FromInteger(EventControls);
@@ -258,6 +261,8 @@ namespace OpenSim.Framework
public void UnpackUpdateMessage(OSDMap args)
{
if (args["object"] != null)
ObjectID = args["object"].AsUUID();
if (args["item"] != null)
ItemID = args["item"].AsUUID();
if (args["ignore"] != null)
@@ -306,8 +311,11 @@ namespace OpenSim.Framework
public AgentGroupData[] Groups;
public Animation[] Anims;
public Animation DefaultAnim = null;
public UUID GranterID;
public UUID ParentPart;
public Vector3 SitOffset;
// Appearance
public AvatarAppearance Appearance;
@@ -390,6 +398,11 @@ namespace OpenSim.Framework
args["animations"] = anims;
}
if (DefaultAnim != null)
{
args["default_animation"] = DefaultAnim.PackUpdateMessage();
}
if (Appearance != null)
args["packed_appearance"] = Appearance.Pack();
@@ -468,6 +481,10 @@ namespace OpenSim.Framework
}
args["attach_objects"] = attObjs;
}
args["parent_part"] = OSD.FromUUID(ParentPart);
args["sit_offset"] = OSD.FromString(SitOffset.ToString());
return args;
}
@@ -583,6 +600,18 @@ namespace OpenSim.Framework
}
}
if (args["default_animation"] != null)
{
try
{
DefaultAnim = new Animation((OSDMap)args["default_animation"]);
}
catch
{
DefaultAnim = null;
}
}
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
//{
// OSDArray textures = (OSDArray)(args["agent_textures"]);
@@ -675,6 +704,11 @@ namespace OpenSim.Framework
}
}
}
if (args["parent_part"] != null)
ParentPart = args["parent_part"].AsUUID();
if (args["sit_offset"] != null)
Vector3.TryParse(args["sit_offset"].AsString(), out SitOffset);
}
public AgentData()

View File

@@ -0,0 +1,40 @@
/*
* 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 OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Framework.Client
{
public interface IClientInventory
{
void SendRemoveInventoryFolders(UUID[] folders);
void SendRemoveInventoryItems(UUID[] folders);
void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items);
}
}

View File

@@ -29,6 +29,7 @@ using System;
using System.Xml;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
@@ -40,6 +41,8 @@ namespace OpenSim.Framework.Console
{
public class Commands : ICommands
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// Encapsulates a command that can be invoked from the console
/// </summary>
@@ -76,12 +79,19 @@ namespace OpenSim.Framework.Console
public List<CommandDelegate> fn;
}
public const string GeneralHelpText = "For more information, type 'help <item>' where <item> is one of the following categories:";
/// <value>
/// Commands organized by keyword in a tree
/// </value>
private Dictionary<string, object> tree =
new Dictionary<string, object>();
/// <summary>
/// Commands organized by module
/// </summary>
private Dictionary<string, List<CommandInfo>> m_modulesCommands = new Dictionary<string, List<CommandInfo>>();
/// <summary>
/// Get help for the given help string
/// </summary>
@@ -98,8 +108,8 @@ namespace OpenSim.Framework.Console
// General help
if (helpParts.Count == 0)
{
help.AddRange(CollectHelp(tree));
help.Sort();
help.Add(GeneralHelpText);
help.AddRange(CollectModulesHelp(tree));
}
else
{
@@ -118,6 +128,13 @@ namespace OpenSim.Framework.Console
{
string originalHelpRequest = string.Join(" ", helpParts.ToArray());
List<string> help = new List<string>();
// Check modules first to see if we just need to display a list of those commands
if (TryCollectModuleHelp(originalHelpRequest, help))
{
help.Insert(0, GeneralHelpText);
return help;
}
Dictionary<string, object> dict = tree;
while (helpParts.Count > 0)
@@ -161,25 +178,63 @@ namespace OpenSim.Framework.Console
return help;
}
private List<string> CollectHelp(Dictionary<string, object> dict)
/// <summary>
/// Try to collect help for the given module if that module exists.
/// </summary>
/// <param name="moduleName"></param>
/// <param name="helpText">/param>
/// <returns>true if there was the module existed, false otherwise.</returns>
private bool TryCollectModuleHelp(string moduleName, List<string> helpText)
{
List<string> result = new List<string>();
foreach (KeyValuePair<string, object> kvp in dict)
lock (m_modulesCommands)
{
if (kvp.Value is Dictionary<string, Object>)
foreach (string key in m_modulesCommands.Keys)
{
result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
}
else
{
if (((CommandInfo)kvp.Value).long_help != String.Empty)
result.Add(((CommandInfo)kvp.Value).help_text+" - "+
((CommandInfo)kvp.Value).long_help);
// Allow topic help requests to succeed whether they are upper or lowercase.
if (moduleName.ToLower() == key.ToLower())
{
List<CommandInfo> commands = m_modulesCommands[key];
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
ourHelpText.Sort();
helpText.AddRange(ourHelpText);
return true;
}
}
return false;
}
return result;
}
private List<string> CollectModulesHelp(Dictionary<string, object> dict)
{
lock (m_modulesCommands)
{
List<string> helpText = new List<string>(m_modulesCommands.Keys);
helpText.Sort();
return helpText;
}
}
// private List<string> CollectHelp(Dictionary<string, object> dict)
// {
// List<string> result = new List<string>();
//
// foreach (KeyValuePair<string, object> kvp in dict)
// {
// if (kvp.Value is Dictionary<string, Object>)
// {
// result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
// }
// else
// {
// if (((CommandInfo)kvp.Value).long_help != String.Empty)
// result.Add(((CommandInfo)kvp.Value).help_text+" - "+
// ((CommandInfo)kvp.Value).long_help);
// }
// }
// return result;
// }
/// <summary>
/// Add a command to those which can be invoked from the console.
@@ -212,21 +267,19 @@ namespace OpenSim.Framework.Console
Dictionary<string, Object> current = tree;
foreach (string s in parts)
foreach (string part in parts)
{
if (current.ContainsKey(s))
if (current.ContainsKey(part))
{
if (current[s] is Dictionary<string, Object>)
{
current = (Dictionary<string, Object>)current[s];
}
if (current[part] is Dictionary<string, Object>)
current = (Dictionary<string, Object>)current[part];
else
return;
}
else
{
current[s] = new Dictionary<string, Object>();
current = (Dictionary<string, Object>)current[s];
current[part] = new Dictionary<string, Object>();
current = (Dictionary<string, Object>)current[part];
}
}
@@ -250,6 +303,24 @@ namespace OpenSim.Framework.Console
info.fn = new List<CommandDelegate>();
info.fn.Add(fn);
current[String.Empty] = info;
// Now add command to modules dictionary
lock (m_modulesCommands)
{
List<CommandInfo> commands;
if (m_modulesCommands.ContainsKey(module))
{
commands = m_modulesCommands[module];
}
else
{
commands = new List<CommandInfo>();
m_modulesCommands[module] = commands;
}
// m_log.DebugFormat("[COMMAND CONSOLE]: Adding to category {0} command {1}", module, command);
commands.Add(info);
}
}
public string[] FindNextOption(string[] cmd, bool term)
@@ -607,8 +678,9 @@ namespace OpenSim.Framework.Console
{
Commands = new Commands();
Commands.AddCommand("console", false, "help", "help [<command>]",
"Get general command list or more detailed help on a specific command", Help);
Commands.AddCommand(
"Help", false, "help", "help [<item>]",
"Display help on a particular command or on a list of commands in a category", Help);
}
private void Help(string module, string[] cmd)

View File

@@ -29,6 +29,7 @@ using System;
using System.Threading;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace OpenSim.Framework.Console
{
@@ -37,28 +38,42 @@ namespace OpenSim.Framework.Console
/// Don't use this except for Unit Testing or you're in for a world of hurt when the
/// sim gets to ReadLine
/// </summary>
public class MockConsole : CommandConsole
public class MockConsole : ICommandConsole
{
public MockConsole(string defaultPrompt) : base(defaultPrompt)
{
}
public override void Output(string text)
{
}
public override void Output(string text, string level)
{
}
private MockCommands m_commands = new MockCommands();
public override string ReadLine(string p, bool isCommand, bool e)
{
//Thread.CurrentThread.Join(1000);
return string.Empty;
}
public override void UnlockOutput()
{
}
public override void LockOutput()
{
}
public ICommands Commands { get { return m_commands; } }
public void Prompt() {}
public void RunCommand(string cmd) {}
public string ReadLine(string p, bool isCommand, bool e) { return ""; }
public object ConsoleScene { get { return null; } }
public void Output(string text, string level) {}
public void Output(string text) {}
public void OutputFormat(string format, params object[] components) {}
public string CmdPrompt(string p) { return ""; }
public string CmdPrompt(string p, string def) { return ""; }
public string CmdPrompt(string p, List<char> excludedCharacters) { return ""; }
public string CmdPrompt(string p, string def, List<char> excludedCharacters) { return ""; }
public string CmdPrompt(string prompt, string defaultresponse, List<string> options) { return ""; }
public string PasswdPrompt(string p) { return ""; }
}
}
public class MockCommands : ICommands
{
public void FromXml(XmlElement root, CommandDelegate fn) {}
public List<string> GetHelp(string[] cmd) { return null; }
public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {}
public void AddCommand(string module, bool shared, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) {}
public string[] FindNextOption(string[] cmd, bool term) { return null; }
public string[] Resolve(string[] cmd) { return null; }
public XmlElement GetXml(XmlDocument doc) { return null; }
}
}

View File

@@ -233,7 +233,7 @@ namespace OpenSim.Framework.Console
string uri = "/ReadResponses/" + sessionID.ToString() + "/";
m_Server.AddPollServiceHTTPHandler(
uri, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, sessionID));
uri, new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, sessionID,25000)); // 25 secs timeout
XmlDocument xmldoc = new XmlDocument();
XmlNode xmlnode = xmldoc.CreateNode(XmlNodeType.XmlDeclaration,

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenMetaverse;
namespace OpenSim.Framework
{
public enum PhysShapeType : byte
{
prim = 0,
none = 1,
convex = 2,
invalid = 255 // use to mark invalid data in ExtraPhysicsData
}
public struct ExtraPhysicsData
{
public float Density;
public float GravitationModifier;
public float Friction;
public float Bounce;
public PhysShapeType PhysShapeType;
}
}

View File

@@ -0,0 +1,62 @@
/*
* 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.Reflection;
using log4net;
public class GcNotify
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public static bool Enabled
{
get { return s_initialized; }
set
{
if (!s_initialized && value)
new GcNotify();
s_initialized = value;
}
}
private static bool s_initialized = false;
private GcNotify() {}
~GcNotify()
{
if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload())
{
m_log.DebugFormat("[GC NOTIFY]: Garbage collection triggered.");
if (Enabled)
new GcNotify();
}
}
}

View File

@@ -1,13 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenMetaverse;
using OpenSim.Framework;
namespace OpenSim.Framework
{
public interface ICallingCardModule
{
UUID CreateCallingCard(UUID userID, UUID creatorID, UUID folderID);
}
}

View File

@@ -70,6 +70,8 @@ namespace OpenSim.Framework
public delegate void StopAnim(IClientAPI remoteClient, UUID animID);
public delegate void ChangeAnim(UUID animID, bool addOrRemove, bool sendPack);
public delegate void LinkObjects(IClientAPI remoteClient, uint parent, List<uint> children);
public delegate void DelinkObjects(List<uint> primIds, IClientAPI client);
@@ -124,12 +126,14 @@ namespace OpenSim.Framework
public delegate void ObjectDrop(uint localID, IClientAPI remoteClient);
public delegate void UpdatePrimFlags(
uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, IClientAPI remoteClient);
uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom,ExtraPhysicsData PhysData, IClientAPI remoteClient);
public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
public delegate void UpdateVector(uint localID, Vector3 pos, IClientAPI remoteClient);
public delegate void ClientChangeObject(uint localID, object data ,IClientAPI remoteClient);
public delegate void UpdatePrimRotation(uint localID, Quaternion rot, IClientAPI remoteClient);
public delegate void UpdatePrimSingleRotation(uint localID, Quaternion rot, IClientAPI remoteClient);
@@ -299,9 +303,9 @@ namespace OpenSim.Framework
public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
public delegate void FriendActionDelegate(
IClientAPI remoteClient, UUID agentID, UUID transactionID, List<UUID> callingCardFolders);
IClientAPI remoteClient, UUID transactionID, List<UUID> callingCardFolders);
public delegate void FriendshipTermination(IClientAPI remoteClient, UUID agentID, UUID ExID);
public delegate void FriendshipTermination(IClientAPI remoteClient, UUID ExID);
public delegate void MoneyTransferRequest(
UUID sourceID, UUID destID, int amount, int transactionType, string description);
@@ -462,7 +466,7 @@ namespace OpenSim.Framework
public delegate void AvatarNotesUpdate(IClientAPI client, UUID targetID, string notes);
public delegate void MuteListRequest(IClientAPI client, uint muteCRC);
public delegate void AvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages);
public delegate void GrantUserFriendRights(IClientAPI client, UUID requester, UUID target, int rights);
public delegate void GrantUserFriendRights(IClientAPI client, UUID target, int rights);
public delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client);
public delegate void AgentFOV(IClientAPI client, float verticalAngle);
@@ -715,7 +719,7 @@ namespace OpenSim.Framework
/// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it
/// is connected).
/// </summary>
ISceneAgent SceneAgent { get; }
ISceneAgent SceneAgent { get; set; }
UUID SessionId { get; }
@@ -789,6 +793,7 @@ namespace OpenSim.Framework
event ObjectDrop OnObjectDrop;
event StartAnim OnStartAnim;
event StopAnim OnStopAnim;
event ChangeAnim OnChangeAnim;
event LinkObjects OnLinkObjects;
event DelinkObjects OnDelinkObjects;
event RequestMapBlocks OnRequestMapBlocks;
@@ -838,6 +843,7 @@ namespace OpenSim.Framework
event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
event UpdatePrimFlags OnUpdatePrimFlags;
event UpdatePrimTexture OnUpdatePrimTexture;
event ClientChangeObject onClientChangeObject;
event UpdateVector OnUpdatePrimGroupPosition;
event UpdateVector OnUpdatePrimSinglePosition;
event UpdatePrimRotation OnUpdatePrimGroupRotation;
@@ -1223,10 +1229,9 @@ namespace OpenSim.Framework
/// <param name="OrbitalPosition">The orbital position is given in radians, and must be "adjusted" for the linden client, see LLClientView</param>
void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear,
float OrbitalPosition);
void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks);
void SendViewerTime(int phase);
UUID GetDefaultAnimation(string name);
void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout,
uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID);
@@ -1317,6 +1322,8 @@ namespace OpenSim.Framework
void SendObjectPropertiesReply(ISceneEntity Entity);
void SendPartPhysicsProprieties(ISceneEntity Entity);
void SendAgentOffline(UUID[] agentIDs);
void SendAgentOnline(UUID[] agentIDs);

View File

@@ -40,7 +40,7 @@ namespace OpenSim.Framework
/// <summary>
/// Get help for the given help string
/// </summary>
/// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param>
/// <param name="cmd">Parsed parts of the help string. If empty then general help is returned.</param>
/// <returns></returns>
List<string> GetHelp(string[] cmd);

View File

@@ -71,6 +71,7 @@ namespace OpenSim.Framework
bool IsEitherBannedOrRestricted(UUID avatar);
bool IsBannedFromLand(UUID avatar);
bool IsRestrictedFromLand(UUID avatar);
bool IsInLandAccessList(UUID avatar);
void SendLandUpdateToClient(IClientAPI remote_client);
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);

View File

@@ -69,7 +69,7 @@ namespace OpenSim.Framework
(uint) ParcelFlags.AllowAPrimitiveEntry |
(uint) ParcelFlags.AllowDeedToGroup |
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
(uint) ParcelFlags.SoundLocal;
(uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat;
private byte _landingType = 0;
private string _name = "Your Parcel";

View File

@@ -99,8 +99,13 @@ namespace OpenSim.Framework
}
else
{
item = oldHeadNext.Item;
item = oldHeadNext.Item;
haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext);
if (haveAdvancedHead)
{
oldHeadNext.Item = default(T);
oldHead.Next = null;
}
}
}
}
@@ -111,6 +116,10 @@ namespace OpenSim.Framework
public void Clear()
{
// ugly
T item;
while(count > 0)
Dequeue(out item);
Init();
}

View File

@@ -63,12 +63,15 @@ namespace OpenSim.Framework
internal void Clear()
{
this.value = default(T);
if (this.handle != null)
{
this.handle.Clear();
this.handle = null;
}
ClearRef();
}
internal void ClearRef()
{
this.value = default(T);
this.handle = null;
}
}
@@ -285,6 +288,7 @@ namespace OpenSim.Framework
if (--this.size > 0 && index != this.size)
{
Set(this.items[this.size], index);
this.items[this.size].ClearRef();
if (!BubbleUp(index))
BubbleDown(index);
}

View File

@@ -119,7 +119,7 @@ namespace OpenSim.Framework
// Copy the temporary stream to the network stream
formDataStream.Seek(0, SeekOrigin.Begin);
using (Stream requestStream = request.GetRequestStream())
formDataStream.CopyTo(requestStream, (int)formDataStream.Length);
formDataStream.CopyStream(requestStream, (int)formDataStream.Length);
}
#endregion Stream Writing

View File

@@ -51,6 +51,7 @@ namespace OpenSim.Framework
protected object m_senderObject;
protected ChatTypeEnum m_type;
protected UUID m_fromID;
protected UUID m_destination = UUID.Zero;
public OSChatMessage()
{
@@ -131,6 +132,12 @@ namespace OpenSim.Framework
set { m_fromID = value; }
}
public UUID Destination
{
get { return m_destination; }
set { m_destination = value; }
}
/// <summary>
///
/// </summary>

View File

@@ -0,0 +1,80 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenMetaverse;
namespace OpenSim.Framework
{
public enum ObjectChangeType : uint
{
// bits definitions
Position = 0x01,
Rotation = 0x02,
Scale = 0x04,
Group = 0x08,
UniformScale = 0x10,
// macros from above
// single prim
primP = 0x01,
primR = 0x02,
primPR = 0x03,
primS = 0x04,
primPS = 0x05,
primRS = 0x06,
primPSR = 0x07,
primUS = 0x14,
primPUS = 0x15,
primRUS = 0x16,
primPUSR = 0x17,
// group
groupP = 0x09,
groupR = 0x0A,
groupPR = 0x0B,
groupS = 0x0C,
groupPS = 0x0D,
groupRS = 0x0E,
groupPSR = 0x0F,
groupUS = 0x1C,
groupPUS = 0x1D,
groupRUS = 0x1E,
groupPUSR = 0x1F,
PRSmask = 0x07
}
public struct ObjectChangeData
{
public Quaternion rotation;
public Vector3 position;
public Vector3 scale;
public ObjectChangeType change;
}
}

View File

@@ -880,6 +880,11 @@ namespace OpenSim.Framework
}
public ulong GetMeshKey(Vector3 size, float lod)
{
return GetMeshKey(size, lod, false);
}
public ulong GetMeshKey(Vector3 size, float lod, bool convex)
{
ulong hash = 5381;
@@ -926,6 +931,9 @@ namespace OpenSim.Framework
hash = djb2(hash, scaleBytes[i]);
}
if(convex)
hash = djb2(hash, 0xa5);
return hash;
}

View File

@@ -423,12 +423,18 @@ namespace OpenSim.Framework
set { m_internalEndPoint = value; }
}
/// <summary>
/// The x co-ordinate of this region in map tiles (e.g. 1000).
/// </summary>
public uint RegionLocX
{
get { return m_regionLocX.Value; }
set { m_regionLocX = value; }
}
/// <summary>
/// The y co-ordinate of this region in map tiles (e.g. 1000).
/// </summary>
public uint RegionLocY
{
get { return m_regionLocY.Value; }

View File

@@ -27,7 +27,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Xml;
using log4net;
using OpenMetaverse;
@@ -375,4 +377,4 @@ namespace OpenSim.Framework
return output;
}
}
}
}

View File

@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
/// <param name="nodeToFill"></param>
/// <param name="processors">/param>
/// <param name="xtr"></param>
public static void ExecuteReadProcessors<NodeType>(
/// <returns>true on successful, false if there were any processing failures</returns>
public static bool ExecuteReadProcessors<NodeType>(
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
{
ExecuteReadProcessors(
return ExecuteReadProcessors(
nodeToFill,
processors,
xtr,
(o, name, e)
=> m_log.ErrorFormat(
=> m_log.DebugFormat(
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
name, e.Message, e.StackTrace));
}
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
/// <param name="parseExceptionAction">
/// Action to take if there is a parsing problem. This will usually just be to log the exception
/// </param>
public static void ExecuteReadProcessors<NodeType>(
/// <returns>true on successful, false if there were any processing failures</returns>
public static bool ExecuteReadProcessors<NodeType>(
NodeType nodeToFill,
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
XmlTextReader xtr,
Action<NodeType, string, Exception> parseExceptionAction)
{
bool errors = false;
string nodeName = string.Empty;
while (xtr.NodeType != XmlNodeType.EndElement)
{
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
}
catch (Exception e)
{
errors = true;
parseExceptionAction(nodeToFill, nodeName, e);
if (xtr.NodeType == XmlNodeType.EndElement)
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
xtr.ReadOuterXml(); // ignore
}
}
return errors;
}
/// <summary>
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
UUID.TryParse(node.InnerText, out uuid);
creator = userService.GetUserAccount(scopeID, uuid);
}
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
hasCreatorData = true;
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
doc.Save(wr);
return wr.ToString();
}
}
}
}
}

View File

@@ -161,43 +161,43 @@ namespace OpenSim.Framework.Servers
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
}
m_console.Commands.AddCommand("base", false, "quit",
m_console.Commands.AddCommand("General", false, "quit",
"quit",
"Quit the application", HandleQuit);
m_console.Commands.AddCommand("base", false, "shutdown",
m_console.Commands.AddCommand("General", false, "shutdown",
"shutdown",
"Quit the application", HandleQuit);
m_console.Commands.AddCommand("base", false, "set log level",
m_console.Commands.AddCommand("General", false, "set log level",
"set log level <level>",
"Set the console logging level", HandleLogLevel);
m_console.Commands.AddCommand("base", false, "show info",
m_console.Commands.AddCommand("General", false, "show info",
"show info",
"Show general information about the server", HandleShow);
m_console.Commands.AddCommand("base", false, "show stats",
m_console.Commands.AddCommand("General", false, "show stats",
"show stats",
"Show statistics", HandleShow);
m_console.Commands.AddCommand("base", false, "show threads",
m_console.Commands.AddCommand("General", false, "show threads",
"show threads",
"Show thread status", HandleShow);
m_console.Commands.AddCommand("base", false, "show uptime",
m_console.Commands.AddCommand("General", false, "show uptime",
"show uptime",
"Show server uptime", HandleShow);
m_console.Commands.AddCommand("base", false, "show version",
m_console.Commands.AddCommand("General", false, "show version",
"show version",
"Show server version", HandleShow);
m_console.Commands.AddCommand("base", false, "threads abort",
m_console.Commands.AddCommand("General", false, "threads abort",
"threads abort <thread-id>",
"Abort a managed thread. Use \"show threads\" to find possible threads.", HandleThreadsAbort);
m_console.Commands.AddCommand("base", false, "threads show",
m_console.Commands.AddCommand("General", false, "threads show",
"threads show",
"Show thread status. Synonym for \"show threads\"",
(string module, string[] args) => Notice(GetThreadsReport()));
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Servers
string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
StringBuilder sb = new StringBuilder();
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreadsInfo();
sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
@@ -269,15 +269,19 @@ namespace OpenSim.Framework.Servers
t.Priority,
t.ThreadState);
sb.Append(Environment.NewLine);
sb.Append("\n");
}
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
ThreadPool.GetAvailableThreads(out workers, out ports);
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
sb.Append("\n");
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
// For some reason mono 2.6.7 returns an empty threads set! Not going to confuse people by reporting
// zero active threads.
int totalThreads = Process.GetCurrentProcess().Threads.Count;
if (totalThreads > 0)
sb.AppendFormat("Total threads active: {0}\n\n", totalThreads);
sb.Append("Main threadpool (excluding script engine pools)\n");
sb.Append(Util.GetThreadPoolReport());
return sb.ToString();
}
@@ -308,7 +312,9 @@ namespace OpenSim.Framework.Servers
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
// the clr version number doesn't match the project version number under Mono.
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
m_log.InfoFormat(
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
StartupSpecific();

View File

@@ -662,11 +662,11 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (IOException e)
{
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e);
}
catch (Exception e)
{
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString());
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e.StackTrace);
SendHTML500(response);
}
finally

View File

@@ -44,13 +44,24 @@ namespace OpenSim.Framework.Servers.HttpServer
public NoEventsMethod NoEvents;
public RequestMethod Request;
public UUID Id;
public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId)
public int TimeOutms;
public EventType Type;
public enum EventType : int
{
Normal = 0,
LslHttp = 1
}
public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents, UUID pId, int pTimeOutms)
{
Request = pRequest;
HasEvents = pHasEvents;
GetEvents = pGetEvents;
NoEvents = pNoEvents;
Id = pId;
TimeOutms = pTimeOutms;
Type = EventType.Normal;
}
}
}

View File

@@ -33,14 +33,18 @@ using log4net;
using HttpServer;
using OpenSim.Framework;
/*
namespace OpenSim.Framework.Servers.HttpServer
{
public class PollServiceRequestManager
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly BaseHttpServer m_server;
private static Queue m_requests = Queue.Synchronized(new Queue());
private static ManualResetEvent m_ev = new ManualResetEvent(false);
private uint m_WorkerThreadCount = 0;
private Thread[] m_workerThreads;
private PollServiceWorkerThread[] m_PollServiceWorkerThreads;
@@ -65,6 +69,7 @@ namespace OpenSim.Framework.Servers.HttpServer
String.Format("PollServiceWorkerThread{0}", i),
ThreadPriority.Normal,
false,
true,
int.MaxValue);
}
@@ -73,6 +78,7 @@ namespace OpenSim.Framework.Servers.HttpServer
"PollServiceWatcherThread",
ThreadPriority.Normal,
false,
true,
1000 * 60 * 10);
}
@@ -86,15 +92,17 @@ namespace OpenSim.Framework.Servers.HttpServer
{
lock (m_requests)
m_requests.Enqueue(req);
m_ev.Set();
}
public void ThreadStart()
{
while (m_running)
{
m_ev.WaitOne(1000);
m_ev.Reset();
Watchdog.UpdateThread();
ProcessQueuedRequests();
Thread.Sleep(1000);
}
}
@@ -150,4 +158,236 @@ namespace OpenSim.Framework.Servers.HttpServer
m_running = false;
}
}
}
}
*/
using System.IO;
using System.Text;
using System.Collections.Generic;
namespace OpenSim.Framework.Servers.HttpServer
{
public class PollServiceRequestManager
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly BaseHttpServer m_server;
private BlockingQueue<PollServiceHttpRequest> m_requests = new BlockingQueue<PollServiceHttpRequest>();
private static Queue<PollServiceHttpRequest> m_slowRequests = new Queue<PollServiceHttpRequest>();
private static Queue<PollServiceHttpRequest> m_retryRequests = new Queue<PollServiceHttpRequest>();
private uint m_WorkerThreadCount = 0;
private Thread[] m_workerThreads;
private Thread m_retrysThread;
private bool m_running = true;
private int slowCount = 0;
// private int m_timeout = 1000; // increase timeout 250; now use the event one
public PollServiceRequestManager(BaseHttpServer pSrv, uint pWorkerThreadCount, int pTimeout)
{
m_server = pSrv;
m_WorkerThreadCount = pWorkerThreadCount;
m_workerThreads = new Thread[m_WorkerThreadCount];
//startup worker threads
for (uint i = 0; i < m_WorkerThreadCount; i++)
{
m_workerThreads[i]
= Watchdog.StartThread(
PoolWorkerJob,
String.Format("PollServiceWorkerThread{0}", i),
ThreadPriority.Normal,
false,
true,
int.MaxValue);
}
m_retrysThread = Watchdog.StartThread(
this.CheckRetries,
"PollServiceWatcherThread",
ThreadPriority.Normal,
false,
true,
1000 * 60 * 10);
}
private void ReQueueEvent(PollServiceHttpRequest req)
{
if (m_running)
{
lock (m_retryRequests)
m_retryRequests.Enqueue(req);
}
}
public void Enqueue(PollServiceHttpRequest req)
{
if (m_running)
{
if (req.PollServiceArgs.Type == PollServiceEventArgs.EventType.LslHttp)
{
m_requests.Enqueue(req);
}
else
{
lock (m_slowRequests)
m_slowRequests.Enqueue(req);
}
}
}
private void CheckRetries()
{
while (m_running)
{
Thread.Sleep(100); // let the world move .. back to faster rate
Watchdog.UpdateThread();
lock (m_retryRequests)
{
while (m_retryRequests.Count > 0 && m_running)
m_requests.Enqueue(m_retryRequests.Dequeue());
}
slowCount++;
if (slowCount >= 10)
{
slowCount = 0;
lock (m_slowRequests)
{
while (m_slowRequests.Count > 0 && m_running)
m_requests.Enqueue(m_slowRequests.Dequeue());
}
}
}
}
~PollServiceRequestManager()
{
m_running = false;
// m_timeout = -10000; // cause all to expire
Thread.Sleep(1000); // let the world move
foreach (Thread t in m_workerThreads)
{
try
{
t.Abort();
}
catch
{
}
}
try
{
foreach (PollServiceHttpRequest req in m_retryRequests)
{
m_server.DoHTTPGruntWork(
req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));
}
}
catch
{
}
PollServiceHttpRequest wreq;
m_retryRequests.Clear();
lock (m_slowRequests)
{
while (m_slowRequests.Count > 0 && m_running)
m_requests.Enqueue(m_slowRequests.Dequeue());
}
while (m_requests.Count() > 0)
{
try
{
wreq = m_requests.Dequeue(0);
m_server.DoHTTPGruntWork(
wreq.PollServiceArgs.NoEvents(wreq.RequestID, wreq.PollServiceArgs.Id),
new OSHttpResponse(new HttpResponse(wreq.HttpContext, wreq.Request), wreq.HttpContext));
}
catch
{
}
}
m_requests.Clear();
}
// work threads
private void PoolWorkerJob()
{
PollServiceHttpRequest req;
StreamReader str;
// while (true)
while (m_running)
{
req = m_requests.Dequeue(5000);
Watchdog.UpdateThread();
if (req != null)
{
try
{
if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id))
{
try
{
str = new StreamReader(req.Request.Body);
}
catch (System.ArgumentException)
{
// Stream was not readable means a child agent
// was closed due to logout, leaving the
// Event Queue request orphaned.
continue;
}
try
{
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
m_server.DoHTTPGruntWork(responsedata,
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));
}
catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
{
// Ignore it, no need to reply
}
str.Close();
}
else
{
// if ((Environment.TickCount - req.RequestTime) > m_timeout)
if ((Environment.TickCount - req.RequestTime) > req.PollServiceArgs.TimeOutms)
{
m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id),
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));
}
else
{
ReQueueEvent(req);
}
}
}
catch (Exception e)
{
m_log.ErrorFormat("Exception in poll service thread: " + e.ToString());
}
}
}
}
}
}

View File

@@ -25,6 +25,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Ubit work moved to PollServiceRequestManager
using System;
using System.Collections;
using System.Collections.Generic;
@@ -89,9 +91,16 @@ namespace OpenSim.Framework.Servers.HttpServer
continue;
}
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
m_server.DoHTTPGruntWork(responsedata,
try
{
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd());
m_server.DoHTTPGruntWork(responsedata,
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
}
catch (ObjectDisposedException) // Browser aborted before we could read body, server closed the stream
{
// Ignore it, no need to reply
}
}
else
{
@@ -121,3 +130,4 @@ namespace OpenSim.Framework.Servers.HttpServer
}
}
}
*/

View File

@@ -29,7 +29,7 @@ namespace OpenSim
{
public class VersionInfo
{
private const string VERSION_NUMBER = "0.7.3CM";
private const string VERSION_NUMBER = "0.7.4CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour
@@ -39,7 +39,8 @@ namespace OpenSim
RC1,
RC2,
Release,
Post_Fixes
Post_Fixes,
Extended
}
public static string Version

View File

@@ -26,8 +26,8 @@
*/
using System;
using System.Diagnostics;
using System.Text;
using OpenMetaverse;
using OpenMetaverse.StructuredData;
@@ -46,9 +46,29 @@ namespace OpenSim.Framework.Statistics
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
"Allocated to OpenSim : {0} MB" + Environment.NewLine,
"Allocated to OpenSim objects: {0} MB\n",
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
Process myprocess = Process.GetCurrentProcess();
if (!myprocess.HasExited)
{
myprocess.Refresh();
sb.Append(
string.Format(
"Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)));
sb.Append(
string.Format(
"Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)));
}
else
sb.Append("Process reported as Exited \n");
return sb.ToString();
}

View File

@@ -36,6 +36,7 @@ using System.IO.Compression;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Cryptography;
@@ -80,12 +81,15 @@ namespace OpenSim.Framework
private static uint nextXferID = 5000;
private static Random randomClass = new Random();
// Get a list of invalid file characters (OS dependent)
private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]";
private static string regexInvalidPathChars = "[" + new String(Path.GetInvalidPathChars()) + "]";
private static object XferLock = new object();
/// <summary>Thread pool used for Util.FireAndForget if
/// FireAndForgetMethod.SmartThreadPool is used</summary>
/// <summary>
/// Thread pool used for Util.FireAndForget if FireAndForgetMethod.SmartThreadPool is used
/// </summary>
private static SmartThreadPool m_ThreadPool;
// Unix-epoch starts at January 1st 1970, 00:00:00 UTC. And all our times in the server are (or at least should be) in UTC.
@@ -143,7 +147,6 @@ namespace OpenSim.Framework
return lerp(y, lerp(x, a, b), lerp(x, c, d));
}
public static Encoding UTF8 = Encoding.UTF8;
/// <value>
@@ -377,6 +380,50 @@ namespace OpenSim.Framework
return sb.ToString();
}
/// <summary>
/// Is the platform Windows?
/// </summary>
/// <returns>true if so, false otherwise</returns>
public static bool IsWindows()
{
PlatformID platformId = Environment.OSVersion.Platform;
return (platformId == PlatformID.Win32NT
|| platformId == PlatformID.Win32S
|| platformId == PlatformID.Win32Windows
|| platformId == PlatformID.WinCE);
}
public static bool LoadArchSpecificWindowsDll(string libraryName)
{
// We do this so that OpenSimulator on Windows loads the correct native library depending on whether
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
// will find it already loaded later on.
//
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
// controlled in config files.
string nativeLibraryPath;
if (Util.Is64BitProcess())
nativeLibraryPath = "lib64/" + libraryName;
else
nativeLibraryPath = "lib32/" + libraryName;
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
{
m_log.ErrorFormat(
"[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
return false;
}
else
{
return true;
}
}
public static bool IsEnvironmentSupported(ref string reason)
{
// Must have .NET 2.0 (Generics / libsl)
@@ -1471,6 +1518,27 @@ namespace OpenSim.Framework
return data;
}
/// <summary>
/// Used to trigger an early library load on Windows systems.
/// </summary>
/// <remarks>
/// Required to get 32-bit and 64-bit processes to automatically use the
/// appropriate native library.
/// </remarks>
/// <param name="dllToLoad"></param>
/// <returns></returns>
[DllImport("kernel32.dll")]
public static extern IntPtr LoadLibrary(string dllToLoad);
/// <summary>
/// Determine whether the current process is 64 bit
/// </summary>
/// <returns>true if so, false if not</returns>
public static bool Is64BitProcess()
{
return IntPtr.Size == 8;
}
#region FireAndForget Threading Pattern
/// <summary>
@@ -1617,6 +1685,61 @@ namespace OpenSim.Framework
}
}
/// <summary>
/// Get a thread pool report.
/// </summary>
/// <returns></returns>
public static string GetThreadPoolReport()
{
string threadPoolUsed = null;
int maxThreads = 0;
int minThreads = 0;
int allocatedThreads = 0;
int inUseThreads = 0;
int waitingCallbacks = 0;
int completionPortThreads = 0;
StringBuilder sb = new StringBuilder();
if (FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool)
{
threadPoolUsed = "SmartThreadPool";
maxThreads = m_ThreadPool.MaxThreads;
minThreads = m_ThreadPool.MinThreads;
inUseThreads = m_ThreadPool.InUseThreads;
allocatedThreads = m_ThreadPool.ActiveThreads;
waitingCallbacks = m_ThreadPool.WaitingCallbacks;
}
else if (
FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem
|| FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem)
{
threadPoolUsed = "BuiltInThreadPool";
ThreadPool.GetMaxThreads(out maxThreads, out completionPortThreads);
ThreadPool.GetMinThreads(out minThreads, out completionPortThreads);
int availableThreads;
ThreadPool.GetAvailableThreads(out availableThreads, out completionPortThreads);
inUseThreads = maxThreads - availableThreads;
allocatedThreads = -1;
waitingCallbacks = -1;
}
if (threadPoolUsed != null)
{
sb.AppendFormat("Thread pool used : {0}\n", threadPoolUsed);
sb.AppendFormat("Max threads : {0}\n", maxThreads);
sb.AppendFormat("Min threads : {0}\n", minThreads);
sb.AppendFormat("Allocated threads : {0}\n", allocatedThreads < 0 ? "not applicable" : allocatedThreads.ToString());
sb.AppendFormat("In use threads : {0}\n", inUseThreads);
sb.AppendFormat("Work items waiting : {0}\n", waitingCallbacks < 0 ? "not available" : waitingCallbacks.ToString());
}
else
{
sb.AppendFormat("Thread pool not used\n");
}
return sb.ToString();
}
private static object SmartThreadPoolCallback(object o)
{
object[] array = (object[])o;
@@ -1642,6 +1765,20 @@ namespace OpenSim.Framework
}
const Int32 EnvironmentTickCountMask = 0x3fffffff;
/// <summary>
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
/// and negative every 24.9 days. Subtracts the passed value (previously fetched by
/// 'EnvironmentTickCount()') and accounts for any wrapping.
/// </summary>
/// <param name="newValue"></param>
/// <param name="prevValue"></param>
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
public static Int32 EnvironmentTickCountSubtract(Int32 newValue, Int32 prevValue)
{
Int32 diff = newValue - prevValue;
return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
}
/// <summary>
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
/// and negative every 24.9 days. Subtracts the passed value (previously fetched by
@@ -1650,8 +1787,7 @@ namespace OpenSim.Framework
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
{
Int32 diff = EnvironmentTickCount() - prevValue;
return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue);
}
// Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount
@@ -1816,11 +1952,12 @@ namespace OpenSim.Framework
#region Universal User Identifiers
/// <summary>
/// </summary>
/// <param name="value">uuid[;endpoint[;name]]</param>
/// <param name="uuid"></param>
/// <param name="url"></param>
/// <param name="firstname"></param>
/// <param name="lastname"></param>
/// <param name="value">uuid[;endpoint[;first last[;secret]]]</param>
/// <param name="uuid">the uuid part</param>
/// <param name="url">the endpoint part (e.g. http://foo.com)</param>
/// <param name="firstname">the first name part (e.g. Test)</param>
/// <param name="lastname">the last name part (e.g User)</param>
/// <param name="secret">the secret part</param>
public static bool ParseUniversalUserIdentifier(string value, out UUID uuid, out string url, out string firstname, out string lastname, out string secret)
{
uuid = UUID.Zero; url = string.Empty; firstname = "Unknown"; lastname = "User"; secret = string.Empty;
@@ -1849,31 +1986,64 @@ namespace OpenSim.Framework
}
/// <summary>
///
/// Produces a universal (HG) system-facing identifier given the information
/// </summary>
/// <param name="acircuit"></param>
/// <returns>uuid[;endpoint[;name]]</returns>
/// <returns>uuid[;homeURI[;first last]]</returns>
public static string ProduceUserUniversalIdentifier(AgentCircuitData acircuit)
{
if (acircuit.ServiceURLs.ContainsKey("HomeURI"))
{
string agentsURI = acircuit.ServiceURLs["HomeURI"].ToString();
if (!agentsURI.EndsWith("/"))
agentsURI += "/";
// This is ugly, but there's no other way, given that the name is changed
// in the agent circuit data for foreigners
if (acircuit.lastname.Contains("@"))
{
string[] parts = acircuit.firstname.Split(new char[] { '.' });
if (parts.Length == 2)
return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
}
return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + acircuit.firstname + " " + acircuit.lastname;
}
return UniversalIdentifier(acircuit.AgentID, acircuit.firstname, acircuit.lastname, acircuit.ServiceURLs["HomeURI"].ToString());
else
return acircuit.AgentID.ToString();
}
}
/// <summary>
/// Produces a universal (HG) system-facing identifier given the information
/// </summary>
/// <param name="id">UUID of the user</param>
/// <param name="firstName">first name (e.g Test)</param>
/// <param name="lastName">last name (e.g. User)</param>
/// <param name="homeURI">homeURI (e.g. http://foo.com)</param>
/// <returns>a string of the form uuid[;homeURI[;first last]]</returns>
public static string UniversalIdentifier(UUID id, String firstName, String lastName, String homeURI)
{
string agentsURI = homeURI;
if (!agentsURI.EndsWith("/"))
agentsURI += "/";
// This is ugly, but there's no other way, given that the name is changed
// in the agent circuit data for foreigners
if (lastName.Contains("@"))
{
string[] parts = firstName.Split(new char[] { '.' });
if (parts.Length == 2)
return id.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
}
return id.ToString() + ";" + agentsURI + ";" + firstName + " " + lastName;
}
/// <summary>
/// Produces a universal (HG) user-facing name given the information
/// </summary>
/// <param name="firstName"></param>
/// <param name="lastName"></param>
/// <param name="homeURI"></param>
/// <returns>string of the form first.last @foo.com or first last</returns>
public static string UniversalName(String firstName, String lastName, String homeURI)
{
Uri uri = null;
try
{
uri = new Uri(homeURI);
}
catch (UriFormatException)
{
return firstName + " " + lastName;
}
return firstName + "." + lastName + " " + "@" + uri.Authority;
}
#endregion
}
}

View File

@@ -72,6 +72,11 @@ namespace OpenSim.Framework
/// </summary>
public bool IsTimedOut { get; set; }
/// <summary>
/// Will this thread trigger the alarm function if it has timed out?
/// </summary>
public bool AlarmIfTimeout { get; set; }
public ThreadWatchdogInfo(Thread thread, int timeout)
{
Thread = thread;
@@ -112,12 +117,13 @@ namespace OpenSim.Framework
/// <param name="start">The method that will be executed in a new thread</param>
/// <param name="name">A name to give to the new thread</param>
/// <param name="priority">Priority to run the thread at</param>
/// <param name="isBackground">True to run this thread as a background
/// thread, otherwise false</param>
/// <param name="isBackground">True to run this thread as a background thread, otherwise false</param>
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
/// <returns>The newly created Thread object</returns>
public static Thread StartThread(ThreadStart start, string name, ThreadPriority priority, bool isBackground)
public static Thread StartThread(
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout)
{
return StartThread(start, name, priority, isBackground, WATCHDOG_TIMEOUT_MS);
return StartThread(start, name, priority, isBackground, alarmIfTimeout, WATCHDOG_TIMEOUT_MS);
}
/// <summary>
@@ -128,21 +134,21 @@ namespace OpenSim.Framework
/// <param name="priority">Priority to run the thread at</param>
/// <param name="isBackground">True to run this thread as a background
/// thread, otherwise false</param>
/// <param name="timeout">
/// Number of milliseconds to wait until we issue a warning about timeout.
/// </para>
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
/// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param>
/// <returns>The newly created Thread object</returns>
public static Thread StartThread(
ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout)
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, int timeout)
{
Thread thread = new Thread(start);
thread.Name = name;
thread.Priority = priority;
thread.IsBackground = isBackground;
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout);
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout) { AlarmIfTimeout = alarmIfTimeout };
m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")");
m_log.DebugFormat(
"[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
lock (m_threads)
m_threads.Add(twi.Thread.ManagedThreadId, twi);
@@ -224,19 +230,39 @@ namespace OpenSim.Framework
/// Get currently watched threads for diagnostic purposes
/// </summary>
/// <returns></returns>
public static ThreadWatchdogInfo[] GetThreads()
public static ThreadWatchdogInfo[] GetThreadsInfo()
{
lock (m_threads)
return m_threads.Values.ToArray();
}
/// <summary>
/// Return the current thread's watchdog info.
/// </summary>
/// <returns>The watchdog info. null if the thread isn't being monitored.</returns>
public static ThreadWatchdogInfo GetCurrentThreadInfo()
{
lock (m_threads)
{
if (m_threads.ContainsKey(Thread.CurrentThread.ManagedThreadId))
return m_threads[Thread.CurrentThread.ManagedThreadId];
}
return null;
}
/// <summary>
/// Check watched threads. Fire alarm if appropriate.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
{
WatchdogTimeout callback = OnWatchdogTimeout;
if (callback != null)
{
ThreadWatchdogInfo timedOut = null;
List<ThreadWatchdogInfo> callbackInfos = null;
lock (m_threads)
{
@@ -246,21 +272,31 @@ namespace OpenSim.Framework
{
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
{
timedOut = threadInfo;
RemoveThread(threadInfo.Thread.ManagedThreadId);
break;
if (callbackInfos == null)
callbackInfos = new List<ThreadWatchdogInfo>();
callbackInfos.Add(threadInfo);
}
else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
{
threadInfo.IsTimedOut = true;
timedOut = threadInfo;
break;
if (threadInfo.AlarmIfTimeout)
{
if (callbackInfos == null)
callbackInfos = new List<ThreadWatchdogInfo>();
callbackInfos.Add(threadInfo);
}
}
}
}
if (timedOut != null)
callback(timedOut.Thread, timedOut.LastTick);
if (callbackInfos != null)
foreach (ThreadWatchdogInfo callbackInfo in callbackInfos)
callback(callbackInfo.Thread, callbackInfo.LastTick);
}
m_watchdogTimer.Start();

View File

@@ -63,77 +63,32 @@ namespace OpenSim.Framework
// a "long" call for warning & debugging purposes
public const int LongCallTime = 500;
// /// <summary>
// /// Send LLSD to an HTTP client in application/llsd+json form
// /// </summary>
// /// <param name="response">HTTP response to send the data in</param>
// /// <param name="body">LLSD to send to the client</param>
// public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
// {
// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
//
// response.ContentEncoding = Encoding.UTF8;
// response.ContentLength = responseData.Length;
// response.ContentType = "application/llsd+json";
// response.Body.Write(responseData, 0, responseData.Length);
// }
//
// /// <summary>
// /// Send LLSD to an HTTP client in application/llsd+xml form
// /// </summary>
// /// <param name="response">HTTP response to send the data in</param>
// /// <param name="body">LLSD to send to the client</param>
// public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
// {
// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
//
// response.ContentEncoding = Encoding.UTF8;
// response.ContentLength = responseData.Length;
// response.ContentType = "application/llsd+xml";
// response.Body.Write(responseData, 0, responseData.Length);
// }
// dictionary of end points
private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
/// <summary>
/// Make a GET or GET-like request to a web service that returns LLSD
/// or JSON data
/// </summary>
public static OSDMap ServiceRequest(string url, string httpVerb)
private static object EndPointLock(string url)
{
string errorMessage;
System.Uri uri = new System.Uri(url);
string endpoint = string.Format("{0}:{1}",uri.Host,uri.Port);
try
lock (m_endpointSerializer)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = httpVerb;
object eplock = null;
using (WebResponse response = request.GetResponse())
if (! m_endpointSerializer.TryGetValue(endpoint,out eplock))
{
using (Stream responseStream = response.GetResponseStream())
{
try
{
string responseStr = responseStream.GetStreamString();
OSD responseOSD = OSDParser.Deserialize(responseStr);
if (responseOSD.Type == OSDType.Map)
return (OSDMap)responseOSD;
else
errorMessage = "Response format was invalid.";
}
catch
{
errorMessage = "Failed to parse the response.";
}
}
eplock = new object();
m_endpointSerializer.Add(endpoint,eplock);
// m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
}
}
catch (Exception ex)
{
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
errorMessage = ex.Message;
}
return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } };
return eplock;
}
}
#region JSONRequest
/// <summary>
/// PUT JSON-encoded data to a web service that returns LLSD or
@@ -165,6 +120,14 @@ namespace OpenSim.Framework
}
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
{
lock (EndPointLock(url))
{
return ServiceOSDRequestWorker(url,data,method,timeout,compressed);
}
}
private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
{
int reqnum = m_requestNumber++;
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
@@ -304,6 +267,10 @@ namespace OpenSim.Framework
return result;
}
#endregion JSONRequest
#region FormRequest
/// <summary>
/// POST URL-encoded form data to a web service that returns LLSD or
/// JSON data
@@ -314,6 +281,14 @@ namespace OpenSim.Framework
}
public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
{
lock (EndPointLock(url))
{
return ServiceFormRequestWorker(url,data,timeout);
}
}
private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
{
int reqnum = m_requestNumber++;
string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
@@ -398,6 +373,8 @@ namespace OpenSim.Framework
result["Message"] = OSD.FromString("Service request failed: " + msg);
return result;
}
#endregion FormRequest
#region Uri
@@ -534,8 +511,13 @@ namespace OpenSim.Framework
/// <remarks>
/// Copying begins at the streams' current positions. The positions are
/// NOT reset after copying is complete.
/// NOTE!! .NET 4.0 adds the method 'Stream.CopyTo(stream, bufferSize)'.
/// This function could be replaced with that method once we move
/// totally to .NET 4.0. For versions before, this routine exists.
/// This routine used to be named 'CopyTo' but the int parameter has
/// a different meaning so this method was renamed to avoid any confusion.
/// </remarks>
public static int CopyTo(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
public static int CopyStream(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
{
byte[] buffer = new byte[4096];
int readBytes;

View File

@@ -225,12 +225,12 @@ namespace OpenSim
/// </summary>
private void RegisterConsoleCommands()
{
m_console.Commands.AddCommand("region", false, "force update",
m_console.Commands.AddCommand("Regions", false, "force update",
"force update",
"Force the update of all objects on clients",
HandleForceUpdate);
m_console.Commands.AddCommand("region", false, "debug packet",
m_console.Commands.AddCommand("Comms", false, "debug packet",
"debug packet <level> [<avatar-first-name> <avatar-last-name>]",
"Turn on packet debugging",
"If level > 255 then all incoming and outgoing packets are logged.\n"
@@ -242,7 +242,7 @@ namespace OpenSim
+ "If an avatar name is given then only packets from that avatar are logged",
Debug);
m_console.Commands.AddCommand("region", false, "debug http",
m_console.Commands.AddCommand("Comms", false, "debug http",
"debug http <level>",
"Turn on inbound http request debugging for everything except the event queue (see debug eq).",
"If level >= 2 then the handler used to service the request is logged.\n"
@@ -250,37 +250,37 @@ namespace OpenSim
+ "If level <= 0 then no extra http logging is done.\n",
Debug);
m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
m_console.Commands.AddCommand("region", false, "debug scene",
m_console.Commands.AddCommand("Regions", false, "debug scene",
"debug scene <scripting> <collisions> <physics>",
"Turn on scene debugging", Debug);
m_console.Commands.AddCommand("region", false, "change region",
m_console.Commands.AddCommand("General", false, "change region",
"change region <region name>",
"Change current console region", ChangeSelectedRegion);
m_console.Commands.AddCommand("region", false, "save xml",
m_console.Commands.AddCommand("Archiving", false, "save xml",
"save xml",
"Save a region's data in XML format", SaveXml);
m_console.Commands.AddCommand("region", false, "save xml2",
m_console.Commands.AddCommand("Archiving", false, "save xml2",
"save xml2",
"Save a region's data in XML2 format", SaveXml2);
m_console.Commands.AddCommand("region", false, "load xml",
m_console.Commands.AddCommand("Archiving", false, "load xml",
"load xml [-newIDs [<x> <y> <z>]]",
"Load a region's data from XML format", LoadXml);
m_console.Commands.AddCommand("region", false, "load xml2",
m_console.Commands.AddCommand("Archiving", false, "load xml2",
"load xml2",
"Load a region's data from XML2 format", LoadXml2);
m_console.Commands.AddCommand("region", false, "save prims xml2",
m_console.Commands.AddCommand("Archiving", false, "save prims xml2",
"save prims xml2 [<prim name> <file name>]",
"Save named prim to XML2", SavePrimsXml2);
m_console.Commands.AddCommand("region", false, "load oar",
m_console.Commands.AddCommand("Archiving", false, "load oar",
"load oar [--merge] [--skip-assets] [<OAR path>]",
"Load a region's data from an OAR archive.",
"--merge will merge the OAR with the existing scene." + Environment.NewLine
@@ -289,7 +289,7 @@ namespace OpenSim
+ " If this is not given then the command looks for an OAR named region.oar in the current directory.",
LoadOar);
m_console.Commands.AddCommand("region", false, "save oar",
m_console.Commands.AddCommand("Archiving", false, "save oar",
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
"Save a region's data to an OAR archive.",
@@ -306,54 +306,54 @@ namespace OpenSim
+ " If this is not given then the oar is saved to region.oar in the current directory.",
SaveOar);
m_console.Commands.AddCommand("region", false, "edit scale",
m_console.Commands.AddCommand("Regions", false, "edit scale",
"edit scale <name> <x> <y> <z>",
"Change the scale of a named prim", HandleEditScale);
m_console.Commands.AddCommand("region", false, "kick user",
m_console.Commands.AddCommand("Users", false, "kick user",
"kick user <first> <last> [message]",
"Kick a user off the simulator", KickUserCommand);
m_console.Commands.AddCommand("region", false, "show users",
m_console.Commands.AddCommand("Users", false, "show users",
"show users [full]",
"Show user data for users currently on the region",
"Without the 'full' option, only users actually on the region are shown."
+ " With the 'full' option child agents of users in neighbouring regions are also shown.",
HandleShow);
m_console.Commands.AddCommand("region", false, "show connections",
m_console.Commands.AddCommand("Comms", false, "show connections",
"show connections",
"Show connection data", HandleShow);
m_console.Commands.AddCommand("region", false, "show circuits",
m_console.Commands.AddCommand("Comms", false, "show circuits",
"show circuits",
"Show agent circuit data", HandleShow);
m_console.Commands.AddCommand("region", false, "show http-handlers",
m_console.Commands.AddCommand("Comms", false, "show http-handlers",
"show http-handlers",
"Show all registered http handlers", HandleShow);
m_console.Commands.AddCommand("region", false, "show pending-objects",
m_console.Commands.AddCommand("Comms", false, "show pending-objects",
"show pending-objects",
"Show # of objects on the pending queues of all scene viewers", HandleShow);
m_console.Commands.AddCommand("region", false, "show modules",
m_console.Commands.AddCommand("General", false, "show modules",
"show modules",
"Show module data", HandleShow);
m_console.Commands.AddCommand("region", false, "show regions",
m_console.Commands.AddCommand("Regions", false, "show regions",
"show regions",
"Show region data", HandleShow);
m_console.Commands.AddCommand("region", false, "show ratings",
m_console.Commands.AddCommand("Regions", false, "show ratings",
"show ratings",
"Show rating data", HandleShow);
m_console.Commands.AddCommand("region", false, "backup",
m_console.Commands.AddCommand("Regions", false, "backup",
"backup",
"Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand);
m_console.Commands.AddCommand("region", false, "create region",
m_console.Commands.AddCommand("Regions", false, "create region",
"create region [\"region name\"] <region_file.ini>",
"Create a new region.",
"The settings for \"region name\" are read from <region_file.ini>. Paths specified with <region_file.ini> are relative to your Regions directory, unless an absolute path is given."
@@ -362,62 +362,57 @@ namespace OpenSim
+ "If <region_file.ini> does not exist, it will be created.",
HandleCreateRegion);
m_console.Commands.AddCommand("region", false, "restart",
m_console.Commands.AddCommand("Regions", false, "restart",
"restart",
"Restart all sims in this instance", RunCommand);
m_console.Commands.AddCommand("region", false, "config set",
m_console.Commands.AddCommand("General", false, "config set",
"config set <section> <key> <value>",
"Set a config option. In most cases this is not useful since changed parameters are not dynamically reloaded. Neither do changed parameters persist - you will have to change a config file manually and restart.", HandleConfig);
m_console.Commands.AddCommand("region", false, "config get",
m_console.Commands.AddCommand("General", false, "config get",
"config get [<section>] [<key>]",
"Synonym for config show",
HandleConfig);
m_console.Commands.AddCommand("region", false, "config show",
m_console.Commands.AddCommand("General", false, "config show",
"config show [<section>] [<key>]",
"Show config information",
"If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
+ "If a section is given but not a field, then all fields in that section are printed.",
HandleConfig);
m_console.Commands.AddCommand("region", false, "config save",
m_console.Commands.AddCommand("General", false, "config save",
"config save <path>",
"Save current configuration to a file at the given path", HandleConfig);
m_console.Commands.AddCommand("region", false, "command-script",
m_console.Commands.AddCommand("General", false, "command-script",
"command-script <script>",
"Run a command script from file", RunCommand);
m_console.Commands.AddCommand("region", false, "remove-region",
m_console.Commands.AddCommand("Regions", false, "remove-region",
"remove-region <name>",
"Remove a region from this simulator", RunCommand);
m_console.Commands.AddCommand("region", false, "delete-region",
m_console.Commands.AddCommand("Regions", false, "delete-region",
"delete-region <name>",
"Delete a region from disk", RunCommand);
m_console.Commands.AddCommand("region", false, "modules list",
m_console.Commands.AddCommand("General", false, "modules list",
"modules list",
"List modules", HandleModules);
m_console.Commands.AddCommand("region", false, "modules load",
m_console.Commands.AddCommand("General", false, "modules load",
"modules load <name>",
"Load a module", HandleModules);
m_console.Commands.AddCommand("region", false, "modules unload",
m_console.Commands.AddCommand("General", false, "modules unload",
"modules unload <name>",
"Unload a module", HandleModules);
m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
"Add-InventoryHost <host>",
String.Empty, RunCommand);
m_console.Commands.AddCommand("region", false, "kill uuid",
m_console.Commands.AddCommand("Regions", false, "kill uuid",
"kill uuid <UUID>",
"Kill an object by UUID", KillUUID);
}
public override void ShutdownSpecific()
@@ -508,7 +503,11 @@ namespace OpenSim
string currentCommand;
while ((currentCommand = readFile.ReadLine()) != null)
{
if (currentCommand != String.Empty)
currentCommand = currentCommand.Trim();
if (!(currentCommand == ""
|| currentCommand.StartsWith(";")
|| currentCommand.StartsWith("//")
|| currentCommand.StartsWith("#")))
{
m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
m_console.RunCommand(currentCommand);
@@ -829,14 +828,6 @@ namespace OpenSim
case "restart":
m_sceneManager.RestartCurrentScene();
break;
case "Add-InventoryHost":
if (cmdparams.Length > 0)
{
MainConsole.Instance.Output("Not implemented.");
}
break;
}
}
@@ -928,7 +919,7 @@ namespace OpenSim
break;
case "scene":
if (args.Length == 5)
if (args.Length == 4)
{
if (m_sceneManager.CurrentScene == null)
{
@@ -936,39 +927,21 @@ namespace OpenSim
}
else
{
bool scriptingOn = !Convert.ToBoolean(args[2]);
bool collisionsOn = !Convert.ToBoolean(args[3]);
bool physicsOn = !Convert.ToBoolean(args[4]);
m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn);
string key = args[2];
string value = args[3];
m_sceneManager.CurrentScene.SetSceneCoreDebug(
new Dictionary<string, string>() { { key, value } });
MainConsole.Instance.Output(
String.Format(
"Set debug scene scripting = {0}, collisions = {1}, physics = {2}",
!scriptingOn, !collisionsOn, !physicsOn));
MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value);
}
}
else
{
MainConsole.Instance.Output("Usage: debug scene <scripting> <collisions> <physics> (where inside <> is true/false)");
MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false");
}
break;
case "teleport":
foreach(Scene s in m_sceneManager.Scenes)
{
if (s.DEBUG)
{
s.DEBUG = false;
MainConsole.Instance.Output("Teleport debugging is disabled!");
}
else{
s.DEBUG = true;
MainConsole.Instance.Output("Teleport debugging is enabled!");
}
}
break;
default:
MainConsole.Instance.Output("Unknown debug command");
break;

View File

@@ -28,6 +28,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Text;
@@ -67,6 +68,9 @@ namespace OpenSim
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
// OpenSim.ini Section name for ESTATES Settings
public const string ESTATE_SECTION_NAME = "Estates";
protected string proxyUrl;
protected int proxyOffset = 0;
@@ -257,15 +261,18 @@ namespace OpenSim
foreach (string topic in topics)
{
m_console.Commands.AddCommand("plugin", false, "help " + topic,
"help " + topic,
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
// This is a hack to allow the user to enter the help command in upper or lowercase. This will go
// away at some point.
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
"help " + capitalizedTopic,
"Get help on plugin command '" + topic + "'",
HandleCommanderHelp);
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
"help " + capitalizedTopic,
"Get help on plugin command '" + topic + "'",
HandleCommanderHelp);
m_console.Commands.AddCommand("plugin", false, topic,
topic,
"Execute subcommand for plugin '" + topic + "'",
null);
ICommander commander = null;
@@ -282,7 +289,7 @@ namespace OpenSim
foreach (string command in commander.Commands.Keys)
{
m_console.Commands.AddCommand(topic, false,
m_console.Commands.AddCommand(capitalizedTopic, false,
topic + " " + command,
topic + " " + commander.Commands[command].ShortHelp(),
String.Empty, HandleCommanderCommand);
@@ -301,7 +308,7 @@ namespace OpenSim
// Only safe for the interactive console, since it won't
// let us come here unless both scene and commander exist
//
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1].ToLower());
if (moduleCommander != null)
m_console.Output(moduleCommander.Help);
}
@@ -502,8 +509,7 @@ namespace OpenSim
scene.SnmpService.LinkUp(scene);
}
scene.StartTimer();
scene.StartTimerWatchdog();
scene.Start();
scene.StartScripts();
@@ -522,12 +528,42 @@ namespace OpenSim
{
RegionInfo regionInfo = scene.RegionInfo;
string estateOwnerFirstName = null;
string estateOwnerLastName = null;
string estateOwnerEMail = null;
string estateOwnerPassword = null;
string rawEstateOwnerUuid = null;
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
{
string defaultEstateOwnerName
= m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
string[] ownerNames = defaultEstateOwnerName.Split(' ');
if (ownerNames.Length >= 2)
{
estateOwnerFirstName = ownerNames[0];
estateOwnerLastName = ownerNames[1];
}
// Info to be used only on Standalone Mode
rawEstateOwnerUuid = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null);
estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null);
estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null);
}
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
List<char> excluded = new List<char>(new char[1]{' '});
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
if (estateOwnerFirstName == null || estateOwnerLastName == null)
{
estateOwnerFirstName = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
estateOwnerLastName = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
}
UserAccount account
= scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, estateOwnerFirstName, estateOwnerLastName);
if (account == null)
{
@@ -546,23 +582,35 @@ namespace OpenSim
if (scene.UserAccountService is UserAccountService)
{
string password = MainConsole.Instance.PasswdPrompt("Password");
string email = MainConsole.Instance.CmdPrompt("Email", "");
if (estateOwnerPassword == null)
estateOwnerPassword = MainConsole.Instance.PasswdPrompt("Password");
string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
if (estateOwnerEMail == null)
estateOwnerEMail = MainConsole.Instance.CmdPrompt("Email");
if (rawEstateOwnerUuid == null)
rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
UUID principalId = UUID.Zero;
if (!UUID.TryParse(rawPrincipalId, out principalId))
UUID estateOwnerUuid = UUID.Zero;
if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
{
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId);
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawEstateOwnerUuid);
return;
}
// If we've been given a zero uuid then this signals that we should use a random user id
if (estateOwnerUuid == UUID.Zero)
estateOwnerUuid = UUID.Random();
account
= ((UserAccountService)scene.UserAccountService).CreateUser(
regionInfo.ScopeID, principalId, first, last, password, email);
regionInfo.ScopeID,
estateOwnerUuid,
estateOwnerFirstName,
estateOwnerLastName,
estateOwnerPassword,
estateOwnerEMail);
}
// }
}
if (account == null)
@@ -967,15 +1015,21 @@ namespace OpenSim
/// This method doesn't allow an estate to be created with the same name as existing estates.
/// </remarks>
/// <param name="regInfo"></param>
/// <param name="existingName">A list of estate names that already exist.</param>
/// <param name="estatesByName">A list of estate names that already exist.</param>
/// <param name="estateName">Estate name to create if already known</param>
/// <returns>true if the estate was created, false otherwise</returns>
public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
public bool CreateEstate(RegionInfo regInfo, Dictionary<string, EstateSettings> estatesByName, string estateName)
{
// Create a new estate
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
if (existingNames.Contains(newName))
string newName;
if (estateName != null && estateName != "")
newName = estateName;
else
newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
if (estatesByName.ContainsKey(newName))
{
MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
return false;
@@ -1002,69 +1056,102 @@ namespace OpenSim
if (EstateDataService != null)
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
if (regInfo.EstateSettings.EstateID == 0) // No record at all
if (regInfo.EstateSettings.EstateID != 0)
return;
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>();
foreach (EstateSettings estate in estates)
estatesByName[estate.EstateName] = estate;
string defaultEstateName = null;
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
{
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
List<string> estateNames = new List<string>();
foreach (EstateSettings estate in estates)
estateNames.Add(estate.EstateName);
while (true)
defaultEstateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null);
if (defaultEstateName != null)
{
if (estates.Count == 0)
{
m_log.Info("[ESTATE] No existing estates found. You must create a new one.");
if (CreateEstate(regInfo, estateNames))
break;
EstateSettings defaultEstate;
bool defaultEstateJoined = false;
if (estatesByName.ContainsKey(defaultEstateName))
{
defaultEstate = estatesByName[defaultEstateName];
if (EstateDataService.LinkRegion(regInfo.RegionID, (int)defaultEstate.EstateID))
defaultEstateJoined = true;
}
else
{
if (CreateEstate(regInfo, estatesByName, defaultEstateName))
defaultEstateJoined = true;
}
if (defaultEstateJoined)
return;
else
m_log.ErrorFormat(
"[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName);
}
}
// If we have no default estate or creation of the default estate failed then ask the user.
while (true)
{
if (estates.Count == 0)
{
m_log.Info("[ESTATE]: No existing estates found. You must create a new one.");
if (CreateEstate(regInfo, estatesByName, null))
break;
else
continue;
}
else
{
string response
= MainConsole.Instance.CmdPrompt(
string.Format(
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
"yes",
new List<string>() { "yes", "no" });
if (response == "no")
{
if (CreateEstate(regInfo, estatesByName, null))
break;
else
continue;
}
else
{
string response
string[] estateNames = estatesByName.Keys.ToArray();
response
= MainConsole.Instance.CmdPrompt(
string.Format(
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
"no",
new List<string>() { "yes", "no" });
if (response == "no")
"Name of estate to join. Existing estate names are ({0})",
string.Join(", ", estateNames)),
estateNames[0]);
List<int> estateIDs = EstateDataService.GetEstates(response);
if (estateIDs.Count < 1)
{
if (CreateEstate(regInfo, estateNames))
break;
else
continue;
}
else
{
response
= MainConsole.Instance.CmdPrompt(
string.Format(
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
"None");
if (response == "None")
continue;
List<int> estateIDs = EstateDataService.GetEstates(response);
if (estateIDs.Count < 1)
{
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
continue;
}
int estateID = estateIDs[0];
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
break;
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
continue;
}
int estateID = estateIDs[0];
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
break;
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
}
}
}

View File

@@ -96,7 +96,10 @@ namespace OpenSim.Region.ClientStack.Linden
// private static readonly string m_fetchInventoryPath = "0006/";
private static readonly string m_copyFromNotecardPath = "0007/";
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
private static readonly string m_getObjectPhysicsDataPath = "0101/";
private static readonly string m_getObjectCostPath = "0102/";
private static readonly string m_ResourceCostSelectedPath = "0103/";
// These are callbacks which will be setup by the scene so that we can update scene data when we
// receive capability calls
@@ -111,6 +114,7 @@ namespace OpenSim.Region.ClientStack.Linden
private IAssetService m_assetService;
private bool m_dumpAssetsToFile = false;
private string m_regionName;
private int m_levelUpload = 0;
public BunchOfCaps(Scene scene, Caps caps)
{
@@ -121,7 +125,10 @@ namespace OpenSim.Region.ClientStack.Linden
{
IConfig sconfig = config.Configs["Startup"];
if (sconfig != null)
{
m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
m_levelUpload = sconfig.GetInt("LevelUpload", 0);
}
}
m_assetService = m_Scene.AssetService;
@@ -182,7 +189,14 @@ namespace OpenSim.Region.ClientStack.Linden
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData);
m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler);
IRequestHandler getObjectCostHandler = new RestStreamHandler("POST", capsBase + m_getObjectCostPath, GetObjectCost);
m_HostCapsObj.RegisterHandler("GetObjectCost", getObjectCostHandler);
IRequestHandler ResourceCostSelectedHandler = new RestStreamHandler("POST", capsBase + m_ResourceCostSelectedPath, ResourceCostSelected);
m_HostCapsObj.RegisterHandler("ResourceCostSelected", ResourceCostSelectedHandler);
// As of RC 1.22.9 of the Linden client this is
// supported
@@ -262,7 +276,7 @@ namespace OpenSim.Region.ClientStack.Linden
{
try
{
m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
// m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
//m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
@@ -357,21 +371,37 @@ namespace OpenSim.Region.ClientStack.Linden
llsdRequest.asset_type == "animation" ||
llsdRequest.asset_type == "sound")
{
ScenePresence avatar = null;
IClientAPI client = null;
IScene scene = null;
if (GetClient != null)
{
client = GetClient(m_HostCapsObj.AgentID);
scene = client.Scene;
m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar);
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
// check user level
if (avatar != null)
{
client = avatar.ControllingClient;
if (avatar.UserLevel < m_levelUpload)
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
errorResponse.uploader = "";
errorResponse.state = "error";
return errorResponse;
}
}
// check funds
if (client != null)
{
IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>();
if (mm != null)
{
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
errorResponse.uploader = "";
@@ -761,7 +791,7 @@ namespace OpenSim.Region.ClientStack.Linden
SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
if (part != null)
{
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
// TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, m_HostCapsObj.AgentID))
{
return LLSDHelpers.SerialiseLLSDReply(response);
@@ -799,6 +829,151 @@ namespace OpenSim.Region.ClientStack.Linden
response["int_response_code"] = 200;
return LLSDHelpers.SerialiseLLSDReply(response);
}
public string GetObjectPhysicsData(string request, string path,
string param, IOSHttpRequest httpRequest,
IOSHttpResponse httpResponse)
{
OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
OSDMap resp = new OSDMap();
OSDArray object_ids = (OSDArray)req["object_ids"];
for (int i = 0 ; i < object_ids.Count ; i++)
{
UUID uuid = object_ids[i].AsUUID();
SceneObjectPart obj = m_Scene.GetSceneObjectPart(uuid);
if (obj != null)
{
OSDMap object_data = new OSDMap();
object_data["PhysicsShapeType"] = obj.PhysicsShapeType;
object_data["Density"] = obj.Density;
object_data["Friction"] = obj.Friction;
object_data["Restitution"] = obj.Bounciness;
object_data["GravityMultiplier"] = obj.GravityModifier;
resp[uuid.ToString()] = object_data;
}
}
string response = OSDParser.SerializeLLSDXmlString(resp);
return response;
}
public string GetObjectCost(string request, string path,
string param, IOSHttpRequest httpRequest,
IOSHttpResponse httpResponse)
{
OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
OSDMap resp = new OSDMap();
OSDArray object_ids = (OSDArray)req["object_ids"];
for (int i = 0; i < object_ids.Count; i++)
{
UUID uuid = object_ids[i].AsUUID();
SceneObjectPart part = m_Scene.GetSceneObjectPart(uuid);
if (part != null)
{
SceneObjectGroup grp = part.ParentGroup;
if (grp != null)
{
float linksetCost;
float linksetPhysCost;
float partCost;
float partPhysCost;
grp.GetResourcesCosts(part, out linksetCost, out linksetPhysCost, out partCost, out partPhysCost);
OSDMap object_data = new OSDMap();
object_data["linked_set_resource_cost"] = linksetCost;
object_data["resource_cost"] = partCost;
object_data["physics_cost"] = partPhysCost;
object_data["linked_set_physics_cost"] = linksetPhysCost;
resp[uuid.ToString()] = object_data;
}
}
}
string response = OSDParser.SerializeLLSDXmlString(resp);
return response;
}
public string ResourceCostSelected(string request, string path,
string param, IOSHttpRequest httpRequest,
IOSHttpResponse httpResponse)
{
OSDMap req = (OSDMap)OSDParser.DeserializeLLSDXml(request);
OSDMap resp = new OSDMap();
float phys=0;
float stream=0;
float simul=0;
if (req.ContainsKey("selected_roots"))
{
OSDArray object_ids = (OSDArray)req["selected_roots"];
// should go by SOG suming costs for all parts
// ll v3 works ok with several objects select we get the list and adds ok
// FS calls per object so results are wrong guess fs bug
for (int i = 0; i < object_ids.Count; i++)
{
UUID uuid = object_ids[i].AsUUID();
float Physc;
float simulc;
float streamc;
SceneObjectGroup grp = m_Scene.GetGroupByPrim(uuid);
if (grp != null)
{
grp.GetSelectedCosts(out Physc, out streamc, out simulc);
phys += Physc;
stream += streamc;
simul += simulc;
}
}
}
else if (req.ContainsKey("selected_prims"))
{
OSDArray object_ids = (OSDArray)req["selected_prims"];
// don't see in use in any of the 2 viewers
// guess it should be for edit linked but... nothing
// should go to SOP per part
for (int i = 0; i < object_ids.Count; i++)
{
UUID uuid = object_ids[i].AsUUID();
SceneObjectPart part = m_Scene.GetSceneObjectPart(uuid);
if (part != null)
{
phys += part.PhysicsCost;
stream += part.StreamingCost;
simul += part.SimulationCost;
}
}
}
if (simul != 0)
{
OSDMap object_data = new OSDMap();
object_data["physics"] = phys;
object_data["streaming"] = stream;
object_data["simulation"] = simul;
resp["selected"] = object_data;
}
string response = OSDParser.SerializeLLSDXmlString(resp);
return response;
}
}
public class AssetUploader

View File

@@ -106,7 +106,7 @@ namespace OpenSim.Region.ClientStack.Linden
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
MainConsole.Instance.Commands.AddCommand(
"event queue",
"Comms",
false,
"debug eq",
"debug eq [0|1]",
@@ -361,7 +361,7 @@ namespace OpenSim.Region.ClientStack.Linden
// This will persist this beyond the expiry of the caps handlers
MainServer.Instance.AddPollServiceHTTPHandler(
capsBase + EventQueueGetUUID.ToString() + "/",
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID,1000)); // 1 sec timeout
Random rnd = new Random(Environment.TickCount);
lock (m_ids)
@@ -805,5 +805,13 @@ namespace OpenSim.Region.ClientStack.Linden
{
return EventQueueHelper.BuildEvent(eventName, eventBody);
}
public void partPhysicsProperties(uint localID, byte physhapetype,
float density, float friction, float bounce, float gravmod,UUID avatarID)
{
OSD item = EventQueueHelper.partPhysicsProperties(localID, physhapetype,
density, friction, bounce, gravmod);
Enqueue(item, avatarID);
}
}
}

View File

@@ -395,5 +395,25 @@ namespace OpenSim.Region.ClientStack.Linden
return message;
}
public static OSD partPhysicsProperties(uint localID, byte physhapetype,
float density, float friction, float bounce, float gravmod)
{
OSDMap physinfo = new OSDMap(6);
physinfo["LocalID"] = localID;
physinfo["Density"] = density;
physinfo["Friction"] = friction;
physinfo["GravityMultiplier"] = gravmod;
physinfo["Restitution"] = bounce;
physinfo["PhysicsShapeType"] = (int)physhapetype;
OSDArray array = new OSDArray(1);
array.Add(physinfo);
OSDMap llsdBody = new OSDMap(1);
llsdBody.Add("ObjectData", array);
return BuildEvent("ObjectPhysicsProperties", llsdBody);
}
}
}

View File

@@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden
// private IAssetService m_assetService;
private bool m_dumpAssetsToFile = false;
private bool m_enabled = true;
private int m_levelUpload = 0;
#region IRegionModuleBase Members
@@ -72,6 +73,7 @@ namespace OpenSim.Region.ClientStack.Linden
return;
m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
m_levelUpload = meshConfig.GetInt("LevelUpload", 0);
}
public void AddRegion(Scene pScene)
@@ -137,25 +139,41 @@ namespace OpenSim.Region.ClientStack.Linden
// llsdRequest.asset_type == "animation" ||
// llsdRequest.asset_type == "sound")
// {
// check user level
ScenePresence avatar = null;
IClientAPI client = null;
m_scene.TryGetScenePresence(agentID, out avatar);
if (avatar != null)
{
client = avatar.ControllingClient;
if (avatar.UserLevel < m_levelUpload)
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
errorResponse.rsvp = "";
errorResponse.state = "error";
return errorResponse;
}
}
// check funds
IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
if (mm != null)
{
if (m_scene.TryGetClient(agentID, out client))
if (!mm.UploadCovered(agentID, mm.UploadCharge))
{
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
{
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
errorResponse.rsvp = "";
errorResponse.state = "error";
return errorResponse;
}
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
errorResponse.rsvp = "";
errorResponse.state = "error";
return errorResponse;
}
}
// }

File diff suppressed because it is too large Load Diff

View File

@@ -244,8 +244,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
base.Start(m_recvBufferSize, m_asyncPacketHandling);
// Start the packet processing threads
Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
Watchdog.StartThread(
IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
Watchdog.StartThread(
OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
m_elapsedMSSinceLastStatReport = Environment.TickCount;
}
@@ -707,14 +710,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
IClientAPI client;
if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
{
//m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
return;
}
udpClient = ((LLClientView)client).UDPClient;
if (!udpClient.IsConnected)
{
// m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet for a unConnected client in " + m_scene.RegionInfo.RegionName);
return;
}
#endregion Packet to Client Mapping
@@ -903,47 +909,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private void HandleUseCircuitCode(object o)
{
// DateTime startTime = DateTime.Now;
object[] array = (object[])o;
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
IPEndPoint remoteEndPoint = null;
IClientAPI client = null;
try
{
// DateTime startTime = DateTime.Now;
object[] array = (object[])o;
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
AuthenticateResponse sessionInfo;
if (IsClientAuthorized(uccp, out sessionInfo))
{
// Begin the process of adding the client to the simulator
client
= AddClient(
uccp.CircuitCode.Code,
uccp.CircuitCode.ID,
uccp.CircuitCode.SessionID,
remoteEndPoint,
sessionInfo);
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
// Send ack straight away to let the viewer know that the connection is active.
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
// circuit code to the existing child agent. This is not particularly obvious.
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
// We only want to send initial data to new clients, not ones which are being converted from child to root.
if (client != null)
client.SceneAgent.SendInitialDataToMe();
}
else
{
// Don't create clients for unauthorized requesters.
m_log.WarnFormat(
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
}
// m_log.DebugFormat(
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
AuthenticateResponse sessionInfo;
if (IsClientAuthorized(uccp, out sessionInfo))
{
// Begin the process of adding the client to the simulator
IClientAPI client
= AddClient(
uccp.CircuitCode.Code,
uccp.CircuitCode.ID,
uccp.CircuitCode.SessionID,
remoteEndPoint,
sessionInfo);
// Send ack straight away to let the viewer know that the connection is active.
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
// circuit code to the existing child agent. This is not particularly obvious.
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
// We only want to send initial data to new clients, not ones which are being converted from child to root.
if (client != null)
client.SceneAgent.SendInitialDataToMe();
}
else
catch (Exception e)
{
// Don't create clients for unauthorized requesters.
m_log.WarnFormat(
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
m_log.ErrorFormat(
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
client != null ? client.Name : "unknown",
client != null ? client.AgentId.ToString() : "unknown",
e.Message,
e.StackTrace);
}
// m_log.DebugFormat(
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
}
/// <summary>

View File

@@ -50,7 +50,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
m_regStatus = RegionStatus.Up;
}
public override void Update() {}
public override void Update(int frames) {}
public override void LoadWorldMap() {}
public override ISceneAgent AddNewClient(IClientAPI client, PresenceType type)

View File

@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
protected Scene m_Scene;
private bool m_dumpAssetsToFile = false;
private int m_levelUpload = 0;
/// <summary>
/// Each agent has its own singleton collection of transactions
@@ -56,8 +57,13 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
#region IRegionModule Members
public void Initialise(IConfigSource config)
public void Initialise(IConfigSource source)
{
IConfig sconfig = source.Configs["Startup"];
if (sconfig != null)
{
m_levelUpload = sconfig.GetInt("LevelUpload", 0);
}
}
public void AddRegion(Scene scene)
@@ -241,7 +247,21 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
(AssetType)type == AssetType.Animation) &&
tempFile == false)
{
ScenePresence avatar = null;
Scene scene = (Scene)remoteClient.Scene;
scene.TryGetScenePresence(remoteClient.AgentId, out avatar);
// check user level
if (avatar != null)
{
if (avatar.UserLevel < m_levelUpload)
{
remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
return;
}
}
// check funds
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
if (mm != null)

View File

@@ -203,10 +203,10 @@ namespace Flotsam.RegionModules.AssetCache
m_CacheDirectoryTierLen = 4;
}
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand);
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand);
}
}
}

View File

@@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
sp.ClearAttachments();
}
public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent)
public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool useAttachData)
{
lock (sp.AttachmentsSyncLock)
{
@@ -273,9 +273,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
attachPos = Vector3.Zero;
}
if (useAttachData)
{
group.RootPart.RotationOffset = group.RootPart.AttachRotation;
attachPos = group.RootPart.AttachOffset;
if (attachmentPt == 0)
{
attachmentPt = group.RootPart.AttachPoint;
if (attachmentPt == 0)
{
attachmentPt = (uint)AttachmentPoint.LeftHand;
attachPos = Vector3.Zero;
}
}
else if (group.RootPart.AttachPoint != attachmentPt)
{
attachPos = Vector3.Zero;
}
}
group.AttachmentPoint = attachmentPt;
group.AbsolutePosition = attachPos;
// We also don't want to do any of the inventory operations for an NPC.
if (sp.PresenceType != PresenceType.Npc)
{
@@ -285,7 +303,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// At the moment we can only deal with a single attachment
if (attachments.Count != 0)
{
UUID oldAttachmentItemID = attachments[0].GetFromItemID();
UUID oldAttachmentItemID = attachments[0].FromItemID;
if (oldAttachmentItemID != UUID.Zero)
DetachSingleAttachmentToInvInternal(sp, oldAttachmentItemID);
@@ -296,7 +314,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
// Add the new attachment to inventory if we don't already have it.
UUID newAttachmentItemID = group.GetFromItemID();
UUID newAttachmentItemID = group.FromItemID;
if (newAttachmentItemID == UUID.Zero)
newAttachmentItemID = AddSceneObjectAsNewAttachmentInInv(sp, group).ID;
@@ -336,7 +354,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
List<SceneObjectGroup> existingAttachments = sp.GetAttachments();
foreach (SceneObjectGroup so in existingAttachments)
{
if (so.GetFromItemID() == itemID)
if (so.FromItemID == itemID)
{
alreadyOn = true;
break;
@@ -393,7 +411,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (so.AttachedAvatar != sp.UUID)
return;
UUID inventoryID = so.GetFromItemID();
UUID inventoryID = so.FromItemID;
// m_log.DebugFormat(
// "[ATTACHMENTS MODULE]: In DetachSingleAttachmentToGround(), object is {0} {1}, associated item is {2}",
@@ -410,14 +428,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
m_scene.AvatarFactory.QueueAppearanceSave(sp.UUID);
sp.RemoveAttachment(so);
so.FromItemID = UUID.Zero;
SceneObjectPart rootPart = so.RootPart;
rootPart.FromItemID = UUID.Zero;
so.AbsolutePosition = sp.AbsolutePosition;
so.AttachedAvatar = UUID.Zero;
rootPart.SetParentLocalId(0);
so.ClearPartAttachmentData();
rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive);
rootPart.ApplyPhysics(rootPart.GetEffectiveObjectFlags(), rootPart.VolumeDetectActive,false);
so.HasGroupChanged = true;
rootPart.Rezzed = DateTime.Now;
rootPart.RemFlag(PrimFlags.TemporaryOnRez);
@@ -526,7 +544,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
InventoryItemBase item = new InventoryItemBase(grp.GetFromItemID(), sp.UUID);
InventoryItemBase item = new InventoryItemBase(grp.FromItemID, sp.UUID);
item = m_scene.InventoryService.GetItem(item);
if (item != null)
@@ -631,19 +649,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// "[ATTACHMENTS MODULE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2}",
// grp.Name, grp.LocalId, remoteClient.Name);
Vector3 inventoryStoredPosition = new Vector3
(((grp.AbsolutePosition.X > (int)Constants.RegionSize)
? (float)Constants.RegionSize - 6
: grp.AbsolutePosition.X)
,
(grp.AbsolutePosition.Y > (int)Constants.RegionSize)
? (float)Constants.RegionSize - 6
: grp.AbsolutePosition.Y,
grp.AbsolutePosition.Z);
Vector3 originalPosition = grp.AbsolutePosition;
grp.AbsolutePosition = inventoryStoredPosition;
// Vector3 inventoryStoredPosition = new Vector3
// (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
// ? (float)Constants.RegionSize - 6
// : grp.AbsolutePosition.X)
// ,
// (grp.AbsolutePosition.Y > (int)Constants.RegionSize)
// ? (float)Constants.RegionSize - 6
// : grp.AbsolutePosition.Y,
// grp.AbsolutePosition.Z);
//
// Vector3 originalPosition = grp.AbsolutePosition;
//
// grp.AbsolutePosition = inventoryStoredPosition;
// If we're being called from a script, then trying to serialize that same script's state will not complete
// in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if
@@ -651,7 +669,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// without state on relog. Arguably, this is what we want anyway.
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false);
grp.AbsolutePosition = originalPosition;
// grp.AbsolutePosition = originalPosition;
AssetBase asset = m_scene.CreateAsset(
grp.GetPartName(grp.LocalId),
@@ -679,26 +697,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
else // oopsies
item.Folder = UUID.Zero;
// Nix the special bits we used to use for slam and the folded perms
uint allowablePermissionsMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move);
if ((sp.UUID != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions())
{
item.BasePermissions = grp.RootPart.NextOwnerMask;
item.CurrentPermissions = grp.RootPart.NextOwnerMask;
item.NextPermissions = grp.RootPart.NextOwnerMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask;
item.BasePermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.CurrentPermissions = grp.RootPart.BaseMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask & allowablePermissionsMask;
}
else
{
item.BasePermissions = grp.RootPart.BaseMask;
item.CurrentPermissions = grp.RootPart.OwnerMask;
item.NextPermissions = grp.RootPart.NextOwnerMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask;
item.GroupPermissions = grp.RootPart.GroupMask;
item.BasePermissions = grp.RootPart.BaseMask & allowablePermissionsMask;
item.CurrentPermissions = grp.RootPart.OwnerMask & allowablePermissionsMask;
item.NextPermissions = grp.RootPart.NextOwnerMask & allowablePermissionsMask;
item.EveryOnePermissions = grp.RootPart.EveryoneMask & allowablePermissionsMask;
item.GroupPermissions = grp.RootPart.GroupMask & allowablePermissionsMask;
}
item.CreationDate = Util.UnixTimeSinceEpoch();
// sets itemID so client can show item as 'attached' in inventory
grp.SetFromItemID(item.ID);
grp.FromItemID = item.ID;
if (m_scene.AddInventoryItem(item))
{
@@ -734,7 +755,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
if (entity is SceneObjectGroup)
{
group = (SceneObjectGroup)entity;
if (group.GetFromItemID() == itemID)
if (group.FromItemID == itemID)
{
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
sp.RemoveAttachment(group);
@@ -789,7 +810,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// This will throw if the attachment fails
try
{
AttachObject(sp, objatt, attachmentPt, false);
AttachObject(sp, objatt, attachmentPt, false, false);
}
catch (Exception e)
{
@@ -944,9 +965,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
AttachmentPt &= 0x7f;
// Calls attach with a Zero position
if (AttachObject(sp, part.ParentGroup, AttachmentPt, false))
if (AttachObject(sp, part.ParentGroup, AttachmentPt, false, true))
{
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId);
// Save avatar attachment information
m_log.Debug(
@@ -969,7 +990,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
ScenePresence sp = m_scene.GetScenePresence(remoteClient.AgentId);
SceneObjectGroup group = m_scene.GetGroupByPrim(objectLocalID);
if (sp != null && group != null)
DetachSingleAttachmentToInv(sp, group.GetFromItemID());
DetachSingleAttachmentToInv(sp, group.FromItemID);
}
private void Client_OnDetachAttachmentIntoInv(UUID itemID, IClientAPI remoteClient)

View File

@@ -106,7 +106,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName).ParentGroup;
m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false);
m_attMod.AttachObject(m_presence, so, (uint)AttachmentPoint.Chest, false, false);
// Check status on scene presence
Assert.That(m_presence.HasAttachments(), Is.True);
@@ -120,8 +120,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
Assert.That(attSo.IsTemporary, Is.False);
// Check item status
Assert.That(m_presence.Appearance.GetAttachpoint(
attSo.GetFromItemID()), Is.EqualTo((int)AttachmentPoint.Chest));
Assert.That(
m_presence.Appearance.GetAttachpoint(attSo.FromItemID),
Is.EqualTo((int)AttachmentPoint.Chest));
}
[Test]
@@ -316,4 +317,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
// Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects");
// }
}
}
}

View File

@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
#region IAvatarFactoryModule
/// </summary>
/// <param name="sp"></param>
/// <param name="texture"></param>
/// <param name="visualParam"></param>
public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
{
SetAppearance(sp, appearance.Texture, appearance.VisualParams);
}
/// <summary>
/// Set appearance data (texture asset IDs and slider settings)
/// </summary>
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
if (!ValidateBakedTextureCache(sp))
// If bake textures are missing and this is not an NPC, request a rebake from client
if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
RequestRebake(sp, true);
// This appears to be set only in the final stage of the appearance
// update transaction. In theory, we should be able to do an immediate
// appearance send and save here.
}
// NPC should send to clients immediately and skip saving appearance
if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
{
SendAppearance((ScenePresence)sp);
return;
}
// save only if there were changes, send no matter what (doesn't hurt to send twice)
if (changed)
QueueAppearanceSave(sp.ControllingClient.AgentId);
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
}
private void SendAppearance(ScenePresence sp)
{
// Send the appearance to everyone in the scene
sp.SendAppearanceToAllOtherAgents();
// Send animations back to the avatar as well
sp.Animator.SendAnimPack();
}
public bool SendAppearance(UUID agentId)
{
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
return false;
}
// Send the appearance to everyone in the scene
sp.SendAppearanceToAllOtherAgents();
// Send animations back to the avatar as well
sp.Animator.SendAnimPack();
SendAppearance(sp);
return true;
}
@@ -474,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
SetAppearanceAssets(sp.UUID, sp.Appearance);
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
}
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
@@ -525,12 +551,17 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
/// <param name="client"></param>
private void Client_OnRequestWearables(IClientAPI client)
{
// m_log.DebugFormat("[AVFACTORY]: Client_OnRequestWearables called for {0} ({1})", client.Name, client.AgentId);
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
if (sp != null)
client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++);
else
m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId);
Util.FireAndForget(delegate(object x)
{
Thread.Sleep(4000);
// m_log.DebugFormat("[AVFACTORY]: Client_OnRequestWearables called for {0} ({1})", client.Name, client.AgentId);
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
if (sp != null)
client.SendWearables(sp.Appearance.Wearables, sp.Appearance.Serial++);
else
m_log.WarnFormat("[AVFACTORY]: Client_OnRequestWearables unable to find presence for {0}", client.AgentId);
});
}
/// <summary>
@@ -626,4 +657,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
}
}
}
}

View File

@@ -199,6 +199,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
UUID fromID = UUID.Zero;
string message = c.Message;
IScene scene = c.Scene;
UUID destination = c.Destination;
Vector3 fromPos = c.Position;
Vector3 regionPos = new Vector3(scene.RegionInfo.RegionLocX * Constants.RegionSize,
scene.RegionInfo.RegionLocY * Constants.RegionSize, 0);
@@ -222,6 +223,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{
fromNamePrefix = m_adminPrefix;
}
destination = UUID.Zero; // Avatars cant "SayTo"
break;
case ChatSourceType.Object:
@@ -244,9 +246,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
{
// This should use ForEachClient, but clients don't have a position.
// If camera is moved into client, then camera position can be used
// MT: No, it can't, as chat is heard from the avatar position, not
// the camera position.
s.ForEachRootScenePresence(
delegate(ScenePresence presence)
{
if (destination != UUID.Zero && presence.UUID != destination)
return;
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
if (Presencecheck != null)
{
@@ -346,7 +352,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
UUID fromAgentID, string fromName, ChatTypeEnum type,
string message, ChatSourceType src)
{
// don't send stuff to child agents
// don't send chat to child agents
if (presence.IsChildAgent) return false;
Vector3 fromRegionPos = fromPos + regionPos;

View File

@@ -51,12 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
m_scene.RegisterModuleInterface<IDialogModule>(this);
m_scene.AddCommand(
this, "alert", "alert <message>",
"Users", this, "alert", "alert <message>",
"Send an alert to everyone",
HandleAlertConsoleCommand);
m_scene.AddCommand(
this, "alert-user", "alert-user <first> <last> <message>",
"Users", this, "alert-user", "alert-user <first> <last> <message>",
"Send an alert to a user",
HandleAlertConsoleCommand);
}

View File

@@ -0,0 +1,313 @@
/*
* Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using Mono.Addins;
namespace OpenSim.Region.CoreModules.Avatar.Friends
{
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XCallingCard")]
public class CallingCardModule : ISharedRegionModule, ICallingCardModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected List<Scene> m_Scenes = new List<Scene>();
protected bool m_Enabled = true;
public void Initialise(IConfigSource source)
{
IConfig ccConfig = source.Configs["XCallingCard"];
if (ccConfig != null)
m_Enabled = ccConfig.GetBoolean("Enabled", true);
}
public void AddRegion(Scene scene)
{
if (!m_Enabled)
return;
m_Scenes.Add(scene);
scene.RegisterModuleInterface<ICallingCardModule>(this);
}
public void RemoveRegion(Scene scene)
{
if (!m_Enabled)
return;
m_Scenes.Remove(scene);
scene.EventManager.OnNewClient -= OnNewClient;
scene.EventManager.OnIncomingInstantMessage +=
OnIncomingInstantMessage;
scene.UnregisterModuleInterface<ICallingCardModule>(this);
}
public void RegionLoaded(Scene scene)
{
if (!m_Enabled)
return;
scene.EventManager.OnNewClient += OnNewClient;
}
public void PostInitialise()
{
}
public void Close()
{
}
public Type ReplaceableInterface
{
get { return null; }
}
public string Name
{
get { return "XCallingCardModule"; }
}
private void OnNewClient(IClientAPI client)
{
client.OnOfferCallingCard += OnOfferCallingCard;
client.OnAcceptCallingCard += OnAcceptCallingCard;
client.OnDeclineCallingCard += OnDeclineCallingCard;
}
private void OnOfferCallingCard(IClientAPI client, UUID destID, UUID transactionID)
{
ScenePresence sp = GetClientPresence(client.AgentId);
if (sp != null)
{
// If we're in god mode, we reverse the meaning. Offer
// calling card becomes "Take a calling card" for that
// person, no matter if they agree or not.
if (sp.GodLevel >= 200)
{
CreateCallingCard(client.AgentId, destID, UUID.Zero, true);
return;
}
}
IClientAPI dest = FindClientObject(destID);
if (dest != null)
{
DoCallingCardOffer(dest, client.AgentId);
return;
}
IMessageTransferModule transferModule =
m_Scenes[0].RequestModuleInterface<IMessageTransferModule>();
if (transferModule != null)
{
transferModule.SendInstantMessage(new GridInstantMessage(
client.Scene, client.AgentId,
client.FirstName+" "+client.LastName,
destID, (byte)211, false,
String.Empty,
transactionID, false, new Vector3(), new byte[0]),
delegate(bool success) {} );
}
}
private void DoCallingCardOffer(IClientAPI dest, UUID from)
{
UUID itemID = CreateCallingCard(dest.AgentId, from, UUID.Zero, false);
dest.SendOfferCallingCard(from, itemID);
}
// Create a calling card in the user's inventory. This is called
// from direct calling card creation, when the offer is forwarded,
// and from the friends module when the friend is confirmed.
// Because of the latter, it will send a bulk inventory update
// if the receiving user is in the same simulator.
public UUID CreateCallingCard(UUID userID, UUID creatorID, UUID folderID)
{
return CreateCallingCard(userID, creatorID, folderID, false);
}
private UUID CreateCallingCard(UUID userID, UUID creatorID, UUID folderID, bool isGod)
{
IUserAccountService userv = m_Scenes[0].UserAccountService;
if (userv == null)
return UUID.Zero;
UserAccount info = userv.GetUserAccount(UUID.Zero, creatorID);
if (info == null)
return UUID.Zero;
IInventoryService inv = m_Scenes[0].InventoryService;
if (inv == null)
return UUID.Zero;
if (folderID == UUID.Zero)
{
InventoryFolderBase folder = inv.GetFolderForType(userID,
AssetType.CallingCard);
if (folder == null) // Nowhere to put it
return UUID.Zero;
folderID = folder.ID;
}
m_log.DebugFormat("[XCALLINGCARD]: Creating calling card for {0} in inventory of {1}", info.Name, userID);
InventoryItemBase item = new InventoryItemBase();
item.AssetID = UUID.Zero;
item.AssetType = (int)AssetType.CallingCard;
item.BasePermissions = (uint)(PermissionMask.Copy | PermissionMask.Modify);
if (isGod)
item.BasePermissions = (uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Move);
item.EveryOnePermissions = (uint)PermissionMask.None;
item.CurrentPermissions = item.BasePermissions;
item.NextPermissions = (uint)(PermissionMask.Copy | PermissionMask.Modify);
item.ID = UUID.Random();
item.CreatorId = creatorID.ToString();
item.Owner = userID;
item.GroupID = UUID.Zero;
item.GroupOwned = false;
item.Folder = folderID;
item.CreationDate = Util.UnixTimeSinceEpoch();
item.InvType = (int)InventoryType.CallingCard;
item.Flags = 0;
item.Name = info.Name;
item.Description = "";
item.SalePrice = 10;
item.SaleType = (byte)SaleType.Not;
inv.AddItem(item);
IClientAPI client = FindClientObject(userID);
if (client != null)
client.SendBulkUpdateInventory(item);
return item.ID;
}
private void OnAcceptCallingCard(IClientAPI client, UUID transactionID, UUID folderID)
{
}
private void OnDeclineCallingCard(IClientAPI client, UUID transactionID)
{
IInventoryService invService = m_Scenes[0].InventoryService;
InventoryFolderBase trashFolder =
invService.GetFolderForType(client.AgentId, AssetType.TrashFolder);
InventoryItemBase item = new InventoryItemBase(transactionID, client.AgentId);
item = invService.GetItem(item);
if (item != null && trashFolder != null)
{
item.Folder = trashFolder.ID;
List<UUID> uuids = new List<UUID>();
uuids.Add(item.ID);
invService.DeleteItems(item.Owner, uuids);
m_Scenes[0].AddInventoryItem(client, item);
}
}
public IClientAPI FindClientObject(UUID agentID)
{
Scene scene = GetClientScene(agentID);
if (scene == null)
return null;
ScenePresence presence = scene.GetScenePresence(agentID);
if (presence == null)
return null;
return presence.ControllingClient;
}
private Scene GetClientScene(UUID agentId)
{
lock (m_Scenes)
{
foreach (Scene scene in m_Scenes)
{
ScenePresence presence = scene.GetScenePresence(agentId);
if (presence != null)
{
if (!presence.IsChildAgent)
return scene;
}
}
}
return null;
}
private ScenePresence GetClientPresence(UUID agentId)
{
lock (m_Scenes)
{
foreach (Scene scene in m_Scenes)
{
ScenePresence presence = scene.GetScenePresence(agentId);
if (presence != null)
{
if (!presence.IsChildAgent)
return presence;
}
}
}
return null;
}
private void OnIncomingInstantMessage(GridInstantMessage msg)
{
if (msg.dialog == (uint)211)
{
IClientAPI client = FindClientObject(new UUID(msg.toAgentID));
if (client == null)
return;
DoCallingCardOffer(client, new UUID(msg.fromAgentID));
}
}
}
}

View File

@@ -51,6 +51,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
public class FriendsModule : ISharedRegionModule, IFriendsModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected bool m_Enabled = false;
protected class UserFriendData
@@ -72,7 +74,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
protected static readonly FriendInfo[] EMPTY_FRIENDS = new FriendInfo[0];
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected List<Scene> m_Scenes = new List<Scene>();
@@ -109,7 +110,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
protected IFriendsService FriendsService
public IFriendsService FriendsService
{
get
{
@@ -156,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
InitModule(config);
m_Enabled = true;
m_log.InfoFormat("[FRIENDS MODULE]: {0} enabled.", Name);
m_log.DebugFormat("[FRIENDS MODULE]: {0} enabled.", Name);
}
}
}
@@ -201,7 +202,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (!m_Enabled)
return;
m_log.DebugFormat("[FRIENDS MODULE]: AddRegion on {0}", Name);
// m_log.DebugFormat("[FRIENDS MODULE]: AddRegion on {0}", Name);
m_Scenes.Add(scene);
scene.RegisterModuleInterface<IFriendsModule>(this);
@@ -212,9 +213,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
scene.EventManager.OnClientLogin += OnClientLogin;
}
public void RegionLoaded(Scene scene)
{
}
public virtual void RegionLoaded(Scene scene) {}
public void RemoveRegion(Scene scene)
{
@@ -236,13 +235,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
#endregion
public virtual uint GetFriendPerms(UUID principalID, UUID friendID)
public virtual int GetRightsGrantedByFriend(UUID principalID, UUID friendID)
{
FriendInfo[] friends = GetFriends(principalID);
FriendInfo[] friends = GetFriendsFromCache(principalID);
FriendInfo finfo = GetFriend(friends, friendID);
if (finfo != null)
{
return (uint)finfo.TheirFlags;
return finfo.TheirFlags;
}
return 0;
@@ -253,9 +252,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
client.OnInstantMessage += OnInstantMessage;
client.OnApproveFriendRequest += OnApproveFriendRequest;
client.OnDenyFriendRequest += OnDenyFriendRequest;
client.OnTerminateFriendship += (thisClient, agentID, exfriendID) => RemoveFriendship(thisClient, exfriendID);
client.OnGrantUserRights += OnGrantUserRights;
client.OnTerminateFriendship += RemoveFriendship;
client.OnGrantUserRights += GrantRights;
// We need to cache information for child agents as well as root agents so that friend edit/move/delete
// permissions will work across borders where both regions are on different simulators.
//
// Do not do this asynchronously. If we do, then subsequent code can outrace CacheFriends() and
// return misleading results from the still empty friends cache.
// If we absolutely need to do this asynchronously, then a signalling mechanism is needed so that calls
@@ -347,18 +349,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Send the friends online
List<UUID> online = GetOnlineFriends(agentID);
if (online.Count > 0)
{
m_log.DebugFormat(
"[FRIENDS MODULE]: User {0} in region {1} has {2} friends online",
client.Name, client.Scene.RegionInfo.RegionName, online.Count);
if (online.Count > 0)
client.SendAgentOnline(online.ToArray());
}
// Send outstanding friendship offers
List<string> outstanding = new List<string>();
FriendInfo[] friends = GetFriends(agentID);
FriendInfo[] friends = GetFriendsFromCache(agentID);
foreach (FriendInfo fi in friends)
{
if (fi.TheirFlags == -1)
@@ -414,23 +411,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
List<UUID> GetOnlineFriends(UUID userID)
{
List<string> friendList = new List<string>();
List<UUID> online = new List<UUID>();
FriendInfo[] friends = GetFriends(userID);
FriendInfo[] friends = GetFriendsFromCache(userID);
foreach (FriendInfo fi in friends)
{
if (((fi.TheirFlags & 1) != 0) && (fi.TheirFlags != -1))
if (((fi.TheirFlags & (int)FriendRights.CanSeeOnline) != 0) && (fi.TheirFlags != -1))
friendList.Add(fi.Friend);
}
List<UUID> online = new List<UUID>();
if (friendList.Count > 0)
GetOnlineFriends(userID, friendList, online);
// m_log.DebugFormat(
// "[FRIENDS MODULE]: User {0} has {1} friends online", userID, online.Count);
return online;
}
protected virtual void GetOnlineFriends(UUID userID, List<string> friendList, /*collector*/ List<UUID> online)
{
// m_log.DebugFormat(
// "[FRIENDS MODULE]: Looking for online presence of {0} users for {1}", friendList.Count, userID);
PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
foreach (PresenceInfo pi in presence)
{
@@ -481,13 +485,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
/// <param name="online"></param>
private void StatusChange(UUID agentID, bool online)
{
FriendInfo[] friends = GetFriends(agentID);
FriendInfo[] friends = GetFriendsFromCache(agentID);
if (friends.Length > 0)
{
List<FriendInfo> friendList = new List<FriendInfo>();
foreach (FriendInfo fi in friends)
{
if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1))
if (((fi.MyFlags & (int)FriendRights.CanSeeOnline) != 0) && (fi.TheirFlags != -1))
friendList.Add(fi);
}
@@ -550,7 +554,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
UUID principalID = new UUID(im.fromAgentID);
UUID friendID = new UUID(im.toAgentID);
m_log.DebugFormat("[FRIENDS]: {0} ({1}) offered friendship to {2}", principalID, im.fromAgentName, friendID);
m_log.DebugFormat("[FRIENDS]: {0} ({1}) offered friendship to {2} ({3})", principalID, client.FirstName + client.LastName, friendID, im.fromAgentName);
// Check that the friendship doesn't exist yet
FriendInfo[] finfos = GetFriendsFromCache(principalID);
if (finfos != null)
{
FriendInfo f = GetFriend(finfos, friendID);
if (f != null)
{
client.SendAgentAlertMessage("This person is already your friend. Please delete it first if you want to reestablish the friendship.", false);
return;
}
}
// This user wants to be friends with the other user.
// Let's add the relation backwards, in case the other is not online
@@ -561,7 +577,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
private void ForwardFriendshipOffer(UUID agentID, UUID friendID, GridInstantMessage im)
protected virtual bool ForwardFriendshipOffer(UUID agentID, UUID friendID, GridInstantMessage im)
{
// !!!!!!!! This is a hack so that we don't have to keep state (transactionID/imSessionID)
// We stick this agent's ID as imSession, so that it's directly available on the receiving end
@@ -570,7 +586,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Try the local sim
if (LocalFriendshipOffered(friendID, im))
return;
return true;
// The prospective friend is not here [as root]. Let's forward.
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
@@ -581,9 +597,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message);
return true;
}
}
// If the prospective friend is not online, he'll get the message upon login.
return false;
}
protected virtual string GetFriendshipRequesterName(UUID agentID)
@@ -592,7 +610,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return (account == null) ? "Unknown" : account.FirstName + " " + account.LastName;
}
private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
protected virtual void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
{
m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", client.AgentId, friendID);
@@ -609,7 +627,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero);
}
// Update the local cache
// Update the local cache.
RecacheFriends(client);
//
@@ -637,18 +655,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders)
private void OnDenyFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
{
m_log.DebugFormat("[FRIENDS]: {0} denied friendship to {1}", agentID, friendID);
m_log.DebugFormat("[FRIENDS]: {0} denied friendship to {1}", client.AgentId, friendID);
DeleteFriendship(agentID, friendID);
DeleteFriendship(client.AgentId, friendID);
//
// Notify the friend
//
// Try local
if (LocalFriendshipDenied(agentID, client.Name, friendID))
if (LocalFriendshipDenied(client.AgentId, client.Name, friendID))
return;
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
@@ -659,7 +677,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
{
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
if (region != null)
m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID);
m_FriendsSimConnector.FriendshipDenied(region, client.AgentId, client.Name, friendID);
else
m_log.WarnFormat("[FRIENDS]: Could not find region {0} in locating {1}", friendSession.RegionID, friendID);
}
@@ -696,23 +714,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
private void OnGrantUserRights(IClientAPI remoteClient, UUID requester, UUID target, int rights)
public void GrantRights(IClientAPI remoteClient, UUID friendID, int rights)
{
m_log.DebugFormat("[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}", requester, rights, target);
UUID requester = remoteClient.AgentId;
FriendInfo[] friends = GetFriends(remoteClient.AgentId);
m_log.DebugFormat(
"[FRIENDS MODULE]: User {0} changing rights to {1} for friend {2}",
requester, rights, friendID);
FriendInfo[] friends = GetFriendsFromCache(requester);
if (friends.Length == 0)
{
return;
}
// Let's find the friend in this user's friend list
FriendInfo friend = GetFriend(friends, target);
FriendInfo friend = GetFriend(friends, friendID);
if (friend != null) // Found it
{
// Store it on the DB
if (!StoreRights(requester, target, rights))
if (!StoreRights(requester, friendID, rights))
{
remoteClient.SendAlertMessage("Unable to grant rights.");
return;
@@ -723,17 +745,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
friend.MyFlags = rights;
// Always send this back to the original client
remoteClient.SendChangeUserRights(requester, target, rights);
remoteClient.SendChangeUserRights(requester, friendID, rights);
//
// Notify the friend
//
// Try local
if (LocalGrantRights(requester, target, myFlags, rights))
if (LocalGrantRights(requester, friendID, myFlags, rights))
return;
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() });
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
if (friendSessions != null && friendSessions.Length > 0)
{
PresenceInfo friendSession = friendSessions[0];
@@ -742,12 +764,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
// TODO: You might want to send the delta to save the lookup
// on the other end!!
m_FriendsSimConnector.GrantRights(region, requester, target, myFlags, rights);
m_FriendsSimConnector.GrantRights(region, requester, friendID, myFlags, rights);
}
}
}
else
m_log.DebugFormat("[FRIENDS MODULE]: friend {0} not found for {1}", target, requester);
{
m_log.DebugFormat("[FRIENDS MODULE]: friend {0} not found for {1}", friendID, requester);
}
}
protected virtual FriendInfo GetFriend(FriendInfo[] friends, UUID friendID)
@@ -762,7 +786,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
#region Local
public bool LocalFriendshipOffered(UUID toID, GridInstantMessage im)
public virtual bool LocalFriendshipOffered(UUID toID, GridInstantMessage im)
{
IClientAPI friendClient = LocateClientObject(toID);
if (friendClient != null)
@@ -791,7 +815,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
ccm.CreateCallingCard(friendID, userID, UUID.Zero);
}
// Update the local cache
RecacheFriends(friendClient);
@@ -885,18 +908,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
#endregion
#region Get / Set friends in several flavours
/// <summary>
/// Get friends from local cache only
/// </summary>
/// <param name="agentID"></param>
/// <returns></returns>
protected FriendInfo[] GetFriends(UUID agentID)
public FriendInfo[] GetFriendsFromCache(UUID userID)
{
UserFriendData friendsData;
lock (m_Friends)
{
if (m_Friends.TryGetValue(agentID, out friendsData))
if (m_Friends.TryGetValue(userID, out friendsData))
return friendsData.Friends;
}
@@ -914,18 +933,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Update local cache
lock (m_Friends)
{
FriendInfo[] friends = GetFriends(friendID);
FriendInfo[] friends = GetFriendsFromCache(friendID);
FriendInfo finfo = GetFriend(friends, userID);
finfo.TheirFlags = rights;
}
}
protected virtual FriendInfo[] GetFriendsFromService(IClientAPI client)
public virtual FriendInfo[] GetFriendsFromService(IClientAPI client)
{
return FriendsService.GetFriends(client.AgentId);
}
private void RecacheFriends(IClientAPI client)
protected void RecacheFriends(IClientAPI client)
{
// FIXME: Ideally, we want to avoid doing this here since it sits the EventManager.OnMakeRootAgent event
// is on the critical path for transferring an avatar from one region to another.
@@ -938,6 +957,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
public bool AreFriendsCached(UUID userID)
{
lock (m_Friends)
return m_Friends.ContainsKey(userID);
}
protected virtual bool StoreRights(UUID agentID, UUID friendID, int rights)
{
FriendsService.StoreFriend(agentID.ToString(), friendID.ToString(), rights);
@@ -951,8 +976,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
protected virtual void StoreFriendships(UUID agentID, UUID friendID)
{
FriendsService.StoreFriend(agentID.ToString(), friendID.ToString(), 1);
FriendsService.StoreFriend(friendID.ToString(), agentID.ToString(), 1);
FriendsService.StoreFriend(agentID.ToString(), friendID.ToString(), (int)FriendRights.CanSeeOnline);
FriendsService.StoreFriend(friendID.ToString(), agentID.ToString(), (int)FriendRights.CanSeeOnline);
}
protected virtual bool DeleteFriendship(UUID agentID, UUID exfriendID)

View File

@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
IUserManagement m_uMan;
IUserManagement UserManagementModule
public IUserManagement UserManagementModule
{
get
{
@@ -61,6 +61,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
}
}
protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector();
protected HGStatusNotifier m_StatusNotifier;
#region ISharedRegionModule
public override string Name
{
@@ -76,6 +79,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
scene.RegisterModuleInterface<IFriendsSimConnector>(this);
}
public override void RegionLoaded(Scene scene)
{
if (!m_Enabled)
return;
if (m_StatusNotifier == null)
m_StatusNotifier = new HGStatusNotifier(this);
}
#endregion
#region IFriendsSimConnector
@@ -94,6 +105,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
#endregion
protected override void OnApproveFriendRequest(IClientAPI client, UUID friendID, List<UUID> callingCardFolders)
{
// Update the local cache. Yes, we need to do it right here
// because the HGFriendsService placed something on the DB
// from under the sim
base.OnApproveFriendRequest(client, friendID, callingCardFolders);
}
protected override bool CacheFriends(IClientAPI client)
{
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entered CacheFriends for {0}", client.Name);
@@ -144,7 +163,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, client.AgentId);
if (account == null) // foreign
{
FriendInfo[] friends = GetFriends(client.AgentId);
FriendInfo[] friends = GetFriendsFromCache(client.AgentId);
foreach (FriendInfo f in friends)
{
client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags);
@@ -183,91 +202,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetOnlineFriends for {0}", userID);
}
//protected override void GetOnlineFriends(UUID userID, List<string> friendList, /*collector*/ List<UUID> online)
//{
// // Let's single out the UUIs
// List<string> localFriends = new List<string>();
// List<string> foreignFriends = new List<string>();
// string tmp = string.Empty;
// foreach (string s in friendList)
// {
// UUID id;
// if (UUID.TryParse(s, out id))
// localFriends.Add(s);
// else if (Util.ParseUniversalUserIdentifier(s, out id, out tmp, out tmp, out tmp, out tmp))
// {
// foreignFriends.Add(s);
// // add it here too, who knows maybe the foreign friends happens to be on this grid
// localFriends.Add(id.ToString());
// }
// }
// // OK, see who's present on this grid
// List<string> toBeRemoved = new List<string>();
// PresenceInfo[] presence = PresenceService.GetAgents(localFriends.ToArray());
// foreach (PresenceInfo pi in presence)
// {
// UUID presenceID;
// if (UUID.TryParse(pi.UserID, out presenceID))
// {
// online.Add(presenceID);
// foreach (string s in foreignFriends)
// if (s.StartsWith(pi.UserID))
// toBeRemoved.Add(s);
// }
// }
// foreach (string s in toBeRemoved)
// foreignFriends.Remove(s);
// // OK, let's send this up the stack, and leave a closure here
// // collecting online friends in other grids
// Util.FireAndForget(delegate { CollectOnlineFriendsElsewhere(userID, foreignFriends); });
//}
//private void CollectOnlineFriendsElsewhere(UUID userID, List<string> foreignFriends)
//{
// // let's divide the friends on a per-domain basis
// Dictionary<string, List<string>> friendsPerDomain = new Dictionary<string, List<string>>();
// foreach (string friend in foreignFriends)
// {
// UUID friendID;
// if (!UUID.TryParse(friend, out friendID))
// {
// // it's a foreign friend
// string url = string.Empty, tmp = string.Empty;
// if (Util.ParseUniversalUserIdentifier(friend, out friendID, out url, out tmp, out tmp, out tmp))
// {
// if (!friendsPerDomain.ContainsKey(url))
// friendsPerDomain[url] = new List<string>();
// friendsPerDomain[url].Add(friend);
// }
// }
// }
// // Now, call those worlds
// foreach (KeyValuePair<string, List<string>> kvp in friendsPerDomain)
// {
// List<string> ids = new List<string>();
// foreach (string f in kvp.Value)
// ids.Add(f);
// UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key);
// List<UUID> online = uConn.GetOnlineFriends(userID, ids);
// // Finally send the notifications to the user
// // this whole process may take a while, so let's check at every
// // iteration that the user is still here
// IClientAPI client = LocateClientObject(userID);
// if (client != null)
// client.SendAgentOnline(online.ToArray());
// else
// break;
// }
//}
protected override void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
{
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering StatusNotify for {0}", userID);
@@ -305,25 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (friendsPerDomain.ContainsKey("local"))
base.StatusNotify(friendsPerDomain["local"], userID, online);
foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain)
{
if (kvp.Key != "local")
{
// For the others, call the user agent service
List<string> ids = new List<string>();
foreach (FriendInfo f in kvp.Value)
ids.Add(f.Friend);
UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key);
List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online);
if (online && friendsOnline.Count > 0)
{
IClientAPI client = LocateClientObject(userID);
if (client != null)
client.SendAgentOnline(friendsOnline.ToArray());
}
}
}
m_StatusNotifier.Notify(userID, friendsPerDomain, online);
// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID);
}
@@ -335,26 +251,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return true;
// fid is not a UUID...
string url = string.Empty, tmp = string.Empty;
if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out first, out last, out tmp))
string url = string.Empty, tmp = string.Empty, f = string.Empty, l = string.Empty;
if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out f, out l, out tmp))
{
IUserManagement userMan = m_Scenes[0].RequestModuleInterface<IUserManagement>();
userMan.AddUser(agentID, first, last, url);
if (!agentID.Equals(UUID.Zero))
{
m_uMan.AddUser(agentID, f, l, url);
return true;
string name = m_uMan.GetUserName(agentID);
string[] parts = name.Trim().Split(new char[] { ' ' });
if (parts.Length == 2)
{
first = parts[0];
last = parts[1];
}
else
{
first = f;
last = l;
}
return true;
}
}
return false;
}
protected override string GetFriendshipRequesterName(UUID agentID)
{
// For the time being we assume that HG friendship requests can only happen
// when avies are on the same region.
IClientAPI client = LocateClientObject(agentID);
if (client != null)
return client.FirstName + " " + client.LastName;
else
return base.GetFriendshipRequesterName(agentID);
return m_uMan.GetUserName(agentID);
}
protected override string FriendshipMessage(string friendID)
@@ -376,8 +300,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
return null;
}
protected override FriendInfo[] GetFriendsFromService(IClientAPI client)
public override FriendInfo[] GetFriendsFromService(IClientAPI client)
{
// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name);
Boolean agentIsLocal = true;
@@ -392,10 +315,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode);
if (agentClientCircuit != null)
{
string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
//[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
finfos = FriendsService.GetFriends(agentUUI);
m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, agentUUI);
finfos = FriendsService.GetFriends(client.AgentId.ToString());
m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString());
}
// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name);
@@ -422,7 +345,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (agentIsLocal) // agent is local, friend is foreigner
{
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo[] finfos = GetFriendsFromCache(agentID);
FriendInfo finfo = GetFriend(finfos, friendID);
if (finfo != null)
{
@@ -454,16 +377,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
friendIsLocal = UserManagementModule.IsLocalGridUser(friendID);
}
// Are they both local users?
if (agentIsLocal && friendIsLocal)
// Is the requester a local user?
if (agentIsLocal)
{
// local grid users
m_log.DebugFormat("[HGFRIENDS MODULE]: Users are both local");
m_log.DebugFormat("[HGFRIENDS MODULE]: Friendship requester is local. Storing backwards.");
base.StoreBackwards(friendID, agentID);
return;
}
// no provision for this temporary friendship state
// no provision for this temporary friendship state when user is not local
//FriendsService.StoreFriend(friendID.ToString(), agentID.ToString(), 0);
}
@@ -501,12 +425,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit);
agentFriendService = agentClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
RecacheFriends(agentClient);
}
if (friendClient != null)
{
friendClientCircuit = ((Scene)(friendClient.Scene)).AuthenticateHandler.GetAgentCircuitData(friendClient.CircuitCode);
friendUUI = Util.ProduceUserUniversalIdentifier(friendClientCircuit);
friendFriendService = friendClientCircuit.ServiceURLs["FriendsServerURI"].ToString();
RecacheFriends(friendClient);
}
m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}",
@@ -515,14 +441,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// Generate a random 8-character hex number that will sign this friendship
string secret = UUID.Random().ToString().Substring(0, 8);
string theFriendUUID = friendUUI + ";" + secret;
string agentUUID = agentUUI + ";" + secret;
if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// This may happen when the agent returned home, in which case the friend is not there
// We need to look for its information in the friends list itself
FriendInfo[] finfos = null;
bool confirming = false;
if (friendUUI == string.Empty)
{
FriendInfo[] finfos = GetFriends(agentID);
finfos = GetFriendsFromCache(agentID);
foreach (FriendInfo finfo in finfos)
{
if (finfo.TheirFlags == -1)
@@ -530,29 +460,57 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (finfo.Friend.StartsWith(friendID.ToString()))
{
friendUUI = finfo.Friend;
theFriendUUID = friendUUI;
UUID utmp = UUID.Zero; String url = String.Empty; String first = String.Empty, last = String.Empty, tmp = String.Empty;
// If it's confirming the friendship, we already have the full UUI with the secret
if (Util.ParseUniversalUserIdentifier(theFriendUUID, out utmp, out url, out first, out last, out secret))
{
agentUUID = agentUUI + ";" + secret;
m_uMan.AddUser(utmp, first, last, url);
}
confirming = true;
break;
}
}
}
}
if (!confirming)
{
friendUUI = m_uMan.GetUserUUI(friendID);
theFriendUUID = friendUUI + ";" + secret;
}
// If it's confirming the friendship, we already have the full friendUUI with the secret
string theFriendUUID = confirming ? friendUUI : friendUUI + ";" + secret;
friendFriendService = m_uMan.GetUserServerURL(friendID, "FriendsServerURI");
// m_log.DebugFormat("[HGFRIENDS MODULE] HG Friendship! thisUUI={0}; friendUUI={1}; foreignThisFriendService={2}; foreignFriendFriendService={3}",
// agentUUI, friendUUI, agentFriendService, friendFriendService);
}
// Delete any previous friendship relations
DeletePreviousRelations(agentID, friendID);
// store in the local friends service a reference to the foreign friend
FriendsService.StoreFriend(agentID.ToString(), theFriendUUID, 1);
// and also the converse
FriendsService.StoreFriend(theFriendUUID, agentID.ToString(), 1);
if (!confirming && friendClientCircuit != null)
{
//if (!confirming)
//{
// store in the foreign friends service a reference to the local agent
HGFriendsServicesConnector friendsConn = new HGFriendsServicesConnector(friendFriendService, friendClientCircuit.SessionID, friendClientCircuit.ServiceSessionID);
friendsConn.NewFriendship(friendID, agentUUI + ";" + secret);
}
HGFriendsServicesConnector friendsConn = null;
if (friendClientCircuit != null) // the friend is here, validate session
friendsConn = new HGFriendsServicesConnector(friendFriendService, friendClientCircuit.SessionID, friendClientCircuit.ServiceSessionID);
else // the friend is not here, he initiated the request in his home world
friendsConn = new HGFriendsServicesConnector(friendFriendService);
friendsConn.NewFriendship(friendID, agentUUID);
//}
}
else if (friendIsLocal) // 'friend' is local, agent is foreigner
{
// Delete any previous friendship relations
DeletePreviousRelations(agentID, friendID);
// store in the local friends service a reference to the foreign agent
FriendsService.StoreFriend(friendID.ToString(), agentUUI + ";" + secret, 1);
// and also the converse
@@ -582,6 +540,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
// my brain hurts now
}
private void DeletePreviousRelations(UUID a1, UUID a2)
{
// Delete any previous friendship relations
FriendInfo[] finfos = null;
FriendInfo f = null;
finfos = GetFriendsFromCache(a1);
if (finfos != null)
{
f = GetFriend(finfos, a2);
if (f != null)
{
FriendsService.Delete(a1, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a1.ToString());
}
}
finfos = GetFriendsFromCache(a2);
if (finfos != null)
{
f = GetFriend(finfos, a1);
if (f != null)
{
FriendsService.Delete(a2, f.Friend);
// and also the converse
FriendsService.Delete(f.Friend, a2.ToString());
}
}
}
protected override bool DeleteFriendship(UUID agentID, UUID exfriendID)
{
Boolean agentIsLocal = true;
@@ -606,7 +594,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
if (agentIsLocal) // agent is local, 'friend' is foreigner
{
// We need to look for its information in the friends list itself
FriendInfo[] finfos = GetFriends(agentID);
FriendInfo[] finfos = GetFriendsFromCache(agentID);
FriendInfo finfo = GetFriend(finfos, exfriendID);
if (finfo != null)
{
@@ -650,7 +638,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
private string GetUUI(UUID localUser, UUID foreignUser)
{
// Let's see if the user is here by any chance
FriendInfo[] finfos = GetFriends(localUser);
FriendInfo[] finfos = GetFriendsFromCache(localUser);
if (finfos != EMPTY_FRIENDS) // friend is here, cool
{
FriendInfo finfo = GetFriend(finfos, foreignUser);
@@ -684,5 +672,80 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
friendConn.DeleteFriendship(foreignUser, localUser, secret);
}
}
protected override bool ForwardFriendshipOffer(UUID agentID, UUID friendID, GridInstantMessage im)
{
if (base.ForwardFriendshipOffer(agentID, friendID, im))
return true;
// OK, that didn't work, so let's try to find this user somewhere
if (!m_uMan.IsLocalGridUser(friendID))
{
string friendsURL = m_uMan.GetUserServerURL(friendID, "FriendsServerURI");
if (friendsURL != string.Empty)
{
m_log.DebugFormat("[HGFRIENDS MODULE]: Forwading friendship from {0} to {1} @ {2}", agentID, friendID, friendsURL);
GridRegion region = new GridRegion();
region.ServerURI = friendsURL;
string name = im.fromAgentName;
if (m_uMan.IsLocalGridUser(agentID))
{
IClientAPI agentClient = LocateClientObject(agentID);
AgentCircuitData agentClientCircuit = ((Scene)(agentClient.Scene)).AuthenticateHandler.GetAgentCircuitData(agentClient.CircuitCode);
string agentHomeService = string.Empty;
try
{
agentHomeService = agentClientCircuit.ServiceURLs["HomeURI"].ToString();
string lastname = "@" + new Uri(agentHomeService).Authority;
string firstname = im.fromAgentName.Replace(" ", ".");
name = firstname + lastname;
}
catch (KeyNotFoundException)
{
m_log.DebugFormat("[HGFRIENDS MODULE]: Key HomeURI not found for user {0}", agentID);
return false;
}
catch (NullReferenceException)
{
m_log.DebugFormat("[HGFRIENDS MODULE]: Null HomeUri for local user {0}", agentID);
return false;
}
catch (UriFormatException)
{
m_log.DebugFormat("[HGFRIENDS MODULE]: Malformed HomeUri {0} for local user {1}", agentHomeService, agentID);
return false;
}
}
m_HGFriendsConnector.FriendshipOffered(region, agentID, friendID, im.message, name);
return true;
}
}
return false;
}
public override bool LocalFriendshipOffered(UUID toID, GridInstantMessage im)
{
if (base.LocalFriendshipOffered(toID, im))
{
if (im.fromAgentName.Contains("@"))
{
string[] parts = im.fromAgentName.Split(new char[] { '@' });
if (parts.Length == 2)
{
string[] fl = parts[0].Trim().Split(new char[] { '.' });
if (fl.Length == 2)
m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], fl[1], "http://" + parts[1]);
else
m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], "", "http://" + parts[1]);
}
}
return true;
}
return false;
}
}
}

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Hypergrid;
using FriendInfo = OpenSim.Services.Interfaces.FriendInfo;
using OpenMetaverse;
using log4net;
namespace OpenSim.Region.CoreModules.Avatar.Friends
{
public class HGStatusNotifier
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private HGFriendsModule m_FriendsModule;
public HGStatusNotifier(HGFriendsModule friendsModule)
{
m_FriendsModule = friendsModule;
}
public void Notify(UUID userID, Dictionary<string, List<FriendInfo>> friendsPerDomain, bool online)
{
foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain)
{
if (kvp.Key != "local")
{
// For the others, call the user agent service
List<string> ids = new List<string>();
foreach (FriendInfo f in kvp.Value)
ids.Add(f.Friend);
if (ids.Count == 0)
continue; // no one to notify. caller don't do this
m_log.DebugFormat("[HG STATUS NOTIFIER]: Notifying {0} friends in {1}", ids.Count, kvp.Key);
// ASSUMPTION: we assume that all users for one home domain
// have exactly the same set of service URLs.
// If this is ever not true, we need to change this.
UUID friendID = UUID.Zero; String tmp = String.Empty;
if (Util.ParseUniversalUserIdentifier(ids[0], out friendID, out tmp, out tmp, out tmp, out tmp))
{
string friendsServerURI = m_FriendsModule.UserManagementModule.GetUserServerURL(friendID, "FriendsServerURI");
if (friendsServerURI != string.Empty)
{
HGFriendsServicesConnector fConn = new HGFriendsServicesConnector(friendsServerURI);
List<UUID> friendsOnline = fConn.StatusNotification(ids, userID, online);
if (online && friendsOnline.Count > 0)
{
IClientAPI client = m_FriendsModule.LocateClientObject(userID);
if (client != null)
client.SendAgentOnline(friendsOnline.ToArray());
}
}
}
}
}
}
}
}

View File

@@ -30,6 +30,7 @@ using System.Collections.Generic;
using Nini.Config;
using NUnit.Framework;
using OpenMetaverse;
using OpenSim.Data.Null;
using OpenSim.Framework;
using OpenSim.Region.CoreModules.Avatar.Friends;
using OpenSim.Region.Framework.Scenes;
@@ -44,9 +45,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
private FriendsModule m_fm;
private TestScene m_scene;
[TestFixtureSetUp]
public void FixtureInit()
{
// Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
}
[TestFixtureTearDown]
public void TearDown()
{
// We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
// threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression
// tests really shouldn't).
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
}
[SetUp]
public void Init()
{
// We must clear friends data between tests since Data.Null holds it in static properties. This is necessary
// so that different services and simulator can share the data in standalone mode. This is pretty horrible
// effectively the statics are global variables.
NullFriendsData.Clear();
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
// Not strictly necessary since FriendsModule assumes it is the default (!)
@@ -62,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
}
[Test]
public void TestNoFriends()
public void TestLoginWithNoFriends()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
@@ -75,6 +97,76 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends.Tests
Assert.That(((TestClient)sp.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(0));
}
[Test]
public void TestLoginWithOfflineFriends()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID user1Id = TestHelpers.ParseTail(0x1);
UUID user2Id = TestHelpers.ParseTail(0x2);
// UserAccountHelpers.CreateUserWithInventory(m_scene, user1Id);
// UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
//
// m_fm.AddFriendship(user1Id, user2Id);
ScenePresence sp1 = SceneHelpers.AddScenePresence(m_scene, user1Id);
ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, user2Id);
m_fm.AddFriendship(sp1.ControllingClient, user2Id);
// Not necessary for this test. CanSeeOnline is automatically granted.
// m_fm.GrantRights(sp1.ControllingClient, user2Id, (int)FriendRights.CanSeeOnline);
// We must logout from the client end so that the presence service is correctly updated by the presence
// detector. This is listening to the OnConnectionClosed event on the client.
((TestClient)sp1.ControllingClient).Logout();
((TestClient)sp2.ControllingClient).Logout();
// m_scene.RemoveClient(sp1.UUID, true);
// m_scene.RemoveClient(sp2.UUID, true);
ScenePresence sp1Redux = SceneHelpers.AddScenePresence(m_scene, user1Id);
// We don't expect to receive notifications of offline friends on login, just online.
Assert.That(((TestClient)sp1Redux.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
Assert.That(((TestClient)sp1Redux.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(0));
}
[Test]
public void TestLoginWithOnlineFriends()
{
TestHelpers.InMethod();
// log4net.Config.XmlConfigurator.Configure();
UUID user1Id = TestHelpers.ParseTail(0x1);
UUID user2Id = TestHelpers.ParseTail(0x2);
// UserAccountHelpers.CreateUserWithInventory(m_scene, user1Id);
// UserAccountHelpers.CreateUserWithInventory(m_scene, user2Id);
//
// m_fm.AddFriendship(user1Id, user2Id);
ScenePresence sp1 = SceneHelpers.AddScenePresence(m_scene, user1Id);
ScenePresence sp2 = SceneHelpers.AddScenePresence(m_scene, user2Id);
m_fm.AddFriendship(sp1.ControllingClient, user2Id);
// Not necessary for this test. CanSeeOnline is automatically granted.
// m_fm.GrantRights(sp1.ControllingClient, user2Id, (int)FriendRights.CanSeeOnline);
// We must logout from the client end so that the presence service is correctly updated by the presence
// detector. This is listening to the OnConnectionClosed event on the client.
// ((TestClient)sp1.ControllingClient).Logout();
((TestClient)sp2.ControllingClient).Logout();
// m_scene.RemoveClient(user2Id, true);
ScenePresence sp2Redux = SceneHelpers.AddScenePresence(m_scene, user2Id);
Assert.That(((TestClient)sp2Redux.ControllingClient).ReceivedOfflineNotifications.Count, Is.EqualTo(0));
Assert.That(((TestClient)sp2Redux.ControllingClient).ReceivedOnlineNotifications.Count, Is.EqualTo(1));
}
[Test]
public void TestAddFriendshipWhileOnline()
{

View File

@@ -267,12 +267,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
m_archiveWriter = new TarArchiveWriter(m_saveStream);
m_log.InfoFormat("[INVENTORY ARCHIVER]: Adding control file to archive.");
// Write out control file. This has to be done first so that subsequent loaders will see this file first
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
// not sure how to fix this though, short of going with a completely different file format.
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
if (inventoryFolder != null)
{
m_log.DebugFormat(

View File

@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted;
scene.AddCommand(
this, "load iar",
"Archiving", this, "load iar",
"load iar [-m|--merge] <first> <last> <inventory path> <password> [<IAR path>]",
"Load user inventory archive (IAR).",
"-m|--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones"
@@ -121,18 +121,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
HandleLoadInvConsoleCommand);
scene.AddCommand(
this, "save iar",
"Archiving", this, "save iar",
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-v|--verbose]",
"Save user inventory archive (IAR).",
"<first> is the user's first name." + Environment.NewLine
+ "<last> is the user's last name." + Environment.NewLine
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine
+ "-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
+ "-c|--creators preserves information about foreign creators." + Environment.NewLine
+ "-v|--verbose extra debug messages." + Environment.NewLine
+ "--noassets stops assets being saved to the IAR."
"<first> is the user's first name.\n"
+ "<last> is the user's last name.\n"
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved.\n"
+ "<IAR path> is the filesystem path at which to save the IAR."
+ string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME),
+ string.Format(" If this is not given then the filename {0} in the current directory is used.\n", DEFAULT_INV_BACKUP_FILENAME)
+ "-h|--home=<url> adds the url of the profile service to the saved user information.\n"
+ "-c|--creators preserves information about foreign creators.\n"
+ "-v|--verbose extra debug messages.\n"
+ "--noassets stops assets being saved to the IAR.",
HandleSaveInvConsoleCommand);
m_aScene = scene;
@@ -349,8 +349,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
{
try
{
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
Dictionary<string, object> options = new Dictionary<string, object>();
OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
@@ -412,7 +410,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
return;
}
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
if (options.ContainsKey("home"))
m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR");

View File

@@ -268,6 +268,39 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
{
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
IInventoryService invService = scene.InventoryService;
// Special case: folder redirect.
// RLV uses this
if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
{
InventoryFolderBase folder = new InventoryFolderBase(inventoryID, client.AgentId);
folder = invService.GetFolder(folder);
if (folder != null)
{
if (im.binaryBucket.Length >= 16)
{
UUID destFolderID = new UUID(im.binaryBucket, 0);
if (destFolderID != UUID.Zero)
{
InventoryFolderBase destFolder = new InventoryFolderBase(destFolderID, client.AgentId);
destFolder = invService.GetFolder(destFolder);
if (destFolder != null)
{
if (folder.ParentID != destFolder.ID)
{
folder.ParentID = destFolder.ID;
invService.MoveFolder(folder);
client.SendBulkUpdateInventory(folder);
}
}
}
}
}
}
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
if (user != null) // Local

View File

@@ -150,7 +150,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
string skillsText = String.Empty;
string languages = String.Empty;
Byte[] charterMember = Utils.StringToBytes("Avatar");
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, avatarID);
string name = "Avatar";
int created = 0;
if (account != null)
{
name = account.FirstName + " " + account.LastName;
created = account.Created;
}
Byte[] charterMember = Utils.StringToBytes(name);
profileUrl = "No profile data";
aboutText = string.Empty;
@@ -160,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
partner = UUID.Zero;
remoteClient.SendAvatarProperties(avatarID, aboutText,
Util.ToDateTime(0).ToString(
Util.ToDateTime(created).ToString(
"M/d/yyyy", CultureInfo.InvariantCulture),
charterMember, firstLifeAboutText,
(uint)(0 & 0xff),

View File

@@ -69,9 +69,10 @@ namespace OpenSim.Region.CoreModules.Framework
{
m_scene = scene;
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
MainConsole.Instance.Commands.AddCommand("Comms", false, "show caps",
"show caps",
"Shows all registered capabilities", HandleShowCapsCommand);
"Shows all registered capabilities for users", HandleShowCapsCommand);
}
public void RegionLoaded(Scene scene)

View File

@@ -36,6 +36,7 @@ using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Physics.Manager;
using OpenSim.Services.Interfaces;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
@@ -60,6 +61,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
set { m_MaxTransferDistance = value; }
}
private int m_levelHGTeleport = 0;
protected bool m_Enabled = false;
protected Scene m_aScene;
protected List<Scene> m_Scenes = new List<Scene>();
@@ -101,7 +104,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
IConfig transferConfig = source.Configs["EntityTransfer"];
if (transferConfig != null)
{
MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
}
m_agentsInTransit = new List<UUID>();
m_Enabled = true;
@@ -228,6 +234,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
// check if HyperGrid teleport is allowed, based on user level
int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
{
m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
return;
}
uint curX = 0, curY = 0;
Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
int curCellX = (int)(curX / Constants.RegionSize);
@@ -305,6 +321,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
return;
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}",
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
@@ -445,7 +464,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
sp.Name, finalDestination.RegionName);
Fail(sp, finalDestination);
Fail(sp, finalDestination, logout);
return;
}
@@ -477,7 +496,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
"[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.",
sp.Name, finalDestination.RegionName);
Fail(sp, finalDestination);
Fail(sp, finalDestination, logout);
return;
}
@@ -528,7 +547,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
private void Fail(ScenePresence sp, GridRegion finalDestination)
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
{
// Client never contacted destination. Let's restore everything back
sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
@@ -543,12 +562,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Finally, kill the agent we just created at the destination.
m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout);
}
protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
{
logout = false;
return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
bool success = m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
if (success)
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
return success;
}
protected virtual bool UpdateAgent(GridRegion reg, GridRegion finalDestination, AgentData agent)
@@ -681,11 +706,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
#region Agent Crossings
public bool Cross(ScenePresence agent, bool isFlying)
public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out uint xDest, out uint yDest, out string version, out Vector3 newpos)
{
Scene scene = agent.Scene;
Vector3 pos = agent.AbsolutePosition;
Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z);
version = String.Empty;
newpos = new Vector3(pos.X, pos.Y, pos.Z);
uint neighbourx = scene.RegionInfo.RegionLocX;
uint neighboury = scene.RegionInfo.RegionLocY;
const float boundaryDistance = 1.7f;
@@ -706,53 +730,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
if (b.TriggerRegionX == 0 && b.TriggerRegionY == 0)
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else
{
agent.IsInTransit = true;
neighboury = b.TriggerRegionY;
neighbourx = b.TriggerRegionX;
Vector3 newposition = pos;
newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
agent.ControllingClient.SendAgentAlertMessage(
String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
return true;
}
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
Border ba = scene.GetCrossedBorder(pos + westCross, Cardinals.W);
if (ba.TriggerRegionX == 0 && ba.TriggerRegionY == 0)
{
neighbourx--;
newpos.X = Constants.RegionSize - enterDistance;
}
else
{
agent.IsInTransit = true;
neighboury = ba.TriggerRegionY;
neighbourx = ba.TriggerRegionX;
Vector3 newposition = pos;
newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
agent.ControllingClient.SendAgentAlertMessage(
String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
return true;
}
neighbourx--;
newpos.X = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos + eastCross, Cardinals.E))
@@ -763,26 +746,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
Border ba = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
if (ba.TriggerRegionX == 0 && ba.TriggerRegionY == 0)
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else
{
agent.IsInTransit = true;
neighboury = ba.TriggerRegionY;
neighbourx = ba.TriggerRegionX;
Vector3 newposition = pos;
newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
agent.ControllingClient.SendAgentAlertMessage(
String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
return true;
}
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
{
@@ -790,35 +755,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize);
newpos.Y = enterDistance;
}
}
else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S);
if (b.TriggerRegionX == 0 && b.TriggerRegionY == 0)
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else
{
agent.IsInTransit = true;
neighboury = b.TriggerRegionY;
neighbourx = b.TriggerRegionX;
Vector3 newposition = pos;
newposition.X += (scene.RegionInfo.RegionLocX - neighbourx) * Constants.RegionSize;
newposition.Y += (scene.RegionInfo.RegionLocY - neighboury) * Constants.RegionSize;
agent.ControllingClient.SendAgentAlertMessage(
String.Format("Moving you to region {0},{1}", neighbourx, neighboury), false);
InformClientToInitateTeleportToLocation(agent, neighbourx, neighboury, newposition, scene);
return true;
}
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
{
Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
newpos.Y = enterDistance;
@@ -849,19 +794,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
*/
ulong neighbourHandle = Utils.UIntsToLong((uint)(neighbourx * Constants.RegionSize), (uint)(neighboury * Constants.RegionSize));
xDest = neighbourx;
yDest = neighboury;
int x = (int)(neighbourx * Constants.RegionSize), y = (int)(neighboury * Constants.RegionSize);
ulong neighbourHandle = Utils.UIntsToLong((uint)x, (uint)y);
ExpiringCache<ulong, DateTime> r;
DateTime banUntil;
if (m_bannedRegions.TryGetValue(agent.ControllingClient.AgentId, out r))
if (m_bannedRegions.TryGetValue(agentID, out r))
{
if (r.TryGetValue(neighbourHandle, out banUntil))
{
if (DateTime.Now < banUntil)
return false;
return null;
r.Remove(neighbourHandle);
}
}
@@ -873,28 +821,43 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
string reason;
string version;
if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out version, out reason))
if (!scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out reason))
{
agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
if (r == null)
{
r = new ExpiringCache<ulong, DateTime>();
r.Add(neighbourHandle, DateTime.Now + TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15));
m_bannedRegions.Add(agent.ControllingClient.AgentId, r, TimeSpan.FromSeconds(45));
m_bannedRegions.Add(agentID, r, TimeSpan.FromSeconds(45));
}
else
{
r.Add(neighbourHandle, DateTime.Now + TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(15));
}
return null;
}
return neighbourRegion;
}
public bool Cross(ScenePresence agent, bool isFlying)
{
uint x;
uint y;
Vector3 newpos;
string version;
GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, out x, out y, out version, out newpos);
if (neighbourRegion == null)
{
agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
return false;
}
agent.IsInTransit = true;
CrossAgentToNewRegionDelegate d = CrossAgentToNewRegionAsync;
d.BeginInvoke(agent, newpos, neighbourx, neighboury, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
d.BeginInvoke(agent, newpos, x, y, neighbourRegion, isFlying, version, CrossAgentToNewRegionCompleted, d);
return true;
}
@@ -951,13 +914,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
icon.EndInvoke(iar);
}
public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion, bool isFlying, string version);
/// <summary>
/// This Closes child agents on neighbouring regions
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
/// </summary>
protected ScenePresence CrossAgentToNewRegionAsync(
public ScenePresence CrossAgentToNewRegionAsync(
ScenePresence agent, Vector3 pos, uint neighbourx, uint neighboury, GridRegion neighbourRegion,
bool isFlying, string version)
{
@@ -1013,6 +974,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
neighbourRegion.RegionHandle);
return agent;
}
// No turning back
agent.IsChildAgent = true;
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
@@ -1161,7 +1125,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// <summary>
/// This informs all neighbouring regions about agent "avatar".
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
/// </summary>
/// <param name="sp"></param>
public void EnableChildAgents(ScenePresence sp)
@@ -1281,13 +1244,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
{
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
try
{
//neighbour.ExternalEndPoint may return null, which will be caught
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
InformClientOfNeighbourCompleted,
d);
// Let's put this back at sync, so that it doesn't clog
// the network, especially for regions in the same physical server.
// We're really not in a hurry here.
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent);
//InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
//d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
// InformClientOfNeighbourCompleted,
// d);
}
catch (ArgumentOutOfRangeException)
@@ -1720,34 +1686,34 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Offset the positions for the new region across the border
Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
grp.RootPart.GroupPosition = pos;
// If we fail to cross the border, then reset the position of the scene object on that border.
uint x = 0, y = 0;
Utils.LongToUInts(newRegionHandle, out x, out y);
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
if (destination != null)
{
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
// Need to turn off the physics flags, otherwise the object will continue to attempt to
// move out of the region creating an infinite loop of failed attempts to cross
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
// We are going to move the object back to the old position so long as the old position
// is in the region
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
grp.AbsolutePosition = oldGroupPosition;
grp.ScheduleGroupForFullUpdate();
if (CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
return; // we did it
}
// no one or failed lets go back and tell physics to go on
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X, 0.5f, (float)Constants.RegionSize - 0.5f);
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z, 0.5f, 4096.0f);
grp.AbsolutePosition = oldGroupPosition;
grp.Velocity = Vector3.Zero;
if (grp.RootPart.PhysActor != null)
grp.RootPart.PhysActor.CrossingFailure();
grp.ScheduleGroupForFullUpdate();
}
/// <summary>
/// Move the given scene object into a new region
/// </summary>
@@ -1757,7 +1723,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// true if the crossing itself was successful, false on failure
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
/// </returns>
protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent)
protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent)
{
//m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
@@ -1782,7 +1748,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
//if (m_interregionCommsOut != null)
// successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
if (m_aScene.SimulationService != null)
successYN = m_aScene.SimulationService.CreateObject(destination, grp, true);
successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true);
if (successYN)
{
@@ -1802,9 +1768,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
if (!grp.IsDeleted)
{
if (grp.RootPart.PhysActor != null)
PhysicsActor pa = grp.RootPart.PhysActor;
if (pa != null)
{
grp.RootPart.PhysActor.CrossingFailure();
pa.CrossingFailure();
if (grp.RootPart.KeyframeMotion != null)
{
grp.RootPart.Velocity = Vector3.Zero;
grp.RootPart.KeyframeMotion.CrossingFailure();
grp.SendGroupRootTerseUpdate();
}
}
}
@@ -1841,7 +1814,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
gobj.IsAttachment = false;
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent);
}
}
@@ -1878,6 +1851,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
protected bool IsInTransit(UUID id)
{
lock (m_agentsInTransit)
{
if (m_agentsInTransit.Contains(id))
return true;
}
return false;
}
protected bool ResetFromTransit(UUID id)
{
lock (m_agentsInTransit)

View File

@@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Connectors.Hypergrid;
@@ -89,7 +90,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed);
}
public override void RegionLoaded(Scene scene)
{
base.RegionLoaded(scene);
@@ -98,6 +98,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
{
m_GatekeeperConnector = new GatekeeperServiceConnector(scene.AssetService);
m_Initialized = true;
}
}
@@ -170,6 +171,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
logout = success; // flag for later logout from this grid; this is an HG TP
if (success)
sp.Scene.EventManager.TriggerTeleportStart(sp.ControllingClient, reg, finalDestination, teleportFlags, logout);
return success;
}
else
@@ -179,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
return base.CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout);
}
public void TriggerTeleportHome(UUID id, IClientAPI client)
@@ -342,6 +346,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
#endregion
private GridRegion MakeRegion(AgentCircuitData aCircuit)
{
GridRegion region = new GridRegion();
@@ -358,5 +363,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
region.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), (int)0);
return region;
}
}
}

View File

@@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Connectors.Hypergrid;
@@ -57,6 +58,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
private string m_HomeURI;
private bool m_OutboundPermission;
private string m_ThisGatekeeper;
private bool m_RestrictInventoryAccessAbroad;
// private bool m_Initialized = false;
@@ -90,6 +92,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
m_HomeURI = thisModuleConfig.GetString("HomeURI", m_HomeURI);
m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true);
m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", string.Empty);
m_RestrictInventoryAccessAbroad = thisModuleConfig.GetBoolean("RestrictInventoryAccessAbroad", false);
}
else
m_log.Warn("[HG INVENTORY ACCESS MODULE]: HGInventoryAccessModule configs not found. ProfileServerURI not set!");
@@ -105,19 +108,85 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
base.AddRegion(scene);
m_assMapper = new HGAssetMapper(scene, m_HomeURI);
scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
scene.EventManager.OnTeleportStart += TeleportStart;
scene.EventManager.OnTeleportFail += TeleportFail;
}
#endregion
#region Event handlers
protected override void OnNewClient(IClientAPI client)
{
base.OnNewClient(client);
client.OnCompleteMovementToRegion += new Action<IClientAPI, bool>(OnCompleteMovementToRegion);
}
protected void OnCompleteMovementToRegion(IClientAPI client, bool arg2)
{
//m_log.DebugFormat("[HG INVENTORY ACCESS MODULE]: OnCompleteMovementToRegion of user {0}", client.Name);
object sp = null;
if (client.Scene.TryGetScenePresence(client.AgentId, out sp))
{
if (sp is ScenePresence)
{
AgentCircuitData aCircuit = ((ScenePresence)sp).Scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
{
if (m_RestrictInventoryAccessAbroad)
{
IUserManagement uMan = m_Scene.RequestModuleInterface<IUserManagement>();
if (uMan.IsLocalGridUser(client.AgentId))
ProcessInventoryForComingHome(client);
else
ProcessInventoryForArriving(client);
}
}
}
}
}
protected void TeleportStart(IClientAPI client, GridRegion destination, GridRegion finalDestination, uint teleportFlags, bool gridLogout)
{
if (gridLogout && m_RestrictInventoryAccessAbroad)
{
IUserManagement uMan = m_Scene.RequestModuleInterface<IUserManagement>();
if (uMan != null && uMan.IsLocalGridUser(client.AgentId))
{
// local grid user
ProcessInventoryForHypergriding(client);
}
else
{
// Foreigner
ProcessInventoryForLeaving(client);
}
}
}
protected void TeleportFail(IClientAPI client, bool gridLogout)
{
if (gridLogout && m_RestrictInventoryAccessAbroad)
{
IUserManagement uMan = m_Scene.RequestModuleInterface<IUserManagement>();
if (uMan.IsLocalGridUser(client.AgentId))
{
ProcessInventoryForComingHome(client);
}
else
{
ProcessInventoryForArriving(client);
}
}
}
public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel)
{
string userAssetServer = string.Empty;
if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
{
Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); });
m_assMapper.Post(assetID, avatarID, userAssetServer);
}
}
@@ -236,8 +305,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return false;
}
#endregion
protected override InventoryItemBase GetItem(UUID agentID, UUID itemID)
{
InventoryItemBase item = base.GetItem(agentID, itemID);
@@ -248,5 +315,84 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
return item;
}
#endregion
#region Inventory manipulation upon arriving/leaving
//
// These 2 are for local and foreign users coming back, respectively
//
private void ProcessInventoryForComingHome(IClientAPI client)
{
m_log.DebugFormat("[HG INVENTORY ACCESS MODULE]: Restoring root folder for local user {0}", client.Name);
if (client is IClientCore)
{
IClientCore core = (IClientCore)client;
IClientInventory inv;
if (core.TryGet<IClientInventory>(out inv))
{
InventoryFolderBase root = m_Scene.InventoryService.GetRootFolder(client.AgentId);
InventoryCollection content = m_Scene.InventoryService.GetFolderContent(client.AgentId, root.ID);
inv.SendBulkUpdateInventory(content.Folders.ToArray(), content.Items.ToArray());
}
}
}
private void ProcessInventoryForArriving(IClientAPI client)
{
}
//
// These 2 are for local and foreign users going away respectively
//
private void ProcessInventoryForHypergriding(IClientAPI client)
{
if (client is IClientCore)
{
IClientCore core = (IClientCore)client;
IClientInventory inv;
if (core.TryGet<IClientInventory>(out inv))
{
InventoryFolderBase root = m_Scene.InventoryService.GetRootFolder(client.AgentId);
if (root != null)
{
m_log.DebugFormat("[HG INVENTORY ACCESS MODULE]: Changing root inventory for user {0}", client.Name);
InventoryCollection content = m_Scene.InventoryService.GetFolderContent(client.AgentId, root.ID);
List<UUID> fids = new List<UUID>();
List<UUID> iids = new List<UUID>();
List<InventoryFolderBase> keep = new List<InventoryFolderBase>();
foreach (InventoryFolderBase f in content.Folders)
{
if (f.Name != "My Suitcase")
{
f.Name = f.Name + " (Unavailable)";
keep.Add(f);
}
}
// items directly under the root folder
foreach (InventoryItemBase it in content.Items)
it.Name = it.Name + " (Unavailable)"; ;
// Send the new names
inv.SendBulkUpdateInventory(keep.ToArray(), content.Items.ToArray());
}
}
}
}
private void ProcessInventoryForLeaving(IClientAPI client)
{
}
#endregion
}
}

View File

@@ -355,6 +355,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (SceneObjectGroup objectGroup in objlist)
{
if (objectGroup.RootPart.KeyframeMotion != null)
objectGroup.RootPart.KeyframeMotion.Stop();
objectGroup.RootPart.SetForce(Vector3.Zero);
objectGroup.RootPart.SetAngularImpulse(Vector3.Zero, false);
objectGroup.RootPart.KeyframeMotion = null;
Vector3 inventoryStoredPosition = new Vector3
(((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
? 250
@@ -365,14 +371,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
: objectGroup.AbsolutePosition.Y,
objectGroup.AbsolutePosition.Z);
Quaternion inventoryStoredRotation = objectGroup.GroupRotation;
originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition;
// Restore attachment data after trip through the sim
if (objectGroup.RootPart.AttachPoint > 0)
{
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
inventoryStoredRotation = objectGroup.RootPart.AttachRotation;
}
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
objectGroup.AbsolutePosition = inventoryStoredPosition;
objectGroup.RootPart.RotationOffset = inventoryStoredRotation;
// Make sure all bits but the ones we want are clear
// on take.
@@ -565,9 +576,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
// action, remoteClient.Name, userID);
}
else if (so.RootPart.OwnerID == so.RootPart.GroupID)
{
// Group owned objects go to the last owner before the object was transferred.
userID = so.RootPart.LastOwnerID;
}
else
{
// All returns / deletes go to the object owner
// Other returns / deletes go to the object owner
//
userID = so.RootPart.OwnerID;
@@ -663,9 +679,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
//
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
{
if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
if (so.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
{
InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID);
InventoryFolderBase f = new InventoryFolderBase(so.FromFolderID, userID);
if (f != null)
folder = m_Scene.InventoryService.GetFolder(f);
}
@@ -757,6 +773,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
g.RootPart.AttachRotation = g.GroupRotation;
g.RootPart.Shape.State = 0;
}
objlist.Add(g);
@@ -789,6 +807,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
g.RootPart.AttachPoint = g.RootPart.Shape.State;
g.RootPart.AttachOffset = g.AbsolutePosition;
g.RootPart.AttachRotation = g.GroupRotation;
g.RootPart.Shape.State = 0;
objlist.Add(g);
XmlElement el = (XmlElement)n;
@@ -955,6 +975,30 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
int primcount = 0;
foreach (SceneObjectGroup g in objlist)
primcount += g.PrimCount;
if (!m_Scene.Permissions.CanRezObject(
primcount, remoteClient.AgentId, pos)
&& !isAttachment)
{
// The client operates in no fail mode. It will
// have already removed the item from the folder
// if it's no copy.
// Put it back if it's not an attachment
//
if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment))
remoteClient.SendBulkUpdateInventory(item);
ILandObject land = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y);
remoteClient.SendAlertMessage(string.Format(
"Can't rez object '{0}' at <{1:F3}, {2:F3}, {3:F3}> on parcel '{4}' in region {5}.",
item.Name, pos.X, pos.Y, pos.Z, land != null ? land.LandData.Name : "Unknown", m_Scene.RegionInfo.RegionName));
return false;
}
for (int i = 0; i < objlist.Count; i++)
{
SceneObjectGroup so = objlist[i];
@@ -977,7 +1021,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
}
rootPart.FromFolderID = item.Folder;
so.FromFolderID = item.Folder;
// Console.WriteLine("rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
@@ -1036,7 +1080,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
rootPart.TrimPermissions();
if (isAttachment)
so.SetFromItemID(item.ID);
so.FromItemID = item.ID;
}
return true;

View File

@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
m_scene = scene;
m_scene.AddCommand(this, "monitor report",
m_scene.AddCommand("General", this, "monitor report",
"monitor report",
"Returns a variety of statistics about the current region and/or simulator",
DebugMonitors);

View File

@@ -0,0 +1,161 @@
/*
* 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.IO;
using System.Reflection;
using OpenSim.Framework;
using OpenSim.Framework.Console;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Hypergrid;
using OpenMetaverse;
using OpenMetaverse.Packets;
using log4net;
using Nini.Config;
namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
public class HGUserManagementModule : UserManagementModule, ISharedRegionModule, IUserManagement
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region ISharedRegionModule
public new void Initialise(IConfigSource config)
{
string umanmod = config.Configs["Modules"].GetString("UserManagementModule", base.Name);
if (umanmod == Name)
{
m_Enabled = true;
RegisterConsoleCmds();
m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name);
}
}
public override string Name
{
get { return "HGUserManagementModule"; }
}
#endregion ISharedRegionModule
protected override void AddAdditionalUsers(UUID avatarID, string query, List<UserData> users)
{
if (query.Contains("@")) // First.Last@foo.com, maybe?
{
string[] words = query.Split(new char[] { '@' });
if (words.Length != 2)
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Malformed address {0}", query);
return;
}
words[0] = words[0].Trim(); // it has at least 1
words[1] = words[1].Trim();
if (words[0] == String.Empty) // query was @foo.com?
{
foreach (UserData d in m_UserCache.Values)
{
if (d.LastName.ToLower().StartsWith("@" + words[1].ToLower()))
users.Add(d);
}
// We're done
return;
}
// words.Length == 2 and words[0] != string.empty
// first.last@foo.com ?
foreach (UserData d in m_UserCache.Values)
{
if (d.LastName.StartsWith("@") &&
d.FirstName.ToLower().Equals(words[0].ToLower()) &&
d.LastName.ToLower().Equals("@" + words[1].ToLower()))
{
users.Add(d);
// It's cached. We're done
return;
}
}
// This is it! Let's ask the other world
if (words[0].Contains("."))
{
string[] names = words[0].Split(new char[] { '.' });
if (names.Length >= 2)
{
string uriStr = "http://" + words[1];
// Let's check that the last name is a valid address
try
{
new Uri(uriStr);
}
catch (UriFormatException)
{
m_log.DebugFormat("[USER MANAGEMENT MODULE]: Malformed address {0}", uriStr);
return;
}
UserAgentServiceConnector uasConn = new UserAgentServiceConnector(uriStr);
UUID userID = uasConn.GetUUID(names[0], names[1]);
if (!userID.Equals(UUID.Zero))
{
UserData ud = new UserData();
ud.Id = userID;
ud.FirstName = words[0];
ud.LastName = "@" + words[1];
users.Add(ud);
AddUser(userID, names[0], names[1], uriStr);
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} found", words[0], words[1]);
}
else
m_log.DebugFormat("[USER MANAGEMENT MODULE]: User {0}@{1} not found", words[0], words[1]);
}
}
}
//else
//{
// foreach (UserData d in m_UserCache.Values)
// {
// if (d.LastName.StartsWith("@") &&
// (d.FirstName.ToLower().StartsWith(query.ToLower()) ||
// d.LastName.ToLower().StartsWith(query.ToLower())))
// users.Add(d);
// }
//}
}
}
}

View File

@@ -38,12 +38,13 @@ using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Hypergrid;
using OpenMetaverse;
using OpenMetaverse.Packets;
using log4net;
using Nini.Config;
namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
class UserData
public class UserData
{
public UUID Id { get; set; }
public string FirstName { get; set; }
@@ -56,36 +57,23 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private List<Scene> m_Scenes = new List<Scene>();
protected bool m_Enabled;
protected List<Scene> m_Scenes = new List<Scene>();
// The cache
Dictionary<UUID, UserData> m_UserCache = new Dictionary<UUID, UserData>();
protected Dictionary<UUID, UserData> m_UserCache = new Dictionary<UUID, UserData>();
#region ISharedRegionModule
public void Initialise(IConfigSource config)
{
//m_Enabled = config.Configs["Modules"].GetBoolean("LibraryModule", m_Enabled);
//if (m_Enabled)
//{
// IConfig libConfig = config.Configs["LibraryService"];
// if (libConfig != null)
// {
// string dllName = libConfig.GetString("LocalServiceModule", string.Empty);
// m_log.Debug("[LIBRARY MODULE]: Library service dll is " + dllName);
// if (dllName != string.Empty)
// {
// Object[] args = new Object[] { config };
// m_Library = ServerUtils.LoadPlugin<ILibraryService>(dllName, args);
// }
// }
//}
MainConsole.Instance.Commands.AddCommand("grid", true,
"show names",
"show names",
"Show the bindings between user UUIDs and user names",
String.Empty,
HandleShowUsers);
string umanmod = config.Configs["Modules"].GetString("UserManagementModule", Name);
if (umanmod == Name)
{
m_Enabled = true;
RegisterConsoleCmds();
m_log.DebugFormat("[USER MANAGEMENT MODULE]: {0} is enabled", Name);
}
}
public bool IsSharedModule
@@ -93,9 +81,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
get { return true; }
}
public string Name
public virtual string Name
{
get { return "UserManagement Module"; }
get { return "BasicUserManagementModule"; }
}
public Type ReplaceableInterface
@@ -105,17 +93,23 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
public void AddRegion(Scene scene)
{
m_Scenes.Add(scene);
if (m_Enabled)
{
m_Scenes.Add(scene);
scene.RegisterModuleInterface<IUserManagement>(this);
scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient);
scene.EventManager.OnPrimsLoaded += new EventManager.PrimsLoaded(EventManager_OnPrimsLoaded);
scene.RegisterModuleInterface<IUserManagement>(this);
scene.EventManager.OnNewClient += new EventManager.OnNewClientDelegate(EventManager_OnNewClient);
scene.EventManager.OnPrimsLoaded += new EventManager.PrimsLoaded(EventManager_OnPrimsLoaded);
}
}
public void RemoveRegion(Scene scene)
{
scene.UnregisterModuleInterface<IUserManagement>(this);
m_Scenes.Remove(scene);
if (m_Enabled)
{
scene.UnregisterModuleInterface<IUserManagement>(this);
m_Scenes.Remove(scene);
}
}
public void RegionLoaded(Scene s)
@@ -149,7 +143,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
void EventManager_OnNewClient(IClientAPI client)
{
client.OnConnectionClosed += new Action<IClientAPI>(HandleConnectionClosed);
client.OnNameFromUUIDRequest += new UUIDNameRequest(HandleUUIDNameRequest);
client.OnAvatarPickerRequest += new AvatarPickerRequest(HandleAvatarPickerRequest);
}
void HandleConnectionClosed(IClientAPI client)
{
client.OnNameFromUUIDRequest -= new UUIDNameRequest(HandleUUIDNameRequest);
client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest);
}
void HandleUUIDNameRequest(UUID uuid, IClientAPI remote_client)
@@ -170,6 +172,77 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
}
}
public void HandleAvatarPickerRequest(IClientAPI client, UUID avatarID, UUID RequestID, string query)
{
//EventManager.TriggerAvatarPickerRequest();
m_log.DebugFormat("[USER MANAGEMENT MODULE]: HandleAvatarPickerRequest for {0}", query);
List<UserAccount> accs = m_Scenes[0].UserAccountService.GetUserAccounts(m_Scenes[0].RegionInfo.ScopeID, query);
List<UserData> users = new List<UserData>();
if (accs != null)
{
foreach (UserAccount acc in accs)
{
UserData ud = new UserData();
ud.FirstName = acc.FirstName;
ud.LastName = acc.LastName;
ud.Id = acc.PrincipalID;
users.Add(ud);
}
}
AddAdditionalUsers(avatarID, query, users);
AvatarPickerReplyPacket replyPacket = (AvatarPickerReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarPickerReply);
// TODO: don't create new blocks if recycling an old packet
AvatarPickerReplyPacket.DataBlock[] searchData =
new AvatarPickerReplyPacket.DataBlock[users.Count];
AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock();
agentData.AgentID = avatarID;
agentData.QueryID = RequestID;
replyPacket.AgentData = agentData;
//byte[] bytes = new byte[AvatarResponses.Count*32];
int i = 0;
foreach (UserData item in users)
{
UUID translatedIDtem = item.Id;
searchData[i] = new AvatarPickerReplyPacket.DataBlock();
searchData[i].AvatarID = translatedIDtem;
searchData[i].FirstName = Utils.StringToBytes((string)item.FirstName);
searchData[i].LastName = Utils.StringToBytes((string)item.LastName);
i++;
}
if (users.Count == 0)
{
searchData = new AvatarPickerReplyPacket.DataBlock[0];
}
replyPacket.Data = searchData;
AvatarPickerReplyAgentDataArgs agent_data = new AvatarPickerReplyAgentDataArgs();
agent_data.AgentID = replyPacket.AgentData.AgentID;
agent_data.QueryID = replyPacket.AgentData.QueryID;
List<AvatarPickerReplyDataArgs> data_args = new List<AvatarPickerReplyDataArgs>();
for (i = 0; i < replyPacket.Data.Length; i++)
{
AvatarPickerReplyDataArgs data_arg = new AvatarPickerReplyDataArgs();
data_arg.AvatarID = replyPacket.Data[i].AvatarID;
data_arg.FirstName = replyPacket.Data[i].FirstName;
data_arg.LastName = replyPacket.Data[i].LastName;
data_args.Add(data_arg);
}
client.SendAvatarPickerReply(agent_data, data_args);
}
protected virtual void AddAdditionalUsers(UUID avatarID, string query, List<UserData> users)
{
}
#endregion Event Handlers
private void CacheCreators(SceneObjectGroup sog)
@@ -224,9 +297,37 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
#region IUserManagement
public UUID GetUserIdByName(string name)
{
string[] parts = name.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length < 2)
throw new Exception("Name must have 2 components");
return GetUserIdByName(parts[0], parts[1]);
}
public UUID GetUserIdByName(string firstName, string lastName)
{
// TODO: Optimize for reverse lookup if this gets used by non-console commands.
lock (m_UserCache)
{
foreach (UserData user in m_UserCache.Values)
{
if (user.FirstName == firstName && user.LastName == lastName)
return user.Id;
}
}
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName);
if (account != null)
return account.PrincipalID;
return UUID.Zero;
}
public string GetUserName(UUID uuid)
{
//m_log.DebugFormat("[XXX] GetUserName {0}", uuid);
string[] names = GetUserNames(uuid);
if (names.Length == 2)
{
@@ -267,9 +368,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
if (userdata.HomeURL != null && userdata.HomeURL != string.Empty)
{
m_log.DebugFormat(
"[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}",
serverType, userdata.HomeURL, userID);
//m_log.DebugFormat(
// "[USER MANAGEMENT MODULE]: Did not find url type {0} so requesting urls from '{1}' for {2}",
// serverType, userdata.HomeURL, userID);
UserAgentServiceConnector uConn = new UserAgentServiceConnector(userdata.HomeURL);
userdata.ServerURLs = uConn.GetServerURLs(userID);
@@ -328,11 +429,15 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
public void AddUser(UUID uuid, string first, string last, string homeURL)
{
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, first {1}, last {2}, url {3}", uuid, first, last, homeURL);
AddUser(uuid, homeURL + ";" + first + " " + last);
}
public void AddUser (UUID id, string creatorData)
{
//m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
UserData oldUser;
//lock the whole block - prevent concurrent update
lock (m_UserCache)
@@ -358,9 +463,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
return;
}
}
// m_log.DebugFormat("[USER MANAGEMENT MODULE]: Adding user with id {0}, creatorData {1}", id, creatorData);
UserAccount account = m_Scenes [0].UserAccountService.GetUserAccount (m_Scenes [0].RegionInfo.ScopeID, id);
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount (m_Scenes [0].RegionInfo.ScopeID, id);
if (account != null)
{
@@ -409,9 +513,9 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
lock (m_UserCache)
m_UserCache[user.Id] = user;
// m_log.DebugFormat(
// "[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}",
// user.Id, user.FirstName, user.LastName, user.HomeURL);
//m_log.DebugFormat(
// "[USER MANAGEMENT MODULE]: Added user {0} {1} {2} {3}",
// user.Id, user.FirstName, user.LastName, user.HomeURL);
}
public bool IsLocalGridUser(UUID uuid)
@@ -425,13 +529,23 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
#endregion IUserManagement
protected void RegisterConsoleCmds()
{
MainConsole.Instance.Commands.AddCommand("Users", true,
"show names",
"show names",
"Show the bindings between user UUIDs and user names",
String.Empty,
HandleShowUsers);
}
private void HandleShowUsers(string module, string[] cmd)
{
lock (m_UserCache)
{
if (m_UserCache.Count == 0)
{
MainConsole.Instance.Output("No users not found");
MainConsole.Instance.Output("No users found");
return;
}

View File

@@ -90,9 +90,9 @@ namespace OpenSim.Region.CoreModules.Hypergrid
}
}
protected override List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
protected override List<MapBlockData> GetAndSendBlocksInternal(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
{
List<MapBlockData> mapBlocks = base.GetAndSendBlocks(remoteClient, minX, minY, maxX, maxY, flag);
List<MapBlockData> mapBlocks = base.GetAndSendBlocksInternal(remoteClient, minX, minY, maxX, maxY, flag);
lock (m_SeenMapBlocks)
{
if (!m_SeenMapBlocks.ContainsKey(remoteClient.AgentId))

View File

@@ -1210,7 +1210,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
if (homeScene.TryGetScenePresence(avatarId,out avatar))
{
KillAUser ku = new KillAUser(avatar,mod);
Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true);
Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true, true);
}
}

View File

@@ -9,6 +9,7 @@
<Extension path = "/OpenSim/RegionModules">
<RegionModule id="UserManagementModule" type="OpenSim.Region.CoreModules.Framework.UserManagement.UserManagementModule" />
<RegionModule id="HGUserManagementModule" type="OpenSim.Region.CoreModules.Framework.UserManagement.HGUserManagementModule" />
<RegionModule id="EntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.EntityTransferModule" />
<RegionModule id="HGEntityTransferModule" type="OpenSim.Region.CoreModules.Framework.EntityTransfer.HGEntityTransferModule" />
<RegionModule id="InventoryAccessModule" type="OpenSim.Region.CoreModules.Framework.InventoryAccess.BasicInventoryAccessModule" />

View File

@@ -172,9 +172,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
string uri = "/lslhttp/" + urlcode.ToString();
m_HttpServer.AddPollServiceHTTPHandler(
uri,
new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
PollServiceEventArgs args = new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode, 25000);
args.Type = PollServiceEventArgs.EventType.LslHttp;
m_HttpServer.AddPollServiceHTTPHandler(uri, args);
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
}
@@ -216,7 +216,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
m_HttpsServer.AddPollServiceHTTPHandler(
uri,
new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode));
new PollServiceEventArgs(HttpRequestHandler, HasEvents, GetEvents, NoEvents, urlcode,25000));
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_GRANTED", url });
}
@@ -422,7 +422,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
}
private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
{
UrlData url = null;
UrlData url = null;
RequestData requestData = null;
lock (m_RequestMap)
@@ -508,7 +508,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
}
else
{
m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString());
//m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString());
return;
}
//for llGetHttpHeader support we need to store original URI here

View File

@@ -90,6 +90,8 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
// private static readonly ILog m_log =
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private const int DEBUG_CHANNEL = 2147483647;
private ListenerManager m_listenerManager;
private Queue m_pending;
private Queue m_pendingQ;
@@ -151,6 +153,14 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
#region IWorldComm Members
public int ListenerCount
{
get
{
return m_listenerManager.ListenerCount;
}
}
/// <summary>
/// Create a listen event callback with the specified filters.
/// The parameters localID,itemID are needed to uniquely identify
@@ -303,6 +313,10 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
public bool DeliverMessageTo(UUID target, int channel, Vector3 pos, string name, UUID id, string msg, out string error)
{
error = null;
if (channel == DEBUG_CHANNEL)
return true;
// Is id an avatar?
ScenePresence sp = m_scene.GetScenePresence(target);
@@ -311,7 +325,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
// Send message to avatar
if (channel == 0)
{
m_scene.SimChatBroadcast(Utils.StringToBytes(msg), ChatTypeEnum.Owner, 0, pos, name, id, false);
// Channel 0 goes to viewer ONLY
m_scene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Broadcast, 0, pos, name, id, false, false, target);
return true;
}
List<SceneObjectGroup> attachments = sp.GetAttachments();
@@ -343,12 +359,9 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
return true;
}
// Need to toss an error here
if (channel == 0)
{
error = "Cannot use llRegionSayTo to message objects on channel 0";
return false;
}
SceneObjectPart part = m_scene.GetSceneObjectPart(target);
if (part == null) // Not even an object
return true; // No error
foreach (ListenerInfo li in m_listenerManager.GetListeners(UUID.Zero, channel, name, id, msg))
{
@@ -438,6 +451,18 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
private int m_maxhandles;
private int m_curlisteners;
/// <summary>
/// Total number of listeners
/// </summary>
public int ListenerCount
{
get
{
lock (m_listeners)
return m_listeners.Count;
}
}
public ListenerManager(int maxlisteners, int maxhandles)
{
m_maxlisteners = maxlisteners;

View File

@@ -48,8 +48,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
private static bool m_Enabled = false;
private IConfigSource m_Config;
bool m_Registered = false;
GatekeeperServiceInConnector m_HypergridHandler;
private bool m_Registered = false;
private string m_LocalServiceDll = String.Empty;
private GatekeeperServiceInConnector m_HypergridHandler;
private UserAgentServerConnector m_UASHandler;
#region IRegionModule interface
@@ -63,6 +65,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
if (m_Enabled)
{
m_log.Info("[HGGRID IN CONNECTOR]: Hypergrid Service In Connector enabled");
IConfig fconfig = config.Configs["FriendsService"];
if (fconfig != null)
{
m_LocalServiceDll = fconfig.GetString("LocalServiceModule", m_LocalServiceDll);
if (m_LocalServiceDll == String.Empty)
m_log.WarnFormat("[HGGRID IN CONNECTOR]: Friends LocalServiceModule config missing");
}
}
}
@@ -91,7 +100,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
{
if (!m_Enabled)
return;
}
public void RemoveRegion(Scene scene)
@@ -112,14 +120,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid
m_log.Info("[HypergridService]: Starting...");
ISimulationService simService = scene.RequestModuleInterface<ISimulationService>();
IFriendsSimConnector friendsConn = scene.RequestModuleInterface<IFriendsSimConnector>();
Object[] args = new Object[] { m_Config };
IFriendsService friendsService = ServerUtils.LoadPlugin<IFriendsService>(m_LocalServiceDll, args);
m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService);
IFriendsSimConnector friendsConn = scene.RequestModuleInterface<IFriendsSimConnector>();
new UserAgentServerConnector(m_Config, MainServer.Instance, friendsConn);
m_UASHandler = new UserAgentServerConnector(m_Config, MainServer.Instance, friendsConn);
new HeloServiceInConnector(m_Config, MainServer.Instance, "HeloService");
new HGFriendsServerConnector(m_Config, MainServer.Instance, "HGFriendsService");
new HGFriendsServerConnector(m_Config, MainServer.Instance, "HGFriendsService", friendsConn);
}
scene.RegisterModuleInterface<IGatekeeperService>(m_HypergridHandler.GateKeeper);
scene.RegisterModuleInterface<IUserAgentService>(m_UASHandler.HomeUsersService);
}
#endregion

View File

@@ -73,14 +73,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
return;
}
string serviceDll = assetConfig.GetString("LocalServiceModule",
String.Empty);
string serviceDll = assetConfig.GetString("LocalServiceModule", String.Empty);
if (serviceDll == String.Empty)
{
m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService");
return;
}
else
{
m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Loading asset service at {0}", serviceDll);
}
Object[] args = new Object[] { source };
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args);

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