Compare commits
898 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2d7f3e731 | ||
|
|
a32b0ce0ae | ||
|
|
042eb80a62 | ||
|
|
df9521caf3 | ||
|
|
7aac4d650f | ||
|
|
24577876be | ||
|
|
ac581b532e | ||
|
|
fa393cb13a | ||
|
|
d00a954d35 | ||
|
|
a5a60df687 | ||
|
|
af60b8ac16 | ||
|
|
1582e05ac7 | ||
|
|
48c52d6e48 | ||
|
|
fb14390fb0 | ||
|
|
9fba4b66bb | ||
|
|
5e8c3f8325 | ||
|
|
7fead01786 | ||
|
|
d0a22fb359 | ||
|
|
24b9a2885f | ||
|
|
c2e5d1d203 | ||
|
|
383ee0d647 | ||
|
|
d98d5ee6be | ||
|
|
1ead2ed5ee | ||
|
|
912bfba20c | ||
|
|
eb5c508f8b | ||
|
|
f0bad66d41 | ||
|
|
0f9eebdfb1 | ||
|
|
bef6fa37b9 | ||
|
|
32ccc19a62 | ||
|
|
f20dc512e8 | ||
|
|
1f052520ae | ||
|
|
680e801bf2 | ||
|
|
603b3a1606 | ||
|
|
b0795bcfef | ||
|
|
52f49b2a78 | ||
|
|
ca2a4bbded | ||
|
|
321e1148da | ||
|
|
6cb50c49b5 | ||
|
|
1cde77293e | ||
|
|
a1f2be5e69 | ||
|
|
f9b5f23383 | ||
|
|
12dd97c9f8 | ||
|
|
0794c6a941 | ||
|
|
aa54e8d95e | ||
|
|
b771965f28 | ||
|
|
acb1590cf0 | ||
|
|
d2b3d45d76 | ||
|
|
50ac61e17f | ||
|
|
19ab4c9508 | ||
|
|
8d3a73d126 | ||
|
|
a6048518b7 | ||
|
|
4c5788c4c0 | ||
|
|
68e4b1115a | ||
|
|
71f2cec1bd | ||
|
|
4900d39b7d | ||
|
|
478d835392 | ||
|
|
7bac069976 | ||
|
|
cabbd187e7 | ||
|
|
97f8175090 | ||
|
|
413b0525db | ||
|
|
19debab060 | ||
|
|
b017d985ab | ||
|
|
b58a47c373 | ||
|
|
00cc42a607 | ||
|
|
bcb3b57f8d | ||
|
|
4f80d75bf3 | ||
|
|
047a4764f2 | ||
|
|
e69efdd4ce | ||
|
|
8fd3f6cf7f | ||
|
|
c554de7501 | ||
|
|
fa11ac8c85 | ||
|
|
7477d7a036 | ||
|
|
a783f048a3 | ||
|
|
f9f776e407 | ||
|
|
330343505c | ||
|
|
26387252f5 | ||
|
|
e941da205b | ||
|
|
03da22378e | ||
|
|
0d4086e602 | ||
|
|
52e2360e91 | ||
|
|
5559422d32 | ||
|
|
c48be64d9a | ||
|
|
3ce335c6f8 | ||
|
|
a636af13e7 | ||
|
|
696c2c429b | ||
|
|
42613ec536 | ||
|
|
5da272d042 | ||
|
|
23d1f0978e | ||
|
|
a390541e1c | ||
|
|
0a004f8c44 | ||
|
|
c5c6627adb | ||
|
|
d7fe9f7b44 | ||
|
|
7368992ee9 | ||
|
|
d8f9b98c4a | ||
|
|
8bdbcda2b7 | ||
|
|
05520d676c | ||
|
|
0eda6714f3 | ||
|
|
85fd2def9c | ||
|
|
8689cdd4dc | ||
|
|
663e25fd3a | ||
|
|
0871d20adb | ||
|
|
cb3b124df9 | ||
|
|
4a33210771 | ||
|
|
a48c493210 | ||
|
|
463fbb4990 | ||
|
|
c8f09f7fcb | ||
|
|
cd9506e842 | ||
|
|
6076eb5558 | ||
|
|
f1c51c8bb4 | ||
|
|
b38d69287a | ||
|
|
0020dbee23 | ||
|
|
5ff9db7388 | ||
|
|
d57bfec702 | ||
|
|
757929012e | ||
|
|
164719119b | ||
|
|
e12993ed22 | ||
|
|
d9ae837063 | ||
|
|
e3cea888fb | ||
|
|
ae99c1393d | ||
|
|
2221517935 | ||
|
|
1d1da5069c | ||
|
|
6e3c79f31e | ||
|
|
f04d51378f | ||
|
|
e3184753a6 | ||
|
|
d2d1c63b17 | ||
|
|
ecfea5fa69 | ||
|
|
8f2986bc6a | ||
|
|
16e90809a9 | ||
|
|
d2d56494b2 | ||
|
|
763dc8bb76 | ||
|
|
b860c8021e | ||
|
|
d5f497478a | ||
|
|
5f94b98cb2 | ||
|
|
dd2d9a68a7 | ||
|
|
3302e8ddc4 | ||
|
|
f9280374d2 | ||
|
|
7a9e246ccd | ||
|
|
7871dd606e | ||
|
|
516ec4acd0 | ||
|
|
83aec1ec94 | ||
|
|
7ebabf185e | ||
|
|
ce8b9b4181 | ||
|
|
fb89d0ff4e | ||
|
|
d4022becc3 | ||
|
|
f63a4c8f2f | ||
|
|
c72c84b455 | ||
|
|
4ccc141764 | ||
|
|
c0b8cbd85b | ||
|
|
dcf7973c9b | ||
|
|
686837d9ed | ||
|
|
fd66ee57f3 | ||
|
|
191bee2ed0 | ||
|
|
54da64acac | ||
|
|
c263fc54ac | ||
|
|
c088397ec7 | ||
|
|
fabe2206db | ||
|
|
17412389f3 | ||
|
|
ef6565470f | ||
|
|
d52fb4d2e9 | ||
|
|
22371ac527 | ||
|
|
c41d418380 | ||
|
|
859e3252be | ||
|
|
d1040c9ff9 | ||
|
|
e06b7ee368 | ||
|
|
85f454e3ae | ||
|
|
9bf6179d24 | ||
|
|
236c0f8e8b | ||
|
|
2e5f200b3b | ||
|
|
3f91805afb | ||
|
|
8d2b4b7b48 | ||
|
|
0dd2496a56 | ||
|
|
50d56c54a3 | ||
|
|
ddfff55cc7 | ||
|
|
0b74662ce2 | ||
|
|
d665f0ae66 | ||
|
|
bebbe407ee | ||
|
|
0c445239a6 | ||
|
|
d1f94b5d58 | ||
|
|
cbb3a8ab94 | ||
|
|
af13c80d68 | ||
|
|
c5891c14c7 | ||
|
|
7270cd0ade | ||
|
|
8c2e1c6c29 | ||
|
|
8c26c8bbc6 | ||
|
|
84227fd558 | ||
|
|
7ab103c96f | ||
|
|
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 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
.project
|
||||
.settings
|
||||
.gitignore
|
||||
*.csproj
|
||||
*.csproj.user
|
||||
*.build
|
||||
@@ -10,6 +11,7 @@
|
||||
*.pidb
|
||||
*.dll.build
|
||||
*.dll
|
||||
*.log
|
||||
*.VisualState.xml
|
||||
*/*/obj
|
||||
*/*/*/obj
|
||||
@@ -23,6 +25,7 @@
|
||||
*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/*/bin
|
||||
addon-modules/
|
||||
bin/Debug/*.dll
|
||||
bin/*.dll.mdb
|
||||
bin/*.db
|
||||
|
||||
@@ -126,6 +126,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
|
||||
availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
|
||||
availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
|
||||
availableMethods["admin_dialog"] = XmlRpcDialogMethod;
|
||||
availableMethods["admin_restart"] = XmlRpcRestartMethod;
|
||||
availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
|
||||
// User management
|
||||
@@ -215,9 +216,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
if (!m_application.SceneManager.TryGetScene(regionID, out rebootedScene))
|
||||
throw new Exception("region not found");
|
||||
|
||||
int timeout = 30000;
|
||||
string message;
|
||||
|
||||
if (requestData.ContainsKey("restart")
|
||||
&& ((string)requestData["restart"] == "delayed")
|
||||
&& requestData.ContainsKey("milliseconds"))
|
||||
{
|
||||
timeout = Int32.Parse(requestData["milliseconds"].ToString());
|
||||
|
||||
if (timeout < 15000)
|
||||
{
|
||||
//It must be at least 15 seconds or we'll cancel the reboot request
|
||||
timeout = 15000;
|
||||
}
|
||||
|
||||
message
|
||||
= "Region is restarting in " + ((int)(timeout / 1000)).ToString()
|
||||
+ " second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Region is restarting in 30 second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string)requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
responseData["rebooting"] = true;
|
||||
response.Value = responseData;
|
||||
rebootedScene.Restart(30);
|
||||
rebootedScene.Restart(timeout / 1000,false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -280,6 +331,53 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
public XmlRpcResponse XmlRpcDialogMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable responseData = new Hashtable();
|
||||
|
||||
m_log.Info("[RADMIN]: Dialog request started");
|
||||
|
||||
try
|
||||
{
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
CheckStringParameters(request, new string[] { "password", "from", "message" });
|
||||
|
||||
if (m_requiredPassword != String.Empty &&
|
||||
(!requestData.Contains("password") || (string)requestData["password"] != m_requiredPassword))
|
||||
throw new Exception("wrong password");
|
||||
|
||||
string message = (string)requestData["message"];
|
||||
string fromuuid = (string)requestData["from"];
|
||||
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
|
||||
|
||||
responseData["accepted"] = true;
|
||||
responseData["success"] = true;
|
||||
response.Value = responseData;
|
||||
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message);
|
||||
m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
|
||||
|
||||
responseData["accepted"] = false;
|
||||
responseData["success"] = false;
|
||||
responseData["error"] = e.Message;
|
||||
response.Value = responseData;
|
||||
}
|
||||
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
@@ -387,13 +485,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
message = "Region is going down now.";
|
||||
}
|
||||
|
||||
m_application.SceneManager.ForEachScene(
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string) requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Perform shutdown
|
||||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||
|
||||
@@ -593,6 +593,7 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
public event DisconnectUser OnDisconnectUser;
|
||||
public event RequestAvatarProperties OnRequestAvatarProperties;
|
||||
public event SetAlwaysRun OnSetAlwaysRun;
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
|
||||
public event DeRezObject OnDeRezObject;
|
||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||
@@ -819,6 +820,10 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
//throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
//throw new System.NotImplementedException();
|
||||
@@ -834,11 +839,19 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.Info("[MXP ClientStack] Close Called");
|
||||
|
||||
// Tell the client to go
|
||||
SendLogoutPacket();
|
||||
if (sendStop == true)
|
||||
{
|
||||
SendLogoutPacket();
|
||||
}
|
||||
|
||||
// Let MXPPacketServer clean it up
|
||||
if (Session.SessionState != SessionState.Disconnected)
|
||||
|
||||
@@ -253,6 +253,7 @@ namespace OpenSim.Client.Sirikata.ClientStack
|
||||
public event AddNewPrim OnAddPrim;
|
||||
public event FetchInventory OnAgentDataUpdateRequest;
|
||||
public event TeleportLocationRequest OnSetStartLocationRequest;
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event RequestGodlikePowers OnRequestGodlikePowers;
|
||||
public event GodKickUser OnGodKickUser;
|
||||
public event ObjectDuplicate OnObjectDuplicate;
|
||||
@@ -439,12 +440,21 @@ namespace OpenSim.Client.Sirikata.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -290,6 +290,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
public event GenericCall2 OnStopMovement = delegate { };
|
||||
public event Action<UUID> OnRemoveAvatar = delegate { };
|
||||
public event ObjectPermissions OnObjectPermissions = delegate { };
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy = delegate { };
|
||||
public event CreateNewInventoryItem OnCreateNewInventoryItem = delegate { };
|
||||
public event LinkInventoryItem OnLinkInventoryItem = delegate { };
|
||||
public event CreateInventoryFolder OnCreateNewInventoryFolder = delegate { };
|
||||
@@ -445,12 +446,21 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications
|
||||
_request = (HttpWebRequest) WebRequest.Create(buildUri());
|
||||
_request.KeepAlive = false;
|
||||
_request.ContentType = "application/xml";
|
||||
_request.Timeout = 900000;
|
||||
_request.Timeout = 30000;
|
||||
_request.Method = RequestMethod;
|
||||
_asyncException = null;
|
||||
_request.ContentLength = src.Length;
|
||||
|
||||
@@ -264,6 +264,9 @@ namespace OpenSim.Framework
|
||||
public delegate void MoveInventoryItem(
|
||||
IClientAPI remoteClient, List<InventoryItemBase> items);
|
||||
|
||||
public delegate void MoveItemsAndLeaveCopy(
|
||||
IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
|
||||
|
||||
public delegate void RemoveInventoryItem(
|
||||
IClientAPI remoteClient, List<UUID> itemIDs);
|
||||
|
||||
@@ -772,6 +775,7 @@ namespace OpenSim.Framework
|
||||
event RequestTaskInventory OnRequestTaskInventory;
|
||||
event UpdateInventoryItem OnUpdateInventoryItem;
|
||||
event CopyInventoryItem OnCopyInventoryItem;
|
||||
event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
event MoveInventoryItem OnMoveInventoryItem;
|
||||
event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||
event RemoveInventoryItem OnRemoveInventoryItem;
|
||||
@@ -940,8 +944,10 @@ namespace OpenSim.Framework
|
||||
void SetDebugPacketLevel(int newDebug);
|
||||
|
||||
void InPacket(object NewPack);
|
||||
void ProcessPendingPackets();
|
||||
void ProcessInPacket(Packet NewPack);
|
||||
void Close();
|
||||
void Close(bool sendStop);
|
||||
void Kick(string message);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1208,7 +1208,7 @@ namespace OpenSim.Framework
|
||||
prim.Textures = this.Textures;
|
||||
|
||||
prim.Properties = new Primitive.ObjectProperties();
|
||||
prim.Properties.Name = "Primitive";
|
||||
prim.Properties.Name = "Object";
|
||||
prim.Properties.Description = "";
|
||||
prim.Properties.CreatorID = UUID.Zero;
|
||||
prim.Properties.GroupID = UUID.Zero;
|
||||
|
||||
@@ -40,6 +40,7 @@ using OpenSim.Framework.Console;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class RegionLightShareData : ICloneable
|
||||
{
|
||||
public UUID regionID = UUID.Zero;
|
||||
|
||||
@@ -48,6 +48,9 @@ namespace OpenSim.Framework.RegionLoader.Web
|
||||
|
||||
public RegionInfo[] LoadRegions()
|
||||
{
|
||||
int tries = 3;
|
||||
int wait = 2000;
|
||||
|
||||
if (m_configSource == null)
|
||||
{
|
||||
m_log.Error("[WEBLOADER]: Unable to load configuration source!");
|
||||
@@ -64,35 +67,47 @@ namespace OpenSim.Framework.RegionLoader.Web
|
||||
}
|
||||
else
|
||||
{
|
||||
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
|
||||
webRequest.Timeout = 30000; //30 Second Timeout
|
||||
m_log.Debug("[WEBLOADER]: Sending Download Request...");
|
||||
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
|
||||
m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server...");
|
||||
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
|
||||
string xmlSource = String.Empty;
|
||||
string tempStr = reader.ReadLine();
|
||||
while (tempStr != null)
|
||||
while (tries > 0)
|
||||
{
|
||||
xmlSource = xmlSource + tempStr;
|
||||
tempStr = reader.ReadLine();
|
||||
}
|
||||
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
|
||||
xmlSource.Length);
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
xmlDoc.LoadXml(xmlSource);
|
||||
if (xmlDoc.FirstChild.Name == "Regions")
|
||||
{
|
||||
RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count];
|
||||
int i;
|
||||
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
|
||||
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
|
||||
webRequest.Timeout = 30000; //30 Second Timeout
|
||||
m_log.Debug("[WEBLOADER]: Sending Download Request...");
|
||||
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
|
||||
m_log.Debug("[WEBLOADER]: Downloading Region Information From Remote Server...");
|
||||
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
|
||||
string xmlSource = String.Empty;
|
||||
string tempStr = reader.ReadLine();
|
||||
while (tempStr != null)
|
||||
{
|
||||
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
|
||||
regionInfos[i] =
|
||||
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
|
||||
xmlSource = xmlSource + tempStr;
|
||||
tempStr = reader.ReadLine();
|
||||
}
|
||||
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
|
||||
xmlSource.Length);
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
xmlDoc.LoadXml(xmlSource);
|
||||
if (xmlDoc.FirstChild.Name == "Regions")
|
||||
{
|
||||
RegionInfo[] regionInfos = new RegionInfo[xmlDoc.FirstChild.ChildNodes.Count];
|
||||
int i;
|
||||
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
|
||||
{
|
||||
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
|
||||
regionInfos[i] =
|
||||
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
|
||||
}
|
||||
|
||||
if (i > 0)
|
||||
return regionInfos;
|
||||
}
|
||||
|
||||
return regionInfos;
|
||||
m_log.Debug("[WEBLOADER]: Request yielded no regions.");
|
||||
tries--;
|
||||
if (tries > 0)
|
||||
{
|
||||
m_log.Debug("[WEBLOADER]: Retrying");
|
||||
System.Threading.Thread.Sleep(wait);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -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,13 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -45,6 +49,124 @@ namespace OpenSim.Framework
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Thread LockedByThread;
|
||||
/// <value>
|
||||
/// An advanced lock for inventory data
|
||||
/// </value>
|
||||
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
/// <summary>
|
||||
/// Are we readlocked by the calling thread?
|
||||
/// </summary>
|
||||
public bool IsReadLockedByMe()
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for reading (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
|
||||
{
|
||||
if (!LockedByThread.IsAlive)
|
||||
{
|
||||
//Locked by dead thread, reset.
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
try
|
||||
{
|
||||
StackTrace stackTrace = new StackTrace(); // get call stack
|
||||
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
|
||||
|
||||
// write call stack method names
|
||||
foreach (StackFrame stackFrame in stackFrames)
|
||||
{
|
||||
m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name
|
||||
}
|
||||
}
|
||||
catch
|
||||
{}
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_itemLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount>0)
|
||||
{
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for writing (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
//Enter a write lock, wait indefinately for one to open.
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
while (!m_itemLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
LockedByThread = Thread.CurrentThread;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
@@ -52,13 +174,12 @@ namespace OpenSim.Framework
|
||||
{
|
||||
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
||||
|
||||
lock (this)
|
||||
m_itemLock.EnterReadLock();
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
m_itemLock.ExitReadLock();
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenSim.Framework
|
||||
public ThreadWatchdogInfo(Thread thread)
|
||||
{
|
||||
Thread = thread;
|
||||
LastTick = Environment.TickCount & Int32.MaxValue;
|
||||
LastTick = Environment.TickCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Framework
|
||||
try
|
||||
{
|
||||
if (m_threads.TryGetValue(threadID, out threadInfo))
|
||||
threadInfo.LastTick = Environment.TickCount & Int32.MaxValue;
|
||||
threadInfo.LastTick = Environment.TickCount;
|
||||
else
|
||||
AddThread(new ThreadWatchdogInfo(Thread.CurrentThread));
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace OpenSim.Framework
|
||||
|
||||
lock (m_threads)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
int now = Environment.TickCount;
|
||||
|
||||
foreach (ThreadWatchdogInfo threadInfo in m_threads.Values)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -88,6 +88,10 @@ namespace OpenSim
|
||||
|
||||
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
|
||||
|
||||
private List<string> m_permsModules;
|
||||
|
||||
private bool m_securePermissionsLoading = true;
|
||||
|
||||
/// <value>
|
||||
/// The config information passed into the OpenSimulator region server.
|
||||
/// </value>
|
||||
@@ -185,6 +189,11 @@ namespace OpenSim
|
||||
CreatePIDFile(pidFile);
|
||||
|
||||
userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
|
||||
|
||||
m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
|
||||
|
||||
string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
|
||||
m_permsModules = new List<string>(permissionModules.Split(','));
|
||||
}
|
||||
|
||||
base.StartupSpecific();
|
||||
@@ -342,11 +351,50 @@ namespace OpenSim
|
||||
}
|
||||
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
|
||||
|
||||
if (m_securePermissionsLoading)
|
||||
{
|
||||
foreach (string s in m_permsModules)
|
||||
{
|
||||
if (!scene.RegionModules.ContainsKey(s))
|
||||
{
|
||||
bool found = false;
|
||||
foreach (IRegionModule m in modules)
|
||||
{
|
||||
if (m.Name == s)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
m_log.Fatal("[MODULES]: Required module " + s + " not found.");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scene.SetModuleInterfaces();
|
||||
// First Step of bootreport sequence
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.ColdStart(1,scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Loading prins", scene);
|
||||
}
|
||||
|
||||
// Prims have to be loaded after module configuration since some modules may be invoked during the load
|
||||
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Creating region texture", scene);
|
||||
}
|
||||
|
||||
// moved these here as the terrain texture has to be created after the modules are initialized
|
||||
// and has to happen before the region is registered with the grid.
|
||||
scene.CreateTerrainTexture();
|
||||
@@ -354,6 +402,10 @@ namespace OpenSim
|
||||
// TODO : Try setting resource for region xstats here on scene
|
||||
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
|
||||
}
|
||||
try
|
||||
{
|
||||
scene.RegisterRegionWithGrid();
|
||||
@@ -362,11 +414,20 @@ namespace OpenSim
|
||||
{
|
||||
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
|
||||
}
|
||||
// Carrying on now causes a lot of confusion down the
|
||||
// line - we need to get the user's attention
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration done", scene);
|
||||
}
|
||||
|
||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
|
||||
@@ -374,6 +435,11 @@ namespace OpenSim
|
||||
// scripting engines.
|
||||
scene.CreateScriptInstances();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("ScriptEngine started", scene);
|
||||
}
|
||||
|
||||
m_sceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
@@ -382,6 +448,10 @@ namespace OpenSim
|
||||
clientServer.Start();
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Initializing region modules", scene);
|
||||
}
|
||||
if (do_post_init)
|
||||
{
|
||||
foreach (IRegionModule module in modules)
|
||||
@@ -393,6 +463,12 @@ namespace OpenSim
|
||||
|
||||
mscene = scene;
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is operational", scene);
|
||||
scene.SnmpService.LinkUp(scene);
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
|
||||
return clientServer;
|
||||
@@ -401,6 +477,11 @@ namespace OpenSim
|
||||
private void ShutdownRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is shutting down", scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
IRegionModulesController controller;
|
||||
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public event RequestTaskInventory OnRequestTaskInventory;
|
||||
public event UpdateInventoryItem OnUpdateInventoryItem;
|
||||
public event CopyInventoryItem OnCopyInventoryItem;
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event MoveInventoryItem OnMoveInventoryItem;
|
||||
public event RemoveInventoryItem OnRemoveInventoryItem;
|
||||
public event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||
@@ -335,11 +336,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// protected HashSet<uint> m_attachmentsSent;
|
||||
|
||||
private int m_moneyBalance;
|
||||
private bool m_deliverPackets = true;
|
||||
private int m_animationSequenceNumber = 1;
|
||||
private bool m_SendLogoutPacketWhenClosing = true;
|
||||
private AgentUpdateArgs lastarg;
|
||||
private bool m_IsActive = true;
|
||||
private bool m_IsLoggingOut = false;
|
||||
private bool m_IsPresenceReady = false;
|
||||
|
||||
protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
|
||||
protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
|
||||
@@ -362,6 +365,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private Timer m_propertiesPacketTimer;
|
||||
private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
|
||||
private List<Packet> m_pendingPackets;
|
||||
|
||||
#endregion Class Members
|
||||
|
||||
@@ -377,6 +381,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_startpos; }
|
||||
set { m_startpos = value; }
|
||||
}
|
||||
public bool DeliverPackets
|
||||
{
|
||||
get { return m_deliverPackets; }
|
||||
set {
|
||||
m_deliverPackets = value;
|
||||
m_udpClient.m_deliverPackets = value;
|
||||
}
|
||||
}
|
||||
public UUID AgentId { get { return m_agentId; } }
|
||||
public UUID ActiveGroupId { get { return m_activeGroupID; } }
|
||||
public string ActiveGroupName { get { return m_activeGroupName; } }
|
||||
@@ -402,6 +414,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_IsActive; }
|
||||
set { m_IsActive = value; }
|
||||
}
|
||||
|
||||
public bool IsLoggingOut
|
||||
{
|
||||
get { return m_IsLoggingOut; }
|
||||
@@ -471,18 +484,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Client Methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[CLIENT]: Close has been called for {0} attached to scene {1}",
|
||||
Name, m_scene.RegionInfo.RegionName);
|
||||
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
if (sendStop)
|
||||
{
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
IsActive = false;
|
||||
|
||||
@@ -762,7 +787,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.ChatData.OwnerID = fromAgentID;
|
||||
reply.ChatData.SourceID = fromAgentID;
|
||||
|
||||
OutPacket(reply, ThrottleOutPacketType.Task);
|
||||
OutPacket(reply, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1048,6 +1073,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public virtual void SendLayerData(float[] map)
|
||||
{
|
||||
Util.FireAndForget(DoSendLayerData, map);
|
||||
|
||||
// Send it sync, and async. It's not that much data
|
||||
// and it improves user experience just so much!
|
||||
DoSendLayerData(map);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1060,16 +1089,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
try
|
||||
{
|
||||
//for (int y = 0; y < 16; y++)
|
||||
//{
|
||||
// for (int x = 0; x < 16; x++)
|
||||
// {
|
||||
// SendLayerData(x, y, map);
|
||||
// }
|
||||
//}
|
||||
|
||||
// Send LayerData in a spiral pattern. Fun!
|
||||
SendLayerTopRight(map, 0, 0, 15, 15);
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 0; x < 16; x+=4)
|
||||
{
|
||||
SendLayerPacket(x, y, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1077,51 +1103,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row
|
||||
for (int i = x1; i <= x2; i++)
|
||||
SendLayerData(i, y1, map);
|
||||
|
||||
// Column
|
||||
for (int j = y1 + 1; j <= y2; j++)
|
||||
SendLayerData(x2, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
|
||||
}
|
||||
|
||||
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row in reverse
|
||||
for (int i = x2; i >= x1; i--)
|
||||
SendLayerData(i, y2, map);
|
||||
|
||||
// Column in reverse
|
||||
for (int j = y2 - 1; j >= y1; j--)
|
||||
SendLayerData(x1, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
|
||||
/// </summary>
|
||||
/// <param name="map">heightmap</param>
|
||||
/// <param name="px">X coordinate for patches 0..12</param>
|
||||
/// <param name="py">Y coordinate for patches 0..15</param>
|
||||
// private void SendLayerPacket(float[] map, int y, int x)
|
||||
// {
|
||||
// int[] patches = new int[4];
|
||||
// patches[0] = x + 0 + y * 16;
|
||||
// patches[1] = x + 1 + y * 16;
|
||||
// patches[2] = x + 2 + y * 16;
|
||||
// patches[3] = x + 3 + y * 16;
|
||||
private void SendLayerPacket(int x, int y, float[] map)
|
||||
{
|
||||
int[] patches = new int[4];
|
||||
patches[0] = x + 0 + y * 16;
|
||||
patches[1] = x + 1 + y * 16;
|
||||
patches[2] = x + 2 + y * 16;
|
||||
patches[3] = x + 3 + y * 16;
|
||||
|
||||
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
|
||||
// OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
// }
|
||||
float[] heightmap = (map.Length == 65536) ?
|
||||
map :
|
||||
LLHeightFieldMoronize(map);
|
||||
|
||||
try
|
||||
{
|
||||
Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
catch
|
||||
{
|
||||
for (int px = x ; px < x + 4 ; px++)
|
||||
SendLayerData(px, y, map);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a specified patch to a client
|
||||
@@ -1141,7 +1151,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
layerpack.Header.Reliable = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Task);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -2213,6 +2223,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(sound, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTransferAbort(TransferRequestPacket transferRequest)
|
||||
{
|
||||
TransferAbortPacket abort = (TransferAbortPacket)PacketPool.Instance.GetPacket(PacketType.TransferAbort);
|
||||
abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID;
|
||||
abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType;
|
||||
m_log.Debug("[Assets] Aborting transfer; asset request failed");
|
||||
OutPacket(abort, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
|
||||
{
|
||||
SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger);
|
||||
@@ -3474,6 +3493,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// </summary>
|
||||
public void SendPrimUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
|
||||
{
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart e = (SceneObjectPart)entity;
|
||||
SceneObjectGroup g = e.ParentGroup;
|
||||
if (g.RootPart.Shape.State > 30) // HUD
|
||||
if (g.OwnerID != AgentId)
|
||||
return; // Don't send updates for other people's HUDs
|
||||
}
|
||||
|
||||
double priority = m_prioritizer.GetUpdatePriority(this, entity);
|
||||
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
@@ -3494,9 +3522,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
EntityUpdate update;
|
||||
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
|
||||
{
|
||||
// If we have sent a kill packet for this object
|
||||
// drop any updates on the floor
|
||||
if (update.Entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
|
||||
continue;
|
||||
|
||||
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
||||
{
|
||||
@@ -3930,6 +3962,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_propertiesPacketTimer.Stop();
|
||||
|
||||
if (m_propertiesBlocks.Count == 0)
|
||||
return;
|
||||
|
||||
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
|
||||
|
||||
int index = 0;
|
||||
@@ -4829,6 +4864,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
|
||||
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
|
||||
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
|
||||
AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
|
||||
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
|
||||
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
|
||||
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
|
||||
@@ -4928,6 +4964,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
|
||||
(x.ControlFlags != lastarg.ControlFlags) ||
|
||||
(x.ControlFlags != 0) ||
|
||||
(x.Far != lastarg.Far) ||
|
||||
(x.Flags != lastarg.Flags) ||
|
||||
(x.State != lastarg.State) ||
|
||||
@@ -5299,7 +5336,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
args.Channel = ch;
|
||||
args.From = String.Empty;
|
||||
args.Message = Utils.BytesToString(msg);
|
||||
args.Type = ChatTypeEnum.Shout;
|
||||
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
|
||||
args.Position = new Vector3();
|
||||
args.Scene = Scene;
|
||||
args.Sender = this;
|
||||
@@ -9337,6 +9374,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
|
||||
|
||||
#region Packet Session and User Check
|
||||
if (m_checkPackets)
|
||||
{
|
||||
if (packet.AgentData.SessionID != SessionId ||
|
||||
packet.AgentData.AgentID != AgentId)
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null;
|
||||
List<InventoryItemBase> items = new List<InventoryItemBase>();
|
||||
foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
|
||||
{
|
||||
InventoryItemBase b = new InventoryItemBase();
|
||||
b.ID = n.OldItemID;
|
||||
b.Folder = n.OldFolderID;
|
||||
items.Add(b);
|
||||
}
|
||||
|
||||
handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
|
||||
if (handlerMoveItemsAndLeaveCopy != null)
|
||||
{
|
||||
handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
@@ -11179,19 +11247,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This processes packets which have accumulated while the presence was still in the process of initialising.
|
||||
/// </summary>
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
m_IsPresenceReady = true;
|
||||
if (m_pendingPackets == null)
|
||||
return;
|
||||
foreach (Packet p in m_pendingPackets)
|
||||
{
|
||||
ProcessInPacket(p);
|
||||
}
|
||||
m_pendingPackets.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
|
||||
/// </summary>
|
||||
/// <param name="Pack">OpenMetaverse.packet</param>
|
||||
public void ProcessInPacket(Packet Pack)
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
if (!m_IsPresenceReady)
|
||||
{
|
||||
if (m_pendingPackets == null)
|
||||
{
|
||||
m_pendingPackets = new List<Packet>();
|
||||
}
|
||||
m_pendingPackets.Add(Pack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
}
|
||||
}
|
||||
|
||||
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
|
||||
@@ -11428,7 +11522,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
|
||||
|
||||
|
||||
//Note, the bool returned from the below function is useless since it is always false.
|
||||
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -149,6 +149,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private int m_defaultRTO = 3000;
|
||||
private int m_maxRTO = 60000;
|
||||
public bool m_deliverPackets = true;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
@@ -389,6 +390,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (category >= 0 && category < m_packetOutboxes.Length)
|
||||
{
|
||||
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
|
||||
|
||||
if (m_deliverPackets == false)
|
||||
{
|
||||
queue.Enqueue(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
TokenBucket bucket = m_throttleCategories[category];
|
||||
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
@@ -419,6 +427,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <returns>True if any packets were sent, otherwise false</returns>
|
||||
public bool DequeueOutgoing()
|
||||
{
|
||||
if (m_deliverPackets == false) return false;
|
||||
|
||||
OutgoingPacket packet;
|
||||
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue;
|
||||
TokenBucket bucket;
|
||||
|
||||
@@ -904,7 +904,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
client.DisableFacelights = m_disableFacelights;
|
||||
|
||||
// Start the IClientAPI
|
||||
client.Start();
|
||||
// Spin it off so that it doesn't clog up the LLUDPServer
|
||||
|
||||
//First, and very importantly:
|
||||
//
|
||||
//Set our DeliverPackets flag in the client to *false*
|
||||
//this will prevent us from missing important messages
|
||||
//before the modules are bound
|
||||
client.DeliverPackets = false;
|
||||
client.DisableFacelights = m_disableFacelights;
|
||||
|
||||
Util.FireAndForget(
|
||||
delegate
|
||||
{
|
||||
try
|
||||
{
|
||||
client.Start();
|
||||
}
|
||||
finally
|
||||
{
|
||||
//Now, release the hounds. er, packets.
|
||||
client.DeliverPackets = true;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -920,7 +943,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_scene.TryGetClient(udpClient.AgentID, out client))
|
||||
{
|
||||
client.IsLoggingOut = true;
|
||||
client.Close();
|
||||
client.Close(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,169 +1,184 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
/// <summary>
|
||||
/// Special collection that is optimized for tracking unacknowledged packets
|
||||
/// </summary>
|
||||
public sealed class UnackedPacketCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information about a pending acknowledgement
|
||||
/// </summary>
|
||||
private struct PendingAck
|
||||
{
|
||||
/// <summary>Sequence number of the packet to remove</summary>
|
||||
public uint SequenceNumber;
|
||||
/// <summary>Environment.TickCount value when the remove was queued.
|
||||
/// This is used to update round-trip times for packets</summary>
|
||||
public int RemoveTime;
|
||||
/// <summary>Whether or not this acknowledgement was attached to a
|
||||
/// resent packet. If so, round-trip time will not be calculated</summary>
|
||||
public bool FromResend;
|
||||
|
||||
public PendingAck(uint sequenceNumber, int currentTime, bool fromResend)
|
||||
{
|
||||
SequenceNumber = sequenceNumber;
|
||||
RemoveTime = currentTime;
|
||||
FromResend = fromResend;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Holds the actual unacked packet data, sorted by sequence number</summary>
|
||||
private Dictionary<uint, OutgoingPacket> m_packets = new Dictionary<uint, OutgoingPacket>();
|
||||
/// <summary>Holds packets that need to be added to the unacknowledged list</summary>
|
||||
private LocklessQueue<OutgoingPacket> m_pendingAdds = new LocklessQueue<OutgoingPacket>();
|
||||
/// <summary>Holds information about pending acknowledgements</summary>
|
||||
private LocklessQueue<PendingAck> m_pendingRemoves = new LocklessQueue<PendingAck>();
|
||||
|
||||
/// <summary>
|
||||
/// Add an unacked packet to the collection
|
||||
/// </summary>
|
||||
/// <param name="packet">Packet that is awaiting acknowledgement</param>
|
||||
/// <returns>True if the packet was successfully added, false if the
|
||||
/// packet already existed in the collection</returns>
|
||||
/// <remarks>This does not immediately add the ACK to the collection,
|
||||
/// it only queues it so it can be added in a thread-safe way later</remarks>
|
||||
public void Add(OutgoingPacket packet)
|
||||
{
|
||||
m_pendingAdds.Enqueue(packet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a packet as acknowledged
|
||||
/// </summary>
|
||||
/// <param name="sequenceNumber">Sequence number of the packet to
|
||||
/// acknowledge</param>
|
||||
/// <param name="currentTime">Current value of Environment.TickCount</param>
|
||||
/// <remarks>This does not immediately acknowledge the packet, it only
|
||||
/// queues the ack so it can be handled in a thread-safe way later</remarks>
|
||||
public void Remove(uint sequenceNumber, int currentTime, bool fromResend)
|
||||
{
|
||||
m_pendingRemoves.Enqueue(new PendingAck(sequenceNumber, currentTime, fromResend));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all of the packets with a TickCount older than
|
||||
/// the specified timeout
|
||||
/// </summary>
|
||||
/// <param name="timeoutMS">Number of ticks (milliseconds) before a
|
||||
/// packet is considered expired</param>
|
||||
/// <returns>A list of all expired packets according to the given
|
||||
/// expiration timeout</returns>
|
||||
/// <remarks>This function is not thread safe, and cannot be called
|
||||
/// multiple times concurrently</remarks>
|
||||
public List<OutgoingPacket> GetExpiredPackets(int timeoutMS)
|
||||
{
|
||||
ProcessQueues();
|
||||
|
||||
List<OutgoingPacket> expiredPackets = null;
|
||||
|
||||
if (m_packets.Count > 0)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
|
||||
foreach (OutgoingPacket packet in m_packets.Values)
|
||||
{
|
||||
// TickCount of zero means a packet is in the resend queue
|
||||
// but hasn't actually been sent over the wire yet
|
||||
if (packet.TickCount == 0)
|
||||
continue;
|
||||
|
||||
if (now - packet.TickCount >= timeoutMS)
|
||||
{
|
||||
if (expiredPackets == null)
|
||||
expiredPackets = new List<OutgoingPacket>();
|
||||
|
||||
// The TickCount will be set to the current time when the packet
|
||||
// is actually sent out again
|
||||
packet.TickCount = 0;
|
||||
|
||||
expiredPackets.Add(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return expiredPackets;
|
||||
}
|
||||
|
||||
private void ProcessQueues()
|
||||
{
|
||||
// Process all the pending adds
|
||||
OutgoingPacket pendingAdd;
|
||||
while (m_pendingAdds.Dequeue(out pendingAdd))
|
||||
m_packets[pendingAdd.SequenceNumber] = pendingAdd;
|
||||
|
||||
// Process all the pending removes, including updating statistics and round-trip times
|
||||
PendingAck pendingRemove;
|
||||
OutgoingPacket ackedPacket;
|
||||
while (m_pendingRemoves.Dequeue(out pendingRemove))
|
||||
{
|
||||
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
|
||||
{
|
||||
m_packets.Remove(pendingRemove.SequenceNumber);
|
||||
|
||||
// Update stats
|
||||
System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
|
||||
|
||||
if (!pendingRemove.FromResend)
|
||||
{
|
||||
// Calculate the round-trip time for this packet and its ACK
|
||||
int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
|
||||
if (rtt > 0)
|
||||
ackedPacket.Client.UpdateRoundTrip(rtt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
/// <summary>
|
||||
/// Special collection that is optimized for tracking unacknowledged packets
|
||||
/// </summary>
|
||||
public sealed class UnackedPacketCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information about a pending acknowledgement
|
||||
/// </summary>
|
||||
private struct PendingAck
|
||||
{
|
||||
/// <summary>Sequence number of the packet to remove</summary>
|
||||
public uint SequenceNumber;
|
||||
/// <summary>Environment.TickCount value when the remove was queued.
|
||||
/// This is used to update round-trip times for packets</summary>
|
||||
public int RemoveTime;
|
||||
/// <summary>Whether or not this acknowledgement was attached to a
|
||||
/// resent packet. If so, round-trip time will not be calculated</summary>
|
||||
public bool FromResend;
|
||||
|
||||
public PendingAck(uint sequenceNumber, int currentTime, bool fromResend)
|
||||
{
|
||||
SequenceNumber = sequenceNumber;
|
||||
RemoveTime = currentTime;
|
||||
FromResend = fromResend;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Holds the actual unacked packet data, sorted by sequence number</summary>
|
||||
private Dictionary<uint, OutgoingPacket> m_packets = new Dictionary<uint, OutgoingPacket>();
|
||||
/// <summary>Holds packets that need to be added to the unacknowledged list</summary>
|
||||
private LocklessQueue<OutgoingPacket> m_pendingAdds = new LocklessQueue<OutgoingPacket>();
|
||||
/// <summary>Holds information about pending acknowledgements</summary>
|
||||
private LocklessQueue<PendingAck> m_pendingRemoves = new LocklessQueue<PendingAck>();
|
||||
|
||||
/// <summary>
|
||||
/// Add an unacked packet to the collection
|
||||
/// </summary>
|
||||
/// <param name="packet">Packet that is awaiting acknowledgement</param>
|
||||
/// <returns>True if the packet was successfully added, false if the
|
||||
/// packet already existed in the collection</returns>
|
||||
/// <remarks>This does not immediately add the ACK to the collection,
|
||||
/// it only queues it so it can be added in a thread-safe way later</remarks>
|
||||
public void Add(OutgoingPacket packet)
|
||||
{
|
||||
m_pendingAdds.Enqueue(packet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Marks a packet as acknowledged
|
||||
/// </summary>
|
||||
/// <param name="sequenceNumber">Sequence number of the packet to
|
||||
/// acknowledge</param>
|
||||
/// <param name="currentTime">Current value of Environment.TickCount</param>
|
||||
/// <remarks>This does not immediately acknowledge the packet, it only
|
||||
/// queues the ack so it can be handled in a thread-safe way later</remarks>
|
||||
public void Remove(uint sequenceNumber, int currentTime, bool fromResend)
|
||||
{
|
||||
m_pendingRemoves.Enqueue(new PendingAck(sequenceNumber, currentTime, fromResend));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of all of the packets with a TickCount older than
|
||||
/// the specified timeout
|
||||
/// </summary>
|
||||
/// <param name="timeoutMS">Number of ticks (milliseconds) before a
|
||||
/// packet is considered expired</param>
|
||||
/// <returns>A list of all expired packets according to the given
|
||||
/// expiration timeout</returns>
|
||||
/// <remarks>This function is not thread safe, and cannot be called
|
||||
/// multiple times concurrently</remarks>
|
||||
public List<OutgoingPacket> GetExpiredPackets(int timeoutMS)
|
||||
{
|
||||
ProcessQueues();
|
||||
|
||||
List<OutgoingPacket> expiredPackets = null;
|
||||
|
||||
if (m_packets.Count > 0)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
|
||||
foreach (OutgoingPacket packet in m_packets.Values)
|
||||
{
|
||||
// TickCount of zero means a packet is in the resend queue
|
||||
// but hasn't actually been sent over the wire yet
|
||||
if (packet.TickCount == 0)
|
||||
continue;
|
||||
|
||||
if (now - packet.TickCount >= timeoutMS)
|
||||
{
|
||||
if (expiredPackets == null)
|
||||
expiredPackets = new List<OutgoingPacket>();
|
||||
|
||||
// The TickCount will be set to the current time when the packet
|
||||
// is actually sent out again
|
||||
packet.TickCount = 0;
|
||||
|
||||
expiredPackets.Add(packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return expiredPackets;
|
||||
}
|
||||
|
||||
private void ProcessQueues()
|
||||
{
|
||||
// Process all the pending adds
|
||||
|
||||
OutgoingPacket pendingAdd;
|
||||
if (m_pendingAdds != null)
|
||||
{
|
||||
while (m_pendingAdds.Dequeue(out pendingAdd))
|
||||
{
|
||||
if (pendingAdd != null && m_packets != null)
|
||||
{
|
||||
m_packets[pendingAdd.SequenceNumber] = pendingAdd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Process all the pending removes, including updating statistics and round-trip times
|
||||
PendingAck pendingRemove;
|
||||
OutgoingPacket ackedPacket;
|
||||
if (m_pendingRemoves != null)
|
||||
{
|
||||
while (m_pendingRemoves.Dequeue(out pendingRemove))
|
||||
{
|
||||
if (m_pendingRemoves != null && m_packets != null)
|
||||
{
|
||||
if (m_packets.TryGetValue(pendingRemove.SequenceNumber, out ackedPacket))
|
||||
{
|
||||
m_packets.Remove(pendingRemove.SequenceNumber);
|
||||
|
||||
// Update stats
|
||||
System.Threading.Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);
|
||||
|
||||
if (!pendingRemove.FromResend)
|
||||
{
|
||||
// Calculate the round-trip time for this packet and its ACK
|
||||
int rtt = pendingRemove.RemoveTime - ackedPacket.TickCount;
|
||||
if (rtt > 0)
|
||||
ackedPacket.Client.UpdateRoundTrip(rtt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
@@ -37,6 +38,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
@@ -233,8 +235,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
||||
{
|
||||
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
|
||||
|
||||
if (updateInventoryStatus)
|
||||
{
|
||||
@@ -253,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc)
|
||||
{
|
||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
@@ -278,13 +286,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
if (doc != null)
|
||||
{
|
||||
objatt.LoadScriptState(doc);
|
||||
objatt.ResetOwnerChangeFlag();
|
||||
}
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 4 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
|
||||
objatt.ResumeScripts();
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
//m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -313,7 +327,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
if (m_scene.InventoryService != null)
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
|
||||
}
|
||||
@@ -358,6 +373,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
// XXYY!!
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
if (item == null)
|
||||
m_log.Error("[ATTACHMENT]: item == null");
|
||||
if (m_scene == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene == null");
|
||||
if (m_scene.InventoryService == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null");
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
|
||||
|
||||
@@ -446,6 +467,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (group.GetFromItemID() == itemID)
|
||||
{
|
||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
||||
// CM / XMREngine!!!! Needed to conclude attach event
|
||||
SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||
group.DetachToInventoryPrep();
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
||||
m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID);
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
private int m_shoutdistance = 100;
|
||||
private int m_whisperdistance = 10;
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
private List<string> FreezeCache = new List<string>();
|
||||
private string m_adminPrefix = "";
|
||||
internal object m_syncy = new object();
|
||||
|
||||
internal IConfig m_config;
|
||||
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
||||
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
||||
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
||||
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
|
||||
}
|
||||
|
||||
public virtual void AddRegion(Scene scene)
|
||||
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
|
||||
{
|
||||
if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
|
||||
c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
|
||||
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
||||
{
|
||||
string fromName = c.From;
|
||||
string fromNamePrefix = "";
|
||||
UUID fromID = UUID.Zero;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
fromPos = avatar.AbsolutePosition;
|
||||
fromName = avatar.Name;
|
||||
fromID = c.Sender.AgentId;
|
||||
|
||||
if (avatar.GodLevel >= 200)
|
||||
{
|
||||
fromNamePrefix = m_adminPrefix;
|
||||
}
|
||||
break;
|
||||
|
||||
case ChatSourceType.Object:
|
||||
@@ -227,7 +241,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
|
||||
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
if (Presencecheck != null)
|
||||
{
|
||||
// This will pass all chat from objects. Not
|
||||
// perfect, but it will do. For now. Better
|
||||
// than the prior behavior of muting all
|
||||
// objects on a parcel with access restrictions
|
||||
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -270,25 +296,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||
|
||||
((Scene)c.Scene).ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
});
|
||||
if (c.Scene != null)
|
||||
{
|
||||
((Scene)c.Scene).ForEachScenePresence
|
||||
(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -317,5 +347,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
System.Threading.Timer Timer;
|
||||
if (flags == 0)
|
||||
{
|
||||
FreezeCache.Add(target.ToString());
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
|
||||
Timers.Add(target, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreezeCache.Remove(target.ToString());
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
UUID target = (UUID)avatar;
|
||||
FreezeCache.Remove(target.ToString());
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,208 +1,223 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
public class DialogModule : IRegionModule, IDialogModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IDialogModule>(this);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
{
|
||||
SendAlertToUser(client, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message, bool modal)
|
||||
{
|
||||
client.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message)
|
||||
{
|
||||
SendAlertToUser(agentID, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message, bool modal)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
presence.ControllingClient.SendAlertMessage(message);
|
||||
});
|
||||
}
|
||||
|
||||
public void SendDialogToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
|
||||
string message, UUID textureID, int ch, string[] buttonlabels)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ownerFirstName = "(unknown";
|
||||
ownerLastName = "user)";
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
}
|
||||
|
||||
public void SendUrlToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
|
||||
}
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ownerFirstName = "(unknown";
|
||||
ownerLastName = "user)";
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
|
||||
}
|
||||
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle an alert command from the console.
|
||||
/// </summary>
|
||||
/// <param name="module"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
|
||||
return;
|
||||
|
||||
if (cmdparams[1] == "general")
|
||||
{
|
||||
string message = CombineParams(cmdparams, 2);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
string firstName = cmdparams[1];
|
||||
string lastName = cmdparams[2];
|
||||
string message = CombineParams(cmdparams, 3);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName, message);
|
||||
SendAlertToUser(firstName, lastName, message, false);
|
||||
}
|
||||
}
|
||||
|
||||
private string CombineParams(string[] commandParams, int pos)
|
||||
{
|
||||
string result = string.Empty;
|
||||
for (int i = pos; i < commandParams.Length; i++)
|
||||
{
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
public class DialogModule : IRegionModule, IDialogModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IDialogModule>(this);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
{
|
||||
SendAlertToUser(client, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message, bool modal)
|
||||
{
|
||||
client.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message)
|
||||
{
|
||||
SendAlertToUser(agentID, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message, bool modal)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
{
|
||||
presence.ControllingClient.SendAlertMessage(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void SendDialogToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
|
||||
string message, UUID textureID, int ch, string[] buttonlabels)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ownerFirstName = "(unknown";
|
||||
ownerLastName = "user)";
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
}
|
||||
|
||||
public void SendUrlToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
|
||||
}
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
}
|
||||
else
|
||||
{
|
||||
ownerFirstName = "(unknown";
|
||||
ownerLastName = "user)";
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
|
||||
}
|
||||
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||
{
|
||||
if (!presence.IsChildAgent)
|
||||
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle an alert command from the console.
|
||||
/// </summary>
|
||||
/// <param name="module"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
|
||||
return;
|
||||
|
||||
if (cmdparams[1] == "general")
|
||||
{
|
||||
string message = CombineParams(cmdparams, 2);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else if (cmdparams[1] == "dialog")
|
||||
{
|
||||
string message = CombineParams(cmdparams, 2);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message);
|
||||
SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
string firstName = cmdparams[1];
|
||||
string lastName = cmdparams[2];
|
||||
string message = CombineParams(cmdparams, 3);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName, message);
|
||||
SendAlertToUser(firstName, lastName, message, false);
|
||||
}
|
||||
}
|
||||
|
||||
private string CombineParams(string[] commandParams, int pos)
|
||||
{
|
||||
string result = string.Empty;
|
||||
for (int i = pos; i < commandParams.Length; i++)
|
||||
{
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
|
||||
//m_log.DebugFormat("[INSTANT MESSAGE]: Attempting delivery of IM from {0} to {1}", im.fromAgentName, toAgentID.ToString());
|
||||
|
||||
// Try root avatar only first
|
||||
foreach (Scene scene in m_Scenes)
|
||||
@@ -140,12 +140,12 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
if (scene.Entities.ContainsKey(toAgentID) &&
|
||||
scene.Entities[toAgentID] is ScenePresence)
|
||||
{
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Looking for {0} in {1}", toAgentID.ToString(), scene.RegionInfo.RegionName);
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
@@ -167,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog);
|
||||
//m_log.InfoFormat("[INVENTORY TRANSFER]: OnInstantMessage {0}", im.dialog);
|
||||
|
||||
Scene scene = FindClientScene(client.AgentId);
|
||||
|
||||
@@ -241,6 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
im.imSessionID = itemID.Guid;
|
||||
}
|
||||
|
||||
im.offline = 1; // Remember these
|
||||
|
||||
// Send the IM to the recipient. The item is already
|
||||
// in their inventory, so it will not be lost if
|
||||
// they are offline.
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
|
||||
// it's actually doing a lot of work.
|
||||
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
||||
if (endPoint.Address != null)
|
||||
if (endPoint != null && endPoint.Address != null)
|
||||
{
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
@@ -549,6 +549,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (uinfo != null)
|
||||
{
|
||||
if (uinfo.HomeRegionID == UUID.Zero)
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("You don't have a home position set.");
|
||||
return;
|
||||
}
|
||||
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
|
||||
if (regionInfo == null)
|
||||
{
|
||||
@@ -556,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return;
|
||||
}
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
|
||||
regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
|
||||
|
||||
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
|
||||
@@ -564,6 +570,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
|
||||
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
|
||||
}
|
||||
else
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -851,15 +863,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||
|
||||
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
||||
if (eq != null)
|
||||
IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint;
|
||||
if (neighbourExternal != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath);
|
||||
if (eq != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (!WaitForCallback(agent.UUID))
|
||||
@@ -957,10 +973,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.Viewer = currentAgentCircuit.Viewer;
|
||||
}
|
||||
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
|
||||
IPEndPoint external = region.ExternalEndPoint;
|
||||
if (external != null)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, external, true,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1089,6 +1109,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
//neighbour.ExternalEndPoint may return null, which will be caught
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
|
||||
@@ -219,6 +219,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
Vector3 originalPosition = objectGroup.AbsolutePosition;
|
||||
|
||||
// Restore attachment data after trip through the sim
|
||||
if (objectGroup.RootPart.AttachPoint > 0)
|
||||
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
|
||||
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
|
||||
|
||||
objectGroup.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
|
||||
@@ -491,6 +496,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
if (item.ID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 1");
|
||||
}
|
||||
|
||||
AssetBase rezAsset = m_Scene.AssetService.Get(item.AssetID.ToString());
|
||||
|
||||
if (rezAsset != null)
|
||||
@@ -513,17 +523,30 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
itemId = item.ID;
|
||||
}
|
||||
|
||||
if (item.ID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 2");
|
||||
}
|
||||
|
||||
string xmlData = Utils.BytesToString(rezAsset.Data);
|
||||
SceneObjectGroup group
|
||||
= SceneObjectSerializer.FromOriginalXmlFormat(itemId, xmlData);
|
||||
|
||||
Vector3 storedPosition = group.AbsolutePosition;
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 3");
|
||||
}
|
||||
group.RootPart.FromFolderID = item.Folder;
|
||||
|
||||
// If it's rezzed in world, select it. Much easier to
|
||||
// find small items.
|
||||
//
|
||||
if (!attachment)
|
||||
{
|
||||
group.RootPart.CreateSelected = true;
|
||||
foreach (SceneObjectPart child in group.Children.Values)
|
||||
child.CreateSelected = true;
|
||||
}
|
||||
|
||||
if (!m_Scene.Permissions.CanRezObject(
|
||||
group.Children.Count, remoteClient.AgentId, pos)
|
||||
@@ -538,9 +561,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
remoteClient.SendBulkUpdateInventory(item);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 4");
|
||||
}
|
||||
group.ResetIDs();
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 5");
|
||||
}
|
||||
if (attachment)
|
||||
{
|
||||
group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
|
||||
@@ -572,7 +601,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
group.SetFromItemID(itemID);
|
||||
}
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 6");
|
||||
}
|
||||
SceneObjectPart rootPart = null;
|
||||
try
|
||||
{
|
||||
@@ -587,7 +619,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
|
||||
}
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 7");
|
||||
}
|
||||
// Since renaming the item in the inventory does not affect the name stored
|
||||
// in the serialization, transfer the correct name from the inventory to the
|
||||
// object itself before we rez.
|
||||
@@ -615,7 +650,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
group.ApplyNextOwnerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 8");
|
||||
}
|
||||
foreach (SceneObjectPart part in partList)
|
||||
{
|
||||
if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
|
||||
@@ -628,13 +666,23 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 9");
|
||||
}
|
||||
rootPart.TrimPermissions();
|
||||
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 10");
|
||||
}
|
||||
if (!attachment)
|
||||
{
|
||||
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
|
||||
{
|
||||
// Save attachment data
|
||||
group.RootPart.AttachPoint = group.RootPart.Shape.State;
|
||||
group.RootPart.AttachOffset = storedPosition;
|
||||
|
||||
group.ClearPartAttachmentData();
|
||||
}
|
||||
|
||||
@@ -660,8 +708,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rootPart.ParentGroup;
|
||||
if (group.UUID == UUID.Zero)
|
||||
{
|
||||
m_log.Debug("[InventoryAccessModule]: Inventory object has UUID.Zero! Position 11");
|
||||
}
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -57,9 +57,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||
config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
|
||||
config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
|
||||
config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion");
|
||||
config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion");
|
||||
config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion");
|
||||
|
||||
m_LocalConnector = new LocalGridServicesConnector(config);
|
||||
@@ -128,8 +128,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||
Assert.IsNotNull(result, "Retrieved GetRegionByName is null");
|
||||
Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match");
|
||||
|
||||
m_LocalConnector.RegisterRegion(UUID.Zero, r2);
|
||||
m_LocalConnector.RegisterRegion(UUID.Zero, r3);
|
||||
m_LocalConnector.RegisterRegion(UUID.Zero, r2);
|
||||
m_LocalConnector.RegisterRegion(UUID.Zero, r3);
|
||||
m_LocalConnector.RegisterRegion(UUID.Zero, r4);
|
||||
|
||||
result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1));
|
||||
@@ -154,38 +154,38 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||
Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null");
|
||||
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
|
||||
|
||||
results = m_LocalConnector.GetDefaultRegions(UUID.Zero);
|
||||
Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null");
|
||||
Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
results = m_LocalConnector.GetDefaultRegions(UUID.Zero);
|
||||
Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null");
|
||||
Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2");
|
||||
|
||||
results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY);
|
||||
Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null");
|
||||
Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size");
|
||||
Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2");
|
||||
|
||||
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
||||
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
if (account != null)
|
||||
m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d));
|
||||
|
||||
m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
||||
// m_log.DebugFormat("[USER CACHE]: cached user {0}", userID);
|
||||
}
|
||||
|
||||
public UserAccount Get(UUID userID, out bool inCache)
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -29,6 +29,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -45,6 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
private delegate void LookupUUIDS(List<UUID> uuidLst);
|
||||
|
||||
private Scene m_scene;
|
||||
private Timer m_regionChangeTimer = new Timer();
|
||||
|
||||
private EstateTerrainXferHandler TerrainUploader;
|
||||
|
||||
@@ -250,7 +252,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
if ((estateAccessType & 4) != 0) // User add
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateUser(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
@@ -265,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
if ((estateAccessType & 8) != 0) // User remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
@@ -280,7 +282,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
if ((estateAccessType & 16) != 0) // Group add
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.AddEstateGroup(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
@@ -294,7 +296,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
if ((estateAccessType & 32) != 0) // Group remove
|
||||
{
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions())
|
||||
if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions())
|
||||
{
|
||||
m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
|
||||
m_scene.RegionInfo.EstateSettings.Save();
|
||||
@@ -898,6 +900,9 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
m_scene.RegisterModuleInterface<IEstateModule>(this);
|
||||
m_scene.EventManager.OnNewClient += EventManager_OnNewClient;
|
||||
m_scene.EventManager.OnRequestChangeWaterHeight += changeWaterHeight;
|
||||
m_regionChangeTimer.AutoReset = false;
|
||||
m_regionChangeTimer.Interval = 2000;
|
||||
m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
|
||||
|
||||
m_scene.AddCommand(this, "set terrain texture",
|
||||
"set terrain texture <number> <uuid> [<x>] [<y>]",
|
||||
@@ -1167,6 +1172,12 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
|
||||
protected void TriggerRegionInfoChange()
|
||||
{
|
||||
m_regionChangeTimer.Stop();
|
||||
m_regionChangeTimer.Start();
|
||||
}
|
||||
|
||||
protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
ChangeDelegate change = OnRegionInfoChange;
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
|
||||
|
||||
private bool m_allowedForcefulBans = true;
|
||||
private UUID DefaultGodParcelGroup;
|
||||
private string DefaultGodParcelName;
|
||||
|
||||
// caches ExtendedLandData
|
||||
private Cache parcelInfoCache;
|
||||
@@ -97,6 +99,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig cnf = source.Configs["LandManagement"];
|
||||
if (cnf != null)
|
||||
{
|
||||
DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
|
||||
DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -161,7 +169,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
client.OnParcelGodForceOwner += ClientOnParcelGodForceOwner;
|
||||
client.OnParcelReclaim += ClientOnParcelReclaim;
|
||||
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
|
||||
client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
|
||||
// client.OnParcelDwellRequest += ClientOnParcelDwellRequest;
|
||||
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
|
||||
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
|
||||
|
||||
@@ -352,7 +360,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
|
||||
{
|
||||
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
|
||||
if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID))
|
||||
{
|
||||
SendYouAreBannedNotice(avatar);
|
||||
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
|
||||
@@ -649,7 +657,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
int x;
|
||||
int y;
|
||||
|
||||
if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0)
|
||||
if (x_float > Constants.RegionSize || x_float < 0 || y_float > Constants.RegionSize || y_float < 0)
|
||||
return null;
|
||||
|
||||
try
|
||||
@@ -992,6 +1000,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//Owner Flag
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
|
||||
{
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.SalePrice > 0 &&
|
||||
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
|
||||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
|
||||
@@ -1292,18 +1304,31 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
|
||||
{
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
lock (m_landList)
|
||||
{
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
//Remove all the land objects in the sim and then process our new data
|
||||
foreach (int n in m_landList.Keys)
|
||||
{
|
||||
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
|
||||
}
|
||||
m_landIDList.Initialize();
|
||||
m_landList.Clear();
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void IncomingLandObjectFromStorage(LandData data)
|
||||
{
|
||||
|
||||
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
|
||||
new_land.LandData = data.Copy();
|
||||
new_land.SetLandBitmapFromByteArray();
|
||||
AddLandObject(new_land);
|
||||
new_land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
|
||||
@@ -1524,5 +1549,321 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
UpdateLandObject(localID, land.LandData);
|
||||
}
|
||||
|
||||
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
|
||||
{
|
||||
ILandObject land = null;
|
||||
List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
|
||||
foreach (ILandObject landObject in Land)
|
||||
{
|
||||
if (landObject.LandData.LocalID == landID)
|
||||
{
|
||||
land = landObject;
|
||||
}
|
||||
}
|
||||
land.DeedToGroup(DefaultGodParcelGroup);
|
||||
land.LandData.Name = DefaultGodParcelName;
|
||||
land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
|
||||
{
|
||||
ScenePresence SP;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
|
||||
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
|
||||
if (SP.GodLevel != 0)
|
||||
{
|
||||
if (flags == 0) //All parcels, scripted or not
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //All parcels, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //not target parcel, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
|
||||
if (landobject.LandData.OwnerID != e.OwnerID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
foreach (SceneObjectGroup ol in returns)
|
||||
{
|
||||
ReturnObject(ol, client);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
|
||||
{
|
||||
SceneObjectGroup[] objs = new SceneObjectGroup[1];
|
||||
objs[0] = obj;
|
||||
((Scene)client.Scene).returnObjects(objs, client.AgentId);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
|
||||
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
System.Threading.Timer Timer;
|
||||
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
if (flags == 0)
|
||||
{
|
||||
targetAvatar.AllowMovement = false;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
|
||||
Timers.Add(targetAvatar.UUID, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetAvatar.AllowMovement = true;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
ScenePresence targetAvatar = (ScenePresence)avatar;
|
||||
targetAvatar.AllowMovement = true;
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
|
||||
}
|
||||
|
||||
|
||||
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
//Just eject
|
||||
if (flags == 0)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Eject and ban
|
||||
if (flags == 1)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "PermissionsModule"; }
|
||||
get { return "DefaultPermissionsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
|
||||
@@ -549,6 +549,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
|
||||
m_scene.SaveTerrain();
|
||||
|
||||
m_scene.EventManager.TriggerTerrainUpdate();
|
||||
|
||||
// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
|
||||
//m_scene.CreateTerrainTexture(true);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
public event DisconnectUser OnDisconnectUser;
|
||||
public event RequestAvatarProperties OnRequestAvatarProperties;
|
||||
public event SetAlwaysRun OnSetAlwaysRun;
|
||||
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event DeRezObject OnDeRezObject;
|
||||
public event Action<IClientAPI> OnRegionHandShakeReply;
|
||||
public event GenericCall2 OnRequestWearables;
|
||||
@@ -817,11 +817,20 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -744,6 +748,26 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
public void TriggerTerrainUpdate()
|
||||
{
|
||||
OnTerrainUpdateDelegate handlerTerrainUpdate = OnTerrainUpdate;
|
||||
if (handlerTerrainUpdate != null)
|
||||
{
|
||||
foreach (OnTerrainUpdateDelegate d in handlerTerrainUpdate.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerTerrainUpdate failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerTerrainTick()
|
||||
{
|
||||
|
||||
@@ -186,9 +186,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return 0.0;
|
||||
|
||||
// Use group position for child prims
|
||||
Vector3 entityPos = entity.AbsolutePosition;
|
||||
Vector3 entityPos;
|
||||
if (entity is SceneObjectPart)
|
||||
entityPos = m_scene.GetGroupByPrim(entity.LocalId).AbsolutePosition;
|
||||
entityPos = ((SceneObjectPart)entity).ParentGroup.AbsolutePosition;
|
||||
else
|
||||
entityPos = entity.AbsolutePosition;
|
||||
|
||||
@@ -211,12 +211,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
|
||||
if (physActor == null || !physActor.IsPhysical)
|
||||
priority += 100;
|
||||
|
||||
if (((SceneObjectPart)entity).ParentGroup.RootPart.IsAttachment)
|
||||
{
|
||||
priority = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PhysicsActor physActor = ((SceneObjectPart)entity).ParentGroup.RootPart.PhysActor;
|
||||
if (physActor == null || !physActor.IsPhysical)
|
||||
priority += 100;
|
||||
}
|
||||
|
||||
if (((SceneObjectPart)entity).ParentGroup.RootPart != (SceneObjectPart)entity)
|
||||
priority +=1;
|
||||
}
|
||||
return priority;
|
||||
}
|
||||
|
||||
@@ -94,6 +94,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
|
||||
{
|
||||
InventoryFolderBase folder;
|
||||
|
||||
if (item.Folder == UUID.Zero)
|
||||
{
|
||||
folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType);
|
||||
if (folder == null)
|
||||
{
|
||||
folder = InventoryService.GetRootFolder(AgentID);
|
||||
|
||||
if (folder == null)
|
||||
return;
|
||||
}
|
||||
|
||||
item.Folder = folder.ID;
|
||||
}
|
||||
|
||||
if (InventoryService.AddItem(item))
|
||||
{
|
||||
int userlevel = 0;
|
||||
@@ -214,8 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// Needs to determine which engine was running it and use that
|
||||
//
|
||||
part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
errors = part.Inventory.GetScriptErrors(item.ItemID);
|
||||
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -633,6 +648,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
}
|
||||
|
||||
if (newName == null) newName = item.Name;
|
||||
|
||||
AssetBase asset = AssetService.Get(item.AssetID.ToString());
|
||||
|
||||
if (asset != null)
|
||||
@@ -679,6 +696,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Move an item within the agent's inventory, and leave a copy (used in making a new outfit)
|
||||
/// </summary>
|
||||
public void MoveInventoryItemsLeaveCopy(IClientAPI remoteClient, List<InventoryItemBase> items, UUID destfolder)
|
||||
{
|
||||
List<InventoryItemBase> moveitems = new List<InventoryItemBase>();
|
||||
foreach (InventoryItemBase b in items)
|
||||
{
|
||||
CopyInventoryItem(remoteClient, 0, remoteClient.AgentId, b.ID, b.Folder, null);
|
||||
InventoryItemBase n = InventoryService.GetItem(b);
|
||||
n.Folder = destfolder;
|
||||
moveitems.Add(n);
|
||||
remoteClient.SendInventoryItemCreateUpdate(n, 0);
|
||||
}
|
||||
|
||||
MoveInventoryItem(remoteClient, moveitems);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Move an item within the agent's inventory.
|
||||
/// </summary>
|
||||
@@ -913,8 +948,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
SceneObjectGroup group = null;
|
||||
if (part != null)
|
||||
{
|
||||
group = part.ParentGroup;
|
||||
}
|
||||
if (part != null && group != null)
|
||||
{
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
@@ -1489,7 +1528,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
|
||||
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
|
||||
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"),
|
||||
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n\n touch_start(integer num)\n {\n }\n}"),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
@@ -1684,11 +1723,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Invalid id
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
{
|
||||
//Client still thinks the object exists, kill it
|
||||
SendKillObject(localID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Already deleted by someone else
|
||||
if (part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||
{
|
||||
//Client still thinks the object exists, kill it
|
||||
SendKillObject(localID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Can't delete child prims
|
||||
if (part != part.ParentGroup.RootPart)
|
||||
@@ -1715,15 +1762,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
|
||||
if (action == DeRezAction.TakeCopy)
|
||||
{
|
||||
if (!Permissions.CanTakeCopyObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToTakeCopy = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
permissionToTakeCopy = false;
|
||||
}
|
||||
if (!Permissions.CanTakeObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToTake = false;
|
||||
|
||||
if (!Permissions.CanDeleteObject(grp.UUID, remoteClient.AgentId))
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Handle god perms
|
||||
|
||||
@@ -137,6 +137,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected SceneCommunicationService m_sceneGridService;
|
||||
public bool LoginsDisabled = true;
|
||||
public bool LoadingPrims = false;
|
||||
public bool CombineRegions = false;
|
||||
|
||||
public new float TimeDilation
|
||||
{
|
||||
@@ -150,6 +151,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public IXfer XferManager;
|
||||
|
||||
protected ISnmpModule m_snmpService = null;
|
||||
public ISnmpModule SnmpService
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_snmpService == null)
|
||||
{
|
||||
m_snmpService = RequestModuleInterface<ISnmpModule>();
|
||||
}
|
||||
|
||||
return m_snmpService;
|
||||
}
|
||||
}
|
||||
|
||||
protected IAssetService m_AssetService;
|
||||
protected IAuthorizationService m_AuthorizationService;
|
||||
|
||||
@@ -608,6 +623,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Load region settings
|
||||
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
|
||||
m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
|
||||
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
|
||||
@@ -709,9 +726,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//Animation states
|
||||
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
||||
// TODO: Change default to true once the feature is supported
|
||||
m_usePreJump = startupConfig.GetBoolean("enableprejump", false);
|
||||
|
||||
m_usePreJump = startupConfig.GetBoolean("enableprejump", true);
|
||||
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
|
||||
|
||||
m_log.DebugFormat("[SCENE]: prejump is {0}", m_usePreJump ? "ON" : "OFF");
|
||||
if (RegionInfo.NonphysPrimMax > 0)
|
||||
{
|
||||
m_maxNonphys = RegionInfo.NonphysPrimMax;
|
||||
@@ -752,6 +770,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
|
||||
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
|
||||
|
||||
#region BinaryStats
|
||||
|
||||
@@ -1023,6 +1042,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds)
|
||||
{
|
||||
Restart(seconds, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given float seconds, this will restart the region. showDialog will optionally alert the users.
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds, bool showDialog)
|
||||
{
|
||||
// notifications are done in 15 second increments
|
||||
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
|
||||
@@ -1044,8 +1072,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
|
||||
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
|
||||
m_restartTimer.Start();
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
if (showDialog)
|
||||
{
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1403,16 +1434,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Check if any objects have reached their targets
|
||||
CheckAtTargets();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
// Run through all ScenePresences looking for updates
|
||||
// Presence updates and queued object updates for each presence are sent to clients
|
||||
if (m_frame % m_update_presences == 0)
|
||||
m_sceneGraph.UpdatePresences();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
if (m_frame % m_update_coarse_locations == 0)
|
||||
{
|
||||
List<Vector3> coarseLocations;
|
||||
@@ -1741,6 +1772,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void StoreWindlightProfile(RegionLightShareData wl)
|
||||
{
|
||||
m_regInfo.WindlightSettings = wl;
|
||||
wl.Save();
|
||||
m_storageManager.DataStore.StoreRegionWindlightSettings(wl);
|
||||
m_eventManager.TriggerOnSaveNewWindlightProfile();
|
||||
}
|
||||
@@ -1923,14 +1955,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
public Vector3 GetNewRezLocation(Vector3 RayStart, Vector3 RayEnd, UUID RayTargetID, Quaternion rot, byte bypassRayCast, byte RayEndIsIntersection, bool frontFacesOnly, Vector3 scale, bool FaceCenter)
|
||||
{
|
||||
|
||||
float wheight = (float)RegionInfo.RegionSettings.WaterHeight;
|
||||
Vector3 wpos = Vector3.Zero;
|
||||
// Check for water surface intersection from above
|
||||
if ( (RayStart.Z > wheight) && (RayEnd.Z < wheight) )
|
||||
{
|
||||
float ratio = (RayStart.Z - wheight) / (RayStart.Z - RayEnd.Z);
|
||||
wpos.X = RayStart.X - (ratio * (RayStart.X - RayEnd.X));
|
||||
wpos.Y = RayStart.Y - (ratio * (RayStart.Y - RayEnd.Y));
|
||||
wpos.Z = wheight;
|
||||
}
|
||||
|
||||
Vector3 pos = Vector3.Zero;
|
||||
if (RayEndIsIntersection == (byte)1)
|
||||
{
|
||||
pos = RayEnd;
|
||||
return pos;
|
||||
}
|
||||
|
||||
if (RayTargetID != UUID.Zero)
|
||||
else if (RayTargetID != UUID.Zero)
|
||||
{
|
||||
SceneObjectPart target = GetSceneObjectPart(RayTargetID);
|
||||
|
||||
@@ -1952,7 +1994,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
|
||||
|
||||
// Un-comment out the following line to Get Raytrace results printed to the console.
|
||||
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
|
||||
// m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
|
||||
float ScaleOffset = 0.5f;
|
||||
|
||||
// If we hit something
|
||||
@@ -1975,13 +2017,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//pos.Z -= 0.25F;
|
||||
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We don't have a target here, so we're going to raytrace all the objects in the scene.
|
||||
|
||||
EntityIntersection ei = m_sceneGraph.GetClosestIntersectingPrim(new Ray(AXOrigin, AXdirection), true, false);
|
||||
|
||||
// Un-comment the following line to print the raytrace results to the console.
|
||||
@@ -1990,13 +2029,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (ei.HitTF)
|
||||
{
|
||||
pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// fall back to our stupid functionality
|
||||
pos = RayEnd;
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2007,8 +2045,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//increase height so its above the ground.
|
||||
//should be getting the normal of the ground at the rez point and using that?
|
||||
pos.Z += scale.Z / 2f;
|
||||
return pos;
|
||||
// return pos;
|
||||
}
|
||||
|
||||
// check against posible water intercept
|
||||
if (wpos.Z > pos.Z) pos = wpos;
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
@@ -2141,13 +2183,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||
/// </summary>
|
||||
public void DeleteAllSceneObjects()
|
||||
{
|
||||
DeleteAllSceneObjects(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||
/// </summary>
|
||||
public void DeleteAllSceneObjects(bool exceptNoCopy)
|
||||
{
|
||||
List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>();
|
||||
lock (Entities)
|
||||
{
|
||||
ICollection<EntityBase> entities = new List<EntityBase>(Entities);
|
||||
@@ -2157,11 +2208,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (e is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup sog = (SceneObjectGroup)e;
|
||||
if (!sog.IsAttachment)
|
||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||
if (sog != null && !sog.IsAttachment)
|
||||
{
|
||||
if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0))
|
||||
{
|
||||
DeleteSceneObject((SceneObjectGroup)e, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
toReturn.Add((SceneObjectGroup)e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (toReturn.Count > 0)
|
||||
{
|
||||
returnObjects(toReturn.ToArray(), UUID.Zero);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2529,6 +2593,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>True if the SceneObjectGroup was added, False if it was not</returns>
|
||||
public bool AddSceneObject(SceneObjectGroup sceneObject)
|
||||
{
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero", sceneObject.UUID);
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the user is banned, we won't let any of their objects
|
||||
// enter. Period.
|
||||
//
|
||||
@@ -2578,15 +2648,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (AttachmentsModule != null)
|
||||
AttachmentsModule.AttachObject(sp.ControllingClient, grp, 0, false);
|
||||
|
||||
m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was found, attaching", sceneObject.UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Attachment {0} arrived and scene presence was not found, setting to temp", sceneObject.UUID);
|
||||
RootPrim.RemFlag(PrimFlags.TemporaryOnRez);
|
||||
RootPrim.AddFlag(PrimFlags.TemporaryOnRez);
|
||||
}
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for {0} was zero after attachment processing. BUG!", sceneObject.UUID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sceneObject.OwnerID == UUID.Zero)
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Owner ID for non-attachment {0} was zero", sceneObject.UUID);
|
||||
return false;
|
||||
}
|
||||
AddRestoredSceneObject(sceneObject, true, false);
|
||||
|
||||
if (!Permissions.CanObjectEntry(sceneObject.UUID,
|
||||
@@ -2861,6 +2943,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
client.OnFetchInventory += HandleFetchInventory;
|
||||
client.OnUpdateInventoryItem += UpdateInventoryItemAsset;
|
||||
client.OnCopyInventoryItem += CopyInventoryItem;
|
||||
client.OnMoveItemsAndLeaveCopy += MoveInventoryItemsLeaveCopy;
|
||||
client.OnMoveInventoryItem += MoveInventoryItem;
|
||||
client.OnRemoveInventoryItem += RemoveInventoryItem;
|
||||
client.OnRemoveInventoryFolder += RemoveInventoryFolder;
|
||||
@@ -3148,6 +3231,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="flags"></param>
|
||||
public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags)
|
||||
{
|
||||
//Add half the avatar's height so that the user doesn't fall through prims
|
||||
ScenePresence presence;
|
||||
if (TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
if (presence.Appearance != null)
|
||||
{
|
||||
position.Z = position.Z + (presence.Appearance.AvatarHeight / 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (GridUserService != null && GridUserService.SetHome(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt))
|
||||
// FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "Home position set.");
|
||||
@@ -3242,7 +3335,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_sceneGridService.SendCloseChildAgentConnections(agentID, regions);
|
||||
|
||||
}
|
||||
m_log.Debug("[Scene] Beginning ClientClosed");
|
||||
m_eventManager.TriggerClientClosed(agentID, this);
|
||||
m_log.Debug("[Scene] Finished ClientClosed");
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
@@ -3250,7 +3345,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Avatar is already disposed :/
|
||||
}
|
||||
|
||||
m_log.Debug("[Scene] Beginning OnRemovePresence");
|
||||
m_eventManager.TriggerOnRemovePresence(agentID);
|
||||
m_log.Debug("[Scene] Finished OnRemovePresence");
|
||||
ForEachClient(
|
||||
delegate(IClientAPI client)
|
||||
{
|
||||
@@ -3266,8 +3363,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
// Remove the avatar from the scene
|
||||
m_log.Debug("[Scene] Begin RemoveScenePresence");
|
||||
m_sceneGraph.RemoveScenePresence(agentID);
|
||||
m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager");
|
||||
m_clientManager.Remove(agentID);
|
||||
m_log.Debug("[Scene] Removed the client manager. Firing avatar.close");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -3281,9 +3381,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString());
|
||||
}
|
||||
|
||||
m_log.Debug("[Scene] Done. Firing RemoveCircuit");
|
||||
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
|
||||
|
||||
m_log.Debug("[Scene] The avatar has left the building");
|
||||
//m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false));
|
||||
//m_log.InfoFormat("[SCENE] Memory post GC {0}", System.GC.GetTotalMemory(true));
|
||||
}
|
||||
@@ -3422,6 +3522,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (land != null && !TestLandRestrictions(agent, land, out reason))
|
||||
{
|
||||
m_log.DebugFormat("[CONNECTION BEGIN]: Denying access to {0} due to no land access", agent.AgentID.ToString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -3535,6 +3636,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
// Honor parcel landing type and position.
|
||||
/*
|
||||
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||
if (land != null)
|
||||
{
|
||||
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
|
||||
@@ -3542,6 +3645,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos = land.LandData.UserLocation;
|
||||
}
|
||||
}
|
||||
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3904,12 +4008,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, false);
|
||||
}
|
||||
|
||||
public bool IncomingCloseChildAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell a single agent to disconnect from the region.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="agentID"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
/// <param name="childOnly"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
|
||||
{
|
||||
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
|
||||
|
||||
@@ -3921,7 +4035,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_sceneGraph.removeUserCount(false);
|
||||
}
|
||||
else
|
||||
else if (!childOnly)
|
||||
{
|
||||
m_sceneGraph.removeUserCount(true);
|
||||
}
|
||||
@@ -3937,9 +4051,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
presence.ControllingClient.SendShutdownConnectionNotice();
|
||||
presence.ControllingClient.Close(false);
|
||||
}
|
||||
else if (!childOnly)
|
||||
{
|
||||
presence.ControllingClient.Close(true);
|
||||
}
|
||||
|
||||
presence.ControllingClient.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5243,4 +5360,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return offsets.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (neighbour != null)
|
||||
{
|
||||
m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
|
||||
// m_log.DebugFormat("[INTERGRID]: Successfully informed neighbour {0}-{1} that I'm here", x / Constants.RegionSize, y / Constants.RegionSize);
|
||||
m_scene.EventManager.TriggerOnRegionUp(neighbour);
|
||||
}
|
||||
else
|
||||
@@ -183,7 +183,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
|
||||
|
||||
List<GridRegion> neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
|
||||
m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
|
||||
//m_log.DebugFormat("[INTERGRID]: Informing {0} neighbours that this region is up", neighbours.Count);
|
||||
foreach (GridRegion n in neighbours)
|
||||
{
|
||||
InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
|
||||
@@ -267,14 +267,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected void SendCloseChildAgentAsync(UUID agentID, ulong regionHandle)
|
||||
{
|
||||
|
||||
m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
|
||||
//m_log.Debug("[INTERGRID]: Sending close agent to " + regionHandle);
|
||||
// let's do our best, but there's not much we can do if the neighbour doesn't accept.
|
||||
|
||||
//m_commsProvider.InterRegion.TellRegionToCloseChildConnection(regionHandle, agentID);
|
||||
uint x = 0, y = 0;
|
||||
Utils.LongToUInts(regionHandle, out x, out y);
|
||||
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||
m_scene.SimulationService.CloseAgent(destination, agentID);
|
||||
m_scene.SimulationService.CloseChildAgent(destination, agentID);
|
||||
}
|
||||
|
||||
private void SendCloseChildAgentCompleted(IAsyncResult iar)
|
||||
@@ -293,7 +293,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||
{
|
||||
return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
|
||||
|
||||
@@ -43,6 +43,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone);
|
||||
|
||||
public delegate void AttachToBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void DetachFromBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void ChangedBackupDelegate(SceneObjectGroup sog);
|
||||
|
||||
public delegate void ObjectCreateDelegate(EntityBase obj);
|
||||
|
||||
public delegate void ObjectDeleteDelegate(EntityBase obj);
|
||||
@@ -61,6 +67,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private PhysicsCrash handlerPhysicsCrash = null;
|
||||
|
||||
public event ObjectDuplicateDelegate OnObjectDuplicate;
|
||||
public event AttachToBackupDelegate OnAttachToBackup;
|
||||
public event DetachFromBackupDelegate OnDetachFromBackup;
|
||||
public event ChangedBackupDelegate OnChangeBackup;
|
||||
public event ObjectCreateDelegate OnObjectCreate;
|
||||
public event ObjectDeleteDelegate OnObjectRemove;
|
||||
|
||||
@@ -68,7 +77,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#region Fields
|
||||
|
||||
protected object m_presenceLock = new object();
|
||||
protected OpenMetaverse.ReaderWriterLockSlim m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
protected Dictionary<UUID, ScenePresence> m_scenePresenceMap = new Dictionary<UUID, ScenePresence>();
|
||||
protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>();
|
||||
|
||||
@@ -128,13 +137,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
protected internal void Close()
|
||||
{
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>();
|
||||
List<ScenePresence> newlist = new List<ScenePresence>();
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
lock (m_dictionary_lock)
|
||||
{
|
||||
@@ -214,27 +228,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
|
||||
if (sp.ParentID != 0)
|
||||
{
|
||||
// sitting avatar
|
||||
SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
|
||||
if (sop != null)
|
||||
{
|
||||
coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we can't find the parent.. ! arg!
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,6 +259,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected internal bool AddRestoredSceneObject(
|
||||
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
|
||||
{
|
||||
if (!m_parentScene.CombineRegions)
|
||||
{
|
||||
// KF: Check for out-of-region, move inside and make static.
|
||||
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
|
||||
sceneObject.RootPart.GroupPosition.Y,
|
||||
sceneObject.RootPart.GroupPosition.Z);
|
||||
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
|
||||
npos.X > Constants.RegionSize ||
|
||||
npos.Y > Constants.RegionSize))
|
||||
{
|
||||
if (npos.X < 0.0) npos.X = 1.0f;
|
||||
if (npos.Y < 0.0) npos.Y = 1.0f;
|
||||
if (npos.Z < 0.0) npos.Z = 0.0f;
|
||||
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
|
||||
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
|
||||
|
||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||
{
|
||||
part.GroupPosition = npos;
|
||||
}
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
|
||||
sceneObject.RootPart.Acceleration = Vector3.Zero;
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
if (!alreadyPersisted)
|
||||
{
|
||||
sceneObject.ForceInventoryPersistence();
|
||||
@@ -354,10 +376,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_numPrim += sceneObject.Children.Count;
|
||||
|
||||
if (attachToBackup)
|
||||
{
|
||||
sceneObject.AttachToBackup();
|
||||
}
|
||||
|
||||
if (OnObjectCreate != null)
|
||||
{
|
||||
OnObjectCreate(sceneObject);
|
||||
}
|
||||
|
||||
lock (m_dictionary_lock)
|
||||
{
|
||||
@@ -424,6 +450,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void FireAttachToBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnAttachToBackup != null)
|
||||
{
|
||||
OnAttachToBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public void FireDetachFromBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnDetachFromBackup != null)
|
||||
{
|
||||
OnDetachFromBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public void FireChangeBackup(SceneObjectGroup obj)
|
||||
{
|
||||
if (OnChangeBackup != null)
|
||||
{
|
||||
OnChangeBackup(obj);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process all pending updates
|
||||
/// </summary>
|
||||
@@ -560,7 +610,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
Entities[presence.UUID] = presence;
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -584,6 +635,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -598,7 +653,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agentID);
|
||||
}
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -620,6 +676,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.WarnFormat("[SCENE]: Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F)
|
||||
@@ -1497,10 +1557,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="childPrims"></param>
|
||||
protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
if (parentGroup == null) return;
|
||||
Monitor.Enter(m_updateLock);
|
||||
|
||||
try
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
parentGroup.areUpdatesSuspended = true;
|
||||
|
||||
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
|
||||
if (parentGroup != null)
|
||||
@@ -1539,12 +1602,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// occur on link to invoke this elsewhere (such as object selection)
|
||||
parentGroup.RootPart.CreateSelected = true;
|
||||
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
parentGroup.areUpdatesSuspended = false;
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
Monitor.Exit(m_updateLock);
|
||||
}
|
||||
}
|
||||
@@ -1581,11 +1644,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
if (childParts.Count > 0)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
try
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart root in rootParts)
|
||||
@@ -1609,10 +1683,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (numChildren > 1)
|
||||
sendEventsToRemainder = false;
|
||||
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
if (newSet.Count > 0)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
try
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is more than one prim remaining, we
|
||||
|
||||
@@ -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
@@ -60,7 +60,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
TELEPORT = 512,
|
||||
REGION_RESTART = 1024,
|
||||
MEDIA = 2048,
|
||||
ANIMATION = 16384
|
||||
ANIMATION = 16384,
|
||||
POSITION = 32768
|
||||
}
|
||||
|
||||
// I don't really know where to put this except here.
|
||||
@@ -149,8 +150,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
[XmlIgnore]
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
||||
public int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
||||
[XmlIgnore]
|
||||
public PhysicsActor PhysActor
|
||||
{
|
||||
@@ -193,6 +194,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
[XmlIgnore]
|
||||
public UUID FromFolderID;
|
||||
|
||||
// The following two are to hold the attachment data
|
||||
// while an object is inworld
|
||||
[XmlIgnore]
|
||||
public byte AttachPoint = 0;
|
||||
|
||||
[XmlIgnore]
|
||||
public Vector3 AttachOffset = Vector3.Zero;
|
||||
|
||||
[XmlIgnore]
|
||||
public int STATUS_ROTATE_X;
|
||||
|
||||
@@ -288,6 +297,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private Quaternion m_sitTargetOrientation = Quaternion.Identity;
|
||||
private Vector3 m_sitTargetPosition;
|
||||
private string m_sitAnimation = "SIT";
|
||||
private bool m_occupied; // KF if any av is sitting on this prim
|
||||
private string m_text = String.Empty;
|
||||
private string m_touchName = String.Empty;
|
||||
private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
|
||||
@@ -377,7 +387,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
|
||||
Quaternion rotationOffset, Vector3 offsetPosition)
|
||||
{
|
||||
m_name = "Primitive";
|
||||
m_name = "Object";
|
||||
|
||||
Rezzed = DateTime.UtcNow;
|
||||
_creationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
|
||||
@@ -473,12 +483,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <value>
|
||||
/// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
|
||||
/// Get the inventory list
|
||||
/// </value>
|
||||
public TaskInventoryDictionary TaskInventory
|
||||
{
|
||||
get { return m_inventory.Items; }
|
||||
set { m_inventory.Items = value; }
|
||||
get {
|
||||
return m_inventory.Items;
|
||||
}
|
||||
set {
|
||||
m_inventory.Items = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -611,14 +625,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_LoopSoundSlavePrims = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] TextureAnimation
|
||||
{
|
||||
get { return m_TextureAnimation; }
|
||||
set { m_TextureAnimation = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] ParticleSystem
|
||||
{
|
||||
get { return m_particleSystem; }
|
||||
@@ -672,7 +684,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set
|
||||
{
|
||||
m_groupPosition = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
@@ -692,25 +703,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Tell the physics engines that this prim changed.
|
||||
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO if we decide to do sitting in a more SL compatible way (multiple avatars per prim), this has to be fixed, too
|
||||
if (m_sitTargetAvatar != UUID.Zero)
|
||||
{
|
||||
if (m_parentGroup != null) // TODO can there be a SOP without a SOG?
|
||||
{
|
||||
ScenePresence avatar;
|
||||
if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar))
|
||||
{
|
||||
avatar.ParentPosition = GetWorldPosition();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,7 +718,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_offsetPosition; }
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
Vector3 oldpos = m_offsetPosition;
|
||||
StoreUndoState(UndoType.STATE_PRIM_POSITION);
|
||||
m_offsetPosition = value;
|
||||
|
||||
if (ParentGroup != null && !ParentGroup.IsDeleted)
|
||||
@@ -733,7 +733,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Tell the physics engines that this prim changed.
|
||||
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor);
|
||||
}
|
||||
|
||||
if (!m_parentGroup.m_dupeInProgress)
|
||||
{
|
||||
List<ScenePresence> avs = ParentGroup.GetLinkedAvatars();
|
||||
foreach (ScenePresence av in avs)
|
||||
{
|
||||
if (av.LinkedPrim == m_uuid)
|
||||
{
|
||||
Vector3 offset = (m_offsetPosition - oldpos);
|
||||
av.OffsetPosition += offset;
|
||||
av.SendFullUpdateToAllClients();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
TriggerScriptChangedEvent(Changed.POSITION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -775,7 +790,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_ROTATION);
|
||||
m_rotationOffset = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
@@ -859,7 +874,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary></summary>
|
||||
public Vector3 Acceleration
|
||||
{
|
||||
get { return m_acceleration; }
|
||||
get
|
||||
{
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
m_acceleration = actor.Acceleration;
|
||||
}
|
||||
return m_acceleration;
|
||||
}
|
||||
|
||||
set { m_acceleration = value; }
|
||||
}
|
||||
|
||||
@@ -964,7 +988,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_shape.Scale; }
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_SCALE);
|
||||
if (m_shape != null)
|
||||
{
|
||||
m_shape.Scale = value;
|
||||
@@ -1034,7 +1058,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (IsAttachment)
|
||||
return GroupPosition;
|
||||
|
||||
return m_offsetPosition + m_groupPosition; }
|
||||
// return m_offsetPosition + m_groupPosition; }
|
||||
return m_groupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset) ; } //KF: Rotation was ignored!
|
||||
}
|
||||
|
||||
public SceneObjectGroup ParentGroup
|
||||
@@ -1193,6 +1218,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
_flags = value;
|
||||
}
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsOccupied // KF If an av is sittingon this prim
|
||||
{
|
||||
get { return m_occupied; }
|
||||
set { m_occupied = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public UUID SitTargetAvatar
|
||||
@@ -1268,14 +1300,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear all pending updates of parts to clients
|
||||
/// </summary>
|
||||
private void ClearUpdateSchedule()
|
||||
{
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
private void SendObjectPropertiesToClient(UUID AgentID)
|
||||
{
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
@@ -1526,14 +1550,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// or flexible
|
||||
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
||||
{
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
Name,
|
||||
Shape,
|
||||
AbsolutePosition,
|
||||
Scale,
|
||||
RotationOffset,
|
||||
RigidBody);
|
||||
|
||||
try
|
||||
{
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
Name,
|
||||
Shape,
|
||||
AbsolutePosition,
|
||||
Scale,
|
||||
RotationOffset,
|
||||
RigidBody);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid);
|
||||
PhysActor = null;
|
||||
}
|
||||
// Basic Physics returns null.. joy joy joy.
|
||||
if (PhysActor != null)
|
||||
{
|
||||
@@ -1561,7 +1592,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_redo.Clear();
|
||||
}
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_ALL);
|
||||
}
|
||||
|
||||
public byte ConvertScriptUintToByte(uint indata)
|
||||
@@ -1673,7 +1704,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
PrimitiveBaseShape shape = PrimitiveBaseShape.Create();
|
||||
part.Shape = shape;
|
||||
|
||||
part.Name = "Primitive";
|
||||
part.Name = "Object";
|
||||
part._ownerID = UUID.Random();
|
||||
|
||||
return part;
|
||||
@@ -2033,12 +2064,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 GetWorldPosition()
|
||||
{
|
||||
Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
|
||||
|
||||
Vector3 axPos = OffsetPosition;
|
||||
|
||||
axPos *= parentRot;
|
||||
Vector3 translationOffsetPosition = axPos;
|
||||
return GroupPosition + translationOffsetPosition;
|
||||
if(_parentID == 0)
|
||||
{
|
||||
return GroupPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2049,7 +2085,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Quaternion newRot;
|
||||
|
||||
if (this.LinkNum == 0)
|
||||
if (this.LinkNum < 2) //KF Single or root prim
|
||||
{
|
||||
newRot = RotationOffset;
|
||||
}
|
||||
@@ -2695,17 +2731,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//Trys to fetch sound id from prim's inventory.
|
||||
//Prim's inventory doesn't support non script items yet
|
||||
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
@@ -2765,7 +2802,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="scale"></param>
|
||||
public void Resize(Vector3 scale)
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_SCALE);
|
||||
m_shape.Scale = scale;
|
||||
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
@@ -2774,38 +2811,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void RotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
rotLookAt(target, strength, damping);
|
||||
}
|
||||
|
||||
public void rotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
if (IsAttachment)
|
||||
{
|
||||
/*
|
||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||
if (avatar != null)
|
||||
{
|
||||
Rotate the Av?
|
||||
} */
|
||||
}
|
||||
else
|
||||
{
|
||||
APIDDamp = damping;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = target;
|
||||
}
|
||||
}
|
||||
|
||||
public void startLookAt(Quaternion rot, float damp, float strength)
|
||||
{
|
||||
APIDDamp = damp;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = rot;
|
||||
}
|
||||
|
||||
public void stopLookAt()
|
||||
{
|
||||
APIDTarget = Quaternion.Identity;
|
||||
m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2817,7 +2823,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (m_parentGroup != null)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
if (!m_parentGroup.areUpdatesSuspended)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
}
|
||||
}
|
||||
|
||||
int timeNow = Util.UnixTimeSinceEpoch();
|
||||
@@ -3034,8 +3043,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
const float ROTATION_TOLERANCE = 0.01f;
|
||||
const float VELOCITY_TOLERANCE = 0.001f;
|
||||
const float POSITION_TOLERANCE = 0.05f;
|
||||
const int TIME_MS_TOLERANCE = 3000;
|
||||
const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
|
||||
const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
|
||||
|
||||
if (m_updateFlag == 1)
|
||||
{
|
||||
@@ -3049,7 +3058,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
||||
{
|
||||
AddTerseUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
|
||||
|
||||
// This causes the Scene to 'poll' physical objects every couple of frames
|
||||
// bad, so it's been replaced by an event driven method.
|
||||
@@ -3067,16 +3076,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_lastAngularVelocity = AngularVelocity;
|
||||
m_lastTerseSent = Environment.TickCount;
|
||||
}
|
||||
//Moved this outside of the if clause so updates don't get blocked.. *sigh*
|
||||
m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
|
||||
{
|
||||
AddFullUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0; //Same here
|
||||
}
|
||||
}
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3096,6 +3107,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UUID ownerID = _ownerID;
|
||||
UUID objectID = UUID;
|
||||
UUID parentID = GetRootPartUUID();
|
||||
|
||||
if (ParentGroup.IsAttachment && ParentGroup.RootPart.Shape.State > 30)
|
||||
{
|
||||
// Use the avatar as the parent for HUDs, since the prims
|
||||
// are not sent to other avatars
|
||||
objectID = _ownerID;
|
||||
parentID = _ownerID;
|
||||
}
|
||||
|
||||
UUID soundID = UUID.Zero;
|
||||
Vector3 position = AbsolutePosition; // region local
|
||||
ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
|
||||
@@ -3103,17 +3123,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!UUID.TryParse(sound, out soundID))
|
||||
{
|
||||
// search sound file from inventory
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (soundID == UUID.Zero)
|
||||
@@ -3313,7 +3332,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
texcolor.B = Util.Clip((float)color.Z, 0.0f, 1.0f);
|
||||
tex.FaceTextures[face].RGBA = texcolor;
|
||||
UpdateTexture(tex);
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
return;
|
||||
}
|
||||
else if (face == ALL_SIDES)
|
||||
@@ -3335,7 +3354,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
tex.DefaultTexture.RGBA = texcolor;
|
||||
}
|
||||
UpdateTexture(tex);
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -3550,7 +3569,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void StopLookAt()
|
||||
{
|
||||
m_parentGroup.stopLookAt();
|
||||
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
|
||||
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
@@ -3577,10 +3596,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
//m_parentGroup.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
public void StoreUndoState()
|
||||
public void StoreUndoState(UndoType type)
|
||||
{
|
||||
if (!Undoing)
|
||||
if (!Undoing && (m_parentGroup == null || m_parentGroup.RootPart == null || !m_parentGroup.RootPart.Undoing))
|
||||
{
|
||||
if (!IgnoreUndoUpdate)
|
||||
{
|
||||
@@ -3591,17 +3609,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
UndoState last = m_undo.Peek();
|
||||
if (last != null)
|
||||
{
|
||||
if (last.Compare(this))
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
UndoState nUndo = new UndoState(this);
|
||||
UndoState lastUndo = m_undo.Peek();
|
||||
|
||||
UndoState nUndo = new UndoState(this, type);
|
||||
|
||||
if (lastUndo != null)
|
||||
{
|
||||
TimeSpan ts = DateTime.Now.Subtract(lastUndo.LastUpdated);
|
||||
if (ts.TotalMilliseconds < 500)
|
||||
{
|
||||
//Delete the last entry since it was less than 500 milliseconds ago
|
||||
nUndo.Merge(lastUndo);
|
||||
m_undo.Pop();
|
||||
}
|
||||
}
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
|
||||
@@ -4078,11 +4104,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_undo.Count > 0)
|
||||
{
|
||||
UndoState nUndo = null;
|
||||
UndoState goback = m_undo.Pop();
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
nUndo = new UndoState(this);
|
||||
nUndo = new UndoState(this, goback.Type);
|
||||
}
|
||||
UndoState goback = m_undo.Pop();
|
||||
|
||||
|
||||
if (goback != null)
|
||||
{
|
||||
goback.PlaybackState(this);
|
||||
@@ -4097,13 +4125,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
lock (m_redo)
|
||||
{
|
||||
UndoState gofwd = m_redo.Pop();
|
||||
if (m_parentGroup.GetSceneMaxUndo() > 0)
|
||||
{
|
||||
UndoState nUndo = new UndoState(this);
|
||||
UndoState nUndo = new UndoState(this, gofwd.Type);
|
||||
|
||||
m_undo.Push(nUndo);
|
||||
}
|
||||
UndoState gofwd = m_redo.Pop();
|
||||
if (gofwd != null)
|
||||
gofwd.PlayfwdState(this);
|
||||
}
|
||||
@@ -4551,8 +4579,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_shape.TextureEntry = textureEntry;
|
||||
TriggerScriptChangedEvent(Changed.TEXTURE);
|
||||
|
||||
m_updateFlag = 1;
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
|
||||
//This is madness..
|
||||
//ParentGroup.ScheduleGroupForFullUpdate();
|
||||
//This is sparta
|
||||
@@ -4797,5 +4826,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Color color = Color;
|
||||
return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A));
|
||||
}
|
||||
|
||||
public void ResetOwnerChangeFlag()
|
||||
{
|
||||
List<UUID> inv = Inventory.GetInventoryList();
|
||||
|
||||
foreach (UUID itemID in inv)
|
||||
{
|
||||
TaskInventoryItem item = Inventory.GetInventoryItem(itemID);
|
||||
item.OwnerChanged = false;
|
||||
Inventory.UpdateInventoryItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private string m_inventoryFileName = String.Empty;
|
||||
private int m_inventoryFileNameSerial = 0;
|
||||
|
||||
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
|
||||
|
||||
/// <value>
|
||||
/// The part to which the inventory belongs.
|
||||
@@ -82,7 +84,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </value>
|
||||
protected internal TaskInventoryDictionary Items
|
||||
{
|
||||
get { return m_items; }
|
||||
get {
|
||||
return m_items;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_items = value;
|
||||
@@ -118,22 +122,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="linkNum">Link number for the part</param>
|
||||
public void ResetInventoryIDs()
|
||||
{
|
||||
lock (m_items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
|
||||
if (0 == Items.Count)
|
||||
{
|
||||
if (0 == m_items.Count)
|
||||
return;
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
IList<TaskInventoryItem> items = GetInventoryItems();
|
||||
m_items.Clear();
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
item.ResetIDs(m_part.UUID);
|
||||
m_items.Add(item.ItemID, item);
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
return;
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.Clear();
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
item.ResetIDs(m_part.UUID);
|
||||
Items.Add(item.ItemID, item);
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -142,12 +149,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="ownerId"></param>
|
||||
public void ChangeInventoryOwner(UUID ownerId)
|
||||
{
|
||||
lock (Items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
if (0 == Items.Count)
|
||||
{
|
||||
if (0 == Items.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
return;
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
@@ -161,6 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
item.OwnerID = ownerId;
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -169,22 +176,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="groupID"></param>
|
||||
public void ChangeInventoryGroup(UUID groupID)
|
||||
{
|
||||
lock (Items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
if (0 == Items.Count)
|
||||
{
|
||||
if (0 == Items.Count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
return;
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if (groupID != item.GroupID)
|
||||
{
|
||||
item.GroupID = groupID;
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -192,9 +201,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
Items.LockItemsForRead(true);
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.LockItemsForRead(false);
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if ((int)InventoryType.LSL == item.InvType)
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList GetScriptErrors(UUID itemID)
|
||||
@@ -227,9 +241,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </param>
|
||||
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
|
||||
{
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
|
||||
Items.LockItemsForRead(true);
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.LockItemsForRead(false);
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
if ((int)InventoryType.LSL == item.InvType)
|
||||
{
|
||||
RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted);
|
||||
m_part.RemoveScriptEvents(item.ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -245,7 +268,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// item.Name, item.ItemID, Name, UUID);
|
||||
|
||||
if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
|
||||
{
|
||||
StoreScriptError(item.ItemID, "no permission");
|
||||
return;
|
||||
}
|
||||
|
||||
m_part.AddFlag(PrimFlags.Scripted);
|
||||
|
||||
@@ -254,14 +280,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (stateSource == 1 && // Prim crossing
|
||||
m_part.ParentGroup.Scene.m_trustBinaries)
|
||||
{
|
||||
lock (m_items)
|
||||
{
|
||||
m_items[item.ItemID].PermsMask = 0;
|
||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||
}
|
||||
|
||||
m_items.LockItemsForWrite(true);
|
||||
m_items[item.ItemID].PermsMask = 0;
|
||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||
m_items.LockItemsForWrite(false);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||
m_part.LocalId, item.ItemID, String.Empty, startParam, postOnRez, engine, stateSource);
|
||||
StoreScriptErrors(item.ItemID, null);
|
||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||
m_part.ScheduleFullUpdate();
|
||||
return;
|
||||
@@ -270,6 +295,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
AssetBase asset = m_part.ParentGroup.Scene.AssetService.Get(item.AssetID.ToString());
|
||||
if (null == asset)
|
||||
{
|
||||
string msg = String.Format("asset ID {0} could not be found", item.AssetID);
|
||||
StoreScriptError(item.ItemID, msg);
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
|
||||
@@ -281,15 +308,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (m_part.ParentGroup.m_savedScriptState != null)
|
||||
RestoreSavedScriptState(item.OldItemID, item.ItemID);
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
m_items[item.ItemID].PermsMask = 0;
|
||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||
}
|
||||
m_items.LockItemsForWrite(true);
|
||||
|
||||
m_items[item.ItemID].PermsMask = 0;
|
||||
m_items[item.ItemID].PermsGranter = UUID.Zero;
|
||||
|
||||
m_items.LockItemsForWrite(false);
|
||||
|
||||
string script = Utils.BytesToString(asset.Data);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRezScript(
|
||||
m_part.LocalId, item.ItemID, script, startParam, postOnRez, engine, stateSource);
|
||||
StoreScriptErrors(item.ItemID, null);
|
||||
m_part.ParentGroup.AddActiveScriptCount(1);
|
||||
m_part.ScheduleFullUpdate();
|
||||
}
|
||||
@@ -353,21 +382,145 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
/// <summary>
|
||||
/// Start a script which is in this prim's inventory.
|
||||
/// Some processing may occur in the background, but this routine returns asap.
|
||||
/// </summary>
|
||||
/// <param name="itemId">
|
||||
/// A <see cref="UUID"/>
|
||||
/// </param>
|
||||
public void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
TaskInventoryItem item = GetInventoryItem(itemId);
|
||||
if (item != null)
|
||||
CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
|
||||
lock (m_scriptErrors)
|
||||
{
|
||||
// Indicate to CreateScriptInstanceInternal() we don't want it to wait for completion
|
||||
m_scriptErrors.Remove(itemId);
|
||||
}
|
||||
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
|
||||
}
|
||||
|
||||
private void CreateScriptInstanceInternal(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
m_items.LockItemsForRead(true);
|
||||
if (m_items.ContainsKey(itemId))
|
||||
{
|
||||
if (m_items.ContainsKey(itemId))
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
CreateScriptInstance(m_items[itemId], startParam, postOnRez, engine, stateSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
string msg = String.Format("couldn't be found for prim {0}, {1} at {2} in {3}", m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
StoreScriptError(itemId, msg);
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't start script with ID {0} since it {1}", itemId, msg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
string msg = String.Format("couldn't be found for prim {0}, {1}", m_part.Name, m_part.UUID);
|
||||
StoreScriptError(itemId, msg);
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
||||
itemId, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
"Couldn't start script with ID {0} since it {1}", itemId, msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start a script which is in this prim's inventory and return any compilation error messages.
|
||||
/// </summary>
|
||||
/// <param name="itemId">
|
||||
/// A <see cref="UUID"/>
|
||||
/// </param>
|
||||
public ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource)
|
||||
{
|
||||
ArrayList errors;
|
||||
|
||||
// Indicate to CreateScriptInstanceInternal() we want it to
|
||||
// post any compilation/loading error messages
|
||||
lock (m_scriptErrors)
|
||||
{
|
||||
m_scriptErrors[itemId] = null;
|
||||
}
|
||||
|
||||
// Perform compilation/loading
|
||||
CreateScriptInstanceInternal(itemId, startParam, postOnRez, engine, stateSource);
|
||||
|
||||
// Wait for and retrieve any errors
|
||||
lock (m_scriptErrors)
|
||||
{
|
||||
while ((errors = m_scriptErrors[itemId]) == null)
|
||||
{
|
||||
if (!System.Threading.Monitor.Wait(m_scriptErrors, 15000))
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"timedout waiting for script {0} errors", itemId);
|
||||
errors = m_scriptErrors[itemId];
|
||||
if (errors == null)
|
||||
{
|
||||
errors = new ArrayList(1);
|
||||
errors.Add("timedout waiting for errors");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_scriptErrors.Remove(itemId);
|
||||
}
|
||||
return errors;
|
||||
}
|
||||
|
||||
// Signal to CreateScriptInstanceEr() that compilation/loading is complete
|
||||
private void StoreScriptErrors(UUID itemId, ArrayList errors)
|
||||
{
|
||||
lock (m_scriptErrors)
|
||||
{
|
||||
// If compilation/loading initiated via CreateScriptInstance(),
|
||||
// it does not want the errors, so just get out
|
||||
if (!m_scriptErrors.ContainsKey(itemId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Initiated via CreateScriptInstanceEr(), if we know what the
|
||||
// errors are, save them and wake CreateScriptInstanceEr().
|
||||
if (errors != null)
|
||||
{
|
||||
m_scriptErrors[itemId] = errors;
|
||||
System.Threading.Monitor.PulseAll(m_scriptErrors);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Initiated via CreateScriptInstanceEr() but we don't know what
|
||||
// the errors are yet, so retrieve them from the script engine.
|
||||
// This may involve some waiting internal to GetScriptErrors().
|
||||
errors = GetScriptErrors(itemId);
|
||||
|
||||
// Get a default non-null value to indicate success.
|
||||
if (errors == null)
|
||||
{
|
||||
errors = new ArrayList();
|
||||
}
|
||||
|
||||
// Post to CreateScriptInstanceEr() and wake it up
|
||||
lock (m_scriptErrors)
|
||||
{
|
||||
m_scriptErrors[itemId] = errors;
|
||||
System.Threading.Monitor.PulseAll(m_scriptErrors);
|
||||
}
|
||||
}
|
||||
|
||||
// Like StoreScriptErrors(), but just posts a single string message
|
||||
private void StoreScriptError(UUID itemId, string message)
|
||||
{
|
||||
ArrayList errors = new ArrayList(1);
|
||||
errors.Add(message);
|
||||
StoreScriptErrors(itemId, errors);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -380,15 +533,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </param>
|
||||
public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted)
|
||||
{
|
||||
bool scriptPresent = false;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
if (m_items.ContainsKey(itemId))
|
||||
scriptPresent = true;
|
||||
}
|
||||
|
||||
if (scriptPresent)
|
||||
if (m_items.ContainsKey(itemId))
|
||||
{
|
||||
if (!sceneObjectBeingDeleted)
|
||||
m_part.RemoveScriptEvents(itemId);
|
||||
@@ -413,14 +558,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns></returns>
|
||||
private bool InventoryContainsName(string name)
|
||||
{
|
||||
lock (m_items)
|
||||
m_items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
if (item.Name == name)
|
||||
{
|
||||
if (item.Name == name)
|
||||
return true;
|
||||
m_items.LockItemsForRead(false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForRead(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -462,8 +609,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="item"></param>
|
||||
public void AddInventoryItemExclusive(TaskInventoryItem item, bool allowedDrop)
|
||||
{
|
||||
List<TaskInventoryItem> il = GetInventoryItems();
|
||||
|
||||
m_items.LockItemsForRead(true);
|
||||
List<TaskInventoryItem> il = new List<TaskInventoryItem>(m_items.Values);
|
||||
m_items.LockItemsForRead(false);
|
||||
foreach (TaskInventoryItem i in il)
|
||||
{
|
||||
if (i.Name == item.Name)
|
||||
@@ -501,14 +649,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
item.Name = name;
|
||||
item.GroupID = m_part.GroupID;
|
||||
|
||||
lock (m_items)
|
||||
m_items.Add(item.ItemID, item);
|
||||
|
||||
if (allowedDrop)
|
||||
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
||||
else
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
m_items.LockItemsForWrite(true);
|
||||
m_items.Add(item.ItemID, item);
|
||||
m_items.LockItemsForWrite(false);
|
||||
if (allowedDrop)
|
||||
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
|
||||
else
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
m_inventorySerial++;
|
||||
//m_inventorySerial += 2;
|
||||
HasInventoryChanged = true;
|
||||
@@ -524,15 +672,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="items"></param>
|
||||
public void RestoreInventoryItems(ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
lock (m_items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
m_items.Add(item.ItemID, item);
|
||||
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
}
|
||||
m_inventorySerial++;
|
||||
m_items.Add(item.ItemID, item);
|
||||
// m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
|
||||
m_inventorySerial++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -543,10 +691,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public TaskInventoryItem GetInventoryItem(UUID itemId)
|
||||
{
|
||||
TaskInventoryItem item;
|
||||
|
||||
lock (m_items)
|
||||
m_items.TryGetValue(itemId, out item);
|
||||
|
||||
m_items.LockItemsForRead(true);
|
||||
m_items.TryGetValue(itemId, out item);
|
||||
m_items.LockItemsForRead(false);
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -562,15 +709,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>();
|
||||
|
||||
lock (m_items)
|
||||
m_items.LockItemsForRead(true);
|
||||
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Name == name)
|
||||
items.Add(item);
|
||||
}
|
||||
if (item.Name == name)
|
||||
items.Add(item);
|
||||
}
|
||||
|
||||
m_items.LockItemsForRead(false);
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
@@ -587,8 +735,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool UpdateInventoryItem(TaskInventoryItem item, bool fireScriptEvents)
|
||||
{
|
||||
TaskInventoryItem it = GetInventoryItem(item.ItemID);
|
||||
if (it != null)
|
||||
m_items.LockItemsForWrite(true);
|
||||
|
||||
if (m_items.ContainsKey(item.ItemID))
|
||||
{
|
||||
item.ParentID = m_part.UUID;
|
||||
item.ParentPartID = m_part.UUID;
|
||||
@@ -600,19 +749,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
item.GroupID = m_part.GroupID;
|
||||
|
||||
if (item.AssetID == UUID.Zero)
|
||||
item.AssetID = it.AssetID;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
m_items[item.ItemID] = item;
|
||||
m_inventorySerial++;
|
||||
}
|
||||
item.AssetID = m_items[item.ItemID].AssetID;
|
||||
|
||||
m_items[item.ItemID] = item;
|
||||
m_inventorySerial++;
|
||||
if (fireScriptEvents)
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
m_items.LockItemsForWrite(false);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -623,8 +768,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
item.ItemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
return false;
|
||||
m_items.LockItemsForWrite(false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -635,37 +781,53 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// in this prim's inventory.</returns>
|
||||
public int RemoveInventoryItem(UUID itemID)
|
||||
{
|
||||
TaskInventoryItem item = GetInventoryItem(itemID);
|
||||
if (item != null)
|
||||
m_items.LockItemsForRead(true);
|
||||
|
||||
if (m_items.ContainsKey(itemID))
|
||||
{
|
||||
int type = m_items[itemID].InvType;
|
||||
m_items.LockItemsForRead(false);
|
||||
if (type == 10) // Script
|
||||
{
|
||||
m_part.RemoveScriptEvents(itemID);
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
|
||||
}
|
||||
m_items.LockItemsForWrite(true);
|
||||
m_items.Remove(itemID);
|
||||
m_items.LockItemsForWrite(false);
|
||||
m_inventorySerial++;
|
||||
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);
|
||||
|
||||
HasInventoryChanged = true;
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
|
||||
if (!ContainsScripts())
|
||||
int scriptcount = 0;
|
||||
m_items.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
if (item.Type == 10)
|
||||
{
|
||||
scriptcount++;
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForRead(false);
|
||||
|
||||
|
||||
if (scriptcount <= 0)
|
||||
{
|
||||
m_part.RemFlag(PrimFlags.Scripted);
|
||||
}
|
||||
|
||||
m_part.ScheduleFullUpdate();
|
||||
|
||||
return type;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
m_items.LockItemsForRead(false);
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Tried to remove item ID {0} from prim {1}, {2} at {3} in {4} but the item does not exist in this inventory",
|
||||
itemID, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
"Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
|
||||
itemID, m_part.Name, m_part.UUID);
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -719,8 +881,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// isn't available (such as drag from prim inventory to agent inventory)
|
||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
||||
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
foreach (TaskInventoryItem item in items)
|
||||
m_items.LockItemsForRead(true);
|
||||
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
UUID ownerID = item.OwnerID;
|
||||
uint everyoneMask = 0;
|
||||
@@ -764,6 +927,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
||||
invString.AddSectionEnd();
|
||||
}
|
||||
int count = m_items.Count;
|
||||
m_items.LockItemsForRead(false);
|
||||
|
||||
fileData = Utils.StringToBytes(invString.BuildString);
|
||||
|
||||
@@ -784,10 +949,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
if (HasInventoryChanged)
|
||||
{
|
||||
HasInventoryChanged = false;
|
||||
List<TaskInventoryItem> items = GetInventoryItems();
|
||||
datastore.StorePrimInventory(m_part.UUID, items);
|
||||
Items.LockItemsForRead(true);
|
||||
datastore.StorePrimInventory(m_part.UUID, Items.Values);
|
||||
Items.LockItemsForRead(false);
|
||||
|
||||
HasInventoryChanged = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -854,89 +1020,75 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
uint mask=0x7fffffff;
|
||||
|
||||
lock (m_items)
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
if (item.InvType != (int)InventoryType.Object)
|
||||
{
|
||||
if (item.InvType != (int)InventoryType.Object)
|
||||
{
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
mask &= ~((uint)PermissionMask.Copy >> 13);
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
|
||||
mask &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
|
||||
mask &= ~((uint)PermissionMask.Modify >> 13);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Copy >> 13);
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Modify >> 13);
|
||||
}
|
||||
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
mask &= ~(uint)PermissionMask.Copy;
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
|
||||
mask &= ~(uint)PermissionMask.Transfer;
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
|
||||
mask &= ~(uint)PermissionMask.Modify;
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
mask &= ~((uint)PermissionMask.Copy >> 13);
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Transfer) == 0)
|
||||
mask &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
if ((item.CurrentPermissions & item.NextPermissions & (uint)PermissionMask.Modify) == 0)
|
||||
mask &= ~((uint)PermissionMask.Modify >> 13);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Copy >> 13);
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Transfer >> 13);
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
||||
mask &= ~((uint)PermissionMask.Modify >> 13);
|
||||
}
|
||||
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
mask &= ~(uint)PermissionMask.Copy;
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)
|
||||
mask &= ~(uint)PermissionMask.Transfer;
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Modify) == 0)
|
||||
mask &= ~(uint)PermissionMask.Modify;
|
||||
}
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
public void ApplyNextOwnerPermissions()
|
||||
{
|
||||
lock (m_items)
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
|
||||
{
|
||||
if (item.InvType == (int)InventoryType.Object && (item.CurrentPermissions & 7) != 0)
|
||||
{
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
|
||||
}
|
||||
item.CurrentPermissions &= item.NextPermissions;
|
||||
item.BasePermissions &= item.NextPermissions;
|
||||
item.EveryonePermissions &= item.NextPermissions;
|
||||
item.OwnerChanged = true;
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Copy >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Copy;
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Transfer >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Transfer;
|
||||
if ((item.CurrentPermissions & ((uint)PermissionMask.Modify >> 13)) == 0)
|
||||
item.CurrentPermissions &= ~(uint)PermissionMask.Modify;
|
||||
}
|
||||
item.OwnerChanged = true;
|
||||
item.CurrentPermissions &= item.NextPermissions;
|
||||
item.BasePermissions &= item.NextPermissions;
|
||||
item.EveryonePermissions &= item.NextPermissions;
|
||||
}
|
||||
}
|
||||
|
||||
public void ApplyGodPermissions(uint perms)
|
||||
{
|
||||
lock (m_items)
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
item.CurrentPermissions = perms;
|
||||
item.BasePermissions = perms;
|
||||
}
|
||||
item.CurrentPermissions = perms;
|
||||
item.BasePermissions = perms;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ContainsScripts()
|
||||
{
|
||||
lock (m_items)
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
{
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -944,11 +1096,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
List<UUID> ret = new List<UUID>();
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
ret.Add(item.ItemID);
|
||||
}
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
ret.Add(item.ItemID);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -978,6 +1127,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
public Dictionary<UUID, string> GetScriptStates()
|
||||
{
|
||||
return GetScriptStates(false);
|
||||
}
|
||||
|
||||
public Dictionary<UUID, string> GetScriptStates(bool oldIDs)
|
||||
{
|
||||
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
|
||||
|
||||
@@ -985,25 +1139,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (engines == null) // No engine at all
|
||||
return ret;
|
||||
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (IScriptModule e in engines)
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
{
|
||||
if (e != null)
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
string n = e.GetXMLState(item.ItemID);
|
||||
if (n != String.Empty)
|
||||
if (e != null)
|
||||
{
|
||||
if (!ret.ContainsKey(item.ItemID))
|
||||
ret[item.ItemID] = n;
|
||||
break;
|
||||
string n = e.GetXMLState(item.ItemID);
|
||||
if (n != String.Empty)
|
||||
{
|
||||
if (oldIDs)
|
||||
{
|
||||
if (!ret.ContainsKey(item.OldItemID))
|
||||
ret[item.OldItemID] = n;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ret.ContainsKey(item.ItemID))
|
||||
ret[item.ItemID] = n;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1013,21 +1175,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (engines == null)
|
||||
return;
|
||||
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
Items.LockItemsForRead(true);
|
||||
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
{
|
||||
foreach (IScriptModule engine in engines)
|
||||
if (item.InvType == (int)InventoryType.LSL)
|
||||
{
|
||||
if (engine != null)
|
||||
foreach (IScriptModule engine in engines)
|
||||
{
|
||||
if (item.OwnerChanged)
|
||||
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
|
||||
item.OwnerChanged = false;
|
||||
engine.ResumeScript(item.ItemID);
|
||||
if (engine != null)
|
||||
{
|
||||
if (item.OwnerChanged)
|
||||
engine.PostScriptEvent(item.ItemID, "changed", new Object[] { (int)Changed.OWNER });
|
||||
item.OwnerChanged = false;
|
||||
engine.ResumeScript(item.ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Items.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -815,6 +815,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
public event ObjectOwner OnObjectOwner;
|
||||
public event DirPlacesQuery OnDirPlacesQuery;
|
||||
public event DirFindQuery OnDirFindQuery;
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event DirLandQuery OnDirLandQuery;
|
||||
public event DirPopularQuery OnDirPopularQuery;
|
||||
public event DirClassifiedQuery OnDirClassifiedQuery;
|
||||
@@ -878,12 +879,21 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -42,17 +42,22 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
public class XmlRpcRouter : IRegionModule, IXmlRpcRouter
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_enabled = false;
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
IConfig startupConfig = config.Configs["Startup"];
|
||||
IConfig startupConfig = config.Configs["XMLRPC"];
|
||||
if (startupConfig == null)
|
||||
return;
|
||||
|
||||
if (startupConfig.GetString("XmlRpcRouterModule",
|
||||
"XmlRpcRouterModule") == "XmlRpcRouterModule")
|
||||
"") == "XmlRpcRouterModule")
|
||||
{
|
||||
scene.RegisterModuleInterface<IXmlRpcRouter>(this);
|
||||
m_enabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +81,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
|
||||
|
||||
public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
|
||||
{
|
||||
scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri});
|
||||
if (m_enabled)
|
||||
{
|
||||
scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] { uri });
|
||||
}
|
||||
}
|
||||
|
||||
public void ScriptRemoved(UUID itemID)
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
#pragma warning disable 67
|
||||
public event Action<IClientAPI> OnLogout;
|
||||
public event ObjectPermissions OnObjectPermissions;
|
||||
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event MoneyTransferRequest OnMoneyTransferRequest;
|
||||
public event ParcelBuy OnParcelBuy;
|
||||
public event Action<IClientAPI> OnConnectionClosed;
|
||||
@@ -832,11 +832,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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.*")]
|
||||
1421
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
1421
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
File diff suppressed because it is too large
Load Diff
3932
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
3932
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;
|
||||
}
|
||||
}
|
||||
3859
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
3859
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)
|
||||
|
||||
@@ -248,6 +248,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
}
|
||||
|
||||
public static void StateChange(IScriptEngine engine, uint localID, UUID itemID)
|
||||
{
|
||||
// Remove a specific script
|
||||
|
||||
// Remove dataserver events
|
||||
m_Dataserver[engine].RemoveEvents(localID, itemID);
|
||||
|
||||
IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>();
|
||||
if (comms != null)
|
||||
comms.DeleteListener(itemID);
|
||||
|
||||
IXMLRPC xmlrpc = engine.World.RequestModuleInterface<IXMLRPC>();
|
||||
xmlrpc.DeleteChannels(itemID);
|
||||
xmlrpc.CancelSRDRequests(itemID);
|
||||
|
||||
// Remove Sensors
|
||||
m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID);
|
||||
|
||||
}
|
||||
|
||||
public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID)
|
||||
{
|
||||
List<Object> data = new List<Object>();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user