Compare commits
712 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eacf3d9221 | ||
|
|
89c1c5c35a | ||
|
|
31cbd6d113 | ||
|
|
5f4105d48c | ||
|
|
7f0f11304f | ||
|
|
922e874653 | ||
|
|
cea856cfc2 | ||
|
|
cecd660388 | ||
|
|
8aa5f30082 | ||
|
|
05b35eb57c | ||
|
|
5f400a50be | ||
|
|
faaef1b498 | ||
|
|
6e7f1a3ac1 | ||
|
|
90c5555d6d | ||
|
|
e947d04038 | ||
|
|
be5dd04150 | ||
|
|
8849b9af8b | ||
|
|
c616335019 | ||
|
|
5b68343361 | ||
|
|
7665013ad8 | ||
|
|
f3e902092a | ||
|
|
14ab22dcd4 | ||
|
|
3368e3853a | ||
|
|
8a45191aa9 | ||
|
|
baa20a10c3 | ||
|
|
edcfaf60c9 | ||
|
|
4cd5e64231 | ||
|
|
e4739523d3 | ||
|
|
fe2b044d38 | ||
|
|
39ae1def85 | ||
|
|
2b49cb9227 | ||
|
|
3d495b709e | ||
|
|
86a82e6ecb | ||
|
|
721d8a7298 | ||
|
|
233c872d24 | ||
|
|
c87e6a289c | ||
|
|
beb5259cd1 | ||
|
|
a7c4cb95aa | ||
|
|
120c9a4ebb | ||
|
|
ec73074aac | ||
|
|
60c15d7c28 | ||
|
|
68281b356c | ||
|
|
071d601dcb | ||
|
|
b38a22506b | ||
|
|
38384cc79c | ||
|
|
4851706d35 | ||
|
|
1cb7695fb0 | ||
|
|
3d5d44279b | ||
|
|
2312504b04 | ||
|
|
d5cbe4cb75 | ||
|
|
3940a4dbc7 | ||
|
|
46a531d865 | ||
|
|
9012084d11 | ||
|
|
8dc7c0849e | ||
|
|
3cd717d929 | ||
|
|
6f4d4543b9 | ||
|
|
06fa038875 | ||
|
|
a5a1df68c2 | ||
|
|
3e908023b2 | ||
|
|
7807d11807 | ||
|
|
827d9be48f | ||
|
|
4fa1d4896c | ||
|
|
a817f6b48c | ||
|
|
d570cffa39 | ||
|
|
2cced72d70 | ||
|
|
9c553cd254 | ||
|
|
ba38c697e8 | ||
|
|
19f18c8a1b | ||
|
|
ef0ac7c403 | ||
|
|
9f00f141fe | ||
|
|
592ff1288d | ||
|
|
c97e9f8621 | ||
|
|
3bcee57e3e | ||
|
|
c3e806a2ea | ||
|
|
49272657d7 | ||
|
|
8f0adfbfb2 | ||
|
|
d188ed8ed8 | ||
|
|
ed5dac7e82 | ||
|
|
bd19cf739a | ||
|
|
acab2a159d | ||
|
|
70d3b9aeca | ||
|
|
5b6485481b | ||
|
|
6c6c7b0927 | ||
|
|
d3d63fe553 | ||
|
|
06fd49bda9 | ||
|
|
6274317e63 | ||
|
|
f64d1cb396 | ||
|
|
30397b6fbc | ||
|
|
96e649189f | ||
|
|
8daa149c36 | ||
|
|
3ef70b55e9 | ||
|
|
e0d533dc4e | ||
|
|
dc9e9931eb | ||
|
|
94ece2789d | ||
|
|
3101d53064 | ||
|
|
afff74a835 | ||
|
|
8a0ec60c8f | ||
|
|
f186882c0f | ||
|
|
cbca58401a | ||
|
|
2cc1f14b0c | ||
|
|
b012e963d7 | ||
|
|
6c37a02c0f | ||
|
|
9d03271265 | ||
|
|
e94cf3d9b7 | ||
|
|
e93853623b | ||
|
|
ce6fbd9680 | ||
|
|
317ac50a97 | ||
|
|
5c02fb435d | ||
|
|
962dade155 | ||
|
|
3428196631 | ||
|
|
3ea4e5ccbe | ||
|
|
53905cf919 | ||
|
|
ab023c6a29 | ||
|
|
9fd45406be | ||
|
|
973537f819 | ||
|
|
9d251b1dc5 | ||
|
|
fc715a092c | ||
|
|
33d05ef554 | ||
|
|
a1416612a9 | ||
|
|
13a0b65a80 | ||
|
|
797767da57 | ||
|
|
95c763201f | ||
|
|
76b59b8df7 | ||
|
|
04b60aa490 | ||
|
|
49d7d8534c | ||
|
|
6d8da699b2 | ||
|
|
891214c65b | ||
|
|
cea7905602 | ||
|
|
958c6c6fde | ||
|
|
33c092781e | ||
|
|
d1c8b083b8 | ||
|
|
8b3042f24f | ||
|
|
7e22be3441 | ||
|
|
b9c40320f1 | ||
|
|
117fd629d6 | ||
|
|
0b75f759b4 | ||
|
|
ef1496ca2d | ||
|
|
704da8c823 | ||
|
|
fdf648bcf3 | ||
|
|
9b30f44672 | ||
|
|
1532dbca0a | ||
|
|
f9b4f5f594 | ||
|
|
5fda89fdb5 | ||
|
|
093cc047cd | ||
|
|
62763cc0fb | ||
|
|
d520360cb8 | ||
|
|
3058761806 | ||
|
|
520b0e131c | ||
|
|
3d319d6c3f | ||
|
|
f59e272643 | ||
|
|
5e4bee0f34 | ||
|
|
4950ee5f3b | ||
|
|
d2342319da | ||
|
|
63531b1df5 | ||
|
|
3ea11fe2e6 | ||
|
|
03a48f87e4 | ||
|
|
e337c9130f | ||
|
|
57a60282f5 | ||
|
|
0ece71f8d1 | ||
|
|
3c3ad08868 | ||
|
|
ae0a7e2c37 | ||
|
|
508bfa1de8 | ||
|
|
6a2e0c707c | ||
|
|
836728e5de | ||
|
|
4e34770aba | ||
|
|
1cfebca48d | ||
|
|
9318674cdb | ||
|
|
77ef0053f2 | ||
|
|
8a084cb7e1 | ||
|
|
de8f9e201f | ||
|
|
b1224c3540 | ||
|
|
aa2f5bdd77 | ||
|
|
be71a2e5bc | ||
|
|
ef93ac4452 | ||
|
|
10ef80cf15 | ||
|
|
97d83c87ec | ||
|
|
8d5cec5e0d | ||
|
|
b3cf5ccf6d | ||
|
|
1dce243661 | ||
|
|
30d3ea3d4b | ||
|
|
6b2d2413f7 | ||
|
|
20ea823c19 | ||
|
|
7d75dc1294 | ||
|
|
54209907f3 | ||
|
|
6e2cc98eac | ||
|
|
4921d5ac2d | ||
|
|
d2dfbbe339 | ||
|
|
74d62901c8 | ||
|
|
fad5158ab4 | ||
|
|
e962c44749 | ||
|
|
c5878b6610 | ||
|
|
dda7185b43 | ||
|
|
293f775fa5 | ||
|
|
655f02b695 | ||
|
|
70aa965c26 | ||
|
|
d8962ef415 | ||
|
|
90c814a7ca | ||
|
|
6668c789d3 | ||
|
|
c900134f91 | ||
|
|
f8e2d25739 | ||
|
|
28c5759456 | ||
|
|
16d8602d3c | ||
|
|
6c4c72546c | ||
|
|
eca15cfbf2 | ||
|
|
bf233ea0dc | ||
|
|
f57f2370f1 | ||
|
|
70f7790413 | ||
|
|
9d4913224f | ||
|
|
d4b4cbf5a5 | ||
|
|
6c1665bf46 | ||
|
|
bbb4d6e4c9 | ||
|
|
890f3cc54c | ||
|
|
59a5367433 | ||
|
|
84e30bee6d | ||
|
|
31439293cc | ||
|
|
e3dac1292e | ||
|
|
3a5d379db8 | ||
|
|
2f409116db | ||
|
|
e7bf6afd3a | ||
|
|
542e6b8af4 | ||
|
|
ea5bcc7b88 | ||
|
|
9ea42fdfab | ||
|
|
7d6680b38a | ||
|
|
66b4309f34 | ||
|
|
ba49319c07 | ||
|
|
ac5373427f | ||
|
|
9e3b5a5587 | ||
|
|
f90d81a864 | ||
|
|
97501495eb | ||
|
|
00737f1c13 | ||
|
|
72b96e8121 | ||
|
|
a9dad99432 | ||
|
|
297bcb5c3d | ||
|
|
c0cb66e602 | ||
|
|
ccbcf421e7 | ||
|
|
344f209565 | ||
|
|
af5eeab7cf | ||
|
|
a92780fe5f | ||
|
|
d28da5e5ce | ||
|
|
b6674c9b76 | ||
|
|
ddd072b3fb | ||
|
|
147c2d6f80 | ||
|
|
5532341bf9 | ||
|
|
6933b48a7e | ||
|
|
f77f9ecd8f | ||
|
|
fc76b5f589 | ||
|
|
71a95900fd | ||
|
|
ba36c62caa | ||
|
|
55f124745f | ||
|
|
1c3790a70d | ||
|
|
bb0806c61e | ||
|
|
1c040d8c1e | ||
|
|
ed1cfb5245 | ||
|
|
91b1d17e5b | ||
|
|
ae7c30a0f3 | ||
|
|
eb5a95d26b | ||
|
|
c25c40a3f9 | ||
|
|
6bc7e3429f | ||
|
|
8f838c722d | ||
|
|
a003c36de5 | ||
|
|
d8bf370fd6 | ||
|
|
a723225179 | ||
|
|
b94cace547 | ||
|
|
9079ad5ceb | ||
|
|
fd37a21b59 | ||
|
|
7705012ee7 | ||
|
|
98bd3e1f34 | ||
|
|
40e05f4109 | ||
|
|
14a86de115 | ||
|
|
5814d16b58 | ||
|
|
3cda854ef3 | ||
|
|
ab716125d7 | ||
|
|
2e94c75729 | ||
|
|
2fe669448f | ||
|
|
fada4cb6c4 | ||
|
|
6a3e1734e6 | ||
|
|
4e0d62547d | ||
|
|
420dd78fb7 | ||
|
|
14fcc2510e | ||
|
|
bc7d84b75c | ||
|
|
add7abc1de | ||
|
|
b309781f2d | ||
|
|
69d0201d4c | ||
|
|
11971fb302 | ||
|
|
02dea4ce58 | ||
|
|
7e0d5b8665 | ||
|
|
2d9a20529d | ||
|
|
733a07e061 | ||
|
|
65775b87e5 | ||
|
|
e0f9b1a699 | ||
|
|
91cfce3758 | ||
|
|
8a69070b51 | ||
|
|
6fdd5bfe2d | ||
|
|
608bb0dfef | ||
|
|
efc3241541 | ||
|
|
49efec2ef1 | ||
|
|
07e0732a10 | ||
|
|
9ca79df802 | ||
|
|
585259ef08 | ||
|
|
97bbce92a8 | ||
|
|
ce86d39c70 | ||
|
|
4f93d30790 | ||
|
|
da849aea78 | ||
|
|
dbce360566 | ||
|
|
c86259c671 | ||
|
|
deaa79ca9e | ||
|
|
87e0c17707 | ||
|
|
80bf3934af | ||
|
|
8ec6e42e34 | ||
|
|
4df87631ed | ||
|
|
9c8d7d34b3 | ||
|
|
8766401777 | ||
|
|
9f8acbfe3e | ||
|
|
175f3f992a | ||
|
|
0fa57cac3f | ||
|
|
5f6e9e6ab9 | ||
|
|
7ad36d3d75 | ||
|
|
881fcb7def | ||
|
|
7ae55f6248 | ||
|
|
0a9c98e7c4 | ||
|
|
9bc5098dd8 | ||
|
|
3e30de7430 | ||
|
|
486ab82c02 | ||
|
|
10750421a3 | ||
|
|
9500ba2ff5 | ||
|
|
13960b3b86 | ||
|
|
7dc5ebc929 | ||
|
|
8b70477556 | ||
|
|
04845c1898 | ||
|
|
9c79fd6308 | ||
|
|
f3c21524be | ||
|
|
08ebcdb0b8 | ||
|
|
f06772a088 | ||
|
|
5c23b4aa56 | ||
|
|
8a32ee7dd2 | ||
|
|
89a003c6fc | ||
|
|
bbffe16f13 | ||
|
|
06661708b4 | ||
|
|
81ff5eaba0 | ||
|
|
899d521ab4 | ||
|
|
27b3f23ff3 | ||
|
|
71f42f185a | ||
|
|
56f60a04d9 | ||
|
|
85646b157c | ||
|
|
31e0704c8d | ||
|
|
7eda9364fd | ||
|
|
780630d7c0 | ||
|
|
af778f09d5 | ||
|
|
de63b60748 | ||
|
|
80024c023a | ||
|
|
d2e4f2d376 | ||
|
|
1667a29c88 | ||
|
|
efa7873ae1 | ||
|
|
65079b1106 | ||
|
|
98cb4f74b2 | ||
|
|
f8d49e0a30 | ||
|
|
72d380acf0 | ||
|
|
68a4f897b4 | ||
|
|
43acd99bb3 | ||
|
|
b7457a0a5d | ||
|
|
c77444a821 | ||
|
|
ccc56e6dd4 | ||
|
|
1636f535ba | ||
|
|
fac55bc78b | ||
|
|
4433f53f72 | ||
|
|
9920e219dd | ||
|
|
a1c4585a39 | ||
|
|
9b6e89457c | ||
|
|
7ecd9b3f1a | ||
|
|
c6ba50b7e2 | ||
|
|
0b2b2daf23 | ||
|
|
58dac970af | ||
|
|
c4eaf195b5 | ||
|
|
d975bd8e5c | ||
|
|
7701ea2798 | ||
|
|
54cedfe432 | ||
|
|
94a46867ed | ||
|
|
c4c4c3696e | ||
|
|
0f3314c04c | ||
|
|
d834a2c3da | ||
|
|
e80e04c5fd | ||
|
|
309f440fc0 | ||
|
|
db5ea850f6 | ||
|
|
20e3de1f0a | ||
|
|
335c1b4420 | ||
|
|
a97a887ea4 | ||
|
|
e40acda6c8 | ||
|
|
e7be131b89 | ||
|
|
fd4a059e9b | ||
|
|
2f454843d8 | ||
|
|
a573b5767b | ||
|
|
5c04d768a6 | ||
|
|
4bf1598930 | ||
|
|
07b4889eab | ||
|
|
7a3bb266eb | ||
|
|
f34cc6b469 | ||
|
|
9b9e2a8c71 | ||
|
|
2fbbc13c71 | ||
|
|
35bf75a77a | ||
|
|
ba31b31ed0 | ||
|
|
fe034dc3e4 | ||
|
|
f505c1d0a4 | ||
|
|
04a68db195 | ||
|
|
e2a521742a | ||
|
|
956225f0e1 | ||
|
|
4fefd05839 | ||
|
|
7d917e7c5c | ||
|
|
5693870fe2 | ||
|
|
18ed68cd31 | ||
|
|
4d712ddaae | ||
|
|
dd544f811a | ||
|
|
e0b287961f | ||
|
|
0f5fb6f190 | ||
|
|
add47befac | ||
|
|
0e36994fe7 | ||
|
|
3ea72eeabb | ||
|
|
4c2a51b1b5 | ||
|
|
46d990419b | ||
|
|
69b5ddceda | ||
|
|
1a2cbbc8c1 | ||
|
|
f35eb8819c | ||
|
|
6df969894c | ||
|
|
e442c2a3f9 | ||
|
|
37815f3402 | ||
|
|
a1cd3b5b88 | ||
|
|
d3f33acc1a | ||
|
|
898fa637c3 | ||
|
|
8cbd0d3b5f | ||
|
|
8198062610 | ||
|
|
80e4068b3e | ||
|
|
1379ae4310 | ||
|
|
7bd48d383d | ||
|
|
f6f6ef1532 | ||
|
|
689514a40a | ||
|
|
40873504dc | ||
|
|
fce9e499e4 | ||
|
|
80b5a95bb8 | ||
|
|
06e351f1ef | ||
|
|
4423630f1e | ||
|
|
5caae0293a | ||
|
|
49baf090cd | ||
|
|
c8c608acc8 | ||
|
|
3d053b194a | ||
|
|
8180c72cbc | ||
|
|
2fdd535302 | ||
|
|
1f7a0cf892 | ||
|
|
83929c69e3 | ||
|
|
87590491b5 | ||
|
|
107a0a4905 | ||
|
|
62dd83f473 | ||
|
|
84b0a23e19 | ||
|
|
7ec1a3fcad | ||
|
|
028a87fe37 | ||
|
|
01c4bb4a5e | ||
|
|
2f0011c605 | ||
|
|
393a782858 | ||
|
|
7f61de8f57 | ||
|
|
e99341d7df | ||
|
|
efd4810851 | ||
|
|
92a8d7ce6c | ||
|
|
d6eff8ebcf | ||
|
|
af2d20c5fa | ||
|
|
47a9e48f46 | ||
|
|
94c417c90c | ||
|
|
ce3e265575 | ||
|
|
b2fefe3e3f | ||
|
|
2084e08ad7 | ||
|
|
9568718add | ||
|
|
6a70349512 | ||
|
|
0ad8046582 | ||
|
|
ad38450f9c | ||
|
|
c8f3bb56ff | ||
|
|
59851ceee6 | ||
|
|
044979066c | ||
|
|
776d62b9c6 | ||
|
|
ae9362636e | ||
|
|
48134af616 | ||
|
|
fc1ac25935 | ||
|
|
0f1a3f8ed2 | ||
|
|
8c20610293 | ||
|
|
d5ed92cf38 | ||
|
|
6478617c93 | ||
|
|
0c5850237e | ||
|
|
9e37d24624 | ||
|
|
44c86cedcf | ||
|
|
cfca9e1e81 | ||
|
|
5b9ca6e35f | ||
|
|
862caa72a8 | ||
|
|
2d9b69c186 | ||
|
|
e9c9a74e0a | ||
|
|
b80ea00265 | ||
|
|
d2e17f4ffb | ||
|
|
1abb70cc73 | ||
|
|
946e06eb58 | ||
|
|
66692f90e3 | ||
|
|
a964431c21 | ||
|
|
496a8a4f7c | ||
|
|
24056dc98b | ||
|
|
6772c9d2b6 | ||
|
|
e3dbd79543 | ||
|
|
d9c48e70a9 | ||
|
|
51bb311565 | ||
|
|
f4e30664e6 | ||
|
|
44d523518a | ||
|
|
8c39392eaa | ||
|
|
884410501e | ||
|
|
a87d7a1296 | ||
|
|
f0152790cf | ||
|
|
8452c0869d | ||
|
|
20e748205e | ||
|
|
649d45a2d4 | ||
|
|
0ae861d7d7 | ||
|
|
511481e8d9 | ||
|
|
1676e70dfe | ||
|
|
46b5fe5acd | ||
|
|
089f5403a7 | ||
|
|
1597e33549 | ||
|
|
121c6b4835 | ||
|
|
a764eb5dc7 | ||
|
|
d22bdb5095 | ||
|
|
a2aadb78a9 | ||
|
|
71adb37fa8 | ||
|
|
6591f8a592 | ||
|
|
3724a38ab4 | ||
|
|
54e6c26def | ||
|
|
0907d5d69e | ||
|
|
53d3f46add | ||
|
|
d657b76dba | ||
|
|
253e2ed699 | ||
|
|
1121919b57 | ||
|
|
61ce884336 | ||
|
|
71fdc24f5c | ||
|
|
aa51b83fdc | ||
|
|
b321c0a932 | ||
|
|
3f901d313b | ||
|
|
67cfe34e67 | ||
|
|
643cc7a0ee | ||
|
|
b3cb99036c | ||
|
|
9602227eb6 | ||
|
|
5e103f2b2e | ||
|
|
d49d44923d | ||
|
|
cbe0841bc9 | ||
|
|
596af3f600 | ||
|
|
8f0d6d6b5c | ||
|
|
a08360e3cd | ||
|
|
06f639b8f3 | ||
|
|
ba3dfe4121 | ||
|
|
67cfac0cf1 | ||
|
|
8ad8bd6282 | ||
|
|
045a44b1af | ||
|
|
d321d23afe | ||
|
|
e3f60ce06f | ||
|
|
4b96a78039 | ||
|
|
19a5e606b3 | ||
|
|
a18f4964cf | ||
|
|
f5c310d9d4 | ||
|
|
a6c93ce875 | ||
|
|
1b8f91a0db | ||
|
|
7371c7662a | ||
|
|
f3a4860635 | ||
|
|
43c303e27a | ||
|
|
e51be5f4a7 | ||
|
|
59f683066a | ||
|
|
b19e564317 | ||
|
|
e881f35fbb | ||
|
|
59a841d69c | ||
|
|
e7439efc74 | ||
|
|
0054afd39b | ||
|
|
7f699fca9a | ||
|
|
e5e951d92c | ||
|
|
5a653ef96f | ||
|
|
165f193f78 | ||
|
|
6eecbc95e4 | ||
|
|
a9f4d7a29c | ||
|
|
c54e0953d0 | ||
|
|
b575bf2524 | ||
|
|
30f59370d3 | ||
|
|
73491cceed | ||
|
|
28c7bb99bf | ||
|
|
551727cd19 | ||
|
|
bde26a8282 | ||
|
|
11c4a2cfd0 | ||
|
|
93b930b937 | ||
|
|
b53b871669 | ||
|
|
0a29842caf | ||
|
|
49fbe0ddb4 | ||
|
|
46fea74726 | ||
|
|
69b551c516 | ||
|
|
fa0621b486 | ||
|
|
84a1a0a729 | ||
|
|
b891291135 | ||
|
|
d8d6e8a304 | ||
|
|
e3c1466047 | ||
|
|
df30b1c832 | ||
|
|
3d3e0ea4f3 | ||
|
|
c7a457f9ee | ||
|
|
31bf25d05e | ||
|
|
eecaa3d9dd | ||
|
|
e38e8ae987 | ||
|
|
6dbe25360e | ||
|
|
6483470ec5 | ||
|
|
83fad75e22 | ||
|
|
7cd44c1a81 | ||
|
|
f8b6bc8d11 | ||
|
|
0020afaf67 | ||
|
|
b8b4517211 | ||
|
|
824d7190c2 | ||
|
|
30d64444a0 | ||
|
|
9904700dfd | ||
|
|
49dbae65c9 | ||
|
|
b056c243e4 | ||
|
|
c00158b238 | ||
|
|
794419852b | ||
|
|
fbafd22124 | ||
|
|
b9cd66d510 | ||
|
|
b310efc50f | ||
|
|
0fdf883cbd | ||
|
|
1382dc976c | ||
|
|
54e4dcf454 | ||
|
|
f6b1344722 | ||
|
|
5ffd59e7b8 | ||
|
|
0889b5aef1 | ||
|
|
59ca92b10b | ||
|
|
956f337046 | ||
|
|
a6a6bf007a | ||
|
|
2e9890bbe6 | ||
|
|
f2427a7320 | ||
|
|
2a6dbd068e | ||
|
|
d092977f4a | ||
|
|
e3f229225c | ||
|
|
ee9d46c825 | ||
|
|
dbd8c400ce | ||
|
|
29a740ec8c | ||
|
|
c2d3afdeee | ||
|
|
9155c9ee37 | ||
|
|
0d1d437bd3 | ||
|
|
b15f20520f | ||
|
|
172e2f4e76 | ||
|
|
23cd1b1954 | ||
|
|
cade14c58c | ||
|
|
1e222d52e6 | ||
|
|
f9ae9afaac | ||
|
|
09bbfc1d56 | ||
|
|
79511ecce2 | ||
|
|
2fe75a62be | ||
|
|
da414fd509 | ||
|
|
f2891e7738 | ||
|
|
fbefa8273b | ||
|
|
ceccfe02d0 | ||
|
|
129de26032 | ||
|
|
43a6fa1d01 | ||
|
|
cc8246206d | ||
|
|
551696bb45 | ||
|
|
ded16d3529 | ||
|
|
2e6dce434f | ||
|
|
9888f95068 | ||
|
|
8bbb88ea4e | ||
|
|
69d83e1548 | ||
|
|
d3e7a52933 | ||
|
|
aa695e92f7 | ||
|
|
0ddd1ce0b7 | ||
|
|
cc18ab12f8 | ||
|
|
2c3f6aaa87 | ||
|
|
5dedacca3c | ||
|
|
ad2f0a1290 | ||
|
|
bd3b9f79c2 | ||
|
|
ed148eba32 | ||
|
|
06f41bb017 | ||
|
|
a27d33cb63 | ||
|
|
22c325aa5a | ||
|
|
ac2fcbe224 | ||
|
|
63b6b9cdce | ||
|
|
de55110247 | ||
|
|
b9d22aa821 | ||
|
|
de927adf27 | ||
|
|
79395bc7db | ||
|
|
c81f37cf82 | ||
|
|
25b4160434 | ||
|
|
32c464ad1f | ||
|
|
d5aceb6d95 | ||
|
|
81f7e9b462 | ||
|
|
8383bde768 | ||
|
|
d114713694 | ||
|
|
cad2bf5b08 | ||
|
|
247c66b3fe | ||
|
|
73c2162ff6 | ||
|
|
889ce36afa | ||
|
|
c3d4b66953 | ||
|
|
234b29cf66 | ||
|
|
31827b0286 | ||
|
|
df121a7cd0 | ||
|
|
03df03b269 | ||
|
|
f1522e6204 | ||
|
|
87bce90086 | ||
|
|
4a29a7f92c | ||
|
|
0149265ee8 | ||
|
|
0844e5951c | ||
|
|
251d1b8fbb | ||
|
|
7f0f5060ec | ||
|
|
d179f2cce9 | ||
|
|
5d0778014d | ||
|
|
4c10826caa | ||
|
|
873c9098d8 | ||
|
|
6ce5080049 | ||
|
|
b9546d12f2 | ||
|
|
a49c524c9e | ||
|
|
b7f1fc116e | ||
|
|
28aa8010b2 | ||
|
|
c09eb00031 | ||
|
|
1113b3b6eb | ||
|
|
a81a16f22f | ||
|
|
8428b25939 |
@@ -126,6 +126,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
|
||||
availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
|
||||
availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
|
||||
availableMethods["admin_dialog"] = XmlRpcDialogMethod;
|
||||
availableMethods["admin_restart"] = XmlRpcRestartMethod;
|
||||
availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
|
||||
// User management
|
||||
@@ -215,9 +216,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene))
|
||||
throw new Exception("region not found");
|
||||
|
||||
int timeout = 30000;
|
||||
string message;
|
||||
|
||||
if (requestData.ContainsKey("restart")
|
||||
&& ((string)requestData["restart"] == "delayed")
|
||||
&& requestData.ContainsKey("milliseconds"))
|
||||
{
|
||||
timeout = Int32.Parse(requestData["milliseconds"].ToString());
|
||||
|
||||
if (timeout < 15000)
|
||||
{
|
||||
//It must be at least 15 seconds or we'll cancel the reboot request
|
||||
timeout = 15000;
|
||||
}
|
||||
|
||||
message
|
||||
= "Region is restarting in " + ((int)(timeout / 1000)).ToString()
|
||||
+ " second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Region is restarting in 30 second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string)requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
responseData["rebooting"] = true;
|
||||
response.Value = responseData;
|
||||
rebootedScene.Restart(30);
|
||||
rebootedScene.Restart(timeout / 1000,false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -280,6 +331,53 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
public XmlRpcResponse XmlRpcDialogMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable responseData = new Hashtable();
|
||||
|
||||
m_log.Info("[RADMIN]: Dialog request started");
|
||||
|
||||
try
|
||||
{
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
checkStringParameters(request, new string[] { "password", "from", "message" });
|
||||
|
||||
if (m_requiredPassword != String.Empty &&
|
||||
(!requestData.Contains("password") || (string)requestData["password"] != m_requiredPassword))
|
||||
throw new Exception("wrong password");
|
||||
|
||||
string message = (string)requestData["message"];
|
||||
string fromuuid = (string)requestData["from"];
|
||||
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
|
||||
|
||||
responseData["accepted"] = true;
|
||||
responseData["success"] = true;
|
||||
response.Value = responseData;
|
||||
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message);
|
||||
m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
|
||||
|
||||
responseData["accepted"] = false;
|
||||
responseData["success"] = false;
|
||||
responseData["error"] = e.Message;
|
||||
response.Value = responseData;
|
||||
}
|
||||
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
@@ -387,13 +485,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
message = "Region is going down now.";
|
||||
}
|
||||
|
||||
m_app.SceneManager.ForEachScene(
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string) requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Perform shutdown
|
||||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||
|
||||
@@ -819,6 +819,10 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
//throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
//throw new System.NotImplementedException();
|
||||
@@ -834,11 +838,19 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.Info("[MXP ClientStack] Close Called");
|
||||
|
||||
// Tell the client to go
|
||||
SendLogoutPacket();
|
||||
if (sendStop == true)
|
||||
{
|
||||
SendLogoutPacket();
|
||||
}
|
||||
|
||||
// Let MXPPacketServer clean it up
|
||||
if (Session.SessionState != SessionState.Disconnected)
|
||||
|
||||
@@ -439,12 +439,21 @@ namespace OpenSim.Client.Sirikata.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -445,12 +445,21 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenSim.Data
|
||||
{
|
||||
public abstract AssetBase GetAsset(UUID uuid);
|
||||
|
||||
public abstract void StoreAsset(AssetBase asset);
|
||||
public abstract bool StoreAsset(AssetBase asset);
|
||||
public abstract bool ExistsAsset(UUID uuid);
|
||||
|
||||
public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenSim.Data
|
||||
public interface IAssetDataPlugin : IPlugin
|
||||
{
|
||||
AssetBase GetAsset(UUID uuid);
|
||||
void StoreAsset(AssetBase asset);
|
||||
bool StoreAsset(AssetBase asset);
|
||||
bool ExistsAsset(UUID uuid);
|
||||
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
void Initialise(string connect);
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// Create asset in m_database
|
||||
/// </summary>
|
||||
/// <param name="asset">the asset</param>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
|
||||
string sql =
|
||||
@@ -192,10 +192,12 @@ namespace OpenSim.Data.MSSQL
|
||||
try
|
||||
{
|
||||
command.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
m_log.Error("[ASSET DB]: Error storing item :" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset UUID to create</param>
|
||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -201,12 +201,14 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,9 +78,12 @@ namespace OpenSim.Data.MySQL
|
||||
if (pd.Length == 0)
|
||||
return false;
|
||||
|
||||
if (regionID == UUID.Zero)
|
||||
return false;
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID where `SessionID`=?SessionID", m_Realm);
|
||||
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
@@ -90,6 +93,5 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,11 @@ CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
|
||||
CREATE INDEX UserID ON Presence(UserID);
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 2 # --------------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE `Presence` ADD COLUMN LastSeen timestamp;
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 32
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE `regionwindlight` (
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Create an asset
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset Base</param>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
|
||||
if (ExistsAsset(asset.FullID))
|
||||
@@ -141,6 +141,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,6 +162,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
||||
/// Create an asset
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset Base</param>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
|
||||
if (ExistsAsset(asset.FullID))
|
||||
@@ -139,6 +139,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -157,6 +158,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
private AssetMetadata m_metadata;
|
||||
|
||||
private int m_uploadAttempts;
|
||||
|
||||
// This is needed for .NET serialization!!!
|
||||
// Do NOT "Optimize" away!
|
||||
public AssetBase()
|
||||
@@ -197,6 +199,12 @@ namespace OpenSim.Framework
|
||||
set { m_metadata.Type = value; }
|
||||
}
|
||||
|
||||
public int UploadAttempts
|
||||
{
|
||||
get { return m_uploadAttempts; }
|
||||
set { m_uploadAttempts = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is this a region only asset, or does this exist on the asset server also
|
||||
/// </summary>
|
||||
|
||||
@@ -940,8 +940,10 @@ namespace OpenSim.Framework
|
||||
void SetDebugPacketLevel(int newDebug);
|
||||
|
||||
void InPacket(object NewPack);
|
||||
void ProcessPendingPackets();
|
||||
void ProcessInPacket(Packet NewPack);
|
||||
void Close();
|
||||
void Close(bool sendStop);
|
||||
void Kick(string message);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenSim.Framework
|
||||
|
||||
private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark |
|
||||
(uint) ParcelFlags.AllowAPrimitiveEntry |
|
||||
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform |
|
||||
(uint) ParcelFlags.AllowDeedToGroup |
|
||||
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
|
||||
(uint) ParcelFlags.SoundLocal;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public enum ParcelMediaCommandEnum
|
||||
public enum ParcelMediaCommandEnum : int
|
||||
{
|
||||
Stop = 0,
|
||||
Pause = 1,
|
||||
|
||||
@@ -1196,7 +1196,7 @@ namespace OpenSim.Framework
|
||||
prim.Textures = this.Textures;
|
||||
|
||||
prim.Properties = new Primitive.ObjectProperties();
|
||||
prim.Properties.Name = "Primitive";
|
||||
prim.Properties.Name = "Object";
|
||||
prim.Properties.Description = "";
|
||||
prim.Properties.CreatorID = UUID.Zero;
|
||||
prim.Properties.GroupID = UUID.Zero;
|
||||
|
||||
@@ -40,6 +40,7 @@ using OpenSim.Framework.Console;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class RegionLightShareData : ICloneable
|
||||
{
|
||||
public UUID regionID = UUID.Zero;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
using (WebResponse resp = request.GetResponse())
|
||||
{
|
||||
if (resp.ContentLength > 0)
|
||||
if (resp.ContentLength != 0)
|
||||
{
|
||||
Stream respStream = null;
|
||||
try
|
||||
|
||||
@@ -56,12 +56,28 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
|
||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
|
||||
{
|
||||
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 100);
|
||||
}
|
||||
/// <summary>
|
||||
/// Perform a synchronous REST request.
|
||||
/// </summary>
|
||||
/// <param name="verb"></param>
|
||||
/// <param name="requestUrl"></param>
|
||||
/// <param name="obj"> </param>
|
||||
/// <param name="timeout"> </param>
|
||||
/// <returns></returns>
|
||||
///
|
||||
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
|
||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
|
||||
{
|
||||
Type type = typeof (TRequest);
|
||||
TResponse deserial = default(TResponse);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
request.Timeout = pTimeout * 1000;
|
||||
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
{
|
||||
@@ -81,7 +97,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
int length = (int) buffer.Length;
|
||||
request.ContentLength = length;
|
||||
|
||||
Stream requestStream = null;
|
||||
try
|
||||
{
|
||||
@@ -103,7 +118,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
using (WebResponse resp = request.GetResponse())
|
||||
{
|
||||
if (resp.ContentLength > 0)
|
||||
if (resp.ContentLength != 0)
|
||||
{
|
||||
Stream respStream = resp.GetResponseStream();
|
||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.1";
|
||||
private const string VERSION_NUMBER = "0.7.1CM";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
{
|
||||
Unknown,
|
||||
Dev,
|
||||
RC1,
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -45,6 +48,111 @@ namespace OpenSim.Framework
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Thread LockedByThread;
|
||||
/// <value>
|
||||
/// An advanced lock for inventory data
|
||||
/// </value>
|
||||
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
/// <summary>
|
||||
/// Are we readlocked by the calling thread?
|
||||
/// </summary>
|
||||
public bool IsReadLockedByMe()
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for reading (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
|
||||
{
|
||||
if (!LockedByThread.IsAlive)
|
||||
{
|
||||
//Locked by dead thread, reset.
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_itemLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount>0)
|
||||
{
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for writing (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
//Enter a write lock, wait indefinately for one to open.
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
while (!m_itemLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
LockedByThread = Thread.CurrentThread;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
@@ -52,13 +160,12 @@ namespace OpenSim.Framework
|
||||
{
|
||||
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
||||
|
||||
lock (this)
|
||||
m_itemLock.EnterReadLock();
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
m_itemLock.ExitReadLock();
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
@@ -36,33 +37,30 @@ namespace OpenSim.Framework
|
||||
[Serializable]
|
||||
public class UndoStack<T>
|
||||
{
|
||||
private int m_new = 1;
|
||||
private int m_old = 0;
|
||||
private T[] m_Undos;
|
||||
private List<T> m_undolist;
|
||||
private int m_max;
|
||||
|
||||
public UndoStack(int capacity)
|
||||
{
|
||||
m_Undos = new T[capacity + 1];
|
||||
m_undolist = new List<T>();
|
||||
m_max = capacity;
|
||||
}
|
||||
|
||||
public bool IsFull
|
||||
{
|
||||
get { return m_new == m_old; }
|
||||
get { return m_undolist.Count >= m_max; }
|
||||
}
|
||||
|
||||
public int Capacity
|
||||
{
|
||||
get { return m_Undos.Length - 1; }
|
||||
get { return m_max; }
|
||||
}
|
||||
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
int count = m_new - m_old - 1;
|
||||
if (count < 0)
|
||||
count += m_Undos.Length;
|
||||
return count;
|
||||
return m_undolist.Count;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,45 +68,39 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (IsFull)
|
||||
{
|
||||
m_old++;
|
||||
if (m_old >= m_Undos.Length)
|
||||
m_old -= m_Undos.Length;
|
||||
m_undolist.RemoveAt(0);
|
||||
}
|
||||
if (++m_new >= m_Undos.Length)
|
||||
m_new -= m_Undos.Length;
|
||||
m_Undos[m_new] = item;
|
||||
m_undolist.Add(item);
|
||||
}
|
||||
|
||||
public T Pop()
|
||||
{
|
||||
if (Count > 0)
|
||||
if (m_undolist.Count > 0)
|
||||
{
|
||||
T deleted = m_Undos[m_new];
|
||||
m_Undos[m_new--] = default(T);
|
||||
if (m_new < 0)
|
||||
m_new += m_Undos.Length;
|
||||
return deleted;
|
||||
int ind = m_undolist.Count - 1;
|
||||
T item = m_undolist[ind];
|
||||
m_undolist.RemoveAt(ind);
|
||||
return item;
|
||||
}
|
||||
else
|
||||
throw new InvalidOperationException("Cannot pop from emtpy stack");
|
||||
throw new InvalidOperationException("Cannot pop from empty stack");
|
||||
}
|
||||
|
||||
public T Peek()
|
||||
{
|
||||
return m_Undos[m_new];
|
||||
if (m_undolist.Count > 0)
|
||||
{
|
||||
return m_undolist[m_undolist.Count - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
if (Count > 0)
|
||||
{
|
||||
for (int i = 0; i < m_Undos.Length; i++)
|
||||
{
|
||||
m_Undos[i] = default(T);
|
||||
}
|
||||
m_new = 1;
|
||||
m_old = 0;
|
||||
}
|
||||
m_undolist.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,19 +997,19 @@ namespace OpenSim.Framework
|
||||
{
|
||||
string os = String.Empty;
|
||||
|
||||
if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
{
|
||||
os = Environment.OSVersion.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
os = ReadEtcIssue();
|
||||
}
|
||||
|
||||
if (os.Length > 45)
|
||||
{
|
||||
os = os.Substring(0, 45);
|
||||
}
|
||||
// if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
// {
|
||||
// os = Environment.OSVersion.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// os = ReadEtcIssue();
|
||||
// }
|
||||
//
|
||||
// if (os.Length > 45)
|
||||
// {
|
||||
// os = os.Substring(0, 45);
|
||||
// }
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace OpenSim
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
else
|
||||
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
|
||||
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
|
||||
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
|
||||
@@ -343,10 +343,26 @@ namespace OpenSim
|
||||
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
|
||||
|
||||
scene.SetModuleInterfaces();
|
||||
// First Step of bootreport sequence
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.ColdStart(1,scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Loading prins", scene);
|
||||
}
|
||||
|
||||
// Prims have to be loaded after module configuration since some modules may be invoked during the load
|
||||
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Creating region texture", scene);
|
||||
}
|
||||
|
||||
// moved these here as the terrain texture has to be created after the modules are initialized
|
||||
// and has to happen before the region is registered with the grid.
|
||||
scene.CreateTerrainTexture();
|
||||
@@ -354,6 +370,10 @@ namespace OpenSim
|
||||
// TODO : Try setting resource for region xstats here on scene
|
||||
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
|
||||
}
|
||||
try
|
||||
{
|
||||
scene.RegisterRegionWithGrid();
|
||||
@@ -362,11 +382,20 @@ namespace OpenSim
|
||||
{
|
||||
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
|
||||
}
|
||||
// Carrying on now causes a lot of confusion down the
|
||||
// line - we need to get the user's attention
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration done", scene);
|
||||
}
|
||||
|
||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
|
||||
@@ -374,6 +403,11 @@ namespace OpenSim
|
||||
// scripting engines.
|
||||
scene.CreateScriptInstances();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("ScriptEngine started", scene);
|
||||
}
|
||||
|
||||
m_sceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
@@ -382,6 +416,10 @@ namespace OpenSim
|
||||
clientServer.Start();
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Initializing region modules", scene);
|
||||
}
|
||||
if (do_post_init)
|
||||
{
|
||||
foreach (IRegionModule module in modules)
|
||||
@@ -393,6 +431,12 @@ namespace OpenSim
|
||||
|
||||
mscene = scene;
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is operational", scene);
|
||||
scene.SnmpService.LinkUp(scene);
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
|
||||
return clientServer;
|
||||
@@ -401,6 +445,11 @@ namespace OpenSim
|
||||
private void ShutdownRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is shutting down", scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
IRegionModulesController controller;
|
||||
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
|
||||
{
|
||||
|
||||
@@ -202,6 +202,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_stopPacket = TexturePacketCount();
|
||||
}
|
||||
|
||||
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
|
||||
if (m_stopPacket == 1 && Layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
|
||||
|
||||
m_currentPacket = StartPacket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -339,6 +339,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private AgentUpdateArgs lastarg;
|
||||
private bool m_IsActive = true;
|
||||
private bool m_IsLoggingOut = false;
|
||||
private bool m_IsPresenceReady = false;
|
||||
|
||||
protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
|
||||
protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
|
||||
@@ -361,6 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private Timer m_propertiesPacketTimer;
|
||||
private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
|
||||
private List<Packet> m_pendingPackets;
|
||||
|
||||
#endregion Class Members
|
||||
|
||||
@@ -401,6 +403,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_IsActive; }
|
||||
set { m_IsActive = value; }
|
||||
}
|
||||
|
||||
public bool IsLoggingOut
|
||||
{
|
||||
get { return m_IsLoggingOut; }
|
||||
@@ -464,18 +467,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Client Methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[CLIENT]: Close has been called for {0} attached to scene {1}",
|
||||
Name, m_scene.RegionInfo.RegionName);
|
||||
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
if (sendStop)
|
||||
{
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
IsActive = false;
|
||||
|
||||
@@ -1041,6 +1056,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public virtual void SendLayerData(float[] map)
|
||||
{
|
||||
Util.FireAndForget(DoSendLayerData, map);
|
||||
|
||||
// Send it sync, and async. It's not that much data
|
||||
// and it improves user experience just so much!
|
||||
DoSendLayerData(map);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1053,16 +1072,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
try
|
||||
{
|
||||
//for (int y = 0; y < 16; y++)
|
||||
//{
|
||||
// for (int x = 0; x < 16; x++)
|
||||
// {
|
||||
// SendLayerData(x, y, map);
|
||||
// }
|
||||
//}
|
||||
|
||||
// Send LayerData in a spiral pattern. Fun!
|
||||
SendLayerTopRight(map, 0, 0, 15, 15);
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 0; x < 16; x+=4)
|
||||
{
|
||||
SendLayerPacket(x, y, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1070,51 +1086,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row
|
||||
for (int i = x1; i <= x2; i++)
|
||||
SendLayerData(i, y1, map);
|
||||
|
||||
// Column
|
||||
for (int j = y1 + 1; j <= y2; j++)
|
||||
SendLayerData(x2, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
|
||||
}
|
||||
|
||||
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row in reverse
|
||||
for (int i = x2; i >= x1; i--)
|
||||
SendLayerData(i, y2, map);
|
||||
|
||||
// Column in reverse
|
||||
for (int j = y2 - 1; j >= y1; j--)
|
||||
SendLayerData(x1, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
|
||||
/// </summary>
|
||||
/// <param name="map">heightmap</param>
|
||||
/// <param name="px">X coordinate for patches 0..12</param>
|
||||
/// <param name="py">Y coordinate for patches 0..15</param>
|
||||
// private void SendLayerPacket(float[] map, int y, int x)
|
||||
// {
|
||||
// int[] patches = new int[4];
|
||||
// patches[0] = x + 0 + y * 16;
|
||||
// patches[1] = x + 1 + y * 16;
|
||||
// patches[2] = x + 2 + y * 16;
|
||||
// patches[3] = x + 3 + y * 16;
|
||||
private void SendLayerPacket(int x, int y, float[] map)
|
||||
{
|
||||
int[] patches = new int[4];
|
||||
patches[0] = x + 0 + y * 16;
|
||||
patches[1] = x + 1 + y * 16;
|
||||
patches[2] = x + 2 + y * 16;
|
||||
patches[3] = x + 3 + y * 16;
|
||||
|
||||
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
|
||||
// OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
// }
|
||||
float[] heightmap = (map.Length == 65536) ?
|
||||
map :
|
||||
LLHeightFieldMoronize(map);
|
||||
|
||||
try
|
||||
{
|
||||
Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
catch
|
||||
{
|
||||
for (int px = x ; px < x + 4 ; px++)
|
||||
SendLayerData(px, y, map);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a specified patch to a client
|
||||
@@ -1134,7 +1134,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
layerpack.Header.Reliable = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Task);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -2206,6 +2206,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(sound, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTransferAbort(TransferRequestPacket transferRequest)
|
||||
{
|
||||
TransferAbortPacket abort = (TransferAbortPacket)PacketPool.Instance.GetPacket(PacketType.TransferAbort);
|
||||
abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID;
|
||||
abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType;
|
||||
m_log.Debug("[Assets] Aborting transfer; asset request failed");
|
||||
OutPacket(abort, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
|
||||
{
|
||||
SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger);
|
||||
@@ -3933,6 +3942,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_propertiesPacketTimer.Stop();
|
||||
|
||||
if (m_propertiesBlocks.Count == 0)
|
||||
return;
|
||||
|
||||
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
|
||||
|
||||
int index = 0;
|
||||
@@ -4924,6 +4936,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
|
||||
(x.ControlFlags != lastarg.ControlFlags) ||
|
||||
(x.ControlFlags != 0) ||
|
||||
(x.Far != lastarg.Far) ||
|
||||
(x.Flags != lastarg.Flags) ||
|
||||
(x.State != lastarg.State) ||
|
||||
@@ -5295,7 +5308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
args.Channel = ch;
|
||||
args.From = String.Empty;
|
||||
args.Message = Utils.BytesToString(msg);
|
||||
args.Type = ChatTypeEnum.Shout;
|
||||
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
|
||||
args.Position = new Vector3();
|
||||
args.Scene = Scene;
|
||||
args.Sender = this;
|
||||
@@ -11175,19 +11188,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This processes packets which have accumulated while the presence was still in the process of initialising.
|
||||
/// </summary>
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
m_IsPresenceReady = true;
|
||||
if (m_pendingPackets == null)
|
||||
return;
|
||||
foreach (Packet p in m_pendingPackets)
|
||||
{
|
||||
ProcessInPacket(p);
|
||||
}
|
||||
m_pendingPackets.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
|
||||
/// </summary>
|
||||
/// <param name="Pack">OpenMetaverse.packet</param>
|
||||
public void ProcessInPacket(Packet Pack)
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
if (!m_IsPresenceReady)
|
||||
{
|
||||
if (m_pendingPackets == null)
|
||||
{
|
||||
m_pendingPackets = new List<Packet>();
|
||||
}
|
||||
m_pendingPackets.Add(Pack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
}
|
||||
}
|
||||
|
||||
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
|
||||
@@ -11424,7 +11463,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
|
||||
|
||||
|
||||
//Note, the bool returned from the below function is useless since it is always false.
|
||||
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -899,6 +899,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
client.OnLogout += LogoutHandler;
|
||||
|
||||
// Start the IClientAPI
|
||||
// Spin it off so that it doesn't clog up the LLUDPServer
|
||||
//Util.FireAndForget(delegate(object o) { client.Start(); });
|
||||
|
||||
// NOTE: DO NOT CALL THIS ASYNCHRONOUSLY!!!!!
|
||||
// This method will ultimately cause the modules to hook
|
||||
// client events in OnNewClient. If they can't do this
|
||||
// before further packets are processed, packets WILL BE LOST.
|
||||
// This includes the all-important EconomyDataRequest!
|
||||
// So using FireAndForget here WILL screw up money. Badly.
|
||||
// You have been warned!
|
||||
client.Start();
|
||||
}
|
||||
else
|
||||
@@ -915,7 +925,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_scene.TryGetClient(udpClient.AgentID, out client))
|
||||
{
|
||||
client.IsLoggingOut = true;
|
||||
client.Close();
|
||||
client.Close(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
this.parent = parent;
|
||||
MaxBurst = maxBurst;
|
||||
DripRate = dripRate;
|
||||
lastDrip = Environment.TickCount & Int32.MaxValue;
|
||||
lastDrip = Environment.TickCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -143,41 +143,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount)
|
||||
{
|
||||
bool dummy;
|
||||
return RemoveTokens(amount, out dummy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a given number of tokens from the bucket
|
||||
/// </summary>
|
||||
/// <param name="amount">Number of tokens to remove from the bucket</param>
|
||||
/// <param name="dripSucceeded">True if tokens were added to the bucket
|
||||
/// during this call, otherwise false</param>
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount, out bool dripSucceeded)
|
||||
{
|
||||
if (maxBurst == 0)
|
||||
{
|
||||
dripSucceeded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
dripSucceeded = Drip();
|
||||
|
||||
if (content - amount >= 0)
|
||||
if (amount > maxBurst)
|
||||
{
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
return false;
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
throw new Exception("amount " + amount + " exceeds maxBurst " + maxBurst);
|
||||
}
|
||||
else
|
||||
|
||||
Drip();
|
||||
|
||||
if (content < amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -193,25 +183,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
content = maxBurst;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
int now = Environment.TickCount;
|
||||
int deltaMS = now - lastDrip;
|
||||
lastDrip = now;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
int deltaMS = now - lastDrip;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
if (deltaMS < 0)
|
||||
lastDrip = now;
|
||||
return false;
|
||||
}
|
||||
|
||||
int dripAmount = deltaMS * tokensPerMS;
|
||||
|
||||
content = Math.Min(content + dripAmount, maxBurst);
|
||||
lastDrip = now;
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
long dripAmount = (long)deltaMS * (long)tokensPerMS + (long)content;
|
||||
if (dripAmount > maxBurst)
|
||||
{
|
||||
dripAmount = maxBurst;
|
||||
}
|
||||
content = (int)dripAmount;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -36,6 +37,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
@@ -198,8 +200,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
||||
{
|
||||
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
|
||||
|
||||
if (updateInventoryStatus)
|
||||
{
|
||||
@@ -218,7 +226,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc)
|
||||
{
|
||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
@@ -244,13 +252,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
if (doc != null)
|
||||
{
|
||||
objatt.LoadScriptState(doc);
|
||||
objatt.ResetOwnerChangeFlag();
|
||||
}
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 3 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
|
||||
objatt.ResumeScripts();
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
//m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -279,7 +293,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
if (m_scene.InventoryService != null)
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
|
||||
}
|
||||
@@ -324,6 +339,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
// XXYY!!
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
if (item == null)
|
||||
m_log.Error("[ATTACHMENT]: item == null");
|
||||
if (m_scene == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene == null");
|
||||
if (m_scene.InventoryService == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null");
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
|
||||
|
||||
@@ -412,6 +433,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (group.GetFromItemID() == itemID)
|
||||
{
|
||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
||||
// CM / XMREngine!!!! Needed to conclude attach event
|
||||
SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||
group.DetachToInventoryPrep();
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
||||
m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID);
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
private int m_shoutdistance = 100;
|
||||
private int m_whisperdistance = 10;
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
private List<string> FreezeCache = new List<string>();
|
||||
private string m_adminPrefix = "";
|
||||
internal object m_syncy = new object();
|
||||
|
||||
internal IConfig m_config;
|
||||
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
||||
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
||||
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
||||
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
|
||||
}
|
||||
|
||||
public virtual void AddRegion(Scene scene)
|
||||
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
|
||||
{
|
||||
if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
|
||||
c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
|
||||
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
||||
{
|
||||
string fromName = c.From;
|
||||
string fromNamePrefix = "";
|
||||
UUID fromID = UUID.Zero;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
fromPos = avatar.AbsolutePosition;
|
||||
fromName = avatar.Name;
|
||||
fromID = c.Sender.AgentId;
|
||||
|
||||
if (avatar.GodLevel > 200)
|
||||
{
|
||||
fromNamePrefix = m_adminPrefix;
|
||||
}
|
||||
break;
|
||||
|
||||
case ChatSourceType.Object:
|
||||
@@ -227,7 +241,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
|
||||
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
if (Presencecheck != null)
|
||||
{
|
||||
if (Presencecheck.IsEitherBannedOrRestricted(c.SenderUUID) != true)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -270,25 +292,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||
|
||||
((Scene)c.Scene).ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
});
|
||||
if (c.Scene != null)
|
||||
{
|
||||
((Scene)c.Scene).ForEachScenePresence
|
||||
(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -317,5 +343,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
System.Threading.Timer Timer;
|
||||
if (flags == 0)
|
||||
{
|
||||
FreezeCache.Add(target.ToString());
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
|
||||
Timers.Add(target, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreezeCache.Remove(target.ToString());
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
UUID target = (UUID)avatar;
|
||||
FreezeCache.Remove(target.ToString());
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,6 +55,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
@@ -181,6 +186,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else if (cmdparams[1] == "dialog")
|
||||
{
|
||||
string message = CombineParams(cmdparams, 2);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
string firstName = cmdparams[1];
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected List<Scene> m_Scenes = new List<Scene>();
|
||||
@@ -203,9 +203,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
UserFriendData data = m_Friends[principalID];
|
||||
|
||||
string searchFor = friendID.ToString();
|
||||
foreach (FriendInfo fi in data.Friends)
|
||||
{
|
||||
if (fi.Friend == friendID.ToString())
|
||||
if (fi.Friend == searchFor)
|
||||
return (uint)fi.TheirFlags;
|
||||
}
|
||||
return 0;
|
||||
@@ -292,7 +293,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
// Inform the friends that this user is online
|
||||
StatusChange(agentID, true);
|
||||
|
||||
|
||||
// Register that we need to send the list of online friends to this user
|
||||
lock (m_NeedsListOfFriends)
|
||||
if (!m_NeedsListOfFriends.Contains(agentID))
|
||||
@@ -498,7 +499,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered)
|
||||
{
|
||||
{
|
||||
// we got a friendship offer
|
||||
UUID principalID = new UUID(im.fromAgentID);
|
||||
UUID friendID = new UUID(im.toAgentID);
|
||||
@@ -730,7 +731,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
// we're done
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,6 +156,31 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
return;
|
||||
}
|
||||
|
||||
DateTime dt = DateTime.UtcNow;
|
||||
|
||||
// Ticks from UtcNow, but make it look like local. Evil, huh?
|
||||
dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
|
||||
|
||||
try
|
||||
{
|
||||
// Convert that to the PST timezone
|
||||
TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
|
||||
dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
|
||||
}
|
||||
|
||||
// And make it look local again to fool the unix time util
|
||||
dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
|
||||
|
||||
im.timestamp = (uint)Util.ToUnixTime(dt);
|
||||
|
||||
// If client is null, this message comes from storage and IS offline
|
||||
if (client != null)
|
||||
im.offline = 0;
|
||||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
m_TransferModule.SendInstantMessage(im,
|
||||
|
||||
@@ -172,13 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void RetrieveInstantMessages(IClientAPI client)
|
||||
{
|
||||
if (m_RestURL != "")
|
||||
{
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
if (m_RestURL == String.Empty)
|
||||
return;
|
||||
|
||||
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
|
||||
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
"POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
|
||||
|
||||
if (msglist != null)
|
||||
{
|
||||
foreach (GridInstantMessage im in msglist)
|
||||
{
|
||||
// client.SendInstantMessage(im);
|
||||
@@ -189,6 +192,17 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Needed for proper state management for stored group
|
||||
// invitations
|
||||
//
|
||||
|
||||
im.offline = 1;
|
||||
|
||||
// Reconstruct imSessionID
|
||||
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
|
||||
{
|
||||
UUID fromAgentID = new UUID(im.fromAgentID);
|
||||
UUID sessionID = fromAgentID ^ client.AgentId;
|
||||
im.imSessionID = new Guid(sessionID.ToString());
|
||||
}
|
||||
|
||||
Scene s = FindScene(client.AgentId);
|
||||
if (s != null)
|
||||
s.EventManager.TriggerIncomingInstantMessage(im);
|
||||
@@ -198,26 +212,37 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void UndeliveredMessage(GridInstantMessage im)
|
||||
{
|
||||
if ((im.offline != 0)
|
||||
&& (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages)))
|
||||
if (im.dialog != (byte)InstantMessageDialog.MessageFromObject &&
|
||||
im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
|
||||
im.dialog != (byte)InstantMessageDialog.GroupNotice &&
|
||||
im.dialog != (byte)InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
|
||||
"POST", m_RestURL+"/SaveMessage/", im);
|
||||
return;
|
||||
}
|
||||
|
||||
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
|
||||
{
|
||||
IClientAPI client = FindClient(new UUID(im.fromAgentID));
|
||||
if (client == null)
|
||||
return;
|
||||
// It's not delivered. Make sure the scope id is saved
|
||||
// We don't need the imSessionID here anymore, overwrite it
|
||||
Scene scene = FindScene(new UUID(im.fromAgentID));
|
||||
if (scene == null)
|
||||
scene = m_SceneList[0];
|
||||
im.imSessionID = new Guid(scene.RegionInfo.ScopeID.ToString());
|
||||
|
||||
client.SendInstantMessage(new GridInstantMessage(
|
||||
null, new UUID(im.toAgentID),
|
||||
"System", new UUID(im.fromAgentID),
|
||||
(byte)InstantMessageDialog.MessageFromAgent,
|
||||
"User is not logged in. "+
|
||||
(success ? "Message saved." : "Message not saved"),
|
||||
false, new Vector3()));
|
||||
}
|
||||
bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>(
|
||||
"POST", m_RestURL+"/SaveMessage/", im);
|
||||
|
||||
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
|
||||
{
|
||||
IClientAPI client = FindClient(new UUID(im.fromAgentID));
|
||||
if (client == null)
|
||||
return;
|
||||
|
||||
client.SendInstantMessage(new GridInstantMessage(
|
||||
null, new UUID(im.toAgentID),
|
||||
"System", new UUID(im.fromAgentID),
|
||||
(byte)InstantMessageDialog.MessageFromAgent,
|
||||
"User is not logged in. "+
|
||||
(success ? "Message saved." : "Message not saved"),
|
||||
false, new Vector3()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,6 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
im.imSessionID = itemID.Guid;
|
||||
}
|
||||
|
||||
im.offline = 1; // Remember these
|
||||
|
||||
// Send the IM to the recipient. The item is already
|
||||
// in their inventory, so it will not be lost if
|
||||
// they are offline.
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
|
||||
// it's actually doing a lot of work.
|
||||
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
||||
if (endPoint.Address != null)
|
||||
if (endPoint != null && endPoint.Address != null)
|
||||
{
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
@@ -851,15 +851,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||
|
||||
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
||||
if (eq != null)
|
||||
IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint;
|
||||
if (neighbourExternal != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath);
|
||||
if (eq != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (!WaitForCallback(agent.UUID))
|
||||
@@ -957,10 +961,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.Viewer = currentAgentCircuit.Viewer;
|
||||
}
|
||||
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
|
||||
IPEndPoint external = region.ExternalEndPoint;
|
||||
if (external != null)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, external, true,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1089,6 +1097,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
//neighbour.ExternalEndPoint may return null, which will be caught
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
|
||||
@@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
|
||||
return urlcode;
|
||||
}
|
||||
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
|
||||
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString();
|
||||
|
||||
UrlData urlData = new UrlData();
|
||||
urlData.hostID = host.UUID;
|
||||
@@ -152,10 +152,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
urlData.urlcode = urlcode;
|
||||
urlData.requests = new Dictionary<UUID, RequestData>();
|
||||
|
||||
|
||||
m_UrlMap[url] = urlData;
|
||||
|
||||
string uri = "/lslhttp/" + urlcode.ToString() + "/";
|
||||
string uri = "/lslhttp/" + urlcode.ToString();
|
||||
|
||||
m_HttpServer.AddPollServiceHTTPHandler(uri,HandleHttpPoll,
|
||||
new PollServiceEventArgs(HttpRequestHandler,HasEvents, GetEvents, NoEvents,
|
||||
@@ -386,6 +385,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public void HttpRequestHandler(UUID requestID, Hashtable request)
|
||||
{
|
||||
lock (request)
|
||||
@@ -400,8 +400,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
int pos1 = uri.IndexOf("/");// /lslhttp
|
||||
int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
|
||||
int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
|
||||
string uri_tmp = uri.Substring(0, pos3 + 1);
|
||||
int pos3 = pos2 + 37; // /lslhttp/urlcode
|
||||
string uri_tmp = uri.Substring(0, pos3);
|
||||
//HTTP server code doesn't provide us with QueryStrings
|
||||
string pathInfo;
|
||||
string queryString;
|
||||
|
||||
@@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
foreach (Scene s in m_sceneList)
|
||||
{
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
{
|
||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
||||
return s.IncomingCloseChildAgent(id);
|
||||
}
|
||||
}
|
||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object-related communications
|
||||
*/
|
||||
|
||||
@@ -252,6 +252,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.CloseChildAgent(destination, id))
|
||||
return true;
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
return m_remoteConnector.CloseChildAgent(destination, id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
|
||||
@@ -261,10 +261,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// Fix ownership/creator of inventory items
|
||||
// Not doing so results in inventory items
|
||||
// being no copy/no mod for everyone
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
{
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
@@ -276,6 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
}
|
||||
}
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
|
||||
|
||||
private bool m_allowedForcefulBans = true;
|
||||
private UUID DefaultGodParcelGroup;
|
||||
private string DefaultGodParcelName;
|
||||
|
||||
// caches ExtendedLandData
|
||||
private Cache parcelInfoCache;
|
||||
@@ -96,6 +98,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig cnf = source.Configs["LandManagement"];
|
||||
if (cnf != null)
|
||||
{
|
||||
DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
|
||||
DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -160,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
|
||||
client.OnParcelReclaim += ClientOnParcelReclaim;
|
||||
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
|
||||
client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
|
||||
// client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
|
||||
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
|
||||
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
|
||||
|
||||
@@ -351,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
|
||||
{
|
||||
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
|
||||
if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID))
|
||||
{
|
||||
SendYouAreBannedNotice(avatar);
|
||||
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
|
||||
@@ -648,7 +656,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
int x;
|
||||
int y;
|
||||
|
||||
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
|
||||
if (x_float > Constants.RegionSize || x_float < 0 || y_float > Constants.RegionSize || y_float < 0)
|
||||
return null;
|
||||
|
||||
try
|
||||
@@ -991,6 +999,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//Owner Flag
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
|
||||
{
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.SalePrice > 0 &&
|
||||
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
|
||||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
|
||||
@@ -1291,18 +1303,31 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
|
||||
{
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
lock (m_landList)
|
||||
{
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
//Remove all the land objects in the sim and then process our new data
|
||||
foreach (int n in m_landList.Keys)
|
||||
{
|
||||
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
|
||||
}
|
||||
m_landIDList.Initialize();
|
||||
m_landList.Clear();
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void IncomingLandObjectFromStorage(LandData data)
|
||||
{
|
||||
|
||||
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
|
||||
new_land.LandData = data.Copy();
|
||||
new_land.SetLandBitmapFromByteArray();
|
||||
AddLandObject(new_land);
|
||||
new_land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
|
||||
@@ -1520,5 +1545,321 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
UpdateLandObject(localID, land.LandData);
|
||||
}
|
||||
|
||||
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
|
||||
{
|
||||
ILandObject land = null;
|
||||
List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
|
||||
foreach (ILandObject landObject in Land)
|
||||
{
|
||||
if (landObject.LandData.LocalID == landID)
|
||||
{
|
||||
land = landObject;
|
||||
}
|
||||
}
|
||||
land.DeedToGroup(DefaultGodParcelGroup);
|
||||
land.LandData.Name = DefaultGodParcelName;
|
||||
land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
|
||||
{
|
||||
ScenePresence SP;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
|
||||
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
|
||||
if (SP.GodLevel != 0)
|
||||
{
|
||||
if (flags == 0) //All parcels, scripted or not
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //All parcels, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //not target parcel, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
|
||||
if (landobject.LandData.OwnerID != e.OwnerID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
foreach (SceneObjectGroup ol in returns)
|
||||
{
|
||||
ReturnObject(ol, client);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
|
||||
{
|
||||
SceneObjectGroup[] objs = new SceneObjectGroup[1];
|
||||
objs[0] = obj;
|
||||
((Scene)client.Scene).returnObjects(objs, client.AgentId);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
|
||||
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
System.Threading.Timer Timer;
|
||||
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
if (flags == 0)
|
||||
{
|
||||
targetAvatar.AllowMovement = false;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
|
||||
Timers.Add(targetAvatar.UUID, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetAvatar.AllowMovement = true;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
ScenePresence targetAvatar = (ScenePresence)avatar;
|
||||
targetAvatar.AllowMovement = true;
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
|
||||
}
|
||||
|
||||
|
||||
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
//Just eject
|
||||
if (flags == 0)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Eject and ban
|
||||
if (flags == 1)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -544,6 +544,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
|
||||
m_scene.SaveTerrain();
|
||||
|
||||
m_scene.EventManager.TriggerTerrainUpdate();
|
||||
|
||||
// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
|
||||
//m_scene.CreateTerrainTexture(true);
|
||||
}
|
||||
|
||||
@@ -821,11 +821,20 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
@@ -82,6 +83,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
|
||||
|
||||
// Same as above, but also load script states from a separate doc
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
|
||||
|
||||
/// <summary>
|
||||
/// Rez multiple attachments from a user's inventory
|
||||
/// </summary>
|
||||
@@ -132,4 +137,4 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </param>
|
||||
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
37
OpenSim/Region/Framework/Interfaces/IDwellModule.cs
Normal file
37
OpenSim/Region/Framework/Interfaces/IDwellModule.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface IDwellModule
|
||||
{
|
||||
int GetDwell(UUID parcelID);
|
||||
}
|
||||
}
|
||||
@@ -105,6 +105,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="stateSource"></param>
|
||||
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
@@ -214,5 +216,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// A <see cref="Dictionary`2"/>
|
||||
/// </returns>
|
||||
Dictionary<UUID, string> GetScriptStates();
|
||||
Dictionary<UUID, string> GetScriptStates(bool oldIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <returns></returns>
|
||||
bool SendReleaseAgent(ulong regionHandle, UUID id, string uri);
|
||||
|
||||
/// <summary>
|
||||
/// Close chid agent.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
bool SendCloseChildAgent(ulong regionHandle, UUID id);
|
||||
|
||||
/// <summary>
|
||||
/// Close agent.
|
||||
/// </summary>
|
||||
|
||||
27
OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
Normal file
27
OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (c) Careminster LImited, Melanie Thielker and the Meta7 Team
|
||||
//
|
||||
// This file is not open source. All rights reserved
|
||||
// Mod 2
|
||||
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
public interface ISnmpModule
|
||||
{
|
||||
void Trap(int code, string Message, Scene scene);
|
||||
void Critical(string Message, Scene scene);
|
||||
void Warning(string Message, Scene scene);
|
||||
void Major(string Message, Scene scene);
|
||||
void ColdStart(int step , Scene scene);
|
||||
void Shutdown(int step , Scene scene);
|
||||
//
|
||||
// Node Start/stop events
|
||||
//
|
||||
void LinkUp(Scene scene);
|
||||
void LinkDown(Scene scene);
|
||||
void BootInfo(string data, Scene scene);
|
||||
void trapDebug(string Module,string data, Scene scene);
|
||||
void trapXMRE(int data, string Message, Scene scene);
|
||||
|
||||
}
|
||||
@@ -226,7 +226,8 @@ namespace OpenSim.Region.Framework
|
||||
"[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e);
|
||||
|
||||
// justincc: Right now this is fatal to really get the user's attention
|
||||
throw e;
|
||||
// TomMeta: WTF? No, how about we /don't/ throw a fatal exception when there's no need to?
|
||||
//throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
get { return m_movementAnimation; }
|
||||
}
|
||||
protected string m_movementAnimation = "DEFAULT";
|
||||
|
||||
// protected string m_movementAnimation = "DEFAULT"; //KF: 'DEFAULT' does not exist!
|
||||
protected string m_movementAnimation = "CROUCH"; //KF: CROUCH ensures reliable Av Anim. init.
|
||||
private int m_animTickFall;
|
||||
private int m_animTickJump;
|
||||
// private int m_animTickJump;
|
||||
public int m_animTickJump; // ScenePresence has to see this to control +Z force
|
||||
|
||||
/// <value>
|
||||
/// The scene presence that this animator applies to
|
||||
@@ -123,8 +124,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
/// </summary>
|
||||
public void TrySetMovementAnimation(string anim)
|
||||
{
|
||||
//m_log.DebugFormat("Updating movement animation to {0}", anim);
|
||||
|
||||
if (!m_scenePresence.IsChildAgent)
|
||||
{
|
||||
if (m_animations.TrySetDefaultAnimation(
|
||||
@@ -146,10 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
const float PREJUMP_DELAY = 0.25f;
|
||||
|
||||
#region Inputs
|
||||
if (m_scenePresence.SitGround)
|
||||
{
|
||||
return "SIT_GROUND_CONSTRAINED";
|
||||
}
|
||||
|
||||
AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags;
|
||||
PhysicsActor actor = m_scenePresence.PhysicsActor;
|
||||
|
||||
@@ -159,11 +155,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix);
|
||||
|
||||
// Check control flags
|
||||
bool heldForward =
|
||||
(((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS));
|
||||
bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG;
|
||||
bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS;
|
||||
bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG;
|
||||
bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS);
|
||||
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
|
||||
bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS);
|
||||
bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG);
|
||||
//bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
|
||||
//bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
|
||||
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
|
||||
@@ -266,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
m_animTickJump = Environment.TickCount;
|
||||
return "PREJUMP";
|
||||
}
|
||||
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 1000.0f)
|
||||
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 800.0f)
|
||||
{
|
||||
// Start actual jump
|
||||
if (m_animTickJump == -1)
|
||||
@@ -316,7 +311,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
public void UpdateMovementAnimations()
|
||||
{
|
||||
m_movementAnimation = GetMovementAnimation();
|
||||
|
||||
if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
|
||||
{
|
||||
// This was the previous behavior before PREJUMP
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private readonly Dictionary<UUID,EntityBase> m_eb_uuid = new Dictionary<UUID, EntityBase>();
|
||||
private readonly Dictionary<uint, EntityBase> m_eb_localID = new Dictionary<uint, EntityBase>();
|
||||
//private readonly Dictionary<UUID, ScenePresence> m_pres_uuid = new Dictionary<UUID, ScenePresence>();
|
||||
private readonly Object m_lock = new Object();
|
||||
private System.Threading.ReaderWriterLockSlim m_lock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
[Obsolete("Use Add() instead.")]
|
||||
public void Add(UUID id, EntityBase eb)
|
||||
@@ -50,7 +50,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void Add(EntityBase entity)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -62,11 +63,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat("Add Entity failed: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertOrReplace(EntityBase entity)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -78,15 +84,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
m_eb_uuid.Clear();
|
||||
m_eb_localID.Clear();
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
@@ -123,7 +138,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool Remove(uint localID)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -141,11 +157,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove(UUID id)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -163,13 +184,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public List<EntityBase> GetAllByType<T>()
|
||||
{
|
||||
List<EntityBase> tmp = new List<EntityBase>();
|
||||
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -187,23 +213,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
tmp = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public List<EntityBase> GetEntities()
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return new List<EntityBase>(m_eb_uuid.Values);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
public EntityBase this[UUID id]
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
EntityBase entity;
|
||||
if (m_eb_uuid.TryGetValue(id, out entity))
|
||||
@@ -211,6 +247,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -222,7 +262,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
EntityBase entity;
|
||||
if (m_eb_localID.TryGetValue(localID, out entity))
|
||||
@@ -230,6 +271,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -239,18 +284,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool TryGetValue(UUID key, out EntityBase obj)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return m_eb_uuid.TryGetValue(key, out obj);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetValue(uint key, out EntityBase obj)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return m_eb_localID.TryGetValue(key, out obj);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -55,8 +55,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public delegate void OnTerrainTickDelegate();
|
||||
|
||||
public delegate void OnTerrainUpdateDelegate();
|
||||
|
||||
public event OnTerrainTickDelegate OnTerrainTick;
|
||||
|
||||
public event OnTerrainUpdateDelegate OnTerrainUpdate;
|
||||
|
||||
public delegate void OnBackupDelegate(IRegionDataStore datastore, bool forceBackup);
|
||||
|
||||
public event OnBackupDelegate OnBackup;
|
||||
@@ -716,6 +720,26 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
public void TriggerTerrainUpdate()
|
||||
{
|
||||
OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
|
||||
if (handlerTerrainUpdate != null)
|
||||
{
|
||||
foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerTerrainTick()
|
||||
{
|
||||
|
||||
@@ -211,12 +211,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
|
||||
if (physActor == null || !physActor.IsPhysical)
|
||||
priority += 100;
|
||||
|
||||
if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
|
||||
{
|
||||
priority = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
|
||||
if (physActor == null || !physActor.IsPhysical)
|
||||
priority += 100;
|
||||
}
|
||||
|
||||
if (((SceneObjectPart)entity).ParentGroup.RootPart != (SceneObjectPart)entity)
|
||||
priority +=1;
|
||||
}
|
||||
return priority;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
|
||||
{
|
||||
InventoryFolderBase folder;
|
||||
|
||||
if (item.Folder == UUID.Zero)
|
||||
{
|
||||
folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType);
|
||||
if (folder == null)
|
||||
{
|
||||
folder = InventoryService.GetRootFolder(AgentID);
|
||||
|
||||
if (folder == null)
|
||||
return;
|
||||
}
|
||||
|
||||
item.Folder = folder.ID;
|
||||
}
|
||||
|
||||
if (InventoryService.AddItem(item))
|
||||
{
|
||||
int userlevel = 0;
|
||||
@@ -214,8 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// Needs to determine which engine was running it and use that
|
||||
//
|
||||
part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
errors = part.Inventory.GetScriptErrors(item.ItemID);
|
||||
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -906,8 +921,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
SceneObjectGroup group = null;
|
||||
if (part != null)
|
||||
{
|
||||
group = part.ParentGroup;
|
||||
}
|
||||
if (part != null && group != null)
|
||||
{
|
||||
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
||||
if (item == null)
|
||||
@@ -1336,7 +1355,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
if (part.Inventory.UpdateInventoryItem(itemInfo))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
// remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
part.GetProperties(remoteClient);
|
||||
}
|
||||
}
|
||||
@@ -1429,7 +1448,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
|
||||
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
|
||||
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"),
|
||||
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
@@ -1655,15 +1674,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
|
||||
if (action == DeRezAction.TakeCopy)
|
||||
{
|
||||
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToTakeCopy = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
permissionToTakeCopy = false;
|
||||
}
|
||||
if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToTake = false;
|
||||
|
||||
if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Handle god perms
|
||||
|
||||
@@ -149,6 +149,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public IXfer XferManager;
|
||||
|
||||
protected ISnmpModule m_snmpService = null;
|
||||
public ISnmpModule SnmpService
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_snmpService == null)
|
||||
{
|
||||
m_snmpService = RequestModuleInterface<ISnmpModule>();
|
||||
}
|
||||
|
||||
return m_snmpService;
|
||||
}
|
||||
}
|
||||
|
||||
protected IAssetService m_AssetService;
|
||||
protected IAuthorizationService m_AuthorizationService;
|
||||
|
||||
@@ -609,6 +623,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Load region settings
|
||||
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
|
||||
m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
|
||||
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
|
||||
@@ -711,7 +727,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
||||
// TODO: Change default to true once the feature is supported
|
||||
m_usePreJump = startupConfig.GetBoolean("enableprejump", false);
|
||||
|
||||
m_usePreJump = true; // Above line fails!?
|
||||
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
|
||||
if (RegionInfo.NonphysPrimMax > 0)
|
||||
{
|
||||
@@ -1024,6 +1040,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds)
|
||||
{
|
||||
Restart(seconds, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given float seconds, this will restart the region. showDialog will optionally alert the users.
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds, bool showDialog)
|
||||
{
|
||||
// notifications are done in 15 second increments
|
||||
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
|
||||
@@ -1045,8 +1070,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
|
||||
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
|
||||
m_restartTimer.Start();
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
if (showDialog)
|
||||
{
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1404,16 +1432,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Check if any objects have reached their targets
|
||||
CheckAtTargets();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
// Run through all ScenePresences looking for updates
|
||||
// Presence updates and queued object updates for each presence are sent to clients
|
||||
if (m_frame % m_update_presences == 0)
|
||||
m_sceneGraph.UpdatePresences();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
if (m_frame % m_update_coarse_locations == 0)
|
||||
{
|
||||
List<Vector3> coarseLocations;
|
||||
@@ -1742,6 +1770,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void StoreWindlightProfile(RegionLightShareData wl)
|
||||
{
|
||||
m_regInfo.WindlightSettings = wl;
|
||||
wl.Save();
|
||||
m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
|
||||
m_eventManager.TriggerOnSaveNewWindlightProfile();
|
||||
}
|
||||
@@ -1920,14 +1949,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
|
||||
{
|
||||
|
||||
float wheight = (float)RegionInfo.RegionSettings.WaterHeight;
|
||||
Vector3 wpos = Vector3.Zero;
|
||||
// Check for water surface intersection from above
|
||||
if ( (RayStart.Z > wheight) && (RayEnd.Z < wheight) )
|
||||
{
|
||||
float ratio = (RayStart.Z - wheight) / (RayStart.Z - RayEnd.Z);
|
||||
wpos.X = RayStart.X - (ratio * (RayStart.X - RayEnd.X));
|
||||
wpos.Y = RayStart.Y - (ratio * (RayStart.Y - RayEnd.Y));
|
||||
wpos.Z = wheight;
|
||||
}
|
||||
|
||||
Vector3 pos = Vector3.Zero;
|
||||
if (RayEndIsIntersection == (byte)1)
|
||||
{
|
||||
pos = RayEnd;
|
||||
return pos;
|
||||
}
|
||||
|
||||
if (RayTargetID != UUID.Zero)
|
||||
else if (RayTargetID != UUID.Zero)
|
||||
{
|
||||
SceneObjectPart target = GetSceneObjectPart(RayTargetID);
|
||||
|
||||
@@ -1949,7 +1988,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
|
||||
|
||||
// Un-comment out the following line to Get Raytrace results printed to the console.
|
||||
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
|
||||
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
|
||||
float ScaleOffset = 0.5f;
|
||||
|
||||
// If we hit something
|
||||
@@ -1972,13 +2011,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//pos.Z -= 0.25F;
|
||||
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We don't have a target here, so we're going to raytrace all the objects in the scene.
|
||||
|
||||
EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false);
|
||||
|
||||
// Un-comment the following line to print the raytrace results to the console.
|
||||
@@ -1987,13 +2023,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (ei.HitTF)
|
||||
{
|
||||
pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// fall back to our stupid functionality
|
||||
pos = RayEnd;
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2004,8 +2039,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//increase height so its above the ground.
|
||||
//should be getting the normal of the ground at the rez point and using that?
|
||||
pos.Z += scale.Z / 2f;
|
||||
return pos;
|
||||
// return pos;
|
||||
}
|
||||
|
||||
// check against posible water intercept
|
||||
if (wpos.Z > pos.Z) pos = wpos;
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
@@ -2138,13 +2177,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||
/// </summary>
|
||||
public void DeleteAllSceneObjects()
|
||||
{
|
||||
DeleteAllSceneObjects(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||
/// </summary>
|
||||
public void DeleteAllSceneObjects(bool exceptNoCopy)
|
||||
{
|
||||
List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>();
|
||||
lock (Entities)
|
||||
{
|
||||
ICollection<EntityBase> entities = new List<EntityBase>(Entities);
|
||||
@@ -2154,11 +2202,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (e is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup sog = (SceneObjectGroup)e;
|
||||
if (!sog.IsAttachment)
|
||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||
if (sog != null && !sog.IsAttachment)
|
||||
{
|
||||
if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
|
||||
{
|
||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
toReturn.Add((SceneObjectGroup)e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (toReturn.Count > 0)
|
||||
{
|
||||
returnObjects(toReturn.ToArray(), UUID.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3197,6 +3258,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="flags"></param>
|
||||
public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
|
||||
{
|
||||
//Add half the avatar's height so that the user doesn't fall through prims
|
||||
ScenePresence presence;
|
||||
if (TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
if (presence.Appearance != null)
|
||||
{
|
||||
position.Z = position.Z + (presence.Appearance.AvatarHeight / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
|
||||
// FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
|
||||
@@ -3584,6 +3655,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
// Honor parcel landing type and position.
|
||||
/*
|
||||
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||
if (land != null)
|
||||
{
|
||||
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
|
||||
@@ -3591,6 +3664,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos = land.LandData.UserLocation;
|
||||
}
|
||||
}
|
||||
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3953,12 +4027,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, false);
|
||||
}
|
||||
|
||||
public bool IncomingCloseChildAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell a single agent to disconnect from the region.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="agentID"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
/// <param name="childOnly"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
|
||||
{
|
||||
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
|
||||
|
||||
@@ -3970,7 +4054,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_sceneGraph.removeUserCount(false);
|
||||
}
|
||||
else
|
||||
else if (!childOnly)
|
||||
{
|
||||
m_sceneGraph.removeUserCount(true);
|
||||
}
|
||||
@@ -3986,9 +4070,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
presence.ControllingClient.SendShutdownConnectionNotice();
|
||||
presence.ControllingClient.Close(false);
|
||||
}
|
||||
else if (!childOnly)
|
||||
{
|
||||
presence.ControllingClient.Close(true);
|
||||
}
|
||||
|
||||
presence.ControllingClient.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
uint x = 0, y = 0;
|
||||
Utils.LongToUInts(regionHandle, out x, out y);
|
||||
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||
m_scene.SimulationService.CloseAgent(destination, agentID);
|
||||
m_scene.SimulationService.CloseChildAgent(destination, agentID);
|
||||
}
|
||||
|
||||
private void SendCloseChildAgentCompleted(IAsyncResult iar)
|
||||
@@ -293,7 +293,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||
{
|
||||
return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
|
||||
|
||||
@@ -43,6 +43,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone);
|
||||
|
||||
public delegate void AttachToBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void DetachFromBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void ChangedBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void ObjectCreateDelegate(EntityBase obj);
|
||||
|
||||
public delegate void ObjectDeleteDelegate(EntityBase obj);
|
||||
@@ -61,6 +67,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private PhysicsCrash handlerPhysicsCrash = null;
|
||||
|
||||
public event ObjectDuplicateDelegate OnObjectDuplicate;
|
||||
public event AttachToBackupDelegate OnAttachToBackup;
|
||||
public event DetachFromBackupDelegate OnDetachFromBackup;
|
||||
public event ChangedBackupDelegate OnChangeBackup;
|
||||
public event ObjectCreateDelegate OnObjectCreate;
|
||||
public event ObjectDeleteDelegate OnObjectRemove;
|
||||
|
||||
@@ -68,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#region Fields
|
||||
|
||||
protected object m_presenceLock = new object();
|
||||
protected OpenMetaverse.ReaderWriterLockSlim m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
protected Dictionary<UUID, ScenePresence> m_scenePresenceMap = new Dictionary<UUID, ScenePresence>();
|
||||
protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>();
|
||||
|
||||
@@ -133,13 +142,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
protected internal void Close()
|
||||
{
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>();
|
||||
List<ScenePresence> newlist = new List<ScenePresence>();
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
lock (m_dictionary_lock)
|
||||
{
|
||||
@@ -269,6 +283,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected internal bool AddRestoredSceneObject(
|
||||
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
|
||||
{
|
||||
// KF: Check for out-of-region, move inside and make static.
|
||||
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
|
||||
sceneObject.RootPart.GroupPosition.Y,
|
||||
sceneObject.RootPart.GroupPosition.Z);
|
||||
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
|
||||
npos.X > Constants.RegionSize ||
|
||||
npos.Y > Constants.RegionSize))
|
||||
{
|
||||
if (npos.X < 0.0) npos.X = 1.0f;
|
||||
if (npos.Y < 0.0) npos.Y = 1.0f;
|
||||
if (npos.Z < 0.0) npos.Z = 0.0f;
|
||||
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
|
||||
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
|
||||
|
||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||
{
|
||||
part.GroupPosition = npos;
|
||||
}
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
|
||||
sceneObject.RootPart.Acceleration = Vector3.Zero;
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
if (!alreadyPersisted)
|
||||
{
|
||||
sceneObject.ForceInventoryPersistence();
|
||||
@@ -359,10 +397,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_numPrim += sceneObject.Children.Count;
|
||||
|
||||
if (attachToBackup)
|
||||
{
|
||||
sceneObject.AttachToBackup();
|
||||
}
|
||||
|
||||
if (OnObjectCreate != null)
|
||||
{
|
||||
OnObjectCreate(sceneObject);
|
||||
}
|
||||
|
||||
lock (m_dictionary_lock)
|
||||
{
|
||||
@@ -429,6 +471,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void FireAttachToBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnAttachToBackup != null)
|
||||
{
|
||||
OnAttachToBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public void FireDetachFromBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnDetachFromBackup != null)
|
||||
{
|
||||
OnDetachFromBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public void FireChangeBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnChangeBackup != null)
|
||||
{
|
||||
OnChangeBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process all pending updates
|
||||
/// </summary>
|
||||
@@ -565,7 +631,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
Entities[presence.UUID] = presence;
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -589,6 +656,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -603,7 +674,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agentID);
|
||||
}
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -625,6 +697,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F)
|
||||
@@ -1502,10 +1578,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="childPrims"></param>
|
||||
protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
if (parentGroup == null) return;
|
||||
Monitor.Enter(m_updateLock);
|
||||
|
||||
try
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
parentGroup.areUpdatesSuspended = true;
|
||||
|
||||
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
|
||||
if (parentGroup != null)
|
||||
@@ -1544,12 +1623,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// occur on link to invoke this elsewhere (such as object selection)
|
||||
parentGroup.RootPart.CreateSelected = true;
|
||||
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
parentGroup.areUpdatesSuspended = false;
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
Monitor.Exit(m_updateLock);
|
||||
}
|
||||
}
|
||||
@@ -1586,11 +1665,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
if (childParts.Count > 0)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
try
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart root in rootParts)
|
||||
@@ -1614,10 +1704,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (numChildren > 1)
|
||||
sendEventsToRemainder = false;
|
||||
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
if (newSet.Count > 0)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
try
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is more than one prim remaining, we
|
||||
|
||||
@@ -46,12 +46,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void ForceInventoryPersistence()
|
||||
{
|
||||
lock (m_parts)
|
||||
lockPartsForRead(true);
|
||||
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
|
||||
lockPartsForRead(false);
|
||||
foreach (SceneObjectPart part in values)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.Inventory.ForceInventoryPersistence();
|
||||
}
|
||||
part.Inventory.ForceInventoryPersistence();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,19 +74,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Stop the scripts contained in all the prims in this group
|
||||
/// </summary>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
/// Should be true if these scripts are being removed because the scene
|
||||
/// object is being deleted. This will prevent spurious updates to the client.
|
||||
/// </param>
|
||||
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
|
||||
{
|
||||
lock (m_parts)
|
||||
lockPartsForRead(true);
|
||||
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
|
||||
lockPartsForRead(false);
|
||||
|
||||
foreach (SceneObjectPart part in values)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
||||
}
|
||||
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
[XmlIgnore]
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
public int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
[XmlIgnore]
|
||||
public PhysicsActor PhysActor;
|
||||
|
||||
@@ -277,6 +277,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private Quaternion m_sitTargetOrientation = Quaternion.Identity;
|
||||
private Vector3 m_sitTargetPosition;
|
||||
private string m_sitAnimation = "SIT";
|
||||
private bool m_occupied; // KF if any av is sitting on this prim
|
||||
private string m_text = String.Empty;
|
||||
private string m_touchName = String.Empty;
|
||||
private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
|
||||
@@ -360,7 +361,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
|
||||
Quaternion rotationOffset, Vector3 offsetPosition)
|
||||
{
|
||||
m_name = "Primitive";
|
||||
m_name = "Object";
|
||||
|
||||
Rezzed = DateTime.UtcNow;
|
||||
_creationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
|
||||
@@ -456,12 +457,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <value>
|
||||
/// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
|
||||
/// Get the inventory list
|
||||
/// </value>
|
||||
public TaskInventoryDictionary TaskInventory
|
||||
{
|
||||
get { return m_inventory.Items; }
|
||||
set { m_inventory.Items = value; }
|
||||
get {
|
||||
return m_inventory.Items;
|
||||
}
|
||||
set {
|
||||
m_inventory.Items = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint ObjectFlags
|
||||
@@ -590,14 +595,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_LoopSoundSlavePrims = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] TextureAnimation
|
||||
{
|
||||
get { return m_TextureAnimation; }
|
||||
set { m_TextureAnimation = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] ParticleSystem
|
||||
{
|
||||
get { return m_particleSystem; }
|
||||
@@ -651,7 +654,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set
|
||||
{
|
||||
m_groupPosition = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
@@ -698,7 +700,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_offsetPosition; }
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_POSITION);
|
||||
m_offsetPosition = value;
|
||||
|
||||
if (ParentGroup != null && !ParentGroup.IsDeleted)
|
||||
@@ -712,6 +714,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Tell the physics engines that this prim changed.
|
||||
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
|
||||
}
|
||||
|
||||
List<ScenePresence> avs = ParentGroup.GetLinkedAvatars();
|
||||
foreach (ScenePresence av in avs)
|
||||
{
|
||||
av.SendFullUpdateToAllClients();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -754,7 +762,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_ROTATION);
|
||||
m_rotationOffset = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
@@ -838,7 +846,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary></summary>
|
||||
public Vector3 Acceleration
|
||||
{
|
||||
get { return m_acceleration; }
|
||||
get
|
||||
{
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
m_acceleration = actor.Acceleration;
|
||||
}
|
||||
return m_acceleration;
|
||||
}
|
||||
|
||||
set { m_acceleration = value; }
|
||||
}
|
||||
|
||||
@@ -865,7 +882,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set
|
||||
{
|
||||
m_color = value;
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
|
||||
/* ScheduleFullUpdate() need not be called b/c after
|
||||
* setting the color, the text will be set, so then
|
||||
@@ -944,7 +960,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_shape.Scale; }
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_SCALE);
|
||||
if (m_shape != null)
|
||||
{
|
||||
m_shape.Scale = value;
|
||||
@@ -989,7 +1005,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (IsAttachment)
|
||||
return GroupPosition;
|
||||
|
||||
return m_offsetPosition + m_groupPosition; }
|
||||
// return m_offsetPosition + m_groupPosition; }
|
||||
return m_groupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset) ; } //KF: Rotation was ignored!
|
||||
}
|
||||
|
||||
public SceneObjectGroup ParentGroup
|
||||
@@ -1140,6 +1157,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return _flags; }
|
||||
set { _flags = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsOccupied // KF If an av is sittingon this prim
|
||||
{
|
||||
get { return m_occupied; }
|
||||
set { m_occupied = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public UUID SitTargetAvatar
|
||||
@@ -1215,14 +1239,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear all pending updates of parts to clients
|
||||
/// </summary>
|
||||
private void ClearUpdateSchedule()
|
||||
{
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
private void SendObjectPropertiesToClient(UUID AgentID)
|
||||
{
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
@@ -1508,7 +1524,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_redo.Clear();
|
||||
}
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_ALL);
|
||||
}
|
||||
|
||||
public byte ConvertScriptUintToByte(uint indata)
|
||||
@@ -1611,7 +1627,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.Create();
|
||||
part.Shape = shape;
|
||||
|
||||
part.Name = "Primitive";
|
||||
part.Name = "Object";
|
||||
part._ownerID = UUID.Random();
|
||||
|
||||
return part;
|
||||
@@ -1734,7 +1750,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// which stops client-side interpolation of deactivated joint proxy objects.
|
||||
}
|
||||
|
||||
if (!UsePhysics && !isNew)
|
||||
if (!UsePhysics)
|
||||
{
|
||||
// reset velocity to 0 on physics switch-off. Without that, the client thinks the
|
||||
// prim still has velocity and continues to interpolate its position along the old
|
||||
@@ -1969,12 +1985,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 GetWorldPosition()
|
||||
{
|
||||
Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
|
||||
|
||||
Vector3 axPos = OffsetPosition;
|
||||
|
||||
axPos *= parentRot;
|
||||
Vector3 translationOffsetPosition = axPos;
|
||||
return GroupPosition + translationOffsetPosition;
|
||||
if(_parentID == 0)
|
||||
{
|
||||
return GroupPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1985,7 +2006,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Quaternion newRot;
|
||||
|
||||
if (this.LinkNum == 0)
|
||||
if (this.LinkNum < 2) //KF Single or root prim
|
||||
{
|
||||
newRot = RotationOffset;
|
||||
}
|
||||
@@ -2631,17 +2652,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//Trys to fetch sound id from prim's inventory.
|
||||
//Prim's inventory doesn't support non script items yet
|
||||
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
@@ -2701,7 +2723,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="scale"></param>
|
||||
public void Resize(Vector3 scale)
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_SCALE);
|
||||
m_shape.Scale = scale;
|
||||
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
@@ -2710,38 +2732,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void RotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
rotLookAt(target, strength, damping);
|
||||
}
|
||||
|
||||
public void rotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
if (IsAttachment)
|
||||
{
|
||||
/*
|
||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||
if (avatar != null)
|
||||
{
|
||||
Rotate the Av?
|
||||
} */
|
||||
}
|
||||
else
|
||||
{
|
||||
APIDDamp = damping;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = target;
|
||||
}
|
||||
}
|
||||
|
||||
public void startLookAt(Quaternion rot, float damp, float strength)
|
||||
{
|
||||
APIDDamp = damp;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = rot;
|
||||
}
|
||||
|
||||
public void stopLookAt()
|
||||
{
|
||||
APIDTarget = Quaternion.Identity;
|
||||
m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2753,7 +2744,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (m_parentGroup != null)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
if (!m_parentGroup.areUpdatesSuspended)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
}
|
||||
}
|
||||
|
||||
int timeNow = Util.UnixTimeSinceEpoch();
|
||||
@@ -2970,8 +2964,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
const float ROTATION_TOLERANCE = 0.01f;
|
||||
const float VELOCITY_TOLERANCE = 0.001f;
|
||||
const float POSITION_TOLERANCE = 0.05f;
|
||||
const int TIME_MS_TOLERANCE = 3000;
|
||||
const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
|
||||
const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
|
||||
|
||||
if (m_updateFlag == 1)
|
||||
{
|
||||
@@ -2985,7 +2979,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
||||
{
|
||||
AddTerseUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
|
||||
|
||||
// This causes the Scene to 'poll' physical objects every couple of frames
|
||||
// bad, so it's been replaced by an event driven method.
|
||||
@@ -3003,16 +2997,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_lastAngularVelocity = AngularVelocity;
|
||||
m_lastTerseSent = Environment.TickCount;
|
||||
}
|
||||
//Moved this outside of the if clause so updates don't get blocked.. *sigh*
|
||||
m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
|
||||
{
|
||||
AddFullUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0; //Same here
|
||||
}
|
||||
}
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3039,17 +3035,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!UUID.TryParse(sound, out soundID))
|
||||
{
|
||||
// search sound file from inventory
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (soundID == UUID.Zero)
|
||||
@@ -3484,7 +3479,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void StopLookAt()
|
||||
{
|
||||
m_parentGroup.stopLookAt();
|
||||
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
|
||||
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
@@ -3511,10 +3506,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
//m_parentGroup.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
public void StoreUndoState()
|
||||
public void StoreUndoState(UndoType type)
|
||||
{
|
||||
if (!Undoing)
|
||||
if (!Undoing && (m_parentGroup == null || m_parentGroup.RootPart == null || !m_parentGroup.RootPart.Undoing))
|
||||
{
|
||||
if (!IgnoreUndoUpdate)
|
||||
{
|
||||
@@ -3525,17 +3519,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
UndoState last = m_undo.Peek();
|
||||
if (last != null)
|
||||
{
|
||||
if (last.Compare(this))
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
UndoState nUndo = new UndoState(this);
|
||||
UndoState lastUndo = m_undo.Peek();
|
||||
|
||||
UndoState nUndo = new UndoState(this, type);
|
||||
|
||||
if (lastUndo != null)
|
||||
{
|
||||
TimeSpan ts = DateTime.Now.Subtract(lastUndo.LastUpdated);
|
||||
if (ts.TotalMilliseconds < 500)
|
||||
{
|
||||
//Delete the last entry since it was less than 500 milliseconds ago
|
||||
nUndo.Merge(lastUndo);
|
||||
m_undo.Pop();
|
||||
}
|
||||
}
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
|
||||
@@ -4012,11 +4014,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
UndoState nUndo = null;
|
||||
UndoState goback = m_undo.Pop();
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
nUndo = new UndoState(this);
|
||||
nUndo = new UndoState(this, goback.Type);
|
||||
}
|
||||
UndoState goback = m_undo.Pop();
|
||||
|
||||
|
||||
if (goback != null)
|
||||
{
|
||||
goback.PlaybackState(this);
|
||||
@@ -4031,13 +4035,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
lock (m_redo)
|
||||
{
|
||||
UndoState gofwd = m_redo.Pop();
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
UndoState nUndo = new UndoState(this);
|
||||
UndoState nUndo = new UndoState(this, gofwd.Type);
|
||||
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
UndoState gofwd = m_redo.Pop();
|
||||
if (gofwd != null)
|
||||
gofwd.PlayfwdState(this);
|
||||
}
|
||||
@@ -4482,8 +4486,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_shape.TextureEntry = textureEntry;
|
||||
TriggerScriptChangedEvent(Changed.TEXTURE);
|
||||
|
||||
m_updateFlag = 1;
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
|
||||
//This is madness..
|
||||
//ParentGroup.ScheduleGroupForFullUpdate();
|
||||
//This is sparta
|
||||
@@ -4728,5 +4733,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Color color = Color;
|
||||
return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A));
|
||||
}
|
||||
|
||||
public void ResetOwnerChangeFlag()
|
||||
{
|
||||
List<UUID> inv = Inventory.GetInventoryList();
|
||||
|
||||
foreach (UUID itemID in inv)
|
||||
{
|
||||
TaskInventoryItem item = Inventory.GetInventoryItem(itemID);
|
||||
item.OwnerChanged = false;
|
||||
Inventory.UpdateInventoryItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -105,7 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
sceneObject.AddPart(part);
|
||||
part.LinkNum = linkNum;
|
||||
part.TrimPermissions();
|
||||
part.StoreUndoState();
|
||||
part.StoreUndoState(UndoType.STATE_ALL);
|
||||
reader.Close();
|
||||
sr.Close();
|
||||
}
|
||||
@@ -231,7 +231,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
if (originalLinkNum != 0)
|
||||
part.LinkNum = originalLinkNum;
|
||||
|
||||
part.StoreUndoState();
|
||||
part.StoreUndoState(UndoType.STATE_ALL);
|
||||
reader.Close();
|
||||
sr.Close();
|
||||
}
|
||||
|
||||
@@ -27,48 +27,125 @@
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using System;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
[Flags]
|
||||
public enum UndoType
|
||||
{
|
||||
STATE_PRIM_POSITION = 1,
|
||||
STATE_PRIM_ROTATION = 2,
|
||||
STATE_PRIM_SCALE = 4,
|
||||
STATE_PRIM_ALL = 7,
|
||||
STATE_GROUP_POSITION = 8,
|
||||
STATE_GROUP_ROTATION = 16,
|
||||
STATE_GROUP_SCALE = 32,
|
||||
STATE_GROUP_ALL = 56,
|
||||
STATE_ALL = 63
|
||||
}
|
||||
|
||||
public class UndoState
|
||||
{
|
||||
public Vector3 Position = Vector3.Zero;
|
||||
public Vector3 Scale = Vector3.Zero;
|
||||
public Quaternion Rotation = Quaternion.Identity;
|
||||
public Vector3 GroupPosition = Vector3.Zero;
|
||||
public Quaternion GroupRotation = Quaternion.Identity;
|
||||
public Vector3 GroupScale = Vector3.Zero;
|
||||
public DateTime LastUpdated = DateTime.Now;
|
||||
public UndoType Type;
|
||||
|
||||
public UndoState(SceneObjectPart part)
|
||||
public UndoState(SceneObjectPart part, UndoType type)
|
||||
{
|
||||
Type = type;
|
||||
if (part != null)
|
||||
{
|
||||
if (part.ParentID == 0)
|
||||
{
|
||||
Position = part.ParentGroup.AbsolutePosition;
|
||||
GroupScale = part.ParentGroup.RootPart.Shape.Scale;
|
||||
|
||||
//FUBAR WARNING: Do NOT get the group's absoluteposition here
|
||||
//or you'll experience a loop and/or a stack issue
|
||||
GroupPosition = part.ParentGroup.RootPart.AbsolutePosition;
|
||||
GroupRotation = part.ParentGroup.GroupRotation;
|
||||
Position = part.ParentGroup.RootPart.AbsolutePosition;
|
||||
Rotation = part.RotationOffset;
|
||||
Scale = part.Shape.Scale;
|
||||
LastUpdated = DateTime.Now;
|
||||
}
|
||||
else
|
||||
{
|
||||
GroupScale = part.Shape.Scale;
|
||||
|
||||
//FUBAR WARNING: Do NOT get the group's absoluteposition here
|
||||
//or you'll experience a loop and/or a stack issue
|
||||
GroupPosition = part.ParentGroup.RootPart.AbsolutePosition;
|
||||
GroupRotation = part.ParentGroup.Rotation;
|
||||
Position = part.OffsetPosition;
|
||||
Rotation = part.RotationOffset;
|
||||
Scale = part.Shape.Scale;
|
||||
LastUpdated = DateTime.Now;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Merge(UndoState last)
|
||||
{
|
||||
if ((Type & UndoType.STATE_GROUP_POSITION) == 0 || ((last.Type & UndoType.STATE_GROUP_POSITION) >= (Type & UndoType.STATE_GROUP_POSITION)))
|
||||
{
|
||||
GroupPosition = last.GroupPosition;
|
||||
Position = last.Position;
|
||||
}
|
||||
if ((Type & UndoType.STATE_GROUP_SCALE) == 0 || ((last.Type & UndoType.STATE_GROUP_SCALE) >= (Type & UndoType.STATE_GROUP_SCALE)))
|
||||
{
|
||||
GroupScale = last.GroupScale;
|
||||
Scale = last.Scale;
|
||||
}
|
||||
if ((Type & UndoType.STATE_GROUP_ROTATION) == 0 || ((last.Type & UndoType.STATE_GROUP_ROTATION) >= (Type & UndoType.STATE_GROUP_ROTATION)))
|
||||
{
|
||||
GroupRotation = last.GroupRotation;
|
||||
Rotation = last.Rotation;
|
||||
}
|
||||
if ((Type & UndoType.STATE_PRIM_POSITION) == 0 || ((last.Type & UndoType.STATE_PRIM_POSITION) >= (Type & UndoType.STATE_PRIM_POSITION)))
|
||||
{
|
||||
Position = last.Position;
|
||||
}
|
||||
if ((Type & UndoType.STATE_PRIM_SCALE) == 0 || ((last.Type & UndoType.STATE_PRIM_SCALE) >= (Type & UndoType.STATE_PRIM_SCALE)))
|
||||
{
|
||||
Scale = last.Scale;
|
||||
}
|
||||
if ((Type & UndoType.STATE_PRIM_ROTATION) == 0 || ((last.Type & UndoType.STATE_PRIM_ROTATION) >= (Type & UndoType.STATE_PRIM_ROTATION)))
|
||||
{
|
||||
Rotation = last.Rotation;
|
||||
}
|
||||
Type = Type | last.Type;
|
||||
}
|
||||
public bool Compare(UndoState undo)
|
||||
{
|
||||
if (undo == null || Position == null) return false;
|
||||
if (undo.Position == Position && undo.Rotation == Rotation && undo.Scale == Scale && undo.GroupPosition == GroupPosition && undo.GroupScale == GroupScale && undo.GroupRotation == GroupRotation)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool Compare(SceneObjectPart part)
|
||||
{
|
||||
if (part != null)
|
||||
{
|
||||
if (part.ParentID == 0)
|
||||
{
|
||||
if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.ParentGroup.Rotation)
|
||||
if (Position == part.ParentGroup.RootPart.AbsolutePosition && Rotation == part.ParentGroup.Rotation && GroupPosition == part.ParentGroup.RootPart.AbsolutePosition && part.ParentGroup.Rotation == GroupRotation && part.Shape.Scale == GroupScale)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Position == part.OffsetPosition && Rotation == part.RotationOffset && Scale == part.Shape.Scale)
|
||||
if (Position == part.OffsetPosition && Rotation == part.RotationOffset && Scale == part.Shape.Scale && GroupPosition == part.ParentGroup.RootPart.AbsolutePosition && part.ParentGroup.Rotation == GroupRotation && part.Shape.Scale == GroupScale)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -78,62 +155,70 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
public void PlaybackState(SceneObjectPart part)
|
||||
private void RestoreState(SceneObjectPart part)
|
||||
{
|
||||
bool GroupChange = false;
|
||||
if ((Type & UndoType.STATE_GROUP_POSITION) != 0
|
||||
|| (Type & UndoType.STATE_GROUP_ROTATION) != 0
|
||||
|| (Type & UndoType.STATE_GROUP_SCALE) != 0)
|
||||
{
|
||||
GroupChange = true;
|
||||
}
|
||||
|
||||
if (part != null)
|
||||
{
|
||||
part.Undoing = true;
|
||||
|
||||
if (part.ParentID == 0)
|
||||
if (part.ParentID == 0 && GroupChange == false)
|
||||
{
|
||||
if (Position != Vector3.Zero)
|
||||
part.ParentGroup.AbsolutePosition = Position;
|
||||
part.RotationOffset = Rotation;
|
||||
|
||||
part.ParentGroup.UpdateSinglePosition(Position, part.LocalId);
|
||||
part.ParentGroup.UpdateSingleRotation(Rotation, part.LocalId);
|
||||
if (Scale != Vector3.Zero)
|
||||
part.Resize(Scale);
|
||||
part.ParentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Position != Vector3.Zero)
|
||||
part.OffsetPosition = Position;
|
||||
part.UpdateRotation(Rotation);
|
||||
if (Scale != Vector3.Zero)
|
||||
part.Resize(Scale); part.ScheduleTerseUpdate();
|
||||
if (GroupChange)
|
||||
{
|
||||
part.ParentGroup.RootPart.Undoing = true;
|
||||
if (GroupPosition != Vector3.Zero)
|
||||
{
|
||||
//Calculate the scale...
|
||||
Vector3 gs = part.Shape.Scale;
|
||||
float scale = GroupScale.Z / gs.Z;
|
||||
|
||||
//Scale first since it can affect our position
|
||||
part.ParentGroup.GroupResize(gs * scale, part.LocalId);
|
||||
part.ParentGroup.AbsolutePosition = GroupPosition;
|
||||
part.ParentGroup.UpdateGroupRotationR(GroupRotation);
|
||||
|
||||
}
|
||||
part.ParentGroup.RootPart.Undoing = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Position != Vector3.Zero) //We can use this for all the updates since all are set
|
||||
{
|
||||
part.OffsetPosition = Position;
|
||||
part.UpdateRotation(Rotation);
|
||||
part.Resize(Scale); part.ScheduleTerseUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
part.Undoing = false;
|
||||
|
||||
}
|
||||
}
|
||||
public void PlaybackState(SceneObjectPart part)
|
||||
{
|
||||
RestoreState(part);
|
||||
}
|
||||
public void PlayfwdState(SceneObjectPart part)
|
||||
{
|
||||
if (part != null)
|
||||
{
|
||||
part.Undoing = true;
|
||||
|
||||
if (part.ParentID == 0)
|
||||
{
|
||||
if (Position != Vector3.Zero)
|
||||
part.ParentGroup.AbsolutePosition = Position;
|
||||
if (Rotation != Quaternion.Identity)
|
||||
part.UpdateRotation(Rotation);
|
||||
if (Scale != Vector3.Zero)
|
||||
part.Resize(Scale);
|
||||
part.ParentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Position != Vector3.Zero)
|
||||
part.OffsetPosition = Position;
|
||||
if (Rotation != Quaternion.Identity)
|
||||
part.UpdateRotation(Rotation);
|
||||
if (Scale != Vector3.Zero)
|
||||
part.Resize(Scale);
|
||||
part.ScheduleTerseUpdate();
|
||||
}
|
||||
part.Undoing = false;
|
||||
|
||||
}
|
||||
RestoreState(part);
|
||||
}
|
||||
}
|
||||
public class LandUndoState
|
||||
@@ -161,3 +246,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -878,12 +878,21 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -836,11 +836,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -624,8 +624,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
|
||||
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void VehicleFlags(int param, bool remove)
|
||||
{
|
||||
|
||||
|
||||
58
OpenSim/Region/Physics/ChOdePlugin/AssemblyInfo.cs
Normal file
58
OpenSim/Region/Physics/ChOdePlugin/AssemblyInfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly : AssemblyTitle("OdePlugin")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("http://opensimulator.org")]
|
||||
[assembly : AssemblyProduct("OdePlugin")]
|
||||
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.6.5.*")]
|
||||
1369
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
1369
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
File diff suppressed because it is too large
Load Diff
3916
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
3916
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
File diff suppressed because it is too large
Load Diff
375
OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs
Normal file
375
OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using Ode.NET;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Processes raycast requests as ODE is in a state to be able to do them.
|
||||
/// This ensures that it's thread safe and there will be no conflicts.
|
||||
/// Requests get returned by a different thread then they were requested by.
|
||||
/// </summary>
|
||||
public class ODERayCastRequestManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Pending Raycast Requests
|
||||
/// </summary>
|
||||
protected List<ODERayCastRequest> m_PendingRequests = new List<ODERayCastRequest>();
|
||||
|
||||
/// <summary>
|
||||
/// Scene that created this object.
|
||||
/// </summary>
|
||||
private OdeScene m_scene;
|
||||
|
||||
/// <summary>
|
||||
/// ODE contact array to be filled by the collision testing
|
||||
/// </summary>
|
||||
d.ContactGeom[] contacts = new d.ContactGeom[5];
|
||||
|
||||
/// <summary>
|
||||
/// ODE near callback delegate
|
||||
/// </summary>
|
||||
private d.NearCallback nearCallback;
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private List<ContactResult> m_contactResults = new List<ContactResult>();
|
||||
|
||||
|
||||
public ODERayCastRequestManager(OdeScene pScene)
|
||||
{
|
||||
m_scene = pScene;
|
||||
nearCallback = near;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queues a raycast
|
||||
/// </summary>
|
||||
/// <param name="position">Origin of Ray</param>
|
||||
/// <param name="direction">Ray normal</param>
|
||||
/// <param name="length">Ray length</param>
|
||||
/// <param name="retMethod">Return method to send the results</param>
|
||||
public void QueueRequest(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod)
|
||||
{
|
||||
lock (m_PendingRequests)
|
||||
{
|
||||
ODERayCastRequest req = new ODERayCastRequest();
|
||||
req.callbackMethod = retMethod;
|
||||
req.length = length;
|
||||
req.Normal = direction;
|
||||
req.Origin = position;
|
||||
|
||||
m_PendingRequests.Add(req);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process all queued raycast requests
|
||||
/// </summary>
|
||||
/// <returns>Time in MS the raycasts took to process.</returns>
|
||||
public int ProcessQueuedRequests()
|
||||
{
|
||||
int time = System.Environment.TickCount;
|
||||
lock (m_PendingRequests)
|
||||
{
|
||||
if (m_PendingRequests.Count > 0)
|
||||
{
|
||||
ODERayCastRequest[] reqs = m_PendingRequests.ToArray();
|
||||
for (int i = 0; i < reqs.Length; i++)
|
||||
{
|
||||
if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast
|
||||
RayCast(reqs[i]); // if there isn't anyone to send results
|
||||
}
|
||||
/*
|
||||
foreach (ODERayCastRequest req in m_PendingRequests)
|
||||
{
|
||||
if (req.callbackMethod != null) // quick optimization here, don't raycast
|
||||
RayCast(req); // if there isn't anyone to send results to
|
||||
|
||||
}
|
||||
*/
|
||||
m_PendingRequests.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Clear();
|
||||
|
||||
return System.Environment.TickCount - time;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method that actually initiates the raycast
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
private void RayCast(ODERayCastRequest req)
|
||||
{
|
||||
// Create the ray
|
||||
IntPtr ray = d.CreateRay(m_scene.space, req.length);
|
||||
d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z);
|
||||
|
||||
// Collide test
|
||||
d.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback);
|
||||
|
||||
// Remove Ray
|
||||
d.GeomDestroy(ray);
|
||||
|
||||
|
||||
// Define default results
|
||||
bool hitYN = false;
|
||||
uint hitConsumerID = 0;
|
||||
float distance = 999999999999f;
|
||||
Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f);
|
||||
Vector3 snormal = Vector3.Zero;
|
||||
|
||||
// Find closest contact and object.
|
||||
lock (m_contactResults)
|
||||
{
|
||||
foreach (ContactResult cResult in m_contactResults)
|
||||
{
|
||||
if (Vector3.Distance(req.Origin, cResult.Pos) < Vector3.Distance(req.Origin, closestcontact))
|
||||
{
|
||||
closestcontact = cResult.Pos;
|
||||
hitConsumerID = cResult.ConsumerID;
|
||||
distance = cResult.Depth;
|
||||
hitYN = true;
|
||||
snormal = cResult.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
m_contactResults.Clear();
|
||||
}
|
||||
|
||||
// Return results
|
||||
if (req.callbackMethod != null)
|
||||
req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal);
|
||||
}
|
||||
|
||||
// This is the standard Near. Uses space AABBs to speed up detection.
|
||||
private void near(IntPtr space, IntPtr g1, IntPtr g2)
|
||||
{
|
||||
|
||||
//Don't test against heightfield Geom, or you'll be sorry!
|
||||
|
||||
/*
|
||||
terminate called after throwing an instance of 'std::bad_alloc'
|
||||
what(): std::bad_alloc
|
||||
Stacktrace:
|
||||
|
||||
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0x00004>
|
||||
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0xffffffff>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0x00280>
|
||||
at (wrapper native-to-managed) OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0xfff
|
||||
fffff>
|
||||
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0x00004>
|
||||
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0xffffffff>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.RayCast (OpenSim.Region.Physics.OdePlugin.ODERayCastRequest) <
|
||||
0x00114>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.ProcessQueuedRequests () <0x000eb>
|
||||
at OpenSim.Region.Physics.OdePlugin.OdeScene.Simulate (single) <0x017e6>
|
||||
at OpenSim.Region.Framework.Scenes.SceneGraph.UpdatePhysics (double) <0x00042>
|
||||
at OpenSim.Region.Framework.Scenes.Scene.Update () <0x0039e>
|
||||
at OpenSim.Region.Framework.Scenes.Scene.Heartbeat (object) <0x00019>
|
||||
at (wrapper runtime-invoke) object.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
|
||||
|
||||
Native stacktrace:
|
||||
|
||||
mono [0x80d2a42]
|
||||
[0xb7f5840c]
|
||||
/lib/i686/cmov/libc.so.6(abort+0x188) [0xb7d1a018]
|
||||
/usr/lib/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x158) [0xb45fc988]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa865]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa8a2]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa9da]
|
||||
/usr/lib/libstdc++.so.6(_Znwj+0x83) [0xb45fb033]
|
||||
/usr/lib/libstdc++.so.6(_Znaj+0x1d) [0xb45fb11d]
|
||||
libode.so(_ZN13dxHeightfield23dCollideHeightfieldZoneEiiiiP6dxGeomiiP12dContactGeomi+0xd04) [0xb46678e4]
|
||||
libode.so(_Z19dCollideHeightfieldP6dxGeomS0_iP12dContactGeomi+0x54b) [0xb466832b]
|
||||
libode.so(dCollide+0x102) [0xb46571b2]
|
||||
[0x95cfdec9]
|
||||
[0x8ea07fe1]
|
||||
[0xab260146]
|
||||
libode.so [0xb465a5c4]
|
||||
libode.so(_ZN11dxHashSpace8collide2EPvP6dxGeomPFvS0_S2_S2_E+0x75) [0xb465bcf5]
|
||||
libode.so(dSpaceCollide2+0x177) [0xb465ac67]
|
||||
[0x95cf978e]
|
||||
[0x8ea07945]
|
||||
[0x95cf2bbc]
|
||||
[0xab2787e7]
|
||||
[0xab419fb3]
|
||||
[0xab416657]
|
||||
[0xab415bda]
|
||||
[0xb609b08e]
|
||||
mono(mono_runtime_delegate_invoke+0x34) [0x8192534]
|
||||
mono [0x81a2f0f]
|
||||
mono [0x81d28b6]
|
||||
mono [0x81ea2c6]
|
||||
/lib/i686/cmov/libpthread.so.0 [0xb7e744c0]
|
||||
/lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7dcd6de]
|
||||
*/
|
||||
|
||||
// Exclude heightfield geom
|
||||
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
if (d.GeomGetClass(g1) == d.GeomClassID.HeightfieldClass || d.GeomGetClass(g2) == d.GeomClassID.HeightfieldClass)
|
||||
return;
|
||||
|
||||
// Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms.
|
||||
if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
|
||||
{
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
// Separating static prim geometry spaces.
|
||||
// We'll be calling near recursivly if one
|
||||
// of them is a space to find all of the
|
||||
// contact points in the space
|
||||
try
|
||||
{
|
||||
d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
|
||||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to collide test a space");
|
||||
return;
|
||||
}
|
||||
//Colliding a space or a geom with a space or a geom. so drill down
|
||||
|
||||
//Collide all geoms in each space..
|
||||
//if (d.GeomIsSpace(g1)) d.SpaceCollide(g1, IntPtr.Zero, nearCallback);
|
||||
//if (d.GeomIsSpace(g2)) d.SpaceCollide(g2, IntPtr.Zero, nearCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
int count = 0;
|
||||
try
|
||||
{
|
||||
|
||||
if (g1 == g2)
|
||||
return; // Can't collide with yourself
|
||||
|
||||
lock (contacts)
|
||||
{
|
||||
count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf);
|
||||
}
|
||||
}
|
||||
catch (SEHException)
|
||||
{
|
||||
m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to collide test an object: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
PhysicsActor p1 = null;
|
||||
PhysicsActor p2 = null;
|
||||
|
||||
if (g1 != IntPtr.Zero)
|
||||
m_scene.actor_name_map.TryGetValue(g1, out p1);
|
||||
|
||||
if (g2 != IntPtr.Zero)
|
||||
m_scene.actor_name_map.TryGetValue(g1, out p2);
|
||||
|
||||
// Loop over contacts, build results.
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (p1 != null) {
|
||||
if (p1 is OdePrim)
|
||||
{
|
||||
ContactResult collisionresult = new ContactResult();
|
||||
|
||||
collisionresult.ConsumerID = ((OdePrim)p1).m_localID;
|
||||
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
|
||||
collisionresult.Depth = contacts[i].depth;
|
||||
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
|
||||
contacts[i].normal.Z);
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Add(collisionresult);
|
||||
}
|
||||
}
|
||||
|
||||
if (p2 != null)
|
||||
{
|
||||
if (p2 is OdePrim)
|
||||
{
|
||||
ContactResult collisionresult = new ContactResult();
|
||||
|
||||
collisionresult.ConsumerID = ((OdePrim)p2).m_localID;
|
||||
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
|
||||
collisionresult.Depth = contacts[i].depth;
|
||||
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
|
||||
contacts[i].normal.Z);
|
||||
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Add(collisionresult);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dereference the creator scene so that it can be garbage collected if needed.
|
||||
/// </summary>
|
||||
internal void Dispose()
|
||||
{
|
||||
m_scene = null;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ODERayCastRequest
|
||||
{
|
||||
public Vector3 Origin;
|
||||
public Vector3 Normal;
|
||||
public float length;
|
||||
public RaycastCallback callbackMethod;
|
||||
}
|
||||
|
||||
public struct ContactResult
|
||||
{
|
||||
public Vector3 Pos;
|
||||
public float Depth;
|
||||
public uint ConsumerID;
|
||||
public Vector3 Normal;
|
||||
}
|
||||
}
|
||||
@@ -26,51 +26,23 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using Ode.NET;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Physics.OdePlugin;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Will be the PhysX plugin but for now will be a very basic physics engine
|
||||
/// </summary>
|
||||
public class PhysXPlugin : IPhysicsPlugin
|
||||
class OdePhysicsJoint : PhysicsJoint
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private PhysXScene _mScene;
|
||||
|
||||
public PhysXPlugin()
|
||||
public override bool IsInPhysicsEngine
|
||||
{
|
||||
}
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
if (_mScene == null)
|
||||
get
|
||||
{
|
||||
_mScene = new PhysXScene(sceneIdentifier);
|
||||
return (jointID != IntPtr.Zero);
|
||||
}
|
||||
return (_mScene);
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("RealPhysX");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
public IntPtr jointID;
|
||||
}
|
||||
}
|
||||
3853
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
3853
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
File diff suppressed because it is too large
Load Diff
122
OpenSim/Region/Physics/ChOdePlugin/Tests/ODETestClass.cs
Normal file
122
OpenSim/Region/Physics/ChOdePlugin/Tests/ODETestClass.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
[TestFixture]
|
||||
public class ODETestClass
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private OdePlugin cbt;
|
||||
private PhysicsScene ps;
|
||||
private IMeshingPlugin imp;
|
||||
|
||||
[SetUp]
|
||||
public void Initialize()
|
||||
{
|
||||
// Loading ODEPlugin
|
||||
cbt = new OdePlugin();
|
||||
// Loading Zero Mesher
|
||||
imp = new ZeroMesherPlugin();
|
||||
// Getting Physics Scene
|
||||
ps = cbt.GetScene("test");
|
||||
// Initializing Physics Scene.
|
||||
ps.Initialise(imp.GetMesher(),null);
|
||||
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
|
||||
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
|
||||
{
|
||||
_heightmap[i] = 21f;
|
||||
}
|
||||
ps.SetTerrain(_heightmap);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Terminate()
|
||||
{
|
||||
ps.DeleteTerrain();
|
||||
ps.Dispose();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateAndDropPhysicalCube()
|
||||
{
|
||||
PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox();
|
||||
Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f);
|
||||
Vector3 size = new Vector3(0.5f, 0.5f, 0.5f);
|
||||
Quaternion rot = Quaternion.Identity;
|
||||
PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true);
|
||||
OdePrim oprim = (OdePrim)prim;
|
||||
OdeScene pscene = (OdeScene) ps;
|
||||
|
||||
Assert.That(oprim.m_taintadd);
|
||||
|
||||
prim.LocalID = 5;
|
||||
|
||||
for (int i = 0; i < 58; i++)
|
||||
{
|
||||
ps.Simulate(0.133f);
|
||||
|
||||
Assert.That(oprim.prim_geom != (IntPtr)0);
|
||||
|
||||
Assert.That(oprim.m_targetSpace != (IntPtr)0);
|
||||
|
||||
//Assert.That(oprim.m_targetSpace == pscene.space);
|
||||
m_log.Info("TargetSpace: " + oprim.m_targetSpace + " - SceneMainSpace: " + pscene.space);
|
||||
|
||||
Assert.That(!oprim.m_taintadd);
|
||||
m_log.Info("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString());
|
||||
|
||||
// Make sure we're above the ground
|
||||
//Assert.That(prim.Position.Z > 20f);
|
||||
//m_log.Info("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore);
|
||||
|
||||
// Make sure we've got a Body
|
||||
Assert.That(oprim.Body != (IntPtr)0);
|
||||
//m_log.Info(
|
||||
}
|
||||
|
||||
// Make sure we're not somewhere above the ground
|
||||
Assert.That(prim.Position.Z < 21.5f);
|
||||
|
||||
ps.RemovePrim(prim);
|
||||
Assert.That(oprim.m_taintremove);
|
||||
ps.Simulate(0.133f);
|
||||
Assert.That(oprim.Body == (IntPtr)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
98
OpenSim/Region/Physics/ChOdePlugin/drawstuff.cs
Normal file
98
OpenSim/Region/Physics/ChOdePlugin/drawstuff.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright ODE
|
||||
* Ode.NET - .NET bindings for ODE
|
||||
* Jason Perkins (starkos@industriousone.com)
|
||||
* Licensed under the New BSD
|
||||
* Part of the OpenDynamicsEngine
|
||||
Open Dynamics Engine
|
||||
Copyright (c) 2001-2007, Russell L. Smith.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
Neither the names of ODE's copyright owner nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Ode.NET;
|
||||
|
||||
namespace Drawstuff.NET
|
||||
{
|
||||
#if dDOUBLE
|
||||
using dReal = System.Double;
|
||||
#else
|
||||
using dReal = System.Single;
|
||||
#endif
|
||||
|
||||
public static class ds
|
||||
{
|
||||
public const int VERSION = 2;
|
||||
|
||||
public enum Texture
|
||||
{
|
||||
None,
|
||||
Wood
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void CallbackFunction(int arg);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Functions
|
||||
{
|
||||
public int version;
|
||||
public CallbackFunction start;
|
||||
public CallbackFunction step;
|
||||
public CallbackFunction command;
|
||||
public CallbackFunction stop;
|
||||
public string path_to_textures;
|
||||
}
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawBox")]
|
||||
public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawCapsule")]
|
||||
public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawConvex")]
|
||||
public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetColor")]
|
||||
public static extern void SetColor(float red, float green, float blue);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetTexture")]
|
||||
public static extern void SetTexture(Texture texture);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetViewpoint")]
|
||||
public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSimulationLoop")]
|
||||
public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn);
|
||||
}
|
||||
}
|
||||
@@ -1210,7 +1210,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public override float APIDDamping{ set { return; } }
|
||||
|
||||
|
||||
public override void SubscribeEvents(int ms)
|
||||
{
|
||||
m_requestedUpdateFrequency = ms;
|
||||
|
||||
@@ -2831,7 +2831,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||
}
|
||||
public override bool PIDActive { set { m_usePID = value; } }
|
||||
public override float PIDTau { set { m_PIDTau = value; } }
|
||||
|
||||
|
||||
public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } }
|
||||
public override bool PIDHoverActive { set { m_useHoverPID = value; } }
|
||||
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } }
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
|
||||
@@ -88,89 +88,7 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (enabledYN)
|
||||
{
|
||||
RegionLoadedDoWork(scene);
|
||||
|
||||
scene.EventManager.OnNewPresence += NewPresence;
|
||||
}
|
||||
}
|
||||
|
||||
private void NewPresence(ScenePresence presence)
|
||||
{
|
||||
if (presence.IsChildAgent)
|
||||
{
|
||||
byte[] throttleData;
|
||||
|
||||
try
|
||||
{
|
||||
throttleData = presence.ControllingClient.GetThrottlesPacked(1);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (throttleData == null)
|
||||
return;
|
||||
|
||||
if (throttleData.Length == 0)
|
||||
return;
|
||||
|
||||
if (throttleData.Length != 28)
|
||||
return;
|
||||
|
||||
byte[] adjData;
|
||||
int pos = 0;
|
||||
|
||||
if (!BitConverter.IsLittleEndian)
|
||||
{
|
||||
byte[] newData = new byte[7 * 4];
|
||||
Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4);
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
Array.Reverse(newData, i * 4, 4);
|
||||
|
||||
adjData = newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
adjData = throttleData;
|
||||
}
|
||||
|
||||
// 0.125f converts from bits to bytes
|
||||
int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
|
||||
// State is a subcategory of task that we allocate a percentage to
|
||||
|
||||
|
||||
//int total = resend + land + wind + cloud + task + texture + asset;
|
||||
|
||||
byte[] data = new byte[7 * 4];
|
||||
int ii = 0;
|
||||
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4);
|
||||
|
||||
try
|
||||
{
|
||||
presence.ControllingClient.SetChildAgentThrottle(data);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void RegionLoadedDoWork(Scene scene)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -73,6 +73,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (m_ScriptEngine.Config.GetBoolean("AllowLightShareFunctions", false))
|
||||
m_LSFunctionsEnabled = true;
|
||||
|
||||
if (m_ScriptEngine.Config.GetBoolean("AllowCareminsterFunctions", false))
|
||||
m_LSFunctionsEnabled = true;
|
||||
|
||||
m_comms = m_ScriptEngine.World.RequestModuleInterface<IScriptModuleComms>();
|
||||
if (m_comms == null)
|
||||
m_LSFunctionsEnabled = false;
|
||||
|
||||
@@ -769,18 +769,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
if (animID == UUID.Zero)
|
||||
target.Animator.AddAnimation(animation, m_host.UUID);
|
||||
else
|
||||
@@ -802,18 +801,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
|
||||
if (animID == UUID.Zero)
|
||||
target.Animator.RemoveAnimation(animation);
|
||||
@@ -1664,6 +1662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1671,6 +1670,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -1717,6 +1717,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1724,6 +1725,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -1774,6 +1776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1781,6 +1784,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
// Is the sensor type is AGENT and not SCRIPTED then include agents
|
||||
if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0)
|
||||
{
|
||||
sensedEntities.AddRange(doAgentSensor(ts));
|
||||
sensedEntities.AddRange(doAgentSensor(ts));
|
||||
}
|
||||
|
||||
// If SCRIPTED or PASSIVE or ACTIVE check objects
|
||||
@@ -309,6 +309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
// in mouselook.
|
||||
|
||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
|
||||
fromRegionPos = avatar.AbsolutePosition;
|
||||
q = avatar.Rotation;
|
||||
}
|
||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||
@@ -422,6 +423,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
SceneObjectPart SensePoint = ts.host;
|
||||
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
|
||||
Quaternion q = SensePoint.RotationOffset;
|
||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
||||
{
|
||||
// In attachments, the sensor cone always orients with the
|
||||
// avatar rotation. This may include a nonzero elevation if
|
||||
// in mouselook.
|
||||
|
||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
|
||||
fromRegionPos = avatar.AbsolutePosition;
|
||||
q = avatar.Rotation;
|
||||
}
|
||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
|
||||
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
|
||||
|
||||
@@ -109,25 +109,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
if (Timers.Count == 0)
|
||||
return;
|
||||
|
||||
Dictionary<string, TimerClass>.ValueCollection tvals;
|
||||
lock (TimerListLock)
|
||||
{
|
||||
// Go through all timers
|
||||
Dictionary<string, TimerClass>.ValueCollection tvals = Timers.Values;
|
||||
foreach (TimerClass ts in tvals)
|
||||
{
|
||||
// Time has passed?
|
||||
if (ts.next < DateTime.Now.Ticks)
|
||||
{
|
||||
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
|
||||
// Add it to queue
|
||||
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
|
||||
new EventParams("timer", new Object[0],
|
||||
new DetectParams[0]));
|
||||
// set next interval
|
||||
tvals = Timers.Values;
|
||||
}
|
||||
|
||||
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
||||
ts.next = DateTime.Now.Ticks + ts.interval;
|
||||
}
|
||||
foreach (TimerClass ts in tvals)
|
||||
{
|
||||
// Time has passed?
|
||||
if (ts.next < DateTime.Now.Ticks)
|
||||
{
|
||||
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
|
||||
// Add it to queue
|
||||
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
|
||||
new EventParams("timer", new Object[0],
|
||||
new DetectParams[0]));
|
||||
// set next interval
|
||||
|
||||
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
||||
ts.next = DateTime.Now.Ticks + ts.interval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
// Avatar Info Commands
|
||||
string osGetAgentIP(string agent);
|
||||
LSL_List osGetAgents();
|
||||
|
||||
|
||||
// Teleport commands
|
||||
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Reflection;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
@@ -132,6 +133,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return (eventFlags);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||
{
|
||||
// IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.
|
||||
|
||||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int CHANGED_ALLOWED_DROP = 64;
|
||||
public const int CHANGED_OWNER = 128;
|
||||
public const int CHANGED_REGION_RESTART = 256;
|
||||
public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART
|
||||
public const int CHANGED_REGION = 512;
|
||||
public const int CHANGED_TELEPORT = 1024;
|
||||
public const int CHANGED_ANIMATION = 16384;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
@@ -309,6 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void llDie()
|
||||
{
|
||||
m_LSL_Functions.llDie();
|
||||
|
||||
@@ -72,5 +72,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
|
||||
}
|
||||
|
||||
public LSL_List cmGetWindlightScene(LSL_List rules)
|
||||
{
|
||||
return m_LS_Functions.lsGetWindlightScene(rules);
|
||||
}
|
||||
|
||||
public int cmSetWindlightScene(LSL_List rules)
|
||||
{
|
||||
return m_LS_Functions.lsSetWindlightScene(rules);
|
||||
}
|
||||
|
||||
public int cmSetWindlightSceneTargeted(LSL_List rules, key target)
|
||||
{
|
||||
return m_LS_Functions.lsSetWindlightSceneTargeted(rules, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
|
||||
@@ -90,6 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return (int)m_Executor.GetStateEventFlags(state);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||
{
|
||||
m_Executor.ExecuteEvent(state, FunctionName, args);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Threading;
|
||||
@@ -238,13 +239,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
|
||||
if (part != null)
|
||||
{
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
if (part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
if (part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
||||
}
|
||||
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
ApiManager am = new ApiManager();
|
||||
@@ -429,14 +429,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
{
|
||||
int permsMask;
|
||||
UUID permsGranter;
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
||||
return;
|
||||
|
||||
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
||||
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
return;
|
||||
}
|
||||
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
||||
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
|
||||
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||
{
|
||||
@@ -545,6 +546,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
return true;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode] //Prevents the debugger from farting in this function
|
||||
public void SetState(string state)
|
||||
{
|
||||
if (state == State)
|
||||
@@ -556,7 +558,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
new DetectParams[0]));
|
||||
PostEvent(new EventParams("state_entry", new Object[0],
|
||||
new DetectParams[0]));
|
||||
|
||||
|
||||
throw new EventAbortException();
|
||||
}
|
||||
|
||||
@@ -639,14 +641,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
/// <returns></returns>
|
||||
public object EventProcessor()
|
||||
{
|
||||
if (m_Suspended)
|
||||
return 0;
|
||||
EventParams data = null;
|
||||
|
||||
lock (m_Script)
|
||||
lock (m_EventQueue)
|
||||
{
|
||||
EventParams data = null;
|
||||
if (m_Suspended)
|
||||
return 0;
|
||||
|
||||
lock (m_EventQueue)
|
||||
lock (m_Script)
|
||||
{
|
||||
data = (EventParams) m_EventQueue.Dequeue();
|
||||
if (data == null) // Shouldn't happen
|
||||
@@ -672,6 +674,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
if (data.EventName == "collision")
|
||||
m_CollisionInQueue = false;
|
||||
}
|
||||
}
|
||||
lock(m_Script)
|
||||
{
|
||||
|
||||
//m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this);
|
||||
|
||||
@@ -828,6 +833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
new Object[0], new DetectParams[0]));
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode] //Stops the VS debugger from farting in this function
|
||||
public void ApiResetScript()
|
||||
{
|
||||
// bool running = Running;
|
||||
|
||||
@@ -83,19 +83,19 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", x, y, z);
|
||||
string s=String.Format("<{0:0.000000}, {1:0.000000}, {2:0.000000}>", x, y, z);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static explicit operator LSLString(Vector3 vec)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
string s=String.Format("<{0:0.000000}, {1:0.000000}, {2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
return new LSLString(s);
|
||||
}
|
||||
|
||||
public static explicit operator string(Vector3 vec)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
string s=String.Format("<{0:0.000000}, {1:0.000000}, {2:0.000000}>", vec.x, vec.y, vec.z);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -342,19 +342,19 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string st=String.Format(Culture.FormatProvider, "<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", x, y, z, s);
|
||||
string st=String.Format(Culture.FormatProvider, "<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", x, y, z, s);
|
||||
return st;
|
||||
}
|
||||
|
||||
public static explicit operator string(Quaternion r)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
string s=String.Format("<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
return s;
|
||||
}
|
||||
|
||||
public static explicit operator LSLString(Quaternion r)
|
||||
{
|
||||
string s=String.Format("<{0:0.000000},{1:0.000000},{2:0.000000},{3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
string s=String.Format("<{0:0.000000}, {1:0.000000}, {2:0.000000}, {3:0.000000}>", r.x, r.y, r.z, r.s);
|
||||
return new LSLString(s);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.IO;
|
||||
using System.Threading;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Security;
|
||||
using System.Security.Policy;
|
||||
using System.Reflection;
|
||||
@@ -102,6 +103,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private Dictionary<UUID, IScriptInstance> m_Scripts =
|
||||
new Dictionary<UUID, IScriptInstance>();
|
||||
|
||||
private OpenMetaverse.ReaderWriterLockSlim m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
|
||||
// Maps the asset ID to the assembly
|
||||
|
||||
private Dictionary<UUID, string> m_Assemblies =
|
||||
@@ -124,6 +127,71 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
IWorkItemResult m_CurrentCompile = null;
|
||||
private Dictionary<UUID, int> m_CompileDict = new Dictionary<UUID, int>();
|
||||
|
||||
private void lockScriptsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_scriptsLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire READ lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_scriptsLock.IsWriteLockHeld)
|
||||
{
|
||||
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void lockScriptsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_scriptsLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire WRITE lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_scriptsLock.IsWriteLockHeld)
|
||||
{
|
||||
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string ScriptEngineName
|
||||
{
|
||||
get { return "XEngine"; }
|
||||
@@ -263,43 +331,45 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
// Force a final state save
|
||||
//
|
||||
if (m_Assemblies.ContainsKey(instance.AssetID))
|
||||
{
|
||||
// Force a final state save
|
||||
//
|
||||
if (m_Assemblies.ContainsKey(instance.AssetID))
|
||||
{
|
||||
string assembly = m_Assemblies[instance.AssetID];
|
||||
instance.SaveState(assembly);
|
||||
}
|
||||
|
||||
// Clear the event queue and abort the instance thread
|
||||
//
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// Release events, timer, etc
|
||||
//
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
// Unload scripts and app domains
|
||||
// Must be done explicitly because they have infinite
|
||||
// lifetime
|
||||
//
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
string assembly = m_Assemblies[instance.AssetID];
|
||||
instance.SaveState(assembly);
|
||||
}
|
||||
|
||||
// Clear the event queue and abort the instance thread
|
||||
//
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// Release events, timer, etc
|
||||
//
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
// Unload scripts and app domains
|
||||
// Must be done explicitly because they have infinite
|
||||
// lifetime
|
||||
//
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
m_Scripts.Clear();
|
||||
m_PrimObjects.Clear();
|
||||
m_Assemblies.Clear();
|
||||
m_DomainScripts.Clear();
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts.Clear();
|
||||
lockScriptsForWrite(false);
|
||||
m_PrimObjects.Clear();
|
||||
m_Assemblies.Clear();
|
||||
m_DomainScripts.Clear();
|
||||
|
||||
lock (m_ScriptEngines)
|
||||
{
|
||||
m_ScriptEngines.Remove(this);
|
||||
@@ -358,22 +428,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
List<IScriptInstance> instances = new List<IScriptInstance>();
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
instances.Add(instance);
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
|
||||
foreach (IScriptInstance i in instances)
|
||||
{
|
||||
string assembly = String.Empty;
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
|
||||
if (!m_Assemblies.ContainsKey(i.AssetID))
|
||||
continue;
|
||||
assembly = m_Assemblies[i.AssetID];
|
||||
}
|
||||
|
||||
|
||||
i.SaveState(assembly);
|
||||
}
|
||||
@@ -701,113 +769,119 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_Scripts)
|
||||
|
||||
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
lockScriptsForRead(true);
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
(m_Scripts[itemID].AssetID != assetID))
|
||||
{
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
lockScriptsForRead(false);
|
||||
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
(m_Scripts[itemID].AssetID != assetID))
|
||||
UUID appDomain = assetID;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
appDomain = part.ParentGroup.RootPart.UUID;
|
||||
|
||||
if (!m_AppDomains.ContainsKey(appDomain))
|
||||
{
|
||||
UUID appDomain = assetID;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
appDomain = part.ParentGroup.RootPart.UUID;
|
||||
|
||||
if (!m_AppDomains.ContainsKey(appDomain))
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
AppDomainSetup appSetup = new AppDomainSetup();
|
||||
// appSetup.ApplicationBase = Path.Combine(
|
||||
// "ScriptEngines",
|
||||
// m_Scene.RegionInfo.RegionID.ToString());
|
||||
AppDomainSetup appSetup = new AppDomainSetup();
|
||||
// appSetup.ApplicationBase = Path.Combine(
|
||||
// "ScriptEngines",
|
||||
// m_Scene.RegionInfo.RegionID.ToString());
|
||||
|
||||
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
|
||||
Evidence evidence = new Evidence(baseEvidence);
|
||||
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
|
||||
Evidence evidence = new Evidence(baseEvidence);
|
||||
|
||||
AppDomain sandbox;
|
||||
if (m_AppDomainLoading)
|
||||
sandbox = AppDomain.CreateDomain(
|
||||
m_Scene.RegionInfo.RegionID.ToString(),
|
||||
evidence, appSetup);
|
||||
else
|
||||
sandbox = AppDomain.CurrentDomain;
|
||||
|
||||
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
||||
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
||||
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
|
||||
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
|
||||
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
|
||||
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
|
||||
//sandbox.SetAppDomainPolicy(sandboxPolicy);
|
||||
|
||||
m_AppDomains[appDomain] = sandbox;
|
||||
AppDomain sandbox;
|
||||
if (m_AppDomainLoading)
|
||||
sandbox = AppDomain.CreateDomain(
|
||||
m_Scene.RegionInfo.RegionID.ToString(),
|
||||
evidence, appSetup);
|
||||
else
|
||||
sandbox = AppDomain.CurrentDomain;
|
||||
|
||||
m_AppDomains[appDomain].AssemblyResolve +=
|
||||
new ResolveEventHandler(
|
||||
AssemblyResolver.OnAssemblyResolve);
|
||||
m_DomainScripts[appDomain] = new List<UUID>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
|
||||
m_ScriptErrorMessage += "Exception creating app domain:\n";
|
||||
m_ScriptFailCount++;
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
||||
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
||||
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
|
||||
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
|
||||
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
|
||||
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
|
||||
//sandbox.SetAppDomainPolicy(sandboxPolicy);
|
||||
|
||||
m_AppDomains[appDomain] = sandbox;
|
||||
|
||||
m_AppDomains[appDomain].AssemblyResolve +=
|
||||
new ResolveEventHandler(
|
||||
AssemblyResolver.OnAssemblyResolve);
|
||||
m_DomainScripts[appDomain] = new List<UUID>();
|
||||
}
|
||||
m_DomainScripts[appDomain].Add(itemID);
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
|
||||
m_ScriptErrorMessage += "Exception creating app domain:\n";
|
||||
m_ScriptFailCount++;
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
m_DomainScripts[appDomain].Add(itemID);
|
||||
|
||||
instance = new ScriptInstance(this, part,
|
||||
itemID, assetID, assembly,
|
||||
m_AppDomains[appDomain],
|
||||
part.ParentGroup.RootPart.Name,
|
||||
item.Name, startParam, postOnRez,
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat(
|
||||
instance = new ScriptInstance(this, part,
|
||||
itemID, assetID, assembly,
|
||||
m_AppDomains[appDomain],
|
||||
part.ParentGroup.RootPart.Name,
|
||||
item.Name, startParam, postOnRez,
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}.{5}",
|
||||
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID,
|
||||
part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
|
||||
if (presence != null)
|
||||
{
|
||||
ShowScriptSaveResponse(item.OwnerID,
|
||||
assetID, "Compile successful", true);
|
||||
}
|
||||
|
||||
instance.AppDomain = appDomain;
|
||||
instance.LineMap = linemap;
|
||||
|
||||
m_Scripts[itemID] = instance;
|
||||
}
|
||||
|
||||
lock (m_PrimObjects)
|
||||
if (presence != null)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
ShowScriptSaveResponse(item.OwnerID,
|
||||
assetID, "Compile successful", true);
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
instance.AppDomain = appDomain;
|
||||
instance.LineMap = linemap;
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts[itemID] = instance;
|
||||
lockScriptsForWrite(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
lockScriptsForRead(false);
|
||||
}
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -820,60 +894,65 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
m_CompileDict.Remove(itemID);
|
||||
}
|
||||
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
// Do we even have it?
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
{
|
||||
// Do we even have it?
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
return;
|
||||
lockScriptsForRead(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
IScriptInstance instance=m_Scripts[itemID];
|
||||
m_Scripts.Remove(itemID);
|
||||
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
IScriptInstance instance=m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts.Remove(itemID);
|
||||
lockScriptsForWrite(false);
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// bool objectRemoved = false;
|
||||
|
||||
lock (m_PrimObjects)
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// objectRemoved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
CleanAssemblies();
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
CleanAssemblies();
|
||||
|
||||
|
||||
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
|
||||
if (handlerScriptRemoved != null)
|
||||
handlerScriptRemoved(itemID);
|
||||
@@ -1125,12 +1204,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private IScriptInstance GetInstance(UUID itemID)
|
||||
{
|
||||
IScriptInstance instance;
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
{
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
return null;
|
||||
instance = m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
return null;
|
||||
}
|
||||
instance = m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -1154,6 +1235,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
return false;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ApiResetScript(UUID itemID)
|
||||
{
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
@@ -1205,6 +1287,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void SetState(UUID itemID, string newState)
|
||||
{
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
@@ -1225,11 +1308,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
{
|
||||
List<IScriptInstance> instances = new List<IScriptInstance>();
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
instances.Add(instance);
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
|
||||
foreach (IScriptInstance i in instances)
|
||||
{
|
||||
|
||||
@@ -108,6 +108,11 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
DoAgentDelete(request, responsedata, agentID, action, regionID);
|
||||
return responsedata;
|
||||
}
|
||||
else if (method.Equals("DELETECHILD"))
|
||||
{
|
||||
DoChildAgentDelete(request, responsedata, agentID, action, regionID);
|
||||
return responsedata;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method);
|
||||
@@ -330,6 +335,24 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
}
|
||||
}
|
||||
|
||||
protected void DoChildAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
|
||||
{
|
||||
m_log.Debug(" >>> DoChildAgentDelete action:" + action + "; RegionID:" + regionID);
|
||||
|
||||
GridRegion destination = new GridRegion();
|
||||
destination.RegionID = regionID;
|
||||
|
||||
if (action.Equals("release"))
|
||||
ReleaseAgent(regionID, id);
|
||||
else
|
||||
m_SimulationService.CloseChildAgent(destination, id);
|
||||
|
||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||
responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
|
||||
|
||||
m_log.Debug("[AGENT HANDLER]: Child Agent Released/Deleted.");
|
||||
}
|
||||
|
||||
protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
|
||||
{
|
||||
m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);
|
||||
|
||||
@@ -144,7 +144,10 @@ namespace OpenSim.Services.AssetService
|
||||
public string Store(AssetBase asset)
|
||||
{
|
||||
//m_log.DebugFormat("[ASSET SERVICE]: Store asset {0} {1}", asset.Name, asset.ID);
|
||||
m_Database.StoreAsset(asset);
|
||||
if (!m_Database.StoreAsset(asset))
|
||||
{
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
return asset.ID;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Timers;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
@@ -48,7 +49,9 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
private string m_ServerURI = String.Empty;
|
||||
private IImprovedAssetCache m_Cache = null;
|
||||
|
||||
private int m_retryCounter;
|
||||
private Dictionary<int, List<AssetBase>> m_retryQueue = new Dictionary<int, List<AssetBase>>();
|
||||
private Timer m_retryTimer;
|
||||
public AssetServicesConnector()
|
||||
{
|
||||
}
|
||||
@@ -85,6 +88,55 @@ namespace OpenSim.Services.Connectors
|
||||
MainConsole.Instance.Commands.AddCommand("asset", false, "dump asset",
|
||||
"dump asset <id> <file>",
|
||||
"dump one cached asset", HandleDumpAsset);
|
||||
|
||||
m_retryTimer = new Timer();
|
||||
m_retryTimer.Elapsed += new ElapsedEventHandler(retryCheck);
|
||||
m_retryTimer.Interval = 60000;
|
||||
}
|
||||
|
||||
protected void retryCheck(object source, ElapsedEventArgs e)
|
||||
{
|
||||
m_retryCounter++;
|
||||
if (m_retryCounter > 60) m_retryCounter -= 60;
|
||||
List<int> keys = new List<int>();
|
||||
foreach (int a in m_retryQueue.Keys)
|
||||
{
|
||||
keys.Add(a);
|
||||
}
|
||||
foreach (int a in keys)
|
||||
{
|
||||
//We exponentially fall back on frequency until we reach one attempt per hour
|
||||
//The net result is that we end up in the queue for roughly 24 hours..
|
||||
//24 hours worth of assets could be a lot, so the hope is that the region admin
|
||||
//will have gotten the asset connector back online quickly!
|
||||
|
||||
int timefactor = a ^ 2;
|
||||
if (timefactor > 60)
|
||||
{
|
||||
timefactor = 60;
|
||||
}
|
||||
|
||||
//First, find out if we care about this timefactor
|
||||
if (timefactor % a == 0)
|
||||
{
|
||||
//Yes, we do!
|
||||
List<AssetBase> retrylist = m_retryQueue[a];
|
||||
m_retryQueue.Remove(a);
|
||||
|
||||
foreach(AssetBase ass in retrylist)
|
||||
{
|
||||
Store(ass); //Store my ass. This function will put it back in the dictionary if it fails
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_retryQueue.Count == 0)
|
||||
{
|
||||
//It might only be one tick per minute, but I have
|
||||
//repented and abandoned my wasteful ways
|
||||
m_retryCounter = 0;
|
||||
m_retryTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
protected void SetCache(IImprovedAssetCache cache)
|
||||
@@ -99,8 +151,8 @@ namespace OpenSim.Services.Connectors
|
||||
AssetBase asset = null;
|
||||
if (m_Cache != null)
|
||||
asset = m_Cache.Get(id);
|
||||
|
||||
if (asset == null)
|
||||
|
||||
if (asset == null || asset.Data == null || asset.Data.Length == 0)
|
||||
{
|
||||
asset = SynchronousRestObjectRequester.
|
||||
MakeRequest<int, AssetBase>("GET", uri, 0);
|
||||
@@ -177,7 +229,7 @@ namespace OpenSim.Services.Connectors
|
||||
if (m_Cache != null)
|
||||
asset = m_Cache.Get(id);
|
||||
|
||||
if (asset == null)
|
||||
if (asset == null || asset.Data == null || asset.Data.Length == 0)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -204,11 +256,10 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
public string Store(AssetBase asset)
|
||||
{
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
if (asset.Temporary || asset.Local)
|
||||
{
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
|
||||
return asset.ID;
|
||||
}
|
||||
|
||||
@@ -218,24 +269,57 @@ namespace OpenSim.Services.Connectors
|
||||
try
|
||||
{
|
||||
newID = SynchronousRestObjectRequester.
|
||||
MakeRequest<AssetBase, string>("POST", uri, asset);
|
||||
MakeRequest<AssetBase, string>("POST", uri, asset, 25);
|
||||
if (newID == null || newID == "")
|
||||
{
|
||||
newID = UUID.Zero.ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1}", asset.ID, e.Message);
|
||||
newID = UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
if (newID != String.Empty)
|
||||
if (newID == UUID.Zero.ToString())
|
||||
{
|
||||
// Placing this here, so that this work with old asset servers that don't send any reply back
|
||||
// SynchronousRestObjectRequester returns somethins that is not an empty string
|
||||
if (newID != null)
|
||||
asset.ID = newID;
|
||||
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
//The asset upload failed, put it in a queue for later
|
||||
asset.UploadAttempts++;
|
||||
if (asset.UploadAttempts > 30)
|
||||
{
|
||||
//By this stage we've been in the queue for a good few hours;
|
||||
//We're going to drop the asset.
|
||||
m_log.ErrorFormat("[Assets] Dropping asset {0} - Upload has been in the queue for too long.", asset.ID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!m_retryQueue.ContainsKey(asset.UploadAttempts))
|
||||
{
|
||||
m_retryQueue.Add(asset.UploadAttempts, new List<AssetBase>());
|
||||
}
|
||||
List<AssetBase> m_queue = m_retryQueue[asset.UploadAttempts];
|
||||
m_queue.Add(asset);
|
||||
m_log.WarnFormat("[Assets] Upload failed: {0} - Requeuing asset for another run.", asset.ID.ToString());
|
||||
m_retryTimer.Start();
|
||||
}
|
||||
}
|
||||
return newID;
|
||||
else
|
||||
{
|
||||
if (asset.UploadAttempts > 0)
|
||||
{
|
||||
m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString());
|
||||
}
|
||||
if (newID != String.Empty)
|
||||
{
|
||||
// Placing this here, so that this work with old asset servers that don't send any reply back
|
||||
// SynchronousRestObjectRequester returns somethins that is not an empty string
|
||||
if (newID != null)
|
||||
asset.ID = newID;
|
||||
|
||||
if (m_Cache != null)
|
||||
m_Cache.Cache(asset);
|
||||
}
|
||||
}
|
||||
return asset.ID;
|
||||
}
|
||||
|
||||
public bool UpdateContent(string id, byte[] data)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user