Compare commits
1116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82e534a029 | ||
|
|
b8924167e0 | ||
|
|
c2bd6ccdb8 | ||
|
|
5f8ab9f018 | ||
|
|
636ca6218d | ||
|
|
c285f87702 | ||
|
|
d5d0e81df2 | ||
|
|
e9ec187746 | ||
|
|
797e461ef9 | ||
|
|
26f12f479f | ||
|
|
69c1e0b2f7 | ||
|
|
840b75ca9b | ||
|
|
9331898c32 | ||
|
|
b800a299aa | ||
|
|
dbd1a68b58 | ||
|
|
3231602b88 | ||
|
|
bd4e3b0aaf | ||
|
|
e2b08bac6d | ||
|
|
13129f1a8d | ||
|
|
e6a8d2872c | ||
|
|
a51a545cb9 | ||
|
|
05dbe4f2c4 | ||
|
|
3113cc9129 | ||
|
|
ac370cf57b | ||
|
|
cf78f3fae3 | ||
|
|
dd7f9ed7bf | ||
|
|
61137eac22 | ||
|
|
2f0a3391ee | ||
|
|
5f266fd571 | ||
|
|
d0c707209a | ||
|
|
9a78281f82 | ||
|
|
7f74dc1b14 | ||
|
|
9fa915bdef | ||
|
|
c3ddf46188 | ||
|
|
301a926015 | ||
|
|
28c4dd7931 | ||
|
|
fa7da00cc3 | ||
|
|
12ebed8bab | ||
|
|
fc33d569cd | ||
|
|
8853c21763 | ||
|
|
e0a02d6ca3 | ||
|
|
ce3594f7f2 | ||
|
|
78a6e5489b | ||
|
|
bb7a755cba | ||
|
|
46e5c8e919 | ||
|
|
e6d0fb0b0e | ||
|
|
efc555ca22 | ||
|
|
455a2ba7de | ||
|
|
537905d81b | ||
|
|
bb1e35fbd9 | ||
|
|
3eb68c319e | ||
|
|
0806d03780 | ||
|
|
cb79e228e4 | ||
|
|
2804c97a39 | ||
|
|
c2971a6398 | ||
|
|
231feab57f | ||
|
|
ff49a21eca | ||
|
|
52dd547863 | ||
|
|
ba0afa53d3 | ||
|
|
2db0ac74c7 | ||
|
|
42f76773a1 | ||
|
|
ca50f6a82c | ||
|
|
1a47ec082e | ||
|
|
b7586806cd | ||
|
|
d8149373c1 | ||
|
|
e55e93c994 | ||
|
|
da6816c805 | ||
|
|
c19ac997b1 | ||
|
|
7bbc486c62 | ||
|
|
6ba7ee6b2e | ||
|
|
90f9b7b7c4 | ||
|
|
50b03d08a8 | ||
|
|
48988bf4e9 | ||
|
|
b4fe6da4eb | ||
|
|
5910be236f | ||
|
|
662976b602 | ||
|
|
fd56fd2ce8 | ||
|
|
b40c91777c | ||
|
|
9f7f266f58 | ||
|
|
7ad1b60eca | ||
|
|
521e2c8355 | ||
|
|
ac7a4a7d38 | ||
|
|
9522881404 | ||
|
|
3d75e9addd | ||
|
|
841c84831f | ||
|
|
5b2aa02fd9 | ||
|
|
41051b3cc6 | ||
|
|
296cf04ce6 | ||
|
|
34e8bf45b6 | ||
|
|
9f17ae580d | ||
|
|
aecac9bba9 | ||
|
|
6f689f591a | ||
|
|
0080f28f1d | ||
|
|
4fbdcb95a0 | ||
|
|
83b16612ce | ||
|
|
1c1f308052 | ||
|
|
33bd4fe789 | ||
|
|
41847e8fdf | ||
|
|
9feef34a81 | ||
|
|
12f9b1df8c | ||
|
|
7229bc4fbd | ||
|
|
9cf8795ecf | ||
|
|
3a760ad12b | ||
|
|
bdd4dcf69b | ||
|
|
a6382deec5 | ||
|
|
9f7aa7deef | ||
|
|
e32855d080 | ||
|
|
7df4383235 | ||
|
|
87a1e00f05 | ||
|
|
251f2444d0 | ||
|
|
1e4e978f7f | ||
|
|
a0c87b5af6 | ||
|
|
512ded6eb5 | ||
|
|
d50a072336 | ||
|
|
ec89dc99b7 | ||
|
|
58b1ee8e2c | ||
|
|
571693d7b6 | ||
|
|
77eb8ade8c | ||
|
|
1f74f013b2 | ||
|
|
7f7bbbb84a | ||
|
|
18beb796bc | ||
|
|
540a1912ce | ||
|
|
356b1ef1d9 | ||
|
|
e27f59cf42 | ||
|
|
2f41bc4ca7 | ||
|
|
1212cb0c74 | ||
|
|
cc290abf7a | ||
|
|
d299f8b55c | ||
|
|
ec305a4825 | ||
|
|
656e64b3ed | ||
|
|
8e51ca3a7b | ||
|
|
5e1aab92f5 | ||
|
|
6a1ce17cdb | ||
|
|
d264f0d301 | ||
|
|
5e5260ad1b | ||
|
|
319007783c | ||
|
|
7a1b1dd419 | ||
|
|
342c64b7ac | ||
|
|
50cc22c9e6 | ||
|
|
8ab4b277c1 | ||
|
|
2684ca0838 | ||
|
|
3284356bba | ||
|
|
cfaefad754 | ||
|
|
c719e016ed | ||
|
|
8886afd319 | ||
|
|
f4f9a2cb45 | ||
|
|
06adbc1324 | ||
|
|
f2e343d530 | ||
|
|
00a23eea0e | ||
|
|
b9c20fbaa7 | ||
|
|
e4c2b44e5c | ||
|
|
e593607171 | ||
|
|
5cbc4e2a5f | ||
|
|
4e0d6e8e41 | ||
|
|
457160afc3 | ||
|
|
24c73aa8b2 | ||
|
|
16814dd8f1 | ||
|
|
5ea979d515 | ||
|
|
eea5d8368a | ||
|
|
713c666827 | ||
|
|
0f40ec5c65 | ||
|
|
db015963a9 | ||
|
|
09fba16094 | ||
|
|
2232e6f273 | ||
|
|
aca10cb027 | ||
|
|
b973fe5297 | ||
|
|
35d6181b78 | ||
|
|
4cf5ef3cd4 | ||
|
|
79bfa275da | ||
|
|
8ee31d97a8 | ||
|
|
47818a2db3 | ||
|
|
4b47008d30 | ||
|
|
fc8d2be632 | ||
|
|
252e159340 | ||
|
|
1096f43f0d | ||
|
|
dc1baf8025 | ||
|
|
1bcb2e788f | ||
|
|
c13045b25e | ||
|
|
314d1171ef | ||
|
|
ef5b628191 | ||
|
|
7296286267 | ||
|
|
4e324ae3cb | ||
|
|
512a13dbe7 | ||
|
|
5a05de0eec | ||
|
|
483fc88b07 | ||
|
|
b9e12ed3b7 | ||
|
|
1bfec00a88 | ||
|
|
8a1640f0a1 | ||
|
|
46412f4931 | ||
|
|
5c368c8d38 | ||
|
|
0ca771c185 | ||
|
|
98b2d3a7f2 | ||
|
|
32ddeab5e3 | ||
|
|
071edaff49 | ||
|
|
a0a25bb8ca | ||
|
|
8613336674 | ||
|
|
3ffdadef70 | ||
|
|
839b08c32b | ||
|
|
f8ff98577e | ||
|
|
f7c4be1fa1 | ||
|
|
c448151f6b | ||
|
|
4708083434 | ||
|
|
b1790ba56e | ||
|
|
187ccd72f0 | ||
|
|
cc8864b0e3 | ||
|
|
47838e5fb3 | ||
|
|
1ab631f015 | ||
|
|
a1074cad5c | ||
|
|
77705145a0 | ||
|
|
1a8a11140c | ||
|
|
fdc59ee802 | ||
|
|
0344395776 | ||
|
|
7c673c79d4 | ||
|
|
fb2deb0d45 | ||
|
|
810840b862 | ||
|
|
ca8b1e488c | ||
|
|
e74809ff4c | ||
|
|
f2d7f3e731 | ||
|
|
a32b0ce0ae | ||
|
|
042eb80a62 | ||
|
|
b43a731beb | ||
|
|
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
|
||||
|
||||
@@ -128,6 +128,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
|
||||
@@ -217,9 +218,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)
|
||||
{
|
||||
@@ -282,6 +333,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)
|
||||
{
|
||||
@@ -389,13 +487,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)
|
||||
@@ -884,7 +897,13 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
// Need to translate to MXP somehow
|
||||
}
|
||||
|
||||
public void SendKillObject(ulong regionHandle, uint localID)
|
||||
public void SendKillObject(ulong regionHandle, List<uint> localIDs)
|
||||
{
|
||||
foreach (uint localID in localIDs)
|
||||
SendKillObject(regionHandle, localID);
|
||||
}
|
||||
|
||||
private void SendKillObject(ulong regionHandle, uint localID)
|
||||
{
|
||||
DisappearanceEventMessage de = new DisappearanceEventMessage();
|
||||
de.ObjectIndex = localID;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
@@ -485,7 +495,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void SendKillObject(ulong regionHandle, uint localID)
|
||||
public void SendKillObject(ulong regionHandle, List<uint> localID)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 32
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE `regionwindlight` (
|
||||
|
||||
@@ -124,7 +124,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))
|
||||
@@ -146,6 +146,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,6 +167,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>
|
||||
@@ -973,7 +979,7 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="localID"></param>
|
||||
void SendKillObject(ulong regionHandle, uint localID);
|
||||
void SendKillObject(ulong regionHandle, List<uint> localID);
|
||||
|
||||
void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
|
||||
void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -244,13 +244,22 @@ namespace OpenSim.Framework
|
||||
// The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
|
||||
// occasionally seems to corrupt its addin cache
|
||||
// Hence, as a temporary solution we'll remove it before each startup
|
||||
|
||||
string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY");
|
||||
string v0 = "addin-db-000";
|
||||
string v1 = "addin-db-001";
|
||||
if (customDir != null && customDir != String.Empty)
|
||||
{
|
||||
v0 = Path.Combine(customDir, v0);
|
||||
v1 = Path.Combine(customDir, v1);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (Directory.Exists("addin-db-000"))
|
||||
Directory.Delete("addin-db-000", true);
|
||||
if (Directory.Exists(v0))
|
||||
Directory.Delete(v0, true);
|
||||
|
||||
if (Directory.Exists("addin-db-001"))
|
||||
Directory.Delete("addin-db-001", true);
|
||||
if (Directory.Exists(v1))
|
||||
Directory.Delete(v1, true);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
|
||||
@@ -1333,7 +1333,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 bool valid = false;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace OpenSim.Framework
|
||||
private UUID _permsGranter;
|
||||
private int _permsMask;
|
||||
private int _type = 0;
|
||||
private UUID _oldID;
|
||||
private UUID _oldID = UUID.Zero;
|
||||
|
||||
private bool _ownerChanged = false;
|
||||
|
||||
@@ -348,7 +348,8 @@ namespace OpenSim.Framework
|
||||
/// <param name="partID">The new part ID to which this item belongs</param>
|
||||
public void ResetIDs(UUID partID)
|
||||
{
|
||||
OldItemID = ItemID;
|
||||
if (_oldID == UUID.Zero)
|
||||
_oldID = ItemID;
|
||||
ItemID = UUID.Random();
|
||||
ParentPartID = partID;
|
||||
ParentID = partID;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1008,19 +1008,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;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenSim.Framework
|
||||
public ThreadWatchdogInfo(Thread thread)
|
||||
{
|
||||
Thread = thread;
|
||||
LastTick = Environment.TickCount & Int32.MaxValue;
|
||||
LastTick = Environment.TickCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,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));
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace OpenSim.Framework
|
||||
|
||||
lock (m_threads)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
int now = Environment.TickCount;
|
||||
|
||||
foreach (ThreadWatchdogInfo threadInfo in m_threads.Values)
|
||||
{
|
||||
|
||||
@@ -437,7 +437,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(','));
|
||||
}
|
||||
|
||||
// Load the simulation data service
|
||||
@@ -360,7 +369,41 @@ 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);
|
||||
@@ -368,6 +411,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();
|
||||
@@ -378,11 +425,20 @@ namespace OpenSim
|
||||
"[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
|
||||
e.Message, 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();
|
||||
|
||||
@@ -390,6 +446,11 @@ namespace OpenSim
|
||||
// scripting engines.
|
||||
scene.CreateScriptInstances();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("ScriptEngine started", scene);
|
||||
}
|
||||
|
||||
m_sceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
@@ -398,6 +459,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)
|
||||
@@ -409,6 +474,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;
|
||||
@@ -417,6 +488,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,6 +155,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; } }
|
||||
@@ -406,6 +418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_IsActive; }
|
||||
set { m_IsActive = value; }
|
||||
}
|
||||
|
||||
public bool IsLoggingOut
|
||||
{
|
||||
get { return m_IsLoggingOut; }
|
||||
@@ -475,18 +488,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;
|
||||
|
||||
@@ -766,7 +791,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.ChatData.OwnerID = fromAgentID;
|
||||
reply.ChatData.SourceID = fromAgentID;
|
||||
|
||||
OutPacket(reply, ThrottleOutPacketType.Task);
|
||||
OutPacket(reply, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1052,6 +1077,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>
|
||||
@@ -1064,16 +1093,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)
|
||||
{
|
||||
@@ -1081,51 +1107,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
|
||||
@@ -1145,7 +1155,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)
|
||||
{
|
||||
@@ -1506,35 +1516,46 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(pc, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
public void SendKillObject(ulong regionHandle, uint localID)
|
||||
public void SendKillObject(ulong regionHandle, List<uint> localIDs)
|
||||
{
|
||||
// m_log.DebugFormat("[CLIENT]: Sending KillObjectPacket to {0} for {1} in {2}", Name, localID, regionHandle);
|
||||
|
||||
KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[0].ID = localID;
|
||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[localIDs.Count];
|
||||
for (int i = 0 ; i < localIDs.Count ; i++ )
|
||||
{
|
||||
kill.ObjectData[i] = new KillObjectPacket.ObjectDataBlock();
|
||||
kill.ObjectData[i].ID = localIDs[i];
|
||||
}
|
||||
kill.Header.Reliable = true;
|
||||
kill.Header.Zerocoded = true;
|
||||
|
||||
if (m_scene.GetScenePresence(localID) == null)
|
||||
if (localIDs.Count == 1)
|
||||
{
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
if (m_scene.GetScenePresence(localIDs[0]) != null)
|
||||
{
|
||||
m_killRecord.Add(localID);
|
||||
|
||||
// The throttle queue used here must match that being used for updates. Otherwise, there is a
|
||||
// chance that a kill packet put on a separate queue will be sent to the client before an existing
|
||||
// update packet on another queue. Receiving updates after kills results in unowned and undeletable
|
||||
// scene objects in a viewer until that viewer is relogged in.
|
||||
OutPacket(kill, ThrottleOutPacketType.Task);
|
||||
OutPacket(kill, ThrottleOutPacketType.State);
|
||||
return;
|
||||
}
|
||||
m_killRecord.Add(localIDs[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
OutPacket(kill, ThrottleOutPacketType.State);
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
{
|
||||
foreach (uint localID in localIDs)
|
||||
m_killRecord.Add(localID);
|
||||
}
|
||||
}
|
||||
|
||||
// The throttle queue used here must match that being used for
|
||||
// updates. Otherwise, there is a chance that a kill packet put
|
||||
// on a separate queue will be sent to the client before an
|
||||
// existing update packet on another queue. Receiving updates
|
||||
// after kills results in unowned and undeletable
|
||||
// scene objects in a viewer until that viewer is relogged in.
|
||||
OutPacket(kill, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2240,6 +2261,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);
|
||||
@@ -3541,6 +3571,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)
|
||||
@@ -3561,23 +3600,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
EntityUpdate update;
|
||||
while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update))
|
||||
{
|
||||
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
||||
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
||||
// safety measure.
|
||||
//
|
||||
// Receiving updates after kills results in undeleteable prims that persist until relog and
|
||||
// currently occurs because prims can be deleted before all queued updates are sent.
|
||||
if (m_killRecord.Contains(update.Entity.LocalId))
|
||||
{
|
||||
// m_log.WarnFormat(
|
||||
// "[CLIENT]: Preventing full update for prim with local id {0} after client for user {1} told it was deleted",
|
||||
// update.Entity.LocalId, Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
@@ -4011,6 +4040,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;
|
||||
@@ -4917,6 +4949,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);
|
||||
@@ -5016,6 +5049,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) ||
|
||||
@@ -5389,7 +5423,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;
|
||||
@@ -9428,6 +9462,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)
|
||||
{
|
||||
@@ -10925,7 +10990,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
// It's a ghost! tell the client to delete it from view.
|
||||
simClient.SendKillObject(Scene.RegionInfo.RegionHandle,
|
||||
localId);
|
||||
new List<uint>() { localId });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -11289,6 +11354,21 @@ 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>
|
||||
@@ -11552,7 +11632,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))
|
||||
@@ -425,6 +433,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;
|
||||
|
||||
@@ -918,7 +918,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
|
||||
{
|
||||
@@ -934,7 +957,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_scene.TryGetClient(udpClient.AgentID, out client))
|
||||
{
|
||||
client.IsLoggingOut = true;
|
||||
client.Close();
|
||||
client.Close(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
this.parent = parent;
|
||||
MaxBurst = maxBurst;
|
||||
DripRate = dripRate;
|
||||
lastDrip = Environment.TickCount & Int32.MaxValue;
|
||||
lastDrip = Environment.TickCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -143,41 +143,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount)
|
||||
{
|
||||
bool dummy;
|
||||
return RemoveTokens(amount, out dummy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a given number of tokens from the bucket
|
||||
/// </summary>
|
||||
/// <param name="amount">Number of tokens to remove from the bucket</param>
|
||||
/// <param name="dripSucceeded">True if tokens were added to the bucket
|
||||
/// during this call, otherwise false</param>
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount, out bool dripSucceeded)
|
||||
{
|
||||
if (maxBurst == 0)
|
||||
{
|
||||
dripSucceeded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
dripSucceeded = Drip();
|
||||
|
||||
if (content - amount >= 0)
|
||||
if (amount > maxBurst)
|
||||
{
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
return false;
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
throw new Exception("amount " + amount + " exceeds maxBurst " + maxBurst);
|
||||
}
|
||||
else
|
||||
|
||||
Drip();
|
||||
|
||||
if (content < amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -193,25 +183,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
content = maxBurst;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
int now = Environment.TickCount;
|
||||
int deltaMS = now - lastDrip;
|
||||
lastDrip = now;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
int deltaMS = now - lastDrip;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
if (deltaMS < 0)
|
||||
lastDrip = now;
|
||||
return false;
|
||||
}
|
||||
|
||||
int dripAmount = deltaMS * tokensPerMS;
|
||||
|
||||
content = Math.Min(content + dripAmount, maxBurst);
|
||||
lastDrip = now;
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
long dripAmount = (long)deltaMS * (long)tokensPerMS + (long)content;
|
||||
if (dripAmount > maxBurst)
|
||||
{
|
||||
dripAmount = maxBurst;
|
||||
}
|
||||
content = (int)dripAmount;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
@@ -229,15 +230,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ATTACHMENTS MODULE]: Rezzing attachment to point {0} from item {1} for {2}",
|
||||
(AttachmentPoint)AttachmentPt, itemID, remoteClient.Name);
|
||||
|
||||
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
// TODO: this short circuits multiple attachments functionality in LL viewer 2.1+ and should
|
||||
// be removed when that functionality is implemented in opensim
|
||||
AttachmentPt &= 0x7f;
|
||||
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
|
||||
|
||||
if (updateInventoryStatus)
|
||||
{
|
||||
@@ -254,7 +257,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)
|
||||
@@ -288,13 +291,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
|
||||
{
|
||||
@@ -331,9 +340,11 @@ 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*/);
|
||||
if (presence.Appearance != null)
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
|
||||
}
|
||||
|
||||
return att.UUID;
|
||||
@@ -376,6 +387,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 */);
|
||||
|
||||
@@ -464,6 +481,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());
|
||||
UpdateKnownItem(remoteClient, group, group.GetFromItemID(), group.OwnerID);
|
||||
@@ -603,7 +622,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
//
|
||||
if (so.IsSelected)
|
||||
{
|
||||
m_scene.SendKillObject(so.RootPart.LocalId);
|
||||
m_scene.SendKillObject(new List<uint> { so.RootPart.LocalId });
|
||||
}
|
||||
|
||||
so.IsSelected = false; // fudge....
|
||||
|
||||
@@ -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:
|
||||
@@ -231,8 +245,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
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)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -276,31 +302,34 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||
|
||||
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
||||
|
||||
((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);
|
||||
receiverIDs.Add(presence.UUID);
|
||||
});
|
||||
|
||||
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
||||
fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, 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);
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
);
|
||||
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
||||
fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -343,5 +372,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,4 +239,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,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)
|
||||
m_NeedsListOfFriends.Add(agentID);
|
||||
@@ -701,7 +701,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)
|
||||
{
|
||||
if (client != null)
|
||||
|
||||
@@ -145,8 +145,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
if (!user.IsChildAgent)
|
||||
{
|
||||
// Local message
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
|
||||
// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
|
||||
// Message sent
|
||||
@@ -168,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
// Local message
|
||||
ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
|
||||
|
||||
m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
|
||||
// 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,38 @@ 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.GroupInvitation &&
|
||||
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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
if (im.binaryBucket.Length < 17) // Invalid
|
||||
return;
|
||||
|
||||
UUID receipientID = new UUID(im.toAgentID);
|
||||
ScenePresence user = scene.GetScenePresence(receipientID);
|
||||
UUID recipientID = new UUID(im.toAgentID);
|
||||
ScenePresence user = scene.GetScenePresence(recipientID);
|
||||
UUID copyID;
|
||||
|
||||
// First byte is the asset type
|
||||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
folderID, new UUID(im.toAgentID));
|
||||
|
||||
InventoryFolderBase folderCopy
|
||||
= scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero);
|
||||
= scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero);
|
||||
|
||||
if (folderCopy == null)
|
||||
{
|
||||
@@ -248,6 +248,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.
|
||||
@@ -417,22 +419,64 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
private void OnGridInstantMessage(GridInstantMessage msg)
|
||||
private void OnGridInstantMessage(GridInstantMessage im)
|
||||
{
|
||||
// Check if this is ours to handle
|
||||
//
|
||||
Scene scene = FindClientScene(new UUID(msg.toAgentID));
|
||||
Scene scene = FindClientScene(new UUID(im.toAgentID));
|
||||
|
||||
if (scene == null)
|
||||
return;
|
||||
|
||||
// Find agent to deliver to
|
||||
//
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID));
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
if (user == null)
|
||||
return;
|
||||
|
||||
// Just forward to local handling
|
||||
OnInstantMessage(user.ControllingClient, msg);
|
||||
// This requires a little bit of processing because we have to make the
|
||||
// new item visible in the recipient's inventory here
|
||||
//
|
||||
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
if (im.binaryBucket.Length < 17) // Invalid
|
||||
return;
|
||||
|
||||
UUID recipientID = new UUID(im.toAgentID);
|
||||
|
||||
// First byte is the asset type
|
||||
AssetType assetType = (AssetType)im.binaryBucket[0];
|
||||
|
||||
if (AssetType.Folder == assetType)
|
||||
{
|
||||
UUID folderID = new UUID(im.binaryBucket, 1);
|
||||
|
||||
InventoryFolderBase given =
|
||||
new InventoryFolderBase(folderID, recipientID);
|
||||
InventoryFolderBase folder =
|
||||
scene.InventoryService.GetFolder(given);
|
||||
|
||||
if (folder != null)
|
||||
user.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
UUID itemID = new UUID(im.binaryBucket, 1);
|
||||
|
||||
InventoryItemBase given =
|
||||
new InventoryItemBase(itemID, recipientID);
|
||||
InventoryItemBase item =
|
||||
scene.InventoryService.GetItem(given);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
user.ControllingClient.SendBulkUpdateInventory(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Just forward to the client
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected virtual void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
client.OnTeleportHomeRequest += TeleportHomeFired;
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
@@ -269,7 +269,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
|
||||
@@ -459,6 +459,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
sp.Scene.CleanDroppedAttachments();
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
|
||||
if (NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
@@ -527,7 +529,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected void KillEntity(Scene scene, uint localID)
|
||||
{
|
||||
scene.SendKillObject(localID);
|
||||
scene.SendKillObject(new List<uint>() { localID });
|
||||
}
|
||||
|
||||
protected virtual GridRegion GetFinalDestination(GridRegion region)
|
||||
@@ -565,7 +567,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
#region Teleport Home
|
||||
|
||||
public virtual void TeleportHome(UUID id, IClientAPI client)
|
||||
public void TeleportHomeFired(UUID id, IClientAPI client)
|
||||
{
|
||||
TeleportHome(id, client);
|
||||
}
|
||||
|
||||
public virtual bool TeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||
|
||||
@@ -574,12 +581,18 @@ 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 false;
|
||||
}
|
||||
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
|
||||
if (regionInfo == null)
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
|
||||
@@ -590,6 +603,13 @@ 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 false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -877,15 +897,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))
|
||||
@@ -987,10 +1011,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.Id0 = currentAgentCircuit.Id0;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -1123,6 +1151,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);
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected override void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
client.OnTeleportHomeRequest += TeleportHomeFired;
|
||||
client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
public override void TeleportHome(UUID id, IClientAPI client)
|
||||
public void TeleportHomeFired(UUID id, IClientAPI client)
|
||||
{
|
||||
TeleportHome(id, client);
|
||||
}
|
||||
|
||||
public override bool TeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||
|
||||
@@ -184,8 +189,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
// local grid user
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
|
||||
base.TeleportHome(id, client);
|
||||
return;
|
||||
return base.TeleportHome(id, client);
|
||||
}
|
||||
|
||||
// Foreign user wants to go home
|
||||
@@ -195,7 +199,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Your information has been lost");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString());
|
||||
@@ -205,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Your home region could not be found");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId);
|
||||
@@ -213,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Internal error");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
||||
@@ -223,6 +227,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ExternalHostName, homeGatekeeper.HttpPort, homeGatekeeper.RegionName);
|
||||
|
||||
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Xml;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
@@ -191,11 +192,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
|
||||
List<SceneObjectGroup> objectGroups, IClientAPI remoteClient)
|
||||
{
|
||||
// HACK: This is only working for lists containing a single item!
|
||||
// It's just a hack to make this WIP compile and run. Nothing
|
||||
// currently calls this with multiple items.
|
||||
UUID ret = UUID.Zero;
|
||||
|
||||
// The following code groups the SOG's by owner. No objects
|
||||
// belonging to different people can be coalesced, for obvious
|
||||
// reasons.
|
||||
Dictionary<UUID, List<SceneObjectGroup>> deletes =
|
||||
new Dictionary<UUID, List<SceneObjectGroup>>();
|
||||
|
||||
@@ -207,264 +208,334 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
deletes[g.OwnerID].Add(g);
|
||||
}
|
||||
|
||||
foreach (List<SceneObjectGroup> objlist in deletes.Values)
|
||||
{
|
||||
foreach (SceneObjectGroup g in objlist)
|
||||
ret = DeleteToInventory(action, folderID, g, remoteClient);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private UUID DeleteToInventory(DeRezAction action, UUID folderID,
|
||||
SceneObjectGroup objectGroup, IClientAPI remoteClient)
|
||||
{
|
||||
// This is pethod scoped and will be returned. It will be the
|
||||
// last created asset id
|
||||
UUID assetID = UUID.Zero;
|
||||
|
||||
Vector3 inventoryStoredPosition = new Vector3
|
||||
(((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: objectGroup.AbsolutePosition.X)
|
||||
,
|
||||
(objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: objectGroup.AbsolutePosition.X,
|
||||
objectGroup.AbsolutePosition.Z);
|
||||
|
||||
Vector3 originalPosition = objectGroup.AbsolutePosition;
|
||||
|
||||
objectGroup.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
|
||||
|
||||
objectGroup.AbsolutePosition = originalPosition;
|
||||
|
||||
// Get the user info of the item destination
|
||||
//
|
||||
UUID userID = UUID.Zero;
|
||||
|
||||
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
|
||||
action == DeRezAction.SaveToExistingUserInventoryItem)
|
||||
// Each iteration is really a separate asset being created,
|
||||
// with distinct destinations as well.
|
||||
foreach (List<SceneObjectGroup> objlist in deletes.Values)
|
||||
{
|
||||
// Take or take copy require a taker
|
||||
// Saving changes requires a local user
|
||||
//
|
||||
if (remoteClient == null)
|
||||
return UUID.Zero;
|
||||
Dictionary<UUID, string> xmlStrings =
|
||||
new Dictionary<UUID, string>();
|
||||
|
||||
userID = remoteClient.AgentId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// All returns / deletes go to the object owner
|
||||
//
|
||||
|
||||
userID = objectGroup.RootPart.OwnerID;
|
||||
}
|
||||
|
||||
if (userID == UUID.Zero) // Can't proceed
|
||||
{
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
// If we're returning someone's item, it goes back to the
|
||||
// owner's Lost And Found folder.
|
||||
// Delete is treated like return in this case
|
||||
// Deleting your own items makes them go to trash
|
||||
//
|
||||
|
||||
InventoryFolderBase folder = null;
|
||||
InventoryItemBase item = null;
|
||||
|
||||
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
||||
{
|
||||
item = new InventoryItemBase(objectGroup.RootPart.FromUserInventoryItemID, userID);
|
||||
item = m_Scene.InventoryService.GetItem(item);
|
||||
|
||||
//item = userInfo.RootFolder.FindItem(
|
||||
// objectGroup.RootPart.FromUserInventoryItemID);
|
||||
|
||||
if (null == item)
|
||||
foreach (SceneObjectGroup objectGroup in objlist)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
|
||||
objectGroup.Name, objectGroup.UUID);
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Folder magic
|
||||
//
|
||||
if (action == DeRezAction.Delete)
|
||||
{
|
||||
// Deleting someone else's item
|
||||
//
|
||||
if (remoteClient == null ||
|
||||
objectGroup.OwnerID != remoteClient.AgentId)
|
||||
{
|
||||
Vector3 inventoryStoredPosition = new Vector3
|
||||
(((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: objectGroup.AbsolutePosition.X)
|
||||
,
|
||||
(objectGroup.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? 250
|
||||
: objectGroup.AbsolutePosition.X,
|
||||
objectGroup.AbsolutePosition.Z);
|
||||
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
|
||||
}
|
||||
}
|
||||
else if (action == DeRezAction.Return)
|
||||
{
|
||||
Vector3 originalPosition = objectGroup.AbsolutePosition;
|
||||
|
||||
// Dump to lost + found unconditionally
|
||||
//
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
// Restore attachment data after trip through the sim
|
||||
if (objectGroup.RootPart.AttachPoint > 0)
|
||||
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
|
||||
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
|
||||
|
||||
if (folderID == UUID.Zero && folder == null)
|
||||
{
|
||||
if (action == DeRezAction.Delete)
|
||||
{
|
||||
// Deletes go to trash by default
|
||||
//
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (remoteClient == null ||
|
||||
objectGroup.OwnerID != remoteClient.AgentId)
|
||||
{
|
||||
// Taking copy of another person's item. Take to
|
||||
// Objects folder.
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Catch all. Use lost & found
|
||||
//
|
||||
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Override and put into where it came from, if it came
|
||||
// from anywhere in inventory
|
||||
//
|
||||
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
|
||||
{
|
||||
if (objectGroup.RootPart.FromFolderID != UUID.Zero)
|
||||
{
|
||||
InventoryFolderBase f = new InventoryFolderBase(objectGroup.RootPart.FromFolderID, userID);
|
||||
folder = m_Scene.InventoryService.GetFolder(f);
|
||||
}
|
||||
}
|
||||
|
||||
if (folder == null) // None of the above
|
||||
{
|
||||
folder = new InventoryFolderBase(folderID);
|
||||
|
||||
if (folder == null) // Nowhere to put it
|
||||
{
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
item = new InventoryItemBase();
|
||||
item.CreatorId = objectGroup.RootPart.CreatorID.ToString();
|
||||
item.ID = UUID.Random();
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = folder.ID;
|
||||
item.Owner = userID;
|
||||
}
|
||||
|
||||
AssetBase asset = CreateAsset(
|
||||
objectGroup.GetPartName(objectGroup.RootPart.LocalId),
|
||||
objectGroup.GetPartDescription(objectGroup.RootPart.LocalId),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
objectGroup.OwnerID.ToString());
|
||||
m_Scene.AssetService.Store(asset);
|
||||
assetID = asset.FullID;
|
||||
|
||||
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
||||
{
|
||||
item.AssetID = asset.FullID;
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AssetID = asset.FullID;
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
uint perms = objectGroup.GetEffectivePermissions();
|
||||
uint nextPerms = (perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
objectGroup.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
// Make sure all bits but the ones we want are clear
|
||||
// on take.
|
||||
// This will be applied to the current perms, so
|
||||
// it will do what we want.
|
||||
objectGroup.RootPart.NextOwnerMask &=
|
||||
((uint)PermissionMask.Copy |
|
||||
((uint)PermissionMask.Copy |
|
||||
(uint)PermissionMask.Transfer |
|
||||
(uint)PermissionMask.Modify);
|
||||
objectGroup.RootPart.NextOwnerMask |=
|
||||
(uint)PermissionMask.Move;
|
||||
|
||||
item.BasePermissions = perms & objectGroup.RootPart.NextOwnerMask;
|
||||
item.CurrentPermissions = item.BasePermissions;
|
||||
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
|
||||
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask & objectGroup.RootPart.NextOwnerMask;
|
||||
item.GroupPermissions = objectGroup.RootPart.GroupMask & objectGroup.RootPart.NextOwnerMask;
|
||||
|
||||
// Magic number badness. Maybe this deserves an enum.
|
||||
// bit 4 (16) is the "Slam" bit, it means treat as passed
|
||||
// and apply next owner perms on rez
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
}
|
||||
else
|
||||
{
|
||||
item.BasePermissions = objectGroup.GetEffectivePermissions();
|
||||
item.CurrentPermissions = objectGroup.GetEffectivePermissions();
|
||||
item.NextPermissions = objectGroup.RootPart.NextOwnerMask;
|
||||
item.EveryOnePermissions = objectGroup.RootPart.EveryoneMask;
|
||||
item.GroupPermissions = objectGroup.RootPart.GroupMask;
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
|
||||
|
||||
item.CurrentPermissions &=
|
||||
((uint)PermissionMask.Copy |
|
||||
(uint)PermissionMask.Transfer |
|
||||
(uint)PermissionMask.Modify |
|
||||
(uint)PermissionMask.Move |
|
||||
7); // Preserve folded permissions
|
||||
objectGroup.AbsolutePosition = originalPosition;
|
||||
|
||||
xmlStrings[objectGroup.UUID] = sceneObjectXml;
|
||||
}
|
||||
|
||||
// TODO: add the new fields (Flags, Sale info, etc)
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
string itemXml;
|
||||
|
||||
m_Scene.AddInventoryItem(item);
|
||||
if (objlist.Count > 1)
|
||||
{
|
||||
float minX, minY, minZ;
|
||||
float maxX, maxY, maxZ;
|
||||
|
||||
if (remoteClient != null && item.Owner == remoteClient.AgentId)
|
||||
{
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
|
||||
if (notifyUser != null)
|
||||
Vector3[] offsets = m_Scene.GetCombinedBoundingBox(objlist,
|
||||
out minX, out maxX, out minY, out maxY,
|
||||
out minZ, out maxZ);
|
||||
|
||||
// CreateWrapper
|
||||
XmlDocument itemDoc = new XmlDocument();
|
||||
XmlElement root = itemDoc.CreateElement("", "CoalescedObject", "");
|
||||
itemDoc.AppendChild(root);
|
||||
|
||||
// Embed the offsets into the group XML
|
||||
for ( int i = 0 ; i < objlist.Count ; i++ )
|
||||
{
|
||||
notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
XmlDocument doc = new XmlDocument();
|
||||
SceneObjectGroup g = objlist[i];
|
||||
doc.LoadXml(xmlStrings[g.UUID]);
|
||||
XmlElement e = (XmlElement)doc.SelectSingleNode("/SceneObjectGroup");
|
||||
e.SetAttribute("offsetx", offsets[i].X.ToString());
|
||||
e.SetAttribute("offsety", offsets[i].Y.ToString());
|
||||
e.SetAttribute("offsetz", offsets[i].Z.ToString());
|
||||
|
||||
XmlNode objectNode = itemDoc.ImportNode(e, true);
|
||||
root.AppendChild(objectNode);
|
||||
}
|
||||
|
||||
float sizeX = maxX - minX;
|
||||
float sizeY = maxY - minY;
|
||||
float sizeZ = maxZ - minZ;
|
||||
|
||||
root.SetAttribute("x", sizeX.ToString());
|
||||
root.SetAttribute("y", sizeY.ToString());
|
||||
root.SetAttribute("z", sizeZ.ToString());
|
||||
|
||||
itemXml = itemDoc.InnerXml;
|
||||
}
|
||||
else
|
||||
{
|
||||
itemXml = xmlStrings[objlist[0].UUID];
|
||||
}
|
||||
|
||||
// Get the user info of the item destination
|
||||
//
|
||||
UUID userID = UUID.Zero;
|
||||
|
||||
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
|
||||
action == DeRezAction.SaveToExistingUserInventoryItem)
|
||||
{
|
||||
// Take or take copy require a taker
|
||||
// Saving changes requires a local user
|
||||
//
|
||||
if (remoteClient == null)
|
||||
return UUID.Zero;
|
||||
|
||||
userID = remoteClient.AgentId;
|
||||
}
|
||||
else
|
||||
{
|
||||
// All returns / deletes go to the object owner
|
||||
//
|
||||
|
||||
userID = objlist[0].RootPart.OwnerID;
|
||||
}
|
||||
|
||||
if (userID == UUID.Zero) // Can't proceed
|
||||
{
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
// If we're returning someone's item, it goes back to the
|
||||
// owner's Lost And Found folder.
|
||||
// Delete is treated like return in this case
|
||||
// Deleting your own items makes them go to trash
|
||||
//
|
||||
|
||||
InventoryFolderBase folder = null;
|
||||
InventoryItemBase item = null;
|
||||
|
||||
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
||||
{
|
||||
item = new InventoryItemBase(objlist[0].RootPart.FromUserInventoryItemID, userID);
|
||||
item = m_Scene.InventoryService.GetItem(item);
|
||||
|
||||
//item = userInfo.RootFolder.FindItem(
|
||||
// objectGroup.RootPart.FromUserInventoryItemID);
|
||||
|
||||
if (null == item)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.",
|
||||
objlist[0].Name, objlist[0].UUID);
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Folder magic
|
||||
//
|
||||
if (action == DeRezAction.Delete)
|
||||
{
|
||||
// Deleting someone else's item
|
||||
//
|
||||
if (remoteClient == null ||
|
||||
objlist[0].OwnerID != remoteClient.AgentId)
|
||||
{
|
||||
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
|
||||
}
|
||||
}
|
||||
else if (action == DeRezAction.Return)
|
||||
{
|
||||
|
||||
// Dump to lost + found unconditionally
|
||||
//
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
|
||||
if (folderID == UUID.Zero && folder == null)
|
||||
{
|
||||
if (action == DeRezAction.Delete)
|
||||
{
|
||||
// Deletes go to trash by default
|
||||
//
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.TrashFolder);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (remoteClient == null ||
|
||||
objlist[0].OwnerID != remoteClient.AgentId)
|
||||
{
|
||||
// Taking copy of another person's item. Take to
|
||||
// Objects folder.
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Catch all. Use lost & found
|
||||
//
|
||||
|
||||
folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Override and put into where it came from, if it came
|
||||
// from anywhere in inventory
|
||||
//
|
||||
if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
|
||||
{
|
||||
if (objlist[0].RootPart.FromFolderID != UUID.Zero)
|
||||
{
|
||||
InventoryFolderBase f = new InventoryFolderBase(objlist[0].RootPart.FromFolderID, userID);
|
||||
folder = m_Scene.InventoryService.GetFolder(f);
|
||||
}
|
||||
}
|
||||
|
||||
if (folder == null) // None of the above
|
||||
{
|
||||
folder = new InventoryFolderBase(folderID);
|
||||
|
||||
if (folder == null) // Nowhere to put it
|
||||
{
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
|
||||
item = new InventoryItemBase();
|
||||
// Can't know creator is the same, so null it in inventory
|
||||
if (objlist.Count > 1)
|
||||
item.CreatorId = UUID.Zero.ToString();
|
||||
else
|
||||
item.CreatorId = objlist[0].RootPart.CreatorID.ToString();
|
||||
item.ID = UUID.Random();
|
||||
item.InvType = (int)InventoryType.Object;
|
||||
item.Folder = folder.ID;
|
||||
item.Owner = userID;
|
||||
if (objlist.Count > 1)
|
||||
{
|
||||
item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SaleType = objlist[0].RootPart.ObjectSaleType;
|
||||
item.SalePrice = objlist[0].RootPart.SalePrice;
|
||||
}
|
||||
}
|
||||
|
||||
AssetBase asset = CreateAsset(
|
||||
objlist[0].GetPartName(objlist[0].RootPart.LocalId),
|
||||
objlist[0].GetPartDescription(objlist[0].RootPart.LocalId),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(itemXml),
|
||||
objlist[0].OwnerID.ToString());
|
||||
m_Scene.AssetService.Store(asset);
|
||||
assetID = asset.FullID;
|
||||
|
||||
if (DeRezAction.SaveToExistingUserInventoryItem == action)
|
||||
{
|
||||
item.AssetID = asset.FullID;
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.AssetID = asset.FullID;
|
||||
|
||||
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
|
||||
foreach (SceneObjectGroup grp in objlist)
|
||||
effectivePerms &= grp.GetEffectivePermissions();
|
||||
effectivePerms |= (uint)PermissionMask.Move;
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != objlist[0].RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
uint perms = effectivePerms;
|
||||
uint nextPerms = (perms & 7) << 13;
|
||||
if ((nextPerms & (uint)PermissionMask.Copy) == 0)
|
||||
perms &= ~(uint)PermissionMask.Copy;
|
||||
if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
|
||||
perms &= ~(uint)PermissionMask.Transfer;
|
||||
if ((nextPerms & (uint)PermissionMask.Modify) == 0)
|
||||
perms &= ~(uint)PermissionMask.Modify;
|
||||
|
||||
item.BasePermissions = perms & objlist[0].RootPart.NextOwnerMask;
|
||||
item.CurrentPermissions = item.BasePermissions;
|
||||
item.NextPermissions = perms & objlist[0].RootPart.NextOwnerMask;
|
||||
item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
|
||||
item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
|
||||
|
||||
// Magic number badness. Maybe this deserves an enum.
|
||||
// bit 4 (16) is the "Slam" bit, it means treat as passed
|
||||
// and apply next owner perms on rez
|
||||
item.CurrentPermissions |= 16; // Slam!
|
||||
}
|
||||
else
|
||||
{
|
||||
item.BasePermissions = effectivePerms;
|
||||
item.CurrentPermissions = effectivePerms;
|
||||
item.NextPermissions = objlist[0].RootPart.NextOwnerMask & effectivePerms;
|
||||
item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & effectivePerms;
|
||||
item.GroupPermissions = objlist[0].RootPart.GroupMask & effectivePerms;
|
||||
|
||||
item.CurrentPermissions &=
|
||||
((uint)PermissionMask.Copy |
|
||||
(uint)PermissionMask.Transfer |
|
||||
(uint)PermissionMask.Modify |
|
||||
(uint)PermissionMask.Move |
|
||||
7); // Preserve folded permissions
|
||||
}
|
||||
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
item.Description = asset.Description;
|
||||
item.Name = asset.Name;
|
||||
item.AssetType = asset.Type;
|
||||
|
||||
m_Scene.AddInventoryItem(item);
|
||||
|
||||
if (remoteClient != null && item.Owner == remoteClient.AgentId)
|
||||
{
|
||||
remoteClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScenePresence notifyUser = m_Scene.GetScenePresence(item.Owner);
|
||||
if (notifyUser != null)
|
||||
{
|
||||
notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return assetID;
|
||||
}
|
||||
|
||||
@@ -515,8 +586,15 @@ 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());
|
||||
|
||||
SceneObjectGroup group = null;
|
||||
|
||||
if (rezAsset != null)
|
||||
{
|
||||
UUID itemId = UUID.Zero;
|
||||
@@ -525,32 +603,83 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// item that it came from. This allows us to enable 'save object to inventory'
|
||||
if (!m_Scene.Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy)
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy && (item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
itemId = item.ID;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Brave new fullperm world
|
||||
//
|
||||
itemId = item.ID;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
// Brave new fullperm world
|
||||
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);
|
||||
List<SceneObjectGroup> objlist =
|
||||
new List<SceneObjectGroup>();
|
||||
List<Vector3> veclist = new List<Vector3>();
|
||||
|
||||
group.RootPart.FromFolderID = item.Folder;
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.LoadXml(xmlData);
|
||||
XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
|
||||
if (e == null || attachment) // Single
|
||||
{
|
||||
SceneObjectGroup g =
|
||||
SceneObjectSerializer.FromOriginalXmlFormat(
|
||||
itemId, xmlData);
|
||||
objlist.Add(g);
|
||||
veclist.Add(new Vector3(0, 0, 0));
|
||||
|
||||
// If it's rezzed in world, select it. Much easier to
|
||||
// find small items.
|
||||
//
|
||||
if (!attachment)
|
||||
group.RootPart.CreateSelected = true;
|
||||
float offsetHeight = 0;
|
||||
pos = m_Scene.GetNewRezLocation(
|
||||
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
|
||||
BypassRayCast, bRayEndIsIntersection, true, g.GetAxisAlignedBoundingBox(out offsetHeight), false);
|
||||
pos.Z += offsetHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
XmlElement coll = (XmlElement)e;
|
||||
float bx = Convert.ToSingle(coll.GetAttribute("x"));
|
||||
float by = Convert.ToSingle(coll.GetAttribute("y"));
|
||||
float bz = Convert.ToSingle(coll.GetAttribute("z"));
|
||||
Vector3 bbox = new Vector3(bx, by, bz);
|
||||
|
||||
pos = m_Scene.GetNewRezLocation(RayStart, RayEnd,
|
||||
RayTargetID, Quaternion.Identity,
|
||||
BypassRayCast, bRayEndIsIntersection, true,
|
||||
bbox, false);
|
||||
|
||||
pos -= bbox / 2;
|
||||
|
||||
XmlNodeList groups = e.SelectNodes("SceneObjectGroup");
|
||||
foreach (XmlNode n in groups)
|
||||
{
|
||||
SceneObjectGroup g =
|
||||
SceneObjectSerializer.FromOriginalXmlFormat(
|
||||
itemId, n.OuterXml);
|
||||
objlist.Add(g);
|
||||
XmlElement el = (XmlElement)n;
|
||||
float x = Convert.ToSingle(el.GetAttribute("offsetx"));
|
||||
float y = Convert.ToSingle(el.GetAttribute("offsety"));
|
||||
float z = Convert.ToSingle(el.GetAttribute("offsetz"));
|
||||
veclist.Add(new Vector3(x, y, z));
|
||||
}
|
||||
}
|
||||
|
||||
int primcount = 0;
|
||||
foreach (SceneObjectGroup g in objlist)
|
||||
primcount += g.PrimCount;
|
||||
|
||||
if (!m_Scene.Permissions.CanRezObject(
|
||||
group.PrimCount, remoteClient.AgentId, pos)
|
||||
primcount, remoteClient.AgentId, pos)
|
||||
&& !attachment)
|
||||
{
|
||||
// The client operates in no fail mode. It will
|
||||
@@ -563,110 +692,144 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
return null;
|
||||
}
|
||||
|
||||
group.ResetIDs();
|
||||
|
||||
if (attachment)
|
||||
for (int i = 0 ; i < objlist.Count ; i++ )
|
||||
{
|
||||
group.RootPart.Flags |= PrimFlags.Phantom;
|
||||
group.RootPart.IsAttachment = true;
|
||||
}
|
||||
group = objlist[i];
|
||||
|
||||
// If we're rezzing an attachment then don't ask AddNewSceneObject() to update the client since
|
||||
// we'll be doing that later on. Scheduling more than one full update during the attachment
|
||||
// process causes some clients to fail to display the attachment properly.
|
||||
m_Scene.AddNewSceneObject(group, true, false);
|
||||
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;
|
||||
|
||||
// m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z);
|
||||
// if attachment we set it's asset id so object updates can reflect that
|
||||
// if not, we set it's position in world.
|
||||
if (!attachment)
|
||||
{
|
||||
group.ScheduleGroupForFullUpdate();
|
||||
|
||||
float offsetHeight = 0;
|
||||
pos = m_Scene.GetNewRezLocation(
|
||||
RayStart, RayEnd, RayTargetID, Quaternion.Identity,
|
||||
BypassRayCast, bRayEndIsIntersection, true, group.GetAxisAlignedBoundingBox(out offsetHeight), false);
|
||||
pos.Z += offsetHeight;
|
||||
group.AbsolutePosition = pos;
|
||||
// m_log.InfoFormat("rezx point for inventory rezz is {0} {1} {2} and offsetheight was {3}", pos.X, pos.Y, pos.Z, offsetHeight);
|
||||
// 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.Parts)
|
||||
child.CreateSelected = true;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
group.SetFromItemID(itemID);
|
||||
}
|
||||
|
||||
SceneObjectPart rootPart = null;
|
||||
try
|
||||
{
|
||||
rootPart = group.GetChildPart(group.UUID);
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
string isAttachment = "";
|
||||
group.ResetIDs();
|
||||
|
||||
if (attachment)
|
||||
isAttachment = " Object was an attachment";
|
||||
|
||||
m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
|
||||
}
|
||||
|
||||
// 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.
|
||||
rootPart.Name = item.Name;
|
||||
rootPart.Description = item.Description;
|
||||
|
||||
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
|
||||
if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
//Need to kill the for sale here
|
||||
rootPart.ObjectSaleType = 0;
|
||||
rootPart.SalePrice = 10;
|
||||
|
||||
if (m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
foreach (SceneObjectPart part in group.Parts)
|
||||
group.RootPart.Flags |= PrimFlags.Phantom;
|
||||
group.RootPart.IsAttachment = true;
|
||||
}
|
||||
|
||||
// If we're rezzing an attachment then don't ask
|
||||
// AddNewSceneObject() to update the client since
|
||||
// we'll be doing that later on. Scheduling more than
|
||||
// one full update during the attachment
|
||||
// process causes some clients to fail to display the
|
||||
// attachment properly.
|
||||
m_Scene.AddNewSceneObject(group, true, false);
|
||||
|
||||
// if attachment we set it's asset id so object updates
|
||||
// can reflect that, if not, we set it's position in world.
|
||||
if (!attachment)
|
||||
{
|
||||
group.ScheduleGroupForFullUpdate();
|
||||
|
||||
group.AbsolutePosition = pos + veclist[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
group.SetFromItemID(itemID);
|
||||
}
|
||||
|
||||
SceneObjectPart rootPart = null;
|
||||
|
||||
try
|
||||
{
|
||||
rootPart = group.GetChildPart(group.UUID);
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
string isAttachment = "";
|
||||
|
||||
if (attachment)
|
||||
isAttachment = " Object was an attachment";
|
||||
|
||||
m_log.Error("[AGENT INVENTORY]: Error rezzing ItemID: " + itemID + " object has no rootpart." + isAttachment);
|
||||
}
|
||||
|
||||
// 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.
|
||||
// On coalesced objects, this has no effect.
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
rootPart.Name = item.Name;
|
||||
rootPart.Description = item.Description;
|
||||
rootPart.ObjectSaleType = item.SaleType;
|
||||
rootPart.SalePrice = item.SalePrice;
|
||||
}
|
||||
|
||||
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
|
||||
if ((rootPart.OwnerID != item.Owner) ||
|
||||
(item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
//Need to kill the for sale here
|
||||
rootPart.ObjectSaleType = 0;
|
||||
rootPart.SalePrice = 10;
|
||||
|
||||
if (m_Scene.Permissions.PropagatePermissions())
|
||||
{
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
foreach (SceneObjectPart part in group.Parts)
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
}
|
||||
|
||||
group.ApplyNextOwnerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart part in group.Parts)
|
||||
{
|
||||
if ((part.OwnerID != item.Owner) ||
|
||||
(item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
part.LastOwnerID = part.OwnerID;
|
||||
part.OwnerID = item.Owner;
|
||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
}
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
|
||||
rootPart.TrimPermissions();
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
group.ApplyNextOwnerPermissions();
|
||||
// Fire on_rez
|
||||
group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
|
||||
rootPart.ParentGroup.ResumeScripts();
|
||||
|
||||
rootPart.ScheduleFullUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart part in group.Parts)
|
||||
{
|
||||
if ((part.OwnerID != item.Owner) || (item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
part.LastOwnerID = part.OwnerID;
|
||||
part.OwnerID = item.Owner;
|
||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
}
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
|
||||
rootPart.TrimPermissions();
|
||||
|
||||
if (!attachment)
|
||||
{
|
||||
if (group.RootPart.Shape.PCode == (byte)PCode.Prim)
|
||||
{
|
||||
group.ClearPartAttachmentData();
|
||||
}
|
||||
|
||||
// Fire on_rez
|
||||
group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
|
||||
rootPart.ParentGroup.ResumeScripts();
|
||||
|
||||
rootPart.ScheduleFullUpdate();
|
||||
}
|
||||
|
||||
if (!m_Scene.Permissions.BypassPermissions())
|
||||
{
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
@@ -682,9 +845,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rootPart.ParentGroup;
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -269,6 +269,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// being no copy/no mod for everyone
|
||||
lock (part.TaskInventory)
|
||||
{
|
||||
if (!ResolveUserUuid(part.CreatorID))
|
||||
part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.OwnerID))
|
||||
part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.LastOwnerID))
|
||||
part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
// And zap any troublesome sit target information
|
||||
part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||
part.SitTargetPosition = new Vector3(0, 0, 0);
|
||||
|
||||
// Fix ownership/creator of inventory items
|
||||
// Not doing so results in inventory items
|
||||
// being no copy/no mod for everyone
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
{
|
||||
@@ -281,6 +298,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
kvp.Value.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
}
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(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();
|
||||
@@ -343,7 +345,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
if (!s.IsChildAgent)
|
||||
{
|
||||
m_scene.TeleportClientHome(user, s.ControllingClient);
|
||||
if (!m_scene.TeleportClientHome(user, s.ControllingClient))
|
||||
{
|
||||
s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
|
||||
s.ControllingClient.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +483,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
ScenePresence s = m_scene.GetScenePresence(prey);
|
||||
if (s != null)
|
||||
{
|
||||
m_scene.TeleportClientHome(prey, s.ControllingClient);
|
||||
if (!m_scene.TeleportClientHome(prey, s.ControllingClient))
|
||||
{
|
||||
s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
|
||||
s.ControllingClient.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -496,7 +506,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
// Also make sure they are actually in the region
|
||||
if (p != null && !p.IsChildAgent)
|
||||
{
|
||||
m_scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
||||
if (!m_scene.TeleportClientHome(p.UUID, p.ControllingClient))
|
||||
{
|
||||
p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
|
||||
p.ControllingClient.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -899,6 +913,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>]",
|
||||
@@ -1168,6 +1185,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;
|
||||
|
||||
|
||||
@@ -85,6 +85,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;
|
||||
@@ -99,6 +101,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)
|
||||
@@ -350,7 +358,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));
|
||||
@@ -647,7 +655,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
|
||||
@@ -990,6 +998,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)
|
||||
@@ -1576,5 +1601,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,6 +288,22 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasGroupAccess(UUID avatar)
|
||||
{
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
{
|
||||
ScenePresence sp;
|
||||
if (!m_scene.TryGetScenePresence(avatar, out sp))
|
||||
return false;
|
||||
|
||||
if (!sp.ControllingClient.IsGroupMember(LandData.GroupID))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsBannedFromLand(UUID avatar)
|
||||
{
|
||||
if (m_scene.Permissions.IsAdministrator(avatar))
|
||||
@@ -324,10 +340,14 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//If they are not on the access list and are not the owner
|
||||
if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar)
|
||||
{
|
||||
//They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
|
||||
return true;
|
||||
if (!HasGroupAccess(avatar))
|
||||
{
|
||||
//They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "PermissionsModule"; }
|
||||
get { return "DefaultPermissionsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
|
||||
@@ -31,12 +31,14 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.World.Sound
|
||||
{
|
||||
public class SoundModule : IRegionModule, ISoundModule
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
@@ -62,6 +64,12 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
public virtual void PlayAttachedSound(
|
||||
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
|
||||
if (part == null)
|
||||
return;
|
||||
|
||||
SceneObjectGroup grp = part.ParentGroup;
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
@@ -71,12 +79,25 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
if (dis > 100.0) // Max audio distance
|
||||
return;
|
||||
|
||||
if (grp.IsAttachment)
|
||||
{
|
||||
if (grp.GetAttachmentPoint() > 30) // HUD
|
||||
{
|
||||
if (sp.ControllingClient.AgentId != grp.OwnerID)
|
||||
return;
|
||||
}
|
||||
|
||||
if (sp.ControllingClient.AgentId == grp.OwnerID)
|
||||
dis = 0;
|
||||
}
|
||||
|
||||
// Scale by distance
|
||||
if (radius == 0)
|
||||
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
|
||||
else
|
||||
gain = (float)((double)gain * ((radius - dis) / radius));
|
||||
|
||||
m_log.DebugFormat("Play sound, gain {0}", gain);
|
||||
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
|
||||
});
|
||||
}
|
||||
@@ -84,6 +105,18 @@ namespace OpenSim.Region.CoreModules.World.Sound
|
||||
public virtual void TriggerSound(
|
||||
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
|
||||
if (part == null)
|
||||
return;
|
||||
|
||||
SceneObjectGroup grp = part.ParentGroup;
|
||||
|
||||
if (grp.IsAttachment && grp.GetAttachmentPoint() > 30)
|
||||
{
|
||||
objectID = ownerID;
|
||||
parentID = ownerID;
|
||||
}
|
||||
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -110,7 +111,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
m_parts.Remove(part.UUID);
|
||||
|
||||
remoteClient.SendKillObject(m_regionHandle, part.LocalId);
|
||||
remoteClient.SendKillObject(m_regionHandle, new List<uint>() { part.LocalId} );
|
||||
remoteClient.AddMoney(1);
|
||||
remoteClient.SendChatMessage("Poof!", 1, AbsolutePosition, "Party Party", UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
@@ -121,7 +122,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
m_parts.Remove(m_rootPart.UUID);
|
||||
m_scene.DeleteSceneObject(this, false);
|
||||
remoteClient.SendKillObject(m_regionHandle, m_rootPart.LocalId);
|
||||
remoteClient.SendKillObject(m_regionHandle, new List<uint>() { m_rootPart.LocalId });
|
||||
remoteClient.AddMoney(50);
|
||||
remoteClient.SendChatMessage("KABLAM!!!", 1, AbsolutePosition, "Groupie Groupie", UUID.Zero, (byte)ChatSourceType.Object, (byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
|
||||
@@ -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 GenericCall1 OnRequestWearables;
|
||||
@@ -429,7 +429,7 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
|
||||
}
|
||||
|
||||
public virtual void SendKillObject(ulong regionHandle, uint localID)
|
||||
public virtual void SendKillObject(ulong regionHandle, List<uint> localID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -821,11 +821,20 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
@@ -82,6 +83,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
|
||||
|
||||
// Same as above, but also load script states from a separate doc
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
|
||||
|
||||
/// <summary>
|
||||
/// Rez multiple attachments from a user's inventory
|
||||
/// </summary>
|
||||
@@ -129,4 +134,4 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="pos"></param>
|
||||
void UpdateAttachmentPosition(IClientAPI client, SceneObjectGroup sog, Vector3 pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,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>
|
||||
@@ -235,5 +237,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// A <see cref="Dictionary`2"/>
|
||||
/// </returns>
|
||||
Dictionary<UUID, string> GetScriptStates();
|
||||
Dictionary<UUID, string> GetScriptStates(bool oldIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position,
|
||||
Vector3 lookAt, uint teleportFlags);
|
||||
|
||||
void TeleportHome(UUID id, IClientAPI client);
|
||||
bool TeleportHome(UUID id, IClientAPI client);
|
||||
|
||||
void Cross(ScenePresence agent, bool isFlying);
|
||||
|
||||
|
||||
@@ -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,11 +53,17 @@ 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
|
||||
public bool m_jumping = false; // Add for jumping
|
||||
public float m_jumpVelocity = 0f; // Add for jumping
|
||||
private int m_landing = 0; // Add for jumping
|
||||
public bool m_falling = false; // Add for falling
|
||||
private float m_fallHeight; // Add for falling
|
||||
|
||||
/// <value>
|
||||
/// The scene presence that this animator applies to
|
||||
/// </value>
|
||||
@@ -114,7 +120,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
public void ResetAnimations()
|
||||
{
|
||||
Console.WriteLine("ResetA.............");
|
||||
m_animations.Clear();
|
||||
TrySetMovementAnimation("STAND");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -123,8 +131,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(
|
||||
@@ -142,14 +148,14 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
/// </summary>
|
||||
public string GetMovementAnimation()
|
||||
{
|
||||
const float FALL_DELAY = 0.33f;
|
||||
const float PREJUMP_DELAY = 0.25f;
|
||||
|
||||
//Console.WriteLine("GMA-------"); //##
|
||||
//#@ const float FALL_DELAY = 0.33f;
|
||||
const float FALL_DELAY = 800f; //## mS
|
||||
//rm for jumping const float PREJUMP_DELAY = 0.25f;
|
||||
const float PREJUMP_DELAY = 200f; // mS add for jumping
|
||||
const float JUMP_PERIOD = 800f; // mS add for jumping
|
||||
#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 +165,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;
|
||||
@@ -182,8 +187,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
// Is the avatar trying to move?
|
||||
// bool moving = (move != Vector3.Zero);
|
||||
bool jumping = m_animTickJump != 0;
|
||||
|
||||
// rm for jumping bool jumping = m_animTickJump != 0;
|
||||
#endregion Inputs
|
||||
|
||||
#region Flying
|
||||
@@ -192,6 +196,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
m_animTickFall = 0;
|
||||
m_animTickJump = 0;
|
||||
m_jumping = false; //add for jumping
|
||||
m_falling = true; //add for falling
|
||||
m_jumpVelocity = 0f; //add for jumping
|
||||
actor.Selected = false; //add for jumping flag
|
||||
m_fallHeight = actor.Position.Z; // save latest flying height
|
||||
|
||||
if (move.X != 0f || move.Y != 0f)
|
||||
{
|
||||
@@ -203,8 +212,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
}
|
||||
else if (move.Z < 0f)
|
||||
{
|
||||
if (actor != null && actor.IsColliding)
|
||||
if (actor != null && actor.IsColliding)
|
||||
{ //##
|
||||
//Console.WriteLine("LAND FLYING"); // ##
|
||||
return "LAND";
|
||||
} //#
|
||||
else
|
||||
return "HOVER_DOWN";
|
||||
}
|
||||
@@ -218,19 +230,28 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
#region Falling/Floating/Landing
|
||||
|
||||
if (actor == null || !actor.IsColliding)
|
||||
// rm for jumping if (actor == null || !actor.IsColliding)
|
||||
if ((actor == null || !actor.IsColliding) && !m_jumping) // add for jumping
|
||||
{
|
||||
float fallElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
||||
// rm float fallElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
||||
float fallElapsed = (float)(Environment.TickCount - m_animTickFall); // add, in mS
|
||||
float fallVelocity = (actor != null) ? actor.Velocity.Z : 0.0f;
|
||||
//Console.WriteLine("falling t={0} v={1}", fallElapsed, fallVelocity); //##
|
||||
|
||||
if (m_animTickFall == 0 || (fallElapsed > FALL_DELAY && fallVelocity >= 0.0f))
|
||||
// rm for fall if (m_animTickFall == 0 || (fallElapsed > FALL_DELAY && fallVelocity >= 0.0f))
|
||||
if (!m_jumping && (fallVelocity < -3.0f) ) m_falling = true; // add for falling and jumping
|
||||
|
||||
if (m_animTickFall == 0 || (fallVelocity >= 0.0f)) // add for jumping
|
||||
// not falling yet or going up
|
||||
{
|
||||
// Just started falling
|
||||
// reset start of fall time
|
||||
m_animTickFall = Environment.TickCount;
|
||||
}
|
||||
else if (!jumping && fallElapsed > FALL_DELAY)
|
||||
// else if (!jumping && fallElapsed > FALL_DELAY)
|
||||
else if (!m_jumping && (fallElapsed > FALL_DELAY) && (fallVelocity < -3.0f) ) // add for falling and jumping
|
||||
{
|
||||
// Falling long enough to trigger the animation
|
||||
//Console.WriteLine("FALLDOWN"); //##
|
||||
return "FALLDOWN";
|
||||
}
|
||||
|
||||
@@ -239,22 +260,97 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
|
||||
#endregion Falling/Floating/Landing
|
||||
|
||||
|
||||
#region Jumping // section added for jumping...
|
||||
|
||||
int jumptime;
|
||||
jumptime = Environment.TickCount - m_animTickJump;
|
||||
|
||||
|
||||
if ((move.Z > 0f) && (!m_jumping))
|
||||
{
|
||||
//Console.WriteLine("PJ {0}", jumptime); //##
|
||||
// Start jumping, prejump
|
||||
m_animTickFall = 0;
|
||||
m_jumping = true;
|
||||
m_falling = false;
|
||||
actor.Selected = true; // borrowed for jmping flag
|
||||
m_animTickJump = Environment.TickCount;
|
||||
m_jumpVelocity = 0.35f;
|
||||
return "PREJUMP";
|
||||
}
|
||||
|
||||
if(m_jumping)
|
||||
{
|
||||
if ( (jumptime > (JUMP_PERIOD * 1.5f)) && actor.IsColliding)
|
||||
{
|
||||
//Console.WriteLine("LA {0}", jumptime); //##
|
||||
// end jumping
|
||||
m_jumping = false;
|
||||
m_falling = false;
|
||||
actor.Selected = false; // borrowed for jumping flag
|
||||
m_jumpVelocity = 0f;
|
||||
m_animTickFall = Environment.TickCount;
|
||||
return "LAND";
|
||||
}
|
||||
else if (jumptime > JUMP_PERIOD)
|
||||
{
|
||||
//Console.WriteLine("JD {0}", jumptime); //##
|
||||
// jump down
|
||||
m_jumpVelocity = 0f;
|
||||
return "JUMP";
|
||||
}
|
||||
else if (jumptime > PREJUMP_DELAY)
|
||||
{
|
||||
//Console.WriteLine("JU {0}", jumptime); //##
|
||||
// jump up
|
||||
m_jumping = true;
|
||||
m_jumpVelocity = 10f;
|
||||
return "JUMP";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Jumping // end added section
|
||||
|
||||
#region Ground Movement
|
||||
|
||||
if (m_movementAnimation == "FALLDOWN")
|
||||
{
|
||||
m_falling = false;
|
||||
m_animTickFall = Environment.TickCount;
|
||||
|
||||
// TODO: SOFT_LAND support
|
||||
return "LAND";
|
||||
float fallHeight = m_fallHeight - actor.Position.Z;
|
||||
//Console.WriteLine("Hit from {0}", fallHeight); //##
|
||||
if (fallHeight > 15.0f) // add for falling
|
||||
return "STANDUP";
|
||||
else if (fallHeight > 8.0f) // add for falling
|
||||
return "SOFT_LAND"; // add for falling
|
||||
else // add for falling
|
||||
return "LAND"; // add for falling
|
||||
}
|
||||
else if (m_movementAnimation == "LAND")
|
||||
// rm jumping float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
||||
// rm jumping if ((m_animTickFall != 0) && (landElapsed <= FALL_DELAY))
|
||||
// rm for landing return "LAND";
|
||||
else if ((m_movementAnimation == "LAND") || (m_movementAnimation == "SOFT_LAND") || (m_movementAnimation == "STANDUP"))
|
||||
{
|
||||
float landElapsed = (float)(Environment.TickCount - m_animTickFall) / 1000f;
|
||||
if ((m_animTickFall != 0) && (landElapsed <= FALL_DELAY))
|
||||
return "LAND";
|
||||
}
|
||||
int landElapsed = Environment.TickCount - m_animTickFall; // add for jumping
|
||||
int limit = 1000; // add for jumping
|
||||
if(m_movementAnimation == "LAND") limit = 350; // add for jumping
|
||||
// NB if the above is set too long a weird anim reset from some place prevents STAND from being sent to client
|
||||
|
||||
if ((m_animTickFall != 0) && (landElapsed <= limit)) // add for jumping
|
||||
{
|
||||
//Console.WriteLine("Lelapse {0}", m_movementAnimation); //##
|
||||
return m_movementAnimation;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Console.WriteLine("end/STAND"); //##
|
||||
m_fallHeight = actor.Position.Z; // save latest flying height
|
||||
return "STAND";
|
||||
}
|
||||
}
|
||||
/* This section removed, replaced by jumping section
|
||||
m_animTickFall = 0;
|
||||
|
||||
if (move.Z > 0f)
|
||||
@@ -266,7 +362,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)
|
||||
@@ -284,29 +380,34 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
// Not jumping
|
||||
m_animTickJump = 0;
|
||||
|
||||
if (move.X != 0f || move.Y != 0f)
|
||||
{
|
||||
// Walking / crouchwalking / running
|
||||
if (move.Z < 0f)
|
||||
return "CROUCHWALK";
|
||||
else if (m_scenePresence.SetAlwaysRun)
|
||||
return "RUN";
|
||||
else
|
||||
return "WALK";
|
||||
}
|
||||
*/
|
||||
// next section moved outside paren. and realigned for jumping
|
||||
if (move.X != 0f || move.Y != 0f)
|
||||
{
|
||||
m_fallHeight = actor.Position.Z; // save latest flying height
|
||||
m_falling = false; // Add for falling
|
||||
// Walking / crouchwalking / running
|
||||
if (move.Z < 0f)
|
||||
return "CROUCHWALK";
|
||||
else if (m_scenePresence.SetAlwaysRun)
|
||||
return "RUN";
|
||||
else
|
||||
{
|
||||
// Not walking
|
||||
if (move.Z < 0f)
|
||||
return "CROUCH";
|
||||
else
|
||||
return "STAND";
|
||||
}
|
||||
return "WALK";
|
||||
}
|
||||
|
||||
// rm for jumping else
|
||||
else if (!m_jumping) // add for jumping
|
||||
{
|
||||
m_falling = false; // Add for falling
|
||||
// Not walking
|
||||
if (move.Z < 0f)
|
||||
return "CROUCH";
|
||||
else
|
||||
return "STAND";
|
||||
}
|
||||
// end section realign for jumping
|
||||
#endregion Ground Movement
|
||||
|
||||
m_falling = false; // Add for falling
|
||||
return m_movementAnimation;
|
||||
}
|
||||
|
||||
@@ -316,16 +417,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
public void UpdateMovementAnimations()
|
||||
{
|
||||
m_movementAnimation = GetMovementAnimation();
|
||||
|
||||
if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
|
||||
/* if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
|
||||
{
|
||||
// This was the previous behavior before PREJUMP
|
||||
TrySetMovementAnimation("JUMP");
|
||||
}
|
||||
else
|
||||
{
|
||||
{ removed for jumping */
|
||||
TrySetMovementAnimation(m_movementAnimation);
|
||||
}
|
||||
// rm for jumping }
|
||||
}
|
||||
|
||||
public UUID[] GetAnimationArray()
|
||||
|
||||
@@ -104,8 +104,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// better than losing the object for now.
|
||||
if (permissionToDelete)
|
||||
{
|
||||
List<uint> killIDs = new List<uint>();
|
||||
|
||||
foreach (SceneObjectGroup g in objectGroups)
|
||||
{
|
||||
killIDs.Add(g.LocalId);
|
||||
g.DeleteGroupFromScene(false);
|
||||
}
|
||||
|
||||
m_scene.SendKillObject(killIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
x = m_inventoryDeletes.Dequeue();
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ASYNC DELETER]: Sending object to user's inventory, {0} item(s) remaining.", left);
|
||||
"[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -177,4 +184,4 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(ISimulationDataService datastore, bool forceBackup);
|
||||
|
||||
public event OnBackupDelegate OnBackup;
|
||||
@@ -757,6 +761,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()
|
||||
{
|
||||
|
||||
@@ -167,6 +167,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private double GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
|
||||
{
|
||||
if (entity == null) return double.NaN;
|
||||
ScenePresence presence = m_scene.GetScenePresence(client.AgentId);
|
||||
if (presence != null)
|
||||
{
|
||||
@@ -226,9 +227,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;
|
||||
|
||||
@@ -251,12 +252,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;
|
||||
}
|
||||
|
||||
@@ -99,34 +99,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="item"></param>
|
||||
public bool AddInventoryItem(InventoryItemBase item)
|
||||
{
|
||||
if (UUID.Zero == item.Folder)
|
||||
InventoryFolderBase folder;
|
||||
|
||||
if (item.Folder == UUID.Zero)
|
||||
{
|
||||
InventoryFolderBase f = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
|
||||
if (f != null)
|
||||
folder = InventoryService.GetFolderForType(item.Owner, (AssetType)item.AssetType);
|
||||
if (folder == null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[LOCAL INVENTORY SERVICES CONNECTOR]: Found folder {0} type {1} for item {2}",
|
||||
// f.Name, (AssetType)f.Type, item.Name);
|
||||
|
||||
item.Folder = f.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
f = InventoryService.GetRootFolder(item.Owner);
|
||||
if (f != null)
|
||||
{
|
||||
item.Folder = f.ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[AGENT INVENTORY]: Could not find root folder for {0} when trying to add item {1} with no parent folder specified",
|
||||
item.Owner, item.Name);
|
||||
folder = InventoryService.GetRootFolder(item.Owner);
|
||||
|
||||
if (folder == null)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
item.Folder = folder.ID;
|
||||
}
|
||||
|
||||
|
||||
if (InventoryService.AddItem(item))
|
||||
{
|
||||
int userlevel = 0;
|
||||
@@ -252,8 +240,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Update item with new asset
|
||||
item.AssetID = asset.FullID;
|
||||
if (group.UpdateInventoryItem(item))
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
group.UpdateInventoryItem(item);
|
||||
|
||||
part.GetProperties(remoteClient);
|
||||
|
||||
@@ -264,12 +251,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);
|
||||
}
|
||||
else
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
}
|
||||
part.ParentGroup.ResumeScripts();
|
||||
return errors;
|
||||
@@ -683,6 +665,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
}
|
||||
|
||||
if (newName == null) newName = item.Name;
|
||||
|
||||
AssetBase asset = AssetService.Get(item.AssetID.ToString());
|
||||
|
||||
if (asset != null)
|
||||
@@ -729,6 +713,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>
|
||||
@@ -972,8 +974,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;
|
||||
@@ -1420,13 +1426,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
agentTransactions.HandleTaskItemUpdateFromTransaction(
|
||||
remoteClient, part, transactionID, currentItem);
|
||||
|
||||
if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
|
||||
remoteClient.SendAgentAlertMessage("Notecard saved", false);
|
||||
else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
else
|
||||
remoteClient.SendAgentAlertMessage("Item saved", false);
|
||||
}
|
||||
|
||||
// Base ALWAYS has move
|
||||
@@ -1544,7 +1543,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);
|
||||
|
||||
@@ -1696,23 +1695,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// build a list of eligible objects
|
||||
List<uint> deleteIDs = new List<uint>();
|
||||
List<SceneObjectGroup> deleteGroups = new List<SceneObjectGroup>();
|
||||
|
||||
// Start with true for both, then remove the flags if objects
|
||||
// that we can't derez are part of the selection
|
||||
bool permissionToTake = true;
|
||||
bool permissionToTakeCopy = true;
|
||||
bool permissionToDelete = true;
|
||||
List<SceneObjectGroup> takeGroups = new List<SceneObjectGroup>();
|
||||
|
||||
foreach (uint localID in localIDs)
|
||||
{
|
||||
// Start with true for both, then remove the flags if objects
|
||||
// that we can't derez are part of the selection
|
||||
bool permissionToTake = true;
|
||||
bool permissionToTakeCopy = true;
|
||||
bool permissionToDelete = true;
|
||||
|
||||
// Invalid id
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
{
|
||||
//Client still thinks the object exists, kill it
|
||||
deleteIDs.Add(localID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Already deleted by someone else
|
||||
if (part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||
{
|
||||
//Client still thinks the object exists, kill it
|
||||
deleteIDs.Add(localID);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Can't delete child prims
|
||||
if (part != part.ParentGroup.RootPart)
|
||||
@@ -1720,9 +1728,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
SceneObjectGroup grp = part.ParentGroup;
|
||||
|
||||
deleteIDs.Add(localID);
|
||||
deleteGroups.Add(grp);
|
||||
|
||||
if (remoteClient == null)
|
||||
{
|
||||
// Autoreturn has a null client. Nothing else does. So
|
||||
@@ -1734,8 +1739,15 @@ 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;
|
||||
|
||||
@@ -1743,71 +1755,88 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Handle god perms
|
||||
if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
|
||||
{
|
||||
permissionToTake = true;
|
||||
permissionToTakeCopy = true;
|
||||
permissionToDelete = true;
|
||||
}
|
||||
|
||||
// If we're re-saving, we don't even want to delete
|
||||
if (action == DeRezAction.SaveToExistingUserInventoryItem)
|
||||
permissionToDelete = false;
|
||||
|
||||
// if we want to take a copy, we also don't want to delete
|
||||
// Note: after this point, the permissionToTakeCopy flag
|
||||
// becomes irrelevant. It already includes the permissionToTake
|
||||
// permission and after excluding no copy items here, we can
|
||||
// just use that.
|
||||
if (action == DeRezAction.TakeCopy)
|
||||
{
|
||||
// If we don't have permission, stop right here
|
||||
if (!permissionToTakeCopy)
|
||||
return;
|
||||
|
||||
permissionToTake = true;
|
||||
// Don't delete
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
||||
if (action == DeRezAction.Return)
|
||||
{
|
||||
if (remoteClient != null)
|
||||
// Handle god perms
|
||||
if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId))
|
||||
{
|
||||
if (Permissions.CanReturnObjects(
|
||||
null,
|
||||
remoteClient.AgentId,
|
||||
deleteGroups))
|
||||
permissionToTake = true;
|
||||
permissionToTakeCopy = true;
|
||||
permissionToDelete = true;
|
||||
}
|
||||
|
||||
// If we're re-saving, we don't even want to delete
|
||||
if (action == DeRezAction.SaveToExistingUserInventoryItem)
|
||||
permissionToDelete = false;
|
||||
|
||||
// if we want to take a copy, we also don't want to delete
|
||||
// Note: after this point, the permissionToTakeCopy flag
|
||||
// becomes irrelevant. It already includes the permissionToTake
|
||||
// permission and after excluding no copy items here, we can
|
||||
// just use that.
|
||||
if (action == DeRezAction.TakeCopy)
|
||||
{
|
||||
// If we don't have permission, stop right here
|
||||
if (!permissionToTakeCopy)
|
||||
return;
|
||||
|
||||
permissionToTake = true;
|
||||
// Don't delete
|
||||
permissionToDelete = false;
|
||||
}
|
||||
|
||||
if (action == DeRezAction.Return)
|
||||
{
|
||||
if (remoteClient != null)
|
||||
{
|
||||
if (Permissions.CanReturnObjects(
|
||||
null,
|
||||
remoteClient.AgentId,
|
||||
deleteGroups))
|
||||
{
|
||||
permissionToTake = true;
|
||||
permissionToDelete = true;
|
||||
|
||||
AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
|
||||
}
|
||||
}
|
||||
else // Auto return passes through here with null agent
|
||||
{
|
||||
permissionToTake = true;
|
||||
permissionToDelete = true;
|
||||
|
||||
foreach (SceneObjectGroup g in deleteGroups)
|
||||
{
|
||||
AddReturn(g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Auto return passes through here with null agent
|
||||
|
||||
if (permissionToTake && (!permissionToDelete))
|
||||
takeGroups.Add(grp);
|
||||
|
||||
if (permissionToDelete)
|
||||
{
|
||||
permissionToTake = true;
|
||||
permissionToDelete = true;
|
||||
if (permissionToTake)
|
||||
deleteGroups.Add(grp);
|
||||
deleteIDs.Add(grp.LocalId);
|
||||
}
|
||||
}
|
||||
|
||||
if (permissionToTake)
|
||||
{
|
||||
m_asyncSceneObjectDeleter.DeleteToInventory(
|
||||
action, destinationID, deleteGroups, remoteClient,
|
||||
permissionToDelete);
|
||||
}
|
||||
else if (permissionToDelete)
|
||||
SendKillObject(deleteIDs);
|
||||
|
||||
if (deleteGroups.Count > 0)
|
||||
{
|
||||
foreach (SceneObjectGroup g in deleteGroups)
|
||||
DeleteSceneObject(g, false);
|
||||
deleteIDs.Remove(g.LocalId);
|
||||
|
||||
m_asyncSceneObjectDeleter.DeleteToInventory(
|
||||
action, destinationID, deleteGroups, remoteClient,
|
||||
true);
|
||||
}
|
||||
if (takeGroups.Count > 0)
|
||||
{
|
||||
m_asyncSceneObjectDeleter.DeleteToInventory(
|
||||
action, destinationID, takeGroups, remoteClient,
|
||||
false);
|
||||
}
|
||||
if (deleteIDs.Count > 0)
|
||||
{
|
||||
foreach (SceneObjectGroup g in deleteGroups)
|
||||
DeleteSceneObject(g, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected ModuleLoader m_moduleLoader;
|
||||
protected AgentCircuitManager m_authenticateHandler;
|
||||
protected SceneCommunicationService m_sceneGridService;
|
||||
protected ISnmpModule m_snmpService = null;
|
||||
|
||||
protected ISimulationDataService m_SimulationDataService;
|
||||
protected IEstateDataService m_EstateDataService;
|
||||
@@ -163,6 +164,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private int landMS;
|
||||
private int lastCompletedFrame;
|
||||
|
||||
public bool CombineRegions = false;
|
||||
private bool m_physics_enabled = true;
|
||||
private bool m_scripts_enabled = true;
|
||||
private string m_defaultScriptEngine;
|
||||
@@ -174,6 +176,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private bool m_firstHeartbeat = true;
|
||||
|
||||
private object m_deleting_scene_object = new object();
|
||||
private object m_cleaningAttachments = new object();
|
||||
|
||||
private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
private bool m_reprioritizationEnabled = true;
|
||||
@@ -217,6 +220,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return m_sceneGridService; }
|
||||
}
|
||||
|
||||
public ISnmpModule SnmpService
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_snmpService == null)
|
||||
{
|
||||
m_snmpService = RequestModuleInterface<ISnmpModule>();
|
||||
}
|
||||
|
||||
return m_snmpService;
|
||||
}
|
||||
}
|
||||
|
||||
public ISimulationDataService SimulationDataService
|
||||
{
|
||||
get
|
||||
@@ -561,6 +577,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
#region Region Settings
|
||||
|
||||
// Load region settings
|
||||
m_regInfo.WindlightSettings = SimulationDataService.LoadRegionWindlightSettings(m_regInfo.RegionID);
|
||||
|
||||
m_regInfo.RegionSettings = simDataService.LoadRegionSettings(m_regInfo.RegionID);
|
||||
if (estateDataService != null)
|
||||
m_regInfo.EstateSettings = estateDataService.LoadEstateSettings(m_regInfo.RegionID, false);
|
||||
@@ -620,9 +638,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;
|
||||
@@ -654,6 +673,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_persistAfter *= 10000000;
|
||||
|
||||
m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
|
||||
m_log.InfoFormat("[SCENE]: Default script engine {0}", m_defaultScriptEngine);
|
||||
|
||||
IConfig packetConfig = m_config.Configs["PacketPool"];
|
||||
if (packetConfig != null)
|
||||
@@ -663,6 +683,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
|
||||
CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
|
||||
|
||||
m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
|
||||
if (m_generateMaptiles)
|
||||
@@ -687,9 +708,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[SCENE]: Failed to load StartupConfig");
|
||||
m_log.Error("[SCENE]: Failed to load StartupConfig: " + e.ToString());
|
||||
}
|
||||
|
||||
#endregion Region Config
|
||||
@@ -925,6 +946,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
|
||||
@@ -946,8 +976,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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1143,6 +1176,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
|
||||
if (HeartbeatThread != null)
|
||||
{
|
||||
m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
|
||||
HeartbeatThread.Abort();
|
||||
HeartbeatThread = null;
|
||||
}
|
||||
@@ -1814,14 +1848,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);
|
||||
|
||||
@@ -1843,7 +1887,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
|
||||
@@ -1866,13 +1910,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.
|
||||
@@ -1881,13 +1922,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
|
||||
@@ -1898,8 +1938,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1979,7 +2023,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool AddRestoredSceneObject(
|
||||
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted, bool sendClientUpdates)
|
||||
{
|
||||
return m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates);
|
||||
bool result = m_sceneGraph.AddRestoredSceneObject(sceneObject, attachToBackup, alreadyPersisted, sendClientUpdates);
|
||||
if (result)
|
||||
sceneObject.IsDeleted = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2056,6 +2103,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </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)
|
||||
{
|
||||
EntityBase[] entities = Entities.GetEntities();
|
||||
@@ -2064,11 +2120,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>
|
||||
@@ -2117,6 +2186,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
group.DeleteGroupFromScene(silent);
|
||||
if (!silent)
|
||||
SendKillObject(new List<uint>() { group.LocalId });
|
||||
|
||||
// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
|
||||
}
|
||||
@@ -2446,6 +2517,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.
|
||||
//
|
||||
@@ -2493,15 +2570,28 @@ 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,
|
||||
@@ -2774,6 +2864,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;
|
||||
@@ -2952,15 +3043,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <param name="agentId">The avatar's Unique ID</param>
|
||||
/// <param name="client">The IClientAPI for the client</param>
|
||||
public virtual void TeleportClientHome(UUID agentId, IClientAPI client)
|
||||
public virtual bool TeleportClientHome(UUID agentId, IClientAPI client)
|
||||
{
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.TeleportHome(agentId, client);
|
||||
return m_teleportModule.TeleportHome(agentId, client);
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Unable to teleport user home: no AgentTransferModule is active");
|
||||
client.SendTeleportFailed("Unable to perform teleports on this simulator.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3059,6 +3151,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.");
|
||||
@@ -3153,7 +3255,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)
|
||||
{
|
||||
@@ -3161,12 +3265,15 @@ 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)
|
||||
{
|
||||
//We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
|
||||
try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); }
|
||||
try { client.SendKillObject(avatar.RegionHandle, new List<uint>() { avatar.LocalId}); }
|
||||
catch (NullReferenceException) { }
|
||||
});
|
||||
|
||||
@@ -3177,8 +3284,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
|
||||
{
|
||||
@@ -3192,8 +3302,10 @@ 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);
|
||||
CleanDroppedAttachments();
|
||||
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));
|
||||
}
|
||||
@@ -3224,18 +3336,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#region Entities
|
||||
|
||||
public void SendKillObject(uint localID)
|
||||
public void SendKillObject(List<uint> localIDs)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part != null) // It is a prim
|
||||
List<uint> deleteIDs = new List<uint>();
|
||||
|
||||
foreach (uint localID in localIDs)
|
||||
{
|
||||
if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
if (part != null) // It is a prim
|
||||
{
|
||||
if (part.ParentGroup.RootPart != part) // Child part
|
||||
return;
|
||||
if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
|
||||
{
|
||||
if (part.ParentGroup.RootPart != part) // Child part
|
||||
continue;
|
||||
}
|
||||
}
|
||||
deleteIDs.Add(localID);
|
||||
}
|
||||
ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); });
|
||||
ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, deleteIDs); });
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -3253,7 +3371,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
|
||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
|
||||
m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
|
||||
m_sceneGridService.KiPrimitive += SendKillObject;
|
||||
m_sceneGridService.OnGetLandData += GetLandData;
|
||||
}
|
||||
|
||||
@@ -3262,7 +3379,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void UnRegisterRegionWithComms()
|
||||
{
|
||||
m_sceneGridService.KiPrimitive -= SendKillObject;
|
||||
m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
|
||||
//m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
|
||||
//m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
|
||||
@@ -3349,6 +3465,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;
|
||||
}
|
||||
}
|
||||
@@ -3408,6 +3525,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (vialogin)
|
||||
{
|
||||
CleanDroppedAttachments();
|
||||
|
||||
if (TestBorderCross(agent.startpos, Cardinals.E))
|
||||
{
|
||||
Border crossedBorder = GetCrossedBorder(agent.startpos, Cardinals.E);
|
||||
@@ -3464,6 +3583,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)
|
||||
@@ -3471,6 +3592,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos = land.LandData.UserLocation;
|
||||
}
|
||||
}
|
||||
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3756,6 +3878,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// We have to wait until the viewer contacts this region after receiving EAC.
|
||||
// That calls AddNewClient, which finally creates the ScenePresence
|
||||
int num = m_sceneGraph.GetNumberOfScenePresences();
|
||||
|
||||
if (num >= RegionInfo.RegionSettings.AgentLimit)
|
||||
{
|
||||
if (!Permissions.IsAdministrator(cAgentData.AgentID))
|
||||
return false;
|
||||
}
|
||||
|
||||
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
|
||||
if (childAgentUpdate != null)
|
||||
{
|
||||
@@ -3821,12 +3951,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);
|
||||
|
||||
@@ -3838,7 +3978,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_sceneGraph.removeUserCount(false);
|
||||
}
|
||||
else
|
||||
else if (!childOnly)
|
||||
{
|
||||
m_sceneGraph.removeUserCount(true);
|
||||
}
|
||||
@@ -3854,9 +3994,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;
|
||||
}
|
||||
|
||||
@@ -4478,7 +4621,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//
|
||||
int health=1; // Start at 1, means we're up
|
||||
|
||||
if ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000)
|
||||
if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000))
|
||||
health+=1;
|
||||
else
|
||||
return health;
|
||||
@@ -4942,8 +5085,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
float ominX, ominY, ominZ, omaxX, omaxY, omaxZ;
|
||||
|
||||
Vector3 vec = g.AbsolutePosition;
|
||||
|
||||
g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ);
|
||||
|
||||
ominX += vec.X;
|
||||
omaxX += vec.X;
|
||||
ominY += vec.Y;
|
||||
omaxY += vec.Y;
|
||||
ominZ += vec.Z;
|
||||
omaxZ += vec.Z;
|
||||
|
||||
if (minX > ominX)
|
||||
minX = ominX;
|
||||
if (minY > ominY)
|
||||
@@ -4984,5 +5136,45 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
throw new Exception(error);
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanDroppedAttachments()
|
||||
{
|
||||
List<SceneObjectGroup> objectsToDelete =
|
||||
new List<SceneObjectGroup>();
|
||||
|
||||
lock (m_cleaningAttachments)
|
||||
{
|
||||
ForEachSOG(delegate (SceneObjectGroup grp)
|
||||
{
|
||||
if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp)))
|
||||
{
|
||||
UUID agentID = grp.OwnerID;
|
||||
if (agentID == UUID.Zero)
|
||||
{
|
||||
objectsToDelete.Add(grp);
|
||||
return;
|
||||
}
|
||||
|
||||
ScenePresence sp = GetScenePresence(agentID);
|
||||
if (sp == null)
|
||||
{
|
||||
objectsToDelete.Add(grp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (objectsToDelete.Count > 0)
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Starting delete of {0} dropped attachments", objectsToDelete.Count);
|
||||
foreach (SceneObjectGroup grp in objectsToDelete)
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Deleting dropped attachment {0} of user {1}", grp.UUID, grp.OwnerID);
|
||||
DeleteSceneObject(grp, true);
|
||||
}
|
||||
m_log.Debug("[SCENE]: Finished dropped attachment deletion");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
public delegate void KiPrimitiveDelegate(uint localID);
|
||||
|
||||
public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst);
|
||||
|
||||
/// <summary>
|
||||
@@ -113,8 +111,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// private LogOffUser handlerLogOffUser = null;
|
||||
// private GetLandData handlerGetLandData = null; // OnGetLandData
|
||||
|
||||
public KiPrimitiveDelegate KiPrimitive;
|
||||
|
||||
public SceneCommunicationService()
|
||||
{
|
||||
}
|
||||
@@ -168,7 +164,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 +179,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 +263,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 +289,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>();
|
||||
|
||||
@@ -124,13 +133,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 (SceneObjectGroupsByFullID)
|
||||
SceneObjectGroupsByFullID.Clear();
|
||||
@@ -209,27 +223,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,6 +254,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.Parts)
|
||||
{
|
||||
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();
|
||||
@@ -456,6 +478,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_updateList[obj.UUID] = obj;
|
||||
}
|
||||
|
||||
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>
|
||||
@@ -590,7 +636,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);
|
||||
@@ -614,6 +661,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -628,7 +679,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);
|
||||
@@ -650,6 +702,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)
|
||||
@@ -773,6 +829,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return m_scenePresenceArray;
|
||||
}
|
||||
|
||||
public int GetNumberOfScenePresences()
|
||||
{
|
||||
return m_scenePresenceArray.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Request a scene presence by UUID. Fast, indexed lookup.
|
||||
/// </summary>
|
||||
@@ -1066,9 +1127,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="action"></param>
|
||||
protected internal void ForEachSOG(Action<SceneObjectGroup> action)
|
||||
{
|
||||
List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
|
||||
foreach (SceneObjectGroup obj in objlist)
|
||||
EntityBase[] objlist = Entities.GetAllByType<SceneObjectGroup>();
|
||||
foreach (EntityBase ent in objlist)
|
||||
{
|
||||
SceneObjectGroup obj = (SceneObjectGroup)ent;
|
||||
|
||||
try
|
||||
{
|
||||
action(obj);
|
||||
@@ -1524,10 +1587,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,11 +1605,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (child != null)
|
||||
{
|
||||
// Make sure no child prim is set for sale
|
||||
// So that, on delink, no prims are unwittingly
|
||||
// left for sale and sold off
|
||||
child.RootPart.ObjectSaleType = 0;
|
||||
child.RootPart.SalePrice = 10;
|
||||
childGroups.Add(child);
|
||||
}
|
||||
}
|
||||
@@ -1566,12 +1627,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);
|
||||
}
|
||||
}
|
||||
@@ -1603,21 +1664,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (!affectedGroups.Contains(group))
|
||||
{
|
||||
group.areUpdatesSuspended = true;
|
||||
affectedGroups.Add(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
if (childParts.Count > 0)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
|
||||
// These are not in affected groups and will not be
|
||||
// handled further. Do the honors here.
|
||||
child.ParentGroup.HasGroupChanged = true;
|
||||
child.ParentGroup.ScheduleGroupForFullUpdate();
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
child.ParentGroup.HasGroupChanged = true;
|
||||
child.ParentGroup.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart root in rootParts)
|
||||
@@ -1627,57 +1691,69 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// However, editing linked parts and unlinking may be different
|
||||
//
|
||||
SceneObjectGroup group = root.ParentGroup;
|
||||
group.areUpdatesSuspended = true;
|
||||
|
||||
List<SceneObjectPart> newSet = new List<SceneObjectPart>(group.Parts);
|
||||
int numChildren = newSet.Count;
|
||||
|
||||
if (numChildren == 1)
|
||||
break;
|
||||
|
||||
// If there are prims left in a link set, but the root is
|
||||
// slated for unlink, we need to do this
|
||||
// Unlink the remaining set
|
||||
//
|
||||
if (numChildren != 1)
|
||||
bool sendEventsToRemainder = true;
|
||||
if (numChildren > 1)
|
||||
sendEventsToRemainder = false;
|
||||
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
{
|
||||
// Unlink the remaining set
|
||||
//
|
||||
bool sendEventsToRemainder = true;
|
||||
if (numChildren > 1)
|
||||
sendEventsToRemainder = false;
|
||||
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
if (p != group.RootPart)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
}
|
||||
|
||||
// If there is more than one prim remaining, we
|
||||
// need to re-link
|
||||
//
|
||||
if (numChildren > 2)
|
||||
{
|
||||
// Remove old root
|
||||
//
|
||||
if (newSet.Contains(root))
|
||||
newSet.Remove(root);
|
||||
|
||||
// Preserve link ordering
|
||||
//
|
||||
newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
if (numChildren > 2)
|
||||
{
|
||||
return a.LinkNum.CompareTo(b.LinkNum);
|
||||
});
|
||||
|
||||
// Determine new root
|
||||
//
|
||||
SceneObjectPart newRoot = newSet[0];
|
||||
newSet.RemoveAt(0);
|
||||
|
||||
foreach (SceneObjectPart newChild in newSet)
|
||||
newChild.UpdateFlag = 0;
|
||||
|
||||
LinkObjects(newRoot, newSet);
|
||||
if (!affectedGroups.Contains(newRoot.ParentGroup))
|
||||
affectedGroups.Add(newRoot.ParentGroup);
|
||||
p.ParentGroup.areUpdatesSuspended = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
p.ParentGroup.HasGroupChanged = true;
|
||||
p.ParentGroup.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there is more than one prim remaining, we
|
||||
// need to re-link
|
||||
//
|
||||
if (numChildren > 2)
|
||||
{
|
||||
// Remove old root
|
||||
//
|
||||
if (newSet.Contains(root))
|
||||
newSet.Remove(root);
|
||||
|
||||
// Preserve link ordering
|
||||
//
|
||||
newSet.Sort(delegate (SceneObjectPart a, SceneObjectPart b)
|
||||
{
|
||||
return a.LinkNum.CompareTo(b.LinkNum);
|
||||
});
|
||||
|
||||
// Determine new root
|
||||
//
|
||||
SceneObjectPart newRoot = newSet[0];
|
||||
newSet.RemoveAt(0);
|
||||
|
||||
foreach (SceneObjectPart newChild in newSet)
|
||||
newChild.UpdateFlag = 0;
|
||||
|
||||
newRoot.ParentGroup.areUpdatesSuspended = true;
|
||||
LinkObjects(newRoot, newSet);
|
||||
if (!affectedGroups.Contains(newRoot.ParentGroup))
|
||||
affectedGroups.Add(newRoot.ParentGroup);
|
||||
}
|
||||
}
|
||||
|
||||
// Finally, trigger events in the roots
|
||||
@@ -1686,6 +1762,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
g.TriggerScriptChangedEvent(Changed.LINK);
|
||||
g.HasGroupChanged = true; // Persist
|
||||
g.areUpdatesSuspended = false;
|
||||
g.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
}
|
||||
@@ -1800,9 +1877,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
child.ApplyNextOwnerPermissions();
|
||||
}
|
||||
}
|
||||
|
||||
copy.RootPart.ObjectSaleType = 0;
|
||||
copy.RootPart.SalePrice = 10;
|
||||
}
|
||||
|
||||
Entities.Add(copy);
|
||||
|
||||
@@ -69,10 +69,6 @@ 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)
|
||||
{
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
@@ -419,6 +415,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void ResumeScripts()
|
||||
{
|
||||
if (m_scene.RegionInfo.RegionSettings.DisableScripts)
|
||||
return;
|
||||
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
parts[i].Inventory.ResumeScripts();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,7 +61,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.
|
||||
@@ -145,10 +146,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 StatusSandboxPos;
|
||||
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
||||
|
||||
[XmlIgnore]
|
||||
public int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
|
||||
[XmlIgnore]
|
||||
public PhysicsActor PhysActor
|
||||
{
|
||||
get { return m_physActor; }
|
||||
@@ -190,7 +191,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@@ -285,6 +294,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);
|
||||
@@ -374,7 +384,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);
|
||||
@@ -430,7 +440,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private uint _ownerMask = (uint)PermissionMask.All;
|
||||
private uint _groupMask = (uint)PermissionMask.None;
|
||||
private uint _everyoneMask = (uint)PermissionMask.None;
|
||||
private uint _nextOwnerMask = (uint)PermissionMask.All;
|
||||
private uint _nextOwnerMask = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer);
|
||||
private PrimFlags _flags = PrimFlags.None;
|
||||
private DateTime m_expires;
|
||||
private DateTime m_rezzed;
|
||||
@@ -470,12 +480,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>
|
||||
@@ -615,14 +629,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_LoopSoundSlavePrims = value; }
|
||||
}
|
||||
|
||||
|
||||
public Byte[] TextureAnimation
|
||||
{
|
||||
get { return m_TextureAnimation; }
|
||||
set { m_TextureAnimation = value; }
|
||||
}
|
||||
|
||||
|
||||
public Byte[] ParticleSystem
|
||||
{
|
||||
get { return m_particleSystem; }
|
||||
@@ -676,7 +688,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set
|
||||
{
|
||||
m_groupPosition = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
@@ -696,25 +707,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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -723,7 +722,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)
|
||||
@@ -737,7 +737,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -779,7 +794,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
set
|
||||
{
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_PRIM_ROTATION);
|
||||
m_rotationOffset = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
@@ -863,7 +878,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; }
|
||||
}
|
||||
|
||||
@@ -968,7 +992,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;
|
||||
@@ -1036,9 +1060,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get {
|
||||
if (IsAttachment)
|
||||
return GroupPosition;
|
||||
return GroupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset);
|
||||
|
||||
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
|
||||
@@ -1197,6 +1222,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; }
|
||||
}
|
||||
|
||||
|
||||
public UUID SitTargetAvatar
|
||||
@@ -1272,14 +1304,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)
|
||||
@@ -1530,14 +1554,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// or flexible
|
||||
if (!isPhantom && !IsAttachment && !(Shape.PathCurve == (byte) Extrusion.Flexible))
|
||||
{
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
string.Format("{0}/{1}", Name, UUID),
|
||||
Shape,
|
||||
AbsolutePosition,
|
||||
Scale,
|
||||
RotationOffset,
|
||||
RigidBody);
|
||||
|
||||
try
|
||||
{
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
string.Format("{0}/{1}", Name, UUID),
|
||||
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)
|
||||
{
|
||||
@@ -1565,7 +1596,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_redo.Clear();
|
||||
}
|
||||
StoreUndoState();
|
||||
StoreUndoState(UndoType.STATE_ALL);
|
||||
}
|
||||
|
||||
public byte ConvertScriptUintToByte(uint indata)
|
||||
@@ -1634,6 +1665,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Move afterwards ResetIDs as it clears the localID
|
||||
dupe.LocalId = localID;
|
||||
if(dupe.PhysActor != null)
|
||||
dupe.PhysActor.LocalID = localID;
|
||||
|
||||
// This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
|
||||
dupe._lastOwnerID = OwnerID;
|
||||
|
||||
@@ -1677,7 +1711,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;
|
||||
@@ -2037,12 +2071,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>
|
||||
@@ -2053,7 +2092,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Quaternion newRot;
|
||||
|
||||
if (this.LinkNum == 0)
|
||||
if (this.LinkNum < 2) //KF Single or root prim
|
||||
{
|
||||
newRot = RotationOffset;
|
||||
}
|
||||
@@ -2699,17 +2738,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)
|
||||
@@ -2769,7 +2809,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;
|
||||
@@ -2778,38 +2818,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>
|
||||
@@ -2821,7 +2830,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (m_parentGroup != null)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
if (!m_parentGroup.areUpdatesSuspended)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
}
|
||||
}
|
||||
|
||||
int timeNow = Util.UnixTimeSinceEpoch();
|
||||
@@ -3038,8 +3050,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)
|
||||
{
|
||||
@@ -3053,7 +3065,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.
|
||||
@@ -3071,16 +3083,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>
|
||||
@@ -3100,6 +3114,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
UUID ownerID = _ownerID;
|
||||
UUID objectID = ParentGroup.RootPart.UUID;
|
||||
UUID parentID = GetRootPartUUID();
|
||||
|
||||
UUID soundID = UUID.Zero;
|
||||
Vector3 position = AbsolutePosition; // region local
|
||||
ulong regionHandle = m_parentGroup.Scene.RegionInfo.RegionHandle;
|
||||
@@ -3107,17 +3122,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)
|
||||
@@ -3554,7 +3568,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void StopLookAt()
|
||||
{
|
||||
m_parentGroup.stopLookAt();
|
||||
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
|
||||
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
@@ -3581,10 +3595,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)
|
||||
{
|
||||
@@ -3595,17 +3608,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);
|
||||
}
|
||||
|
||||
@@ -4082,11 +4103,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);
|
||||
@@ -4101,13 +4124,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);
|
||||
}
|
||||
@@ -4555,8 +4578,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
|
||||
@@ -4789,5 +4813,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,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.
|
||||
@@ -83,7 +85,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </value>
|
||||
protected internal TaskInventoryDictionary Items
|
||||
{
|
||||
get { return m_items; }
|
||||
get {
|
||||
return m_items;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_items = value;
|
||||
@@ -119,52 +123,57 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="linkNum">Link number for the part</param>
|
||||
public void ResetInventoryIDs()
|
||||
{
|
||||
if (null == m_part || null == m_part.ParentGroup)
|
||||
return;
|
||||
|
||||
lock (m_items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
|
||||
if (Items.Count == 0)
|
||||
{
|
||||
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;
|
||||
if (m_part.ParentGroup != null)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
public void ResetObjectID()
|
||||
{
|
||||
lock (Items)
|
||||
m_items.LockItemsForWrite(true);
|
||||
|
||||
if (Items.Count == 0)
|
||||
{
|
||||
if (Items.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
if (m_part.ParentGroup != null)
|
||||
{
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.Clear();
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
item.ParentPartID = m_part.UUID;
|
||||
item.ParentID = m_part.UUID;
|
||||
Items.Add(item.ItemID, item);
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
return;
|
||||
}
|
||||
|
||||
HasInventoryChanged = true;
|
||||
if (m_part.ParentGroup != null)
|
||||
{
|
||||
m_part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
IList<TaskInventoryItem> items = new List<TaskInventoryItem>(Items.Values);
|
||||
Items.Clear();
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
item.ParentPartID = m_part.UUID;
|
||||
item.ParentID = m_part.UUID;
|
||||
Items.Add(item.ItemID, item);
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -173,12 +182,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;
|
||||
@@ -192,6 +200,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
item.OwnerID = ownerId;
|
||||
}
|
||||
}
|
||||
m_items.LockItemsForWrite(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -200,22 +209,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>
|
||||
@@ -223,9 +234,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)
|
||||
@@ -258,9 +274,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>
|
||||
@@ -276,7 +301,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);
|
||||
|
||||
@@ -285,14 +313,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (stateSource == 2 && // 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;
|
||||
@@ -301,6 +328,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",
|
||||
@@ -312,15 +341,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();
|
||||
}
|
||||
@@ -384,21 +415,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>
|
||||
@@ -411,15 +566,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);
|
||||
@@ -444,14 +591,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;
|
||||
}
|
||||
|
||||
@@ -493,8 +642,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)
|
||||
@@ -532,14 +682,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;
|
||||
@@ -555,15 +705,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>
|
||||
@@ -574,10 +724,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;
|
||||
}
|
||||
|
||||
@@ -593,15 +742,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;
|
||||
}
|
||||
|
||||
@@ -679,8 +829,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;
|
||||
@@ -692,19 +843,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
|
||||
@@ -715,8 +862,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>
|
||||
@@ -727,37 +875,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;
|
||||
@@ -865,6 +1029,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
invString.AddSectionEnd();
|
||||
}
|
||||
}
|
||||
int count = m_items.Count;
|
||||
m_items.LockItemsForRead(false);
|
||||
|
||||
fileData = Utils.StringToBytes(invString.BuildString);
|
||||
|
||||
@@ -885,10 +1051,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -955,89 +1122,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;
|
||||
}
|
||||
|
||||
@@ -1045,11 +1198,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;
|
||||
}
|
||||
@@ -1079,6 +1229,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>();
|
||||
|
||||
@@ -1086,25 +1241,35 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (engines == null) // No engine at all
|
||||
return ret;
|
||||
|
||||
List<TaskInventoryItem> scripts = GetInventoryScripts();
|
||||
|
||||
foreach (TaskInventoryItem item in scripts)
|
||||
Items.LockItemsForRead(true);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Items.LockItemsForRead(false);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1114,21 +1279,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
@@ -99,7 +99,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();
|
||||
}
|
||||
@@ -217,7 +217,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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -813,6 +813,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;
|
||||
@@ -876,12 +877,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();
|
||||
}
|
||||
@@ -937,7 +947,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
}
|
||||
|
||||
public void SendKillObject(ulong regionHandle, uint localID)
|
||||
public void SendKillObject(ulong regionHandle, List<uint> localID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -259,9 +259,10 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
// I thought that the DeleteGroup() function would handle all of this, but it doesn't. I'm not sure WHAT it handles.
|
||||
((SceneObjectGroup)scene.Entities[uuid]).DetachFromBackup();
|
||||
scene.PhysicsScene.RemovePrim(((SceneObjectGroup)scene.Entities[uuid]).RootPart.PhysActor);
|
||||
scene.SendKillObject(scene.Entities[uuid].LocalId);
|
||||
scene.SendKillObject(new List<uint>() { scene.Entities[uuid].LocalId });
|
||||
scene.SceneGraph.DeleteSceneObject(uuid, false);
|
||||
((SceneObjectGroup)scene.Entities[uuid]).DeleteGroupFromScene(false);
|
||||
scene.SendKillObject(new List<uint>() { ((SceneObjectGroup)scene.Entities[uuid]).LocalId });
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
//This is important because we are not IN any database.
|
||||
//m_Entity.FakeDeleteGroup();
|
||||
foreach (SceneObjectPart part in m_Entity.Parts)
|
||||
client.SendKillObject(m_Entity.RegionHandle, part.LocalId);
|
||||
client.SendKillObject(m_Entity.RegionHandle, new List<uint>() { part.LocalId });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -187,7 +187,7 @@ namespace OpenSim.Region.OptionalModules.ContentManagement
|
||||
{
|
||||
m_Entity.Scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{ controller.SendKillObject(m_Entity.RegionHandle, part.LocalId); }
|
||||
{ controller.SendKillObject(m_Entity.RegionHandle, new List<uint>() { part.LocalId }); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -519,7 +519,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
|
||||
}
|
||||
|
||||
public virtual void SendKillObject(ulong regionHandle, uint localID)
|
||||
public virtual void SendKillObject(ulong regionHandle, List<uint> localID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -836,11 +836,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -386,7 +386,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
m_scene.ForEachClient(delegate(IClientAPI controller)
|
||||
{
|
||||
controller.SendKillObject(m_scene.RegionInfo.RegionHandle,
|
||||
selectedTree.LocalId);
|
||||
new List<uint>() { selectedTree.LocalId });
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -727,7 +727,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
|
||||
m_scene.ForEachClient(delegate(IClientAPI controller)
|
||||
{
|
||||
controller.SendKillObject(m_scene.RegionInfo.RegionHandle,
|
||||
selectedTree.LocalId);
|
||||
new List<uint>() { selectedTree.LocalId });
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
@@ -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.*")]
|
||||
1437
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
1437
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
File diff suppressed because it is too large
Load Diff
3917
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
3917
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;
|
||||
}
|
||||
}
|
||||
3869
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
3869
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;
|
||||
|
||||
@@ -572,8 +572,8 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
break;
|
||||
|
||||
case HollowShape.Circle:
|
||||
// Hollow shape is a perfect cyllinder in respect to the cube's scale
|
||||
// Cyllinder hollow volume calculation
|
||||
// Hollow shape is a perfect cylinder in respect to the cube's scale
|
||||
// Cylinder hollow volume calculation
|
||||
|
||||
hollowVolume *= 0.1963495f * 3.07920140172638f;
|
||||
break;
|
||||
@@ -2819,7 +2819,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>();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user