Compare commits
584 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31177d9259 | ||
|
|
48577af325 | ||
|
|
335ff4359c | ||
|
|
86903f23dd | ||
|
|
40d5148bbc | ||
|
|
4edaa4e41a | ||
|
|
faca755995 | ||
|
|
8c130bcaf5 | ||
|
|
e41374dd01 | ||
|
|
0d15a6a01f | ||
|
|
152d5dc2a7 | ||
|
|
db418bff2b | ||
|
|
113a9704f2 | ||
|
|
64fad2f80e | ||
|
|
4e8c8b2cd8 | ||
|
|
abef034d1b | ||
|
|
ba2318bd61 | ||
|
|
571f6a0300 | ||
|
|
4de8915ddd | ||
|
|
9f45198516 | ||
|
|
6759ed1013 | ||
|
|
963b1e861c | ||
|
|
84be90e5f8 | ||
|
|
f560d581bb | ||
|
|
23605cf93d | ||
|
|
c60e1a1ae6 | ||
|
|
3c48b44b68 | ||
|
|
b9f602cc77 | ||
|
|
37c9700904 | ||
|
|
a180fef99e | ||
|
|
6cf90e5516 | ||
|
|
d589a8bc04 | ||
|
|
f85d054bc6 | ||
|
|
79d51c27bb | ||
|
|
09deaa890d | ||
|
|
2ef0062664 | ||
|
|
562c585bc6 | ||
|
|
cdcb67a952 | ||
|
|
d5f9f5c9c3 | ||
|
|
b3dddd7447 | ||
|
|
a87c4c7d89 | ||
|
|
fe2fa70c74 | ||
|
|
74dd38db70 | ||
|
|
5fb5758103 | ||
|
|
e10d61ea8c | ||
|
|
b3574d23e4 | ||
|
|
3a5e317f65 | ||
|
|
26a94610fc | ||
|
|
4ac857f902 | ||
|
|
fb7bbe167a | ||
|
|
5cba04e2d6 | ||
|
|
d0742cea3e | ||
|
|
ee3d06220e | ||
|
|
791c4d5b9f | ||
|
|
86b22604fa | ||
|
|
a4fee98352 | ||
|
|
bbff036944 | ||
|
|
492515cf3f | ||
|
|
12c62d30e1 | ||
|
|
c94240ba5b | ||
|
|
4f98259617 | ||
|
|
2540132a54 | ||
|
|
19aab3e6fe | ||
|
|
7dfd1468cc | ||
|
|
64c80aec64 | ||
|
|
5bff741544 | ||
|
|
61b816ebba | ||
|
|
75c880a6f3 | ||
|
|
9bc0419679 | ||
|
|
a407eb287f | ||
|
|
eb273b808e | ||
|
|
3666518319 | ||
|
|
67d5dbbb49 | ||
|
|
6df9d40d99 | ||
|
|
ee00c5c885 | ||
|
|
76cc303031 | ||
|
|
e2130817e5 | ||
|
|
f70a3099b5 | ||
|
|
702fd1e094 | ||
|
|
36d77fe27c | ||
|
|
b2dfa6f022 | ||
|
|
bf469819a6 | ||
|
|
a8424490ae | ||
|
|
236cc1f268 | ||
|
|
89322aaf94 | ||
|
|
f391d028de | ||
|
|
895d28f14d | ||
|
|
79f7c466a1 | ||
|
|
894bb4893b | ||
|
|
498ea76e63 | ||
|
|
1dc23b2b97 | ||
|
|
b0eccd5044 | ||
|
|
f53b4e7a21 | ||
|
|
39c02dcc8c | ||
|
|
364a7c3088 | ||
|
|
28e2cd3fa2 | ||
|
|
52be581f71 | ||
|
|
93fe384cce | ||
|
|
42d65840c8 | ||
|
|
dae038a117 | ||
|
|
4cfa3be4ef | ||
|
|
bc43c7007d | ||
|
|
8c9e4c1f7b | ||
|
|
9568f24c26 | ||
|
|
2f25f70316 | ||
|
|
e20bad12cc | ||
|
|
7af28724ac | ||
|
|
92d3c611e5 | ||
|
|
2b75035aef | ||
|
|
8fa83cf430 | ||
|
|
b83449ae9a | ||
|
|
804b332d45 | ||
|
|
783443705d | ||
|
|
7412795a0b | ||
|
|
2e106cd5de | ||
|
|
ce7beb6f20 | ||
|
|
462ad336dc | ||
|
|
8dfe59d7b8 | ||
|
|
a7d9f5598f | ||
|
|
ccb17eab71 | ||
|
|
ffe4d738fb | ||
|
|
566aaef1f4 | ||
|
|
b3072cf343 | ||
|
|
4ba48151b2 | ||
|
|
6235d16c31 | ||
|
|
3388534ff5 | ||
|
|
fd9cb3cb68 | ||
|
|
9e05067a4f | ||
|
|
984faf24df | ||
|
|
ff6c69000e | ||
|
|
9bc4dc6c5f | ||
|
|
cccf695327 | ||
|
|
37de965233 | ||
|
|
aeeed29d62 | ||
|
|
a09cba6da3 | ||
|
|
a16ddbee41 | ||
|
|
e308841de9 | ||
|
|
e0b5a3cd90 | ||
|
|
2bb0419251 | ||
|
|
dcac2a7f71 | ||
|
|
a9999a9676 | ||
|
|
56965dd959 | ||
|
|
ef15711089 | ||
|
|
af9dc483e9 | ||
|
|
f9923d4423 | ||
|
|
c796f7861e | ||
|
|
c5af16aef8 | ||
|
|
5abcecc735 | ||
|
|
af39af1cc4 | ||
|
|
57940087d1 | ||
|
|
e75596524a | ||
|
|
9df510157e | ||
|
|
22693304fb | ||
|
|
3d8f59aac3 | ||
|
|
e5df8cafb8 | ||
|
|
d7ffcace8f | ||
|
|
29a8ae48b5 | ||
|
|
a68e2fe169 | ||
|
|
8763a637b5 | ||
|
|
206a694c6b | ||
|
|
b9e0f1cd2b | ||
|
|
d4034271eb | ||
|
|
1c618843b8 | ||
|
|
32db725dd7 | ||
|
|
f4fe8763ad | ||
|
|
b42cfe49a2 | ||
|
|
6440892788 | ||
|
|
516ee244b4 | ||
|
|
1d47bcb6b6 | ||
|
|
20be6a4b48 | ||
|
|
6bd1f0f209 | ||
|
|
375fb66589 | ||
|
|
ed162a10be | ||
|
|
7560010f34 | ||
|
|
09f4e72d6a | ||
|
|
5681e812a5 | ||
|
|
c97890ca69 | ||
|
|
5a96ef52cb | ||
|
|
3531f29a6a | ||
|
|
cc204497e0 | ||
|
|
67432fcbf2 | ||
|
|
1c5f6e48b8 | ||
|
|
de6f147d3c | ||
|
|
16809bd0ea | ||
|
|
80dcc13af2 | ||
|
|
e977761071 | ||
|
|
18b1ee6f37 | ||
|
|
1b3b7a61ac | ||
|
|
ecdb88679e | ||
|
|
01972cc9e8 | ||
|
|
2fb89b5aac | ||
|
|
85c909c0b5 | ||
|
|
dc17cee044 | ||
|
|
b4923da334 | ||
|
|
424f68b64b | ||
|
|
0482758e96 | ||
|
|
22e216fd12 | ||
|
|
fa484c3494 | ||
|
|
c13a99dc5c | ||
|
|
8af8319b95 | ||
|
|
d9aaf51561 | ||
|
|
ae662b54ea | ||
|
|
5d4ac5a90f | ||
|
|
1743fe5d62 | ||
|
|
81aeecc907 | ||
|
|
f76dceb90b | ||
|
|
73db057fa1 | ||
|
|
326f1507fa | ||
|
|
de47646c3d | ||
|
|
938fa96b9f | ||
|
|
b6fc5bad00 | ||
|
|
b49f8a377b | ||
|
|
36bfd3667c | ||
|
|
14eeb8b31b | ||
|
|
7272a4cae8 | ||
|
|
65c131c4a3 | ||
|
|
c245178eee | ||
|
|
a61f20ac74 | ||
|
|
319ebaca06 | ||
|
|
4578ff74fe | ||
|
|
2206132ab9 | ||
|
|
542d075376 | ||
|
|
efae7c6fc2 | ||
|
|
20eac8d6d0 | ||
|
|
d7fa4cacb3 | ||
|
|
af9cd7d30c | ||
|
|
2aac113ac1 | ||
|
|
5bc07a15f5 | ||
|
|
d2b19f00da | ||
|
|
d55f72f3df | ||
|
|
ac037dfe21 | ||
|
|
1937e5f1ec | ||
|
|
da2b23f18d | ||
|
|
cd3762ca9f | ||
|
|
6cca713679 | ||
|
|
de869028cb | ||
|
|
45df324ab3 | ||
|
|
e469879725 | ||
|
|
d94c4646cc | ||
|
|
f422b9b388 | ||
|
|
e87a179c89 | ||
|
|
fc33afddd3 | ||
|
|
eaccfa6d99 | ||
|
|
fd7a097849 | ||
|
|
f7dcd33008 | ||
|
|
6ba42e9e75 | ||
|
|
71b73d6dc3 | ||
|
|
af5383e479 | ||
|
|
645e3171b4 | ||
|
|
597df51f91 | ||
|
|
ec044537d5 | ||
|
|
32171708c3 | ||
|
|
28483150e2 | ||
|
|
0f70460a32 | ||
|
|
9417176389 | ||
|
|
38e96afa38 | ||
|
|
b058ba5859 | ||
|
|
845228b35e | ||
|
|
75f5e66d1c | ||
|
|
1f3c9db2b9 | ||
|
|
8aa43e72e5 | ||
|
|
a960273e91 | ||
|
|
a2c93133be | ||
|
|
afab5f5cd1 | ||
|
|
7ab83f9eb2 | ||
|
|
de44e93aa2 | ||
|
|
1e7fb2dc36 | ||
|
|
991151250d | ||
|
|
0811f3d28d | ||
|
|
1de80cdafe | ||
|
|
3ec2923022 | ||
|
|
faf6b56839 | ||
|
|
2ed59ad8ac | ||
|
|
f35826eb31 | ||
|
|
4e5b2346a5 | ||
|
|
fc861c7904 | ||
|
|
db4ca57590 | ||
|
|
8459b98f68 | ||
|
|
ab0294f010 | ||
|
|
0eb457442d | ||
|
|
d469bde849 | ||
|
|
3ac6a423f7 | ||
|
|
8c2564c05c | ||
|
|
dc460579fd | ||
|
|
946c2e7e7c | ||
|
|
330b976a62 | ||
|
|
f6e166cd0b | ||
|
|
8c40215834 | ||
|
|
fba59d905c | ||
|
|
b9c2a1508e | ||
|
|
ab7b7c5d3d | ||
|
|
b5a3c74a5c | ||
|
|
b7e75d467c | ||
|
|
8873a4a8fc | ||
|
|
1e86c58822 | ||
|
|
21d0cbf703 | ||
|
|
87a87ebb9a | ||
|
|
3af2095cbc | ||
|
|
59a17ad676 | ||
|
|
8a402850dd | ||
|
|
387ce8ef35 | ||
|
|
2e9ef015f7 | ||
|
|
f5f5f2e3fb | ||
|
|
1f2472d0fc | ||
|
|
b63134764f | ||
|
|
b24190ec98 | ||
|
|
5b82f18d64 | ||
|
|
a86fedd25f | ||
|
|
3a458e2a36 | ||
|
|
919569f6ec | ||
|
|
a791620622 | ||
|
|
68698975f1 | ||
|
|
87825b0abe | ||
|
|
311a03befa | ||
|
|
b768c35f6f | ||
|
|
efd9791506 | ||
|
|
756ac4f321 | ||
|
|
11d8119a21 | ||
|
|
528085adef | ||
|
|
e76b01a201 | ||
|
|
a3c0e3ed26 | ||
|
|
785671e242 | ||
|
|
40bf789ad7 | ||
|
|
7e90ea3551 | ||
|
|
764270a0d8 | ||
|
|
ef3cc2e507 | ||
|
|
a0d047413b | ||
|
|
73c9abf5f2 | ||
|
|
d342adaa87 | ||
|
|
f65218f826 | ||
|
|
839aa57b42 | ||
|
|
ff92330523 | ||
|
|
90a39379f0 | ||
|
|
13c4fd7271 | ||
|
|
9de991301c | ||
|
|
16c9c1dff7 | ||
|
|
91ca3117cb | ||
|
|
6f220a8679 | ||
|
|
1fb53e7103 | ||
|
|
22f6fa49e3 | ||
|
|
16feed456a | ||
|
|
68859af3f8 | ||
|
|
633e1ed62c | ||
|
|
130768b16a | ||
|
|
8cd1dc8d60 | ||
|
|
d87813a194 | ||
|
|
046113c137 | ||
|
|
03136df1a7 | ||
|
|
7c7cdf3431 | ||
|
|
4832ed6960 | ||
|
|
f0178a6a41 | ||
|
|
276fdbc1b3 | ||
|
|
5b90f5bb17 | ||
|
|
d98af79f77 | ||
|
|
b977f962fa | ||
|
|
aa52c8b20f | ||
|
|
3d36a6d55c | ||
|
|
e717398f6c | ||
|
|
a2ab3b88de | ||
|
|
b9baab5521 | ||
|
|
653a98e891 | ||
|
|
e56ef2720e | ||
|
|
df3d1d1301 | ||
|
|
a5b8359b8e | ||
|
|
ca5c0814f4 | ||
|
|
f1886c449c | ||
|
|
a1679517d3 | ||
|
|
f555febdb7 | ||
|
|
ce7694c108 | ||
|
|
c677c04f10 | ||
|
|
35b7c80e0b | ||
|
|
e81e19a3b4 | ||
|
|
210f227fe6 | ||
|
|
ce47d0c454 | ||
|
|
d8a786870b | ||
|
|
ce97ebdc88 | ||
|
|
b6b505163c | ||
|
|
1e5869dcf6 | ||
|
|
f2c78281ce | ||
|
|
33617e09a1 | ||
|
|
c1740a2903 | ||
|
|
5221f2421e | ||
|
|
54ec8b197b | ||
|
|
14b659e550 | ||
|
|
402128bb53 | ||
|
|
0b9bf236dd | ||
|
|
503ce70f74 | ||
|
|
060d6fe8f4 | ||
|
|
7cc89cdadc | ||
|
|
f8a4b61954 | ||
|
|
91a5c602e3 | ||
|
|
531edd51d8 | ||
|
|
14a4b146bf | ||
|
|
5b69872655 | ||
|
|
4e9509dafa | ||
|
|
f457952755 | ||
|
|
818379ba14 | ||
|
|
fae869c4ca | ||
|
|
d588467d5b | ||
|
|
e3d6d36c72 | ||
|
|
7f96bb601a | ||
|
|
76e9cc41bd | ||
|
|
6f89975526 | ||
|
|
74dea4cfd5 | ||
|
|
7b65985047 | ||
|
|
5781d4d52d | ||
|
|
f82b903dee | ||
|
|
4589bc84a3 | ||
|
|
735d89e369 | ||
|
|
d016051fa0 | ||
|
|
42802669dd | ||
|
|
22290ef35a | ||
|
|
a27e4ce6cb | ||
|
|
91efccabdc | ||
|
|
ee7cda261c | ||
|
|
d26fbf727a | ||
|
|
b5af17c8e3 | ||
|
|
3db10fdbef | ||
|
|
6511c3b5c6 | ||
|
|
7a50705188 | ||
|
|
0e5d3d051b | ||
|
|
f5fac2c916 | ||
|
|
581e76942f | ||
|
|
2bf42f30af | ||
|
|
b9934fc4db | ||
|
|
31c636f1e4 | ||
|
|
36e3123069 | ||
|
|
327320d1a7 | ||
|
|
21f30a1b5f | ||
|
|
90dd5844d6 | ||
|
|
3c77b8f463 | ||
|
|
80133f9ebe | ||
|
|
2f61763923 | ||
|
|
7d2cd0d935 | ||
|
|
ae58cf4224 | ||
|
|
495a3e7daf | ||
|
|
92afa6aa44 | ||
|
|
ddd9384b39 | ||
|
|
4dc27aa91f | ||
|
|
b96a53962b | ||
|
|
3c2fb77133 | ||
|
|
eb5bec96e4 | ||
|
|
2f795e4fa6 | ||
|
|
4fc0cfba3c | ||
|
|
77355295da | ||
|
|
4ec2fc4cc2 | ||
|
|
020103c51e | ||
|
|
ac02cadbdb | ||
|
|
1cfd63d0b4 | ||
|
|
1c42337381 | ||
|
|
87d810217e | ||
|
|
772aedc731 | ||
|
|
fb6d6e5cca | ||
|
|
48f4b32d7f | ||
|
|
ebd99c9e3e | ||
|
|
21a6ef5bb6 | ||
|
|
a6f7328216 | ||
|
|
b36ef60aca | ||
|
|
8d7b1f8aa0 | ||
|
|
b0da4b8d13 | ||
|
|
cfa022700d | ||
|
|
9ab5c5040d | ||
|
|
5df3944607 | ||
|
|
fb2ace6fff | ||
|
|
f931c0a868 | ||
|
|
f4cc19968c | ||
|
|
b542622b3a | ||
|
|
5f97b3e1d9 | ||
|
|
e379566e6e | ||
|
|
80f486c778 | ||
|
|
632a42e2b1 | ||
|
|
bceef401fa | ||
|
|
1b0abf8f0c | ||
|
|
e29d563557 | ||
|
|
33aa6d172f | ||
|
|
3089b6d824 | ||
|
|
a5b3989e5d | ||
|
|
387a1bb283 | ||
|
|
b481a78234 | ||
|
|
d667f9d260 | ||
|
|
696b3f66c4 | ||
|
|
49e2872f9e | ||
|
|
61f4523e01 | ||
|
|
a74167bb06 | ||
|
|
f2a9d26118 | ||
|
|
e50b6b5334 | ||
|
|
967d42d393 | ||
|
|
e50155ebca | ||
|
|
f99278c956 | ||
|
|
95809cabd9 | ||
|
|
9d973ec3b3 | ||
|
|
d29fc53052 | ||
|
|
91312daeb2 | ||
|
|
0e5f5538bc | ||
|
|
f9721573d9 | ||
|
|
c7948a669a | ||
|
|
5e626ce55d | ||
|
|
380962d359 | ||
|
|
daa4745fb7 | ||
|
|
de69a24574 | ||
|
|
b602b476ad | ||
|
|
c77be802d2 | ||
|
|
1826b2b18e | ||
|
|
f35bd6eb7d | ||
|
|
dcb94b8a24 | ||
|
|
6632eb7c05 | ||
|
|
f0a098924e | ||
|
|
7c347f4c5c | ||
|
|
d86cbe6379 | ||
|
|
c0fec70b1a | ||
|
|
2c5ff93990 | ||
|
|
1ec84ac8b1 | ||
|
|
d5c8c6bc12 | ||
|
|
5dd2569bf7 | ||
|
|
d7e6fe488d | ||
|
|
ce468215d5 | ||
|
|
6f7825e310 | ||
|
|
dd0a89a0e6 | ||
|
|
190f9c258b | ||
|
|
46d8405229 | ||
|
|
9598c1af9e | ||
|
|
82487549f7 | ||
|
|
cdc3781f42 | ||
|
|
7df7b86ec5 | ||
|
|
81fda6f947 | ||
|
|
e9322b0bf7 | ||
|
|
96f889b20e | ||
|
|
224efe7b76 | ||
|
|
ebb394bbda | ||
|
|
c17965eec4 | ||
|
|
4ead48f09f | ||
|
|
41f3f2400e | ||
|
|
f06394f195 | ||
|
|
d53a53d4c5 | ||
|
|
757d9163fa | ||
|
|
25111e703f | ||
|
|
ad1b9bbba6 | ||
|
|
97b8739c1d | ||
|
|
0760121eb9 | ||
|
|
0a22e78f59 | ||
|
|
5e51f16ceb | ||
|
|
fd8a7e64b9 | ||
|
|
ed5f574356 | ||
|
|
44349f742e | ||
|
|
e3993eefa5 | ||
|
|
8db5d79f4b | ||
|
|
bf56b30024 | ||
|
|
8321ecb7a2 | ||
|
|
783ee949ea | ||
|
|
e041f09750 | ||
|
|
fa3edcf55c | ||
|
|
874bde366a | ||
|
|
d8df2d6bed | ||
|
|
126eae7100 | ||
|
|
3c097cb7a9 | ||
|
|
189f51233e | ||
|
|
76dc29dc37 | ||
|
|
df3914c7cd | ||
|
|
740eac192b | ||
|
|
783ecd01f4 | ||
|
|
a0e3e23aa9 | ||
|
|
1acee36822 | ||
|
|
ac90322f1b | ||
|
|
2ca93cb144 | ||
|
|
4e2805496c | ||
|
|
46af3a3d92 | ||
|
|
717b11856e | ||
|
|
0199abd625 | ||
|
|
550f6c4ad2 | ||
|
|
2b506cffb1 | ||
|
|
33469a0d2b | ||
|
|
1f18ce516f | ||
|
|
2ec34580ce | ||
|
|
288baaecaf | ||
|
|
d2b00749ef | ||
|
|
8f02fd926e | ||
|
|
9f914327c6 | ||
|
|
4215877b48 | ||
|
|
d2e79e26d7 | ||
|
|
3f6c6eed33 | ||
|
|
0a71e3ab39 | ||
|
|
8fe8fdb0c9 | ||
|
|
fbfd28a61b | ||
|
|
a0d0c9f751 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -66,6 +66,7 @@ Examples/*.dll
|
||||
OpenSim.build
|
||||
OpenSim.sln
|
||||
OpenSim.suo
|
||||
OpenSim.userprefs
|
||||
Prebuild/Prebuild.build
|
||||
Prebuild/Prebuild.sln
|
||||
TestResult.xml
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
==== Building OpenSim ====
|
||||
|
||||
=== Building on Windows ===
|
||||
# Building on Windows
|
||||
|
||||
Steps:
|
||||
* runprebuild.bat
|
||||
@@ -9,16 +7,15 @@ Steps:
|
||||
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
|
||||
* run OpenSim.exe
|
||||
|
||||
=== Building on Linux ===
|
||||
# Building on Linux
|
||||
|
||||
Prereqs:
|
||||
* Mono >= 2.4.3
|
||||
* Nant >= 0.85
|
||||
* On some Linux distributions you may need to install additional packages.
|
||||
See http://opensimulator.org/wiki/Dependencies for more information.
|
||||
|
||||
* May also use xbuild (included in mono distributions)
|
||||
* May use Monodevelop, a cross-platform IDE
|
||||
* Mono >= 2.4.3
|
||||
* Nant >= 0.85
|
||||
* On some Linux distributions you may need to install additional packages.
|
||||
See http://opensimulator.org/wiki/Dependencies for more information.
|
||||
* May also use xbuild (included in mono distributions)
|
||||
* May use Monodevelop, a cross-platform IDE
|
||||
|
||||
From the distribution type:
|
||||
* ./runprebuild.sh
|
||||
@@ -27,13 +24,13 @@ From the distribution type:
|
||||
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
|
||||
* run mono OpenSim.exe
|
||||
|
||||
=== Using Monodevelop ===
|
||||
# Using Monodevelop
|
||||
|
||||
From the distribution type:
|
||||
* ./runprebuild.sh
|
||||
* type monodevelop OpenSim.sln
|
||||
|
||||
=== References ===
|
||||
# References
|
||||
|
||||
Helpful resources:
|
||||
* http://opensimulator.org/wiki/Build_Instructions
|
||||
@@ -1,5 +1,5 @@
|
||||
<<<>>>>The following people have contributed to OpenSim (Thank you
|
||||
for your effort!)
|
||||
for your effort!)
|
||||
|
||||
= Current OpenSim Developers (in very rough order of appearance) =
|
||||
These folks represent the current core team for OpenSim, and are the
|
||||
@@ -16,7 +16,7 @@ people that make the day to day of OpenSim happen.
|
||||
* BlueWall (James Hughes)
|
||||
* Nebadon Izumi (Michael Cerquoni, OSgrid)
|
||||
* Snoopy Pfeffer
|
||||
* Richard Adams (Intel)
|
||||
* Robert Adams (Intel)
|
||||
|
||||
= Core Developers Following the White Rabbit =
|
||||
Core developers who have temporarily (we hope) gone chasing the white rabbit.
|
||||
@@ -182,12 +182,14 @@ what it is today.
|
||||
|
||||
This software uses components from the following developers:
|
||||
* Sleepycat Software (Berkeley DB)
|
||||
* Aurora-Sim (http://aurora-sim.org)
|
||||
* SQLite (Public Domain)
|
||||
* XmlRpcCS (http://xmlrpccs.sf.net/)
|
||||
* MySQL, Inc. (MySQL Connector/NET)
|
||||
* NUnit (http://www.nunit.org)
|
||||
* AGEIA Inc. (PhysX)
|
||||
* Russel L. Smith (ODE)
|
||||
* Erwin Coumans (Bullet)
|
||||
* Prebuild (http://sourceforge.net/projects/dnpb/)
|
||||
* LibOpenMetaverse (http://lib.openmetaverse.org/)
|
||||
* DotNetOpenMail v0.5.8b (http://dotnetopenmail.sourceforge.net)
|
||||
@@ -209,3 +211,4 @@ In addition, we would like to thank:
|
||||
* The NANT Developers
|
||||
* Microsoft (.NET, MSSQL-Adapters)
|
||||
*x
|
||||
|
||||
|
||||
@@ -99,12 +99,12 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
|
||||
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules...");
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
|
||||
//m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
|
||||
//m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
|
||||
//m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
|
||||
//m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
|
||||
//m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
|
||||
//m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
|
||||
// m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
|
||||
// m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Done.");
|
||||
@@ -136,9 +136,6 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_openSim.ModuleLoader.PostInitialise();
|
||||
m_openSim.ModuleLoader.ClearCache();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
}
|
||||
}
|
||||
|
||||
#region IRegionModulesController implementation
|
||||
#region Region Module interfacesController implementation
|
||||
|
||||
/// <summary>
|
||||
/// Check that the given module is no disabled in the [Modules] section of the config files.
|
||||
|
||||
@@ -572,7 +572,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
|
||||
region.ExternalHostName = (string) requestData["external_address"];
|
||||
|
||||
bool persist = Convert.ToBoolean((string) requestData["persist"]);
|
||||
bool persist = Convert.ToBoolean(requestData["persist"]);
|
||||
if (persist)
|
||||
{
|
||||
// default place for region configuration files is in the
|
||||
@@ -728,7 +728,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
responseData["success"] = true;
|
||||
responseData["region_name"] = region.RegionName;
|
||||
responseData["region_id"] = region.RegionID.ToString();
|
||||
responseData["region_uuid"] = region.RegionID.ToString(); //Deprecate July 2012
|
||||
|
||||
m_log.Info("[RADMIN]: CreateRegion: request complete");
|
||||
}
|
||||
@@ -982,8 +981,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
string lastName = (string) requestData["user_lastname"];
|
||||
string password = (string) requestData["user_password"];
|
||||
|
||||
uint regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]);
|
||||
uint regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]);
|
||||
uint regionXLocation = Convert.ToUInt32(requestData["start_region_x"]);
|
||||
uint regionYLocation = Convert.ToUInt32(requestData["start_region_y"]);
|
||||
|
||||
string email = ""; // empty string for email
|
||||
if (requestData.Contains("user_email"))
|
||||
@@ -1180,9 +1179,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
|
||||
if (requestData.ContainsKey("user_password")) password = (string) requestData["user_password"];
|
||||
if (requestData.ContainsKey("start_region_x"))
|
||||
regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]);
|
||||
regionXLocation = Convert.ToUInt32(requestData["start_region_x"]);
|
||||
if (requestData.ContainsKey("start_region_y"))
|
||||
regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]);
|
||||
regionYLocation = Convert.ToUInt32(requestData["start_region_y"]);
|
||||
|
||||
// if (requestData.ContainsKey("start_lookat_x"))
|
||||
// ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]);
|
||||
@@ -1369,6 +1368,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
/// <description>profile url</description></item>
|
||||
/// <item><term>noassets</term>
|
||||
/// <description>true if no assets should be saved</description></item>
|
||||
/// <item><term>all</term>
|
||||
/// <description>true to save all the regions in the simulator</description></item>
|
||||
/// <item><term>perm</term>
|
||||
/// <description>C and/or T</description></item>
|
||||
/// </list>
|
||||
@@ -1425,6 +1426,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
options["checkPermissions"] = (string)requestData["perm"];
|
||||
}
|
||||
|
||||
if ((string)requestData["all"] == "true")
|
||||
{
|
||||
options["all"] = (string)requestData["all"];
|
||||
}
|
||||
|
||||
IRegionArchiverModule archiver = scene.RequestModuleInterface<IRegionArchiverModule>();
|
||||
|
||||
if (archiver != null)
|
||||
@@ -1874,29 +1880,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
{
|
||||
return;
|
||||
}
|
||||
#region Deprecate July 2012
|
||||
//region_ID, regionid, region_uuid will be deprecated in July 2012!!!!!!
|
||||
else if (requestData.ContainsKey("regionid") &&
|
||||
!String.IsNullOrEmpty((string)requestData["regionid"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
|
||||
}
|
||||
else if (requestData.ContainsKey("region_ID") &&
|
||||
!String.IsNullOrEmpty((string)requestData["region_ID"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
|
||||
}
|
||||
else if (requestData.ContainsKey("regionID") &&
|
||||
!String.IsNullOrEmpty((string)requestData["regionID"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
|
||||
}
|
||||
else if (requestData.ContainsKey("region_uuid") &&
|
||||
!String.IsNullOrEmpty((string)requestData["region_uuid"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
|
||||
}
|
||||
#endregion
|
||||
else
|
||||
{
|
||||
responseData["accepted"] = false;
|
||||
@@ -1918,56 +1901,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
throw new Exception(String.Format("Region ID {0} not found", regionID));
|
||||
}
|
||||
}
|
||||
#region Deprecate July 2012
|
||||
else if (requestData.ContainsKey("regionid") &&
|
||||
!String.IsNullOrEmpty((string)requestData["regionid"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
|
||||
|
||||
UUID regionID = (UUID)(string)requestData["regionid"];
|
||||
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
|
||||
{
|
||||
responseData["error"] = String.Format("Region ID {0} not found", regionID);
|
||||
throw new Exception(String.Format("Region ID {0} not found", regionID));
|
||||
}
|
||||
}
|
||||
else if (requestData.ContainsKey("region_ID") &&
|
||||
!String.IsNullOrEmpty((string)requestData["region_ID"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
|
||||
|
||||
UUID regionID = (UUID)(string)requestData["region_ID"];
|
||||
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
|
||||
{
|
||||
responseData["error"] = String.Format("Region ID {0} not found", regionID);
|
||||
throw new Exception(String.Format("Region ID {0} not found", regionID));
|
||||
}
|
||||
}
|
||||
else if (requestData.ContainsKey("regionID") &&
|
||||
!String.IsNullOrEmpty((string)requestData["regionID"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
|
||||
|
||||
UUID regionID = (UUID)(string)requestData["regionID"];
|
||||
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
|
||||
{
|
||||
responseData["error"] = String.Format("Region ID {0} not found", regionID);
|
||||
throw new Exception(String.Format("Region ID {0} not found", regionID));
|
||||
}
|
||||
}
|
||||
else if (requestData.ContainsKey("region_uuid") &&
|
||||
!String.IsNullOrEmpty((string)requestData["region_uuid"]))
|
||||
{
|
||||
m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
|
||||
|
||||
UUID regionID = (UUID)(string)requestData["region_uuid"];
|
||||
if (!m_application.SceneManager.TryGetScene(regionID, out scene))
|
||||
{
|
||||
responseData["error"] = String.Format("Region ID {0} not found", regionID);
|
||||
throw new Exception(String.Format("Region ID {0} not found", regionID));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
else if (requestData.ContainsKey("region_name") &&
|
||||
!String.IsNullOrEmpty((string)requestData["region_name"]))
|
||||
{
|
||||
|
||||
@@ -312,14 +312,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
// Now that everything is setup we can proceed to
|
||||
// add THIS agent to the HTTP server's handler list
|
||||
|
||||
if (!AddAgentHandler(Rest.Name,this))
|
||||
{
|
||||
Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
|
||||
foreach (IRest handler in handlers)
|
||||
{
|
||||
handler.Close();
|
||||
}
|
||||
}
|
||||
// FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
|
||||
// have to be handled through the AddHttpHandler interface.
|
||||
// if (!AddAgentHandler(Rest.Name,this))
|
||||
// {
|
||||
// Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
|
||||
// foreach (IRest handler in handlers)
|
||||
// {
|
||||
// handler.Close();
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -342,11 +344,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
{
|
||||
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
|
||||
|
||||
try
|
||||
{
|
||||
RemoveAgentHandler(Rest.Name, this);
|
||||
}
|
||||
catch (KeyNotFoundException){}
|
||||
// FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
|
||||
// have to be handled through the AddHttpHandler interface.
|
||||
// try
|
||||
// {
|
||||
// RemoveAgentHandler(Rest.Name, this);
|
||||
// }
|
||||
// catch (KeyNotFoundException){}
|
||||
|
||||
foreach (IRest handler in handlers)
|
||||
{
|
||||
|
||||
@@ -297,7 +297,9 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
{
|
||||
if (!IsEnabled) return false;
|
||||
_agents.Add(agentName, handler);
|
||||
return _httpd.AddAgentHandler(agentName, handler);
|
||||
// return _httpd.AddAgentHandler(agentName, handler);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -316,7 +318,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
if (_agents[agentName] == handler)
|
||||
{
|
||||
_agents.Remove(agentName);
|
||||
return _httpd.RemoveAgentHandler(agentName, handler);
|
||||
// return _httpd.RemoveAgentHandler(agentName, handler);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -358,10 +360,10 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
_httpd.RemoveStreamHandler(h.HttpMethod, h.Path);
|
||||
}
|
||||
_handlers = null;
|
||||
foreach (KeyValuePair<string, IHttpAgentHandler> h in _agents)
|
||||
{
|
||||
_httpd.RemoveAgentHandler(h.Key, h.Value);
|
||||
}
|
||||
// foreach (KeyValuePair<string, IHttpAgentHandler> h in _agents)
|
||||
// {
|
||||
// _httpd.RemoveAgentHandler(h.Key, h.Value);
|
||||
// }
|
||||
_agents = null;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
//m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache");
|
||||
// m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache");
|
||||
|
||||
// Fetch locally or remotely. Misses return a 404
|
||||
texture = m_assetService.Get(textureID.ToString());
|
||||
@@ -197,7 +197,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
}
|
||||
else // it was on the cache
|
||||
{
|
||||
//m_log.DebugFormat("[GETTEXTURE]: texture was in the cache");
|
||||
// m_log.DebugFormat("[GETTEXTURE]: texture was in the cache");
|
||||
WriteTextureData(httpRequest, httpResponse, texture, format);
|
||||
return true;
|
||||
}
|
||||
@@ -219,12 +219,30 @@ namespace OpenSim.Capabilities.Handlers
|
||||
int start, end;
|
||||
if (TryParseRange(range, out start, out end))
|
||||
{
|
||||
|
||||
// Before clamping start make sure we can satisfy it in order to avoid
|
||||
// sending back the last byte instead of an error status
|
||||
if (start >= texture.Data.Length)
|
||||
{
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
||||
// m_log.DebugFormat(
|
||||
// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}",
|
||||
// texture.ID, start, texture.Data.Length);
|
||||
|
||||
// Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back
|
||||
// Requested Range Not Satisfiable (416) here. However, it appears that at least recent implementations
|
||||
// of the Linden Lab viewer (3.2.1 and 3.3.4 and probably earlier), a viewer that has previously
|
||||
// received a very small texture may attempt to fetch bytes from the server past the
|
||||
// range of data that it received originally. Whether this happens appears to depend on whether
|
||||
// the viewer's estimation of how large a request it needs to make for certain discard levels
|
||||
// (http://wiki.secondlife.com/wiki/Image_System#Discard_Level_and_Mip_Mapping), chiefly discard
|
||||
// level 2. If this estimate is greater than the total texture size, returning a RequestedRangeNotSatisfiable
|
||||
// here will cause the viewer to treat the texture as bad and never display the full resolution
|
||||
// However, if we return PartialContent (or OK) instead, the viewer will display that resolution.
|
||||
|
||||
// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
||||
// response.AddHeader("Content-Range", String.Format("bytes */{0}", texture.Data.Length));
|
||||
// response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||
response.ContentType = texture.Metadata.ContentType;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -232,12 +250,18 @@ namespace OpenSim.Capabilities.Handlers
|
||||
start = Utils.Clamp(start, 0, end);
|
||||
int len = end - start + 1;
|
||||
|
||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
|
||||
// Always return PartialContent, even if the range covered the entire data length
|
||||
// We were accidentally sending back 404 before in this situation
|
||||
// https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the
|
||||
// entire range is requested, and viewer 3.2.2 (and very probably earlier) seems fine with this.
|
||||
//
|
||||
// We also do not want to send back OK even if the whole range was satisfiable since this causes
|
||||
// HTTP textures on at least Imprudence 1.4.0-beta2 to never display the final texture quality.
|
||||
// if (end > maxEnd)
|
||||
// response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||
// else
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||
|
||||
response.ContentLength = len;
|
||||
|
||||
@@ -85,21 +85,6 @@ namespace OpenSim.Data
|
||||
List<RegionData> GetHyperlinks(UUID scopeID);
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum RegionFlags : int
|
||||
{
|
||||
DefaultRegion = 1, // Used for new Rez. Random if multiple defined
|
||||
FallbackRegion = 2, // Regions we redirect to when the destination is down
|
||||
RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
|
||||
NoDirectLogin = 8, // Region unavailable for direct logins (by name)
|
||||
Persistent = 16, // Don't remove on unregister
|
||||
LockedOut = 32, // Don't allow registration
|
||||
NoMove = 64, // Don't allow moving this region
|
||||
Reservation = 128, // This is an inactive reservation
|
||||
Authenticate = 256, // Require authentication
|
||||
Hyperlink = 512 // Record represents a HG link
|
||||
}
|
||||
|
||||
public class RegionDataDistanceCompare : IComparer<RegionData>
|
||||
{
|
||||
private Vector2 m_origin;
|
||||
|
||||
@@ -116,7 +116,22 @@ namespace OpenSim.Data
|
||||
/// <returns>true if the delete was successful, false if it was not</returns>
|
||||
bool DeleteItems(string[] fields, string[] vals);
|
||||
|
||||
bool MoveItem(string id, string newParent);
|
||||
/// <summary>
|
||||
/// Move an item to another folder.
|
||||
/// </summary>
|
||||
/// <returns>/returns>
|
||||
/// <param name='id'>UUID of the item</param>
|
||||
/// <param name='newParent'>UUID of the new parent folder.</param>
|
||||
bool MoveItem(string id, string newParentFolderID);
|
||||
|
||||
/// <summary>
|
||||
/// Move a folder to another folder.
|
||||
/// </summary>
|
||||
/// <returns>/returns>
|
||||
/// <param name='id'>UUID of the item</param>
|
||||
/// <param name='newParent'>UUID of the new parent folder.</param>
|
||||
bool MoveFolder(string id, string newParentFolderID);
|
||||
|
||||
XInventoryItem[] GetActiveGestures(UUID principalID);
|
||||
int GetAssetPermissions(UUID principalID, UUID assetID);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using RegionFlags = OpenSim.Framework.RegionFlags;
|
||||
|
||||
namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
|
||||
@@ -43,12 +43,12 @@ namespace OpenSim.Data.MSSQL
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(
|
||||
// MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private MSSQLGenericTableHandler<XInventoryFolder> m_Folders;
|
||||
private MSSQLFolderHandler m_Folders;
|
||||
private MSSQLItemHandler m_Items;
|
||||
|
||||
public MSSQLXInventoryData(string conn, string realm)
|
||||
{
|
||||
m_Folders = new MSSQLGenericTableHandler<XInventoryFolder>(
|
||||
m_Folders = new MSSQLFolderHandler(
|
||||
conn, "inventoryfolders", "InventoryStore");
|
||||
m_Items = new MSSQLItemHandler(
|
||||
conn, "inventoryitems", String.Empty);
|
||||
@@ -85,6 +85,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
return m_Folders.Delete(field, val);
|
||||
}
|
||||
|
||||
public bool DeleteFolders(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Folders.Delete(fields, vals);
|
||||
@@ -94,15 +95,22 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
return m_Items.Delete(field, val);
|
||||
}
|
||||
|
||||
public bool DeleteItems(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Items.Delete(fields, vals);
|
||||
}
|
||||
|
||||
public bool MoveItem(string id, string newParent)
|
||||
{
|
||||
return m_Items.MoveItem(id, newParent);
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParent)
|
||||
{
|
||||
return m_Folders.MoveFolder(id, newParent);
|
||||
}
|
||||
|
||||
public XInventoryItem[] GetActiveGestures(UUID principalID)
|
||||
{
|
||||
return m_Items.GetActiveGestures(principalID);
|
||||
@@ -124,79 +132,115 @@ namespace OpenSim.Data.MSSQL
|
||||
public bool MoveItem(string id, string newParent)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where inventoryID = @InventoryID", m_Realm);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParent));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@InventoryID", id));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
return cmd.ExecuteNonQuery() == 0 ? false : true;
|
||||
cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where inventoryID = @InventoryID", m_Realm);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParent));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@InventoryID", id));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
return cmd.ExecuteNonQuery() == 0 ? false : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public XInventoryItem[] GetActiveGestures(UUID principalID)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from inventoryitems where avatarId = @uuid and assetType = @type and flags = 1", m_Realm);
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from inventoryitems where avatarId = @uuid and assetType = @type and flags = 1", m_Realm);
|
||||
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@uuid", principalID.ToString()));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@type", (int)AssetType.Gesture));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
return DoQuery(cmd);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@uuid", principalID.ToString()));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@type", (int)AssetType.Gesture));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int GetAssetPermissions(UUID principalID, UUID assetID)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = @PrincipalID and assetID = @AssetID group by assetID", m_Realm);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString()));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@AssetID", assetID.ToString()));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
|
||||
int perms = 0;
|
||||
|
||||
if (reader.Read())
|
||||
cmd.CommandText = String.Format("select bit_or(inventoryCurrentPermissions) as inventoryCurrentPermissions from inventoryitems where avatarID = @PrincipalID and assetID = @AssetID group by assetID", m_Realm);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@PrincipalID", principalID.ToString()));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@AssetID", assetID.ToString()));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]);
|
||||
|
||||
int perms = 0;
|
||||
|
||||
if (reader.Read())
|
||||
{
|
||||
perms = Convert.ToInt32(reader["inventoryCurrentPermissions"]);
|
||||
}
|
||||
|
||||
return perms;
|
||||
}
|
||||
|
||||
return perms;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Store(XInventoryItem item)
|
||||
{
|
||||
if (!base.Store(item))
|
||||
return false;
|
||||
|
||||
string sql = "update inventoryfolders set version=version+1 where folderID = @folderID";
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString());
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString());
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MSSQLFolderHandler : MSSQLGenericTableHandler<XInventoryFolder>
|
||||
{
|
||||
public MSSQLFolderHandler(string c, string t, string m) :
|
||||
base(c, t, m)
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParentFolderID)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set parentFolderID = @ParentFolderID where folderID = @folderID", m_Realm);
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@ParentFolderID", newParentFolderID));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@folderID", id));
|
||||
cmd.Connection = conn;
|
||||
conn.Open();
|
||||
return cmd.ExecuteNonQuery() == 0 ? false : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,6 +219,8 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public virtual bool Store(T row)
|
||||
{
|
||||
// m_log.DebugFormat("[MYSQL GENERIC TABLE HANDLER]: Store(T row) invoked");
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
string query = "";
|
||||
@@ -273,6 +275,10 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public virtual bool Delete(string[] fields, string[] keys)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[MYSQL GENERIC TABLE HANDLER]: Delete(string[] fields, string[] keys) invoked with {0}:{1}",
|
||||
// string.Join(",", fields), string.Join(",", keys));
|
||||
|
||||
if (fields.Length != keys.Length)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
using MySql.Data.MySqlClient;
|
||||
using RegionFlags = OpenSim.Framework.RegionFlags;
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
|
||||
@@ -26,9 +26,10 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenMetaverse;
|
||||
@@ -41,12 +42,12 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
public class MySQLXInventoryData : IXInventoryData
|
||||
{
|
||||
private MySQLGenericTableHandler<XInventoryFolder> m_Folders;
|
||||
private MySqlFolderHandler m_Folders;
|
||||
private MySqlItemHandler m_Items;
|
||||
|
||||
public MySQLXInventoryData(string conn, string realm)
|
||||
{
|
||||
m_Folders = new MySQLGenericTableHandler<XInventoryFolder>(
|
||||
m_Folders = new MySqlFolderHandler(
|
||||
conn, "inventoryfolders", "InventoryStore");
|
||||
m_Items = new MySqlItemHandler(
|
||||
conn, "inventoryitems", String.Empty);
|
||||
@@ -105,6 +106,11 @@ namespace OpenSim.Data.MySQL
|
||||
return m_Items.MoveItem(id, newParent);
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParent)
|
||||
{
|
||||
return m_Folders.MoveFolder(id, newParent);
|
||||
}
|
||||
|
||||
public XInventoryItem[] GetActiveGestures(UUID principalID)
|
||||
{
|
||||
return m_Items.GetActiveGestures(principalID);
|
||||
@@ -118,22 +124,69 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public class MySqlItemHandler : MySQLGenericTableHandler<XInventoryItem>
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MySqlItemHandler(string c, string t, string m) :
|
||||
base(c, t, m)
|
||||
{
|
||||
}
|
||||
|
||||
public override bool Delete(string field, string val)
|
||||
{
|
||||
XInventoryItem[] retrievedItems = Get(new string[] { field }, new string[] { val });
|
||||
if (retrievedItems.Length == 0)
|
||||
return false;
|
||||
|
||||
if (!base.Delete(field, val))
|
||||
return false;
|
||||
|
||||
// Don't increment folder version here since Delete(string, string) calls Delete(string[], string[])
|
||||
// IncrementFolderVersion(retrievedItems[0].parentFolderID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Delete(string[] fields, string[] vals)
|
||||
{
|
||||
XInventoryItem[] retrievedItems = Get(fields, vals);
|
||||
if (retrievedItems.Length == 0)
|
||||
return false;
|
||||
|
||||
if (!base.Delete(fields, vals))
|
||||
return false;
|
||||
|
||||
HashSet<UUID> deletedItemFolderUUIDs = new HashSet<UUID>();
|
||||
|
||||
Array.ForEach<XInventoryItem>(retrievedItems, i => deletedItemFolderUUIDs.Add(i.parentFolderID));
|
||||
|
||||
foreach (UUID deletedItemFolderUUID in deletedItemFolderUUIDs)
|
||||
IncrementFolderVersion(deletedItemFolderUUID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool MoveItem(string id, string newParent)
|
||||
{
|
||||
XInventoryItem[] retrievedItems = Get(new string[] { "inventoryID" }, new string[] { id });
|
||||
if (retrievedItems.Length == 0)
|
||||
return false;
|
||||
|
||||
UUID oldParent = retrievedItems[0].parentFolderID;
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set parentFolderID = ?ParentFolderID where inventoryID = ?InventoryID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?ParentFolderID", newParent);
|
||||
cmd.Parameters.AddWithValue("?InventoryID", id);
|
||||
|
||||
return ExecuteNonQuery(cmd) == 0 ? false : true;
|
||||
if (ExecuteNonQuery(cmd) == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
IncrementFolderVersion(oldParent);
|
||||
IncrementFolderVersion(newParent);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public XInventoryItem[] GetActiveGestures(UUID principalID)
|
||||
@@ -184,6 +237,21 @@ namespace OpenSim.Data.MySQL
|
||||
if (!base.Store(item))
|
||||
return false;
|
||||
|
||||
IncrementFolderVersion(item.parentFolderID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IncrementFolderVersion(UUID folderID)
|
||||
{
|
||||
return IncrementFolderVersion(folderID.ToString());
|
||||
}
|
||||
|
||||
private bool IncrementFolderVersion(string folderID)
|
||||
{
|
||||
// m_log.DebugFormat("[MYSQL ITEM HANDLER]: Incrementing version on folder {0}", folderID);
|
||||
// Util.PrintCallStack();
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
@@ -193,7 +261,7 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.Connection = dbcon;
|
||||
|
||||
cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID");
|
||||
cmd.Parameters.AddWithValue("?folderID", item.parentFolderID.ToString());
|
||||
cmd.Parameters.AddWithValue("?folderID", folderID);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -205,9 +273,96 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
cmd.Dispose();
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MySqlFolderHandler : MySQLGenericTableHandler<XInventoryFolder>
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MySqlFolderHandler(string c, string t, string m) :
|
||||
base(c, t, m)
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParentFolderID)
|
||||
{
|
||||
XInventoryFolder[] folders = Get(new string[] { "folderID" }, new string[] { id });
|
||||
|
||||
if (folders.Length == 0)
|
||||
return false;
|
||||
|
||||
UUID oldParentFolderUUID = folders[0].parentFolderID;
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText
|
||||
= String.Format(
|
||||
"update {0} set parentFolderID = ?ParentFolderID where folderID = ?folderID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?ParentFolderID", newParentFolderID);
|
||||
cmd.Parameters.AddWithValue("?folderID", id);
|
||||
|
||||
if (ExecuteNonQuery(cmd) == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
IncrementFolderVersion(oldParentFolderUUID);
|
||||
IncrementFolderVersion(newParentFolderID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool Store(XInventoryFolder folder)
|
||||
{
|
||||
if (!base.Store(folder))
|
||||
return false;
|
||||
|
||||
IncrementFolderVersion(folder.parentFolderID);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool IncrementFolderVersion(UUID folderID)
|
||||
{
|
||||
return IncrementFolderVersion(folderID.ToString());
|
||||
}
|
||||
|
||||
private bool IncrementFolderVersion(string folderID)
|
||||
{
|
||||
// m_log.DebugFormat("[MYSQL FOLDER HANDLER]: Incrementing version on folder {0}", folderID);
|
||||
// Util.PrintCallStack();
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.Connection = dbcon;
|
||||
|
||||
cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID");
|
||||
cmd.Parameters.AddWithValue("?folderID", folderID);
|
||||
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cmd.Dispose();
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,3 +17,8 @@ CREATE TABLE `GridUser` (
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 2 # --------------------------
|
||||
BEGIN;
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -33,6 +33,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using RegionFlags = OpenSim.Framework.RegionFlags;
|
||||
|
||||
namespace OpenSim.Data.Null
|
||||
{
|
||||
|
||||
@@ -1366,6 +1366,13 @@ namespace OpenSim.Data.SQLite
|
||||
createCol(land, "UserLookAtZ", typeof(Double));
|
||||
createCol(land, "AuthbuyerID", typeof(String));
|
||||
createCol(land, "OtherCleanTime", typeof(Int32));
|
||||
createCol(land, "Dwell", typeof(Int32));
|
||||
createCol(land, "MediaType", typeof(String));
|
||||
createCol(land, "MediaDescription", typeof(String));
|
||||
createCol(land, "MediaSize", typeof(String));
|
||||
createCol(land, "MediaLoop", typeof(Boolean));
|
||||
createCol(land, "ObscureMedia", typeof(Boolean));
|
||||
createCol(land, "ObscureMusic", typeof(Boolean));
|
||||
|
||||
land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] };
|
||||
|
||||
@@ -1781,9 +1788,16 @@ namespace OpenSim.Data.SQLite
|
||||
newData.PassHours = Convert.ToSingle(row["PassHours"]);
|
||||
newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
|
||||
newData.SnapshotID = (UUID)(String)row["SnapshotUUID"];
|
||||
newData.Dwell = Convert.ToInt32(row["Dwell"]);
|
||||
newData.MediaType = (String)row["MediaType"];
|
||||
newData.MediaDescription = (String)row["MediaDescription"];
|
||||
newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
|
||||
newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
|
||||
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
|
||||
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
|
||||
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
|
||||
try
|
||||
{
|
||||
|
||||
newData.UserLocation =
|
||||
new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
|
||||
Convert.ToSingle(row["UserLocationZ"]));
|
||||
@@ -2195,12 +2209,13 @@ namespace OpenSim.Data.SQLite
|
||||
row["UserLookAtZ"] = land.UserLookAt.Z;
|
||||
row["AuthbuyerID"] = land.AuthBuyerID.ToString();
|
||||
row["OtherCleanTime"] = land.OtherCleanTime;
|
||||
row["Dwell"] = land.Dwell;
|
||||
row["MediaType"] = land.MediaType;
|
||||
row["MediaDescription"] = land.MediaDescription;
|
||||
row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString();
|
||||
row["MediaLoop"] = land.MediaLoop.ToString();
|
||||
row["ObscureMusic"] = land.ObscureMusic.ToString();
|
||||
row["ObscureMedia"] = land.ObscureMedia.ToString();
|
||||
row["MediaSize"] = String.Format("{0},{1}", land.MediaWidth, land.MediaHeight);
|
||||
row["MediaLoop"] = land.MediaLoop;
|
||||
row["ObscureMusic"] = land.ObscureMusic;
|
||||
row["ObscureMedia"] = land.ObscureMedia;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private SQLiteGenericTableHandler<XInventoryFolder> m_Folders;
|
||||
private SqliteFolderHandler m_Folders;
|
||||
private SqliteItemHandler m_Items;
|
||||
|
||||
public SQLiteXInventoryData(string conn, string realm)
|
||||
@@ -55,7 +55,7 @@ namespace OpenSim.Data.SQLite
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
||||
m_Folders = new SqliteFolderHandler(
|
||||
conn, "inventoryfolders", "XInventoryStore");
|
||||
m_Items = new SqliteItemHandler(
|
||||
conn, "inventoryitems", String.Empty);
|
||||
@@ -114,6 +114,11 @@ namespace OpenSim.Data.SQLite
|
||||
return m_Items.MoveItem(id, newParent);
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParent)
|
||||
{
|
||||
return m_Folders.MoveFolder(id, newParent);
|
||||
}
|
||||
|
||||
public XInventoryItem[] GetActiveGestures(UUID principalID)
|
||||
{
|
||||
return m_Items.GetActiveGestures(principalID);
|
||||
@@ -177,4 +182,23 @@ namespace OpenSim.Data.SQLite
|
||||
return perms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SqliteFolderHandler : SQLiteGenericTableHandler<XInventoryFolder>
|
||||
{
|
||||
public SqliteFolderHandler(string c, string t, string m) :
|
||||
base(c, t, m)
|
||||
{
|
||||
}
|
||||
|
||||
public bool MoveFolder(string id, string newParentFolderID)
|
||||
{
|
||||
SqliteCommand cmd = new SqliteCommand();
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where folderID = :FolderID", m_Realm);
|
||||
cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParentFolderID));
|
||||
cmd.Parameters.Add(new SqliteParameter(":FolderID", id));
|
||||
|
||||
return ExecuteNonQuery(cmd, m_Connection) == 0 ? false : true;
|
||||
}
|
||||
}
|
||||
}
|
||||
84
OpenSim/Framework/AssetPermissions.cs
Normal file
84
OpenSim/Framework/AssetPermissions.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using Nini.Config;
|
||||
using log4net;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public class AssetPermissions
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool[] m_DisallowExport, m_DisallowImport;
|
||||
private string[] m_AssetTypeNames;
|
||||
|
||||
public AssetPermissions(IConfig config)
|
||||
{
|
||||
Type enumType = typeof(AssetType);
|
||||
m_AssetTypeNames = Enum.GetNames(enumType);
|
||||
for (int i = 0; i < m_AssetTypeNames.Length; i++)
|
||||
m_AssetTypeNames[i] = m_AssetTypeNames[i].ToLower();
|
||||
int n = Enum.GetValues(enumType).Length;
|
||||
m_DisallowExport = new bool[n];
|
||||
m_DisallowImport = new bool[n];
|
||||
|
||||
LoadPermsFromConfig(config, "DisallowExport", m_DisallowExport);
|
||||
LoadPermsFromConfig(config, "DisallowImport", m_DisallowImport);
|
||||
|
||||
}
|
||||
|
||||
private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray)
|
||||
{
|
||||
if (assetConfig == null)
|
||||
return;
|
||||
|
||||
string perms = assetConfig.GetString(variable, String.Empty);
|
||||
string[] parts = perms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string s in parts)
|
||||
{
|
||||
int index = Array.IndexOf(m_AssetTypeNames, s.Trim().ToLower());
|
||||
if (index >= 0)
|
||||
bitArray[index] = true;
|
||||
else
|
||||
m_log.WarnFormat("[Asset Permissions]: Invalid AssetType {0}", s);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool AllowedExport(sbyte type)
|
||||
{
|
||||
string assetTypeName = ((AssetType)type).ToString();
|
||||
|
||||
int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower());
|
||||
if (index >= 0 && m_DisallowExport[index])
|
||||
{
|
||||
m_log.DebugFormat("[Asset Permissions]: Export denied: configuration does not allow export of AssetType {0}", assetTypeName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AllowedImport(sbyte type)
|
||||
{
|
||||
string assetTypeName = ((AssetType)type).ToString();
|
||||
|
||||
int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower());
|
||||
if (index >= 0 && m_DisallowImport[index])
|
||||
{
|
||||
m_log.DebugFormat("[Asset Permissions]: Import denied: configuration does not allow import of AssetType {0}", assetTypeName);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -330,6 +330,9 @@ namespace OpenSim.Framework
|
||||
SetVisualParams(visualParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set avatar height by a calculation based on their visual parameters.
|
||||
/// </summary>
|
||||
public virtual void SetHeight()
|
||||
{
|
||||
// Start with shortest possible female avatar height
|
||||
|
||||
@@ -306,6 +306,8 @@ namespace OpenSim.Framework
|
||||
|
||||
public AgentGroupData[] Groups;
|
||||
public Animation[] Anims;
|
||||
public Animation DefaultAnim = null;
|
||||
public Animation AnimState = null;
|
||||
|
||||
public UUID GranterID;
|
||||
|
||||
@@ -390,6 +392,16 @@ namespace OpenSim.Framework
|
||||
args["animations"] = anims;
|
||||
}
|
||||
|
||||
if (DefaultAnim != null)
|
||||
{
|
||||
args["default_animation"] = DefaultAnim.PackUpdateMessage();
|
||||
}
|
||||
|
||||
if (AnimState != null)
|
||||
{
|
||||
args["animation_state"] = AnimState.PackUpdateMessage();
|
||||
}
|
||||
|
||||
if (Appearance != null)
|
||||
args["packed_appearance"] = Appearance.Pack();
|
||||
|
||||
@@ -583,6 +595,30 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
if (args["default_animation"] != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
DefaultAnim = new Animation((OSDMap)args["default_animation"]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
DefaultAnim = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (args["animation_state"] != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
AnimState = new Animation((OSDMap)args["animation_state"]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
AnimState = null;
|
||||
}
|
||||
}
|
||||
|
||||
//if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array)
|
||||
//{
|
||||
// OSDArray textures = (OSDArray)(args["agent_textures"]);
|
||||
|
||||
@@ -33,7 +33,8 @@ namespace OpenSim.Framework.Client
|
||||
{
|
||||
event ChatMessage OnChatFromClient;
|
||||
|
||||
void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source,
|
||||
byte audible);
|
||||
void SendChatMessage(
|
||||
string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
|
||||
byte audible);
|
||||
}
|
||||
}
|
||||
}
|
||||
228
OpenSim/Framework/Console/ConsoleUtil.cs
Normal file
228
OpenSim/Framework/Console/ConsoleUtil.cs
Normal file
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
public class ConsoleUtil
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public const int LocalIdNotFound = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Used by modules to display stock co-ordinate help, though possibly this should be under some general section
|
||||
/// rather than in each help summary.
|
||||
/// </summary>
|
||||
public const string CoordHelp
|
||||
= @"Each component of the coord is comma separated. There must be no spaces between the commas.
|
||||
If you don't care about the z component you can simply omit it.
|
||||
If you don't care about the x or y components then you can leave them blank (though a comma is still required)
|
||||
If you want to specify the maxmimum value of a component then you can use ~ instead of a number
|
||||
If you want to specify the minimum value of a component then you can use -~ instead of a number
|
||||
e.g.
|
||||
delete object pos 20,20,20 to 40,40,40
|
||||
delete object pos 20,20 to 40,40
|
||||
delete object pos ,20,20 to ,40,40
|
||||
delete object pos ,,30 to ,,~
|
||||
delete object pos ,,-~ to ,,30";
|
||||
|
||||
public const string MinRawConsoleVectorValue = "-~";
|
||||
public const string MaxRawConsoleVectorValue = "~";
|
||||
|
||||
public const string VectorSeparator = ",";
|
||||
public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray();
|
||||
|
||||
/// <summary>
|
||||
/// Check if the given file path exists.
|
||||
/// </summary>
|
||||
/// <remarks>If not, warning is printed to the given console.</remarks>
|
||||
/// <returns>true if the file does not exist, false otherwise.</returns>
|
||||
/// <param name='console'></param>
|
||||
/// <param name='path'></param>
|
||||
public static bool CheckFileDoesNotExist(ICommandConsole console, string path)
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
console.OutputFormat("File {0} already exists. Please move or remove it.", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Try to parse a console UUID from the console.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Will complain to the console if parsing fails.
|
||||
/// </remarks>
|
||||
/// <returns></returns>
|
||||
/// <param name='console'>If null then no complaint is printed.</param>
|
||||
/// <param name='rawUuid'></param>
|
||||
/// <param name='uuid'></param>
|
||||
public static bool TryParseConsoleUuid(ICommandConsole console, string rawUuid, out UUID uuid)
|
||||
{
|
||||
if (!UUID.TryParse(rawUuid, out uuid))
|
||||
{
|
||||
if (console != null)
|
||||
console.OutputFormat("{0} is not a valid uuid", rawUuid);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool TryParseConsoleLocalId(ICommandConsole console, string rawLocalId, out uint localId)
|
||||
{
|
||||
if (!uint.TryParse(rawLocalId, out localId))
|
||||
{
|
||||
if (console != null)
|
||||
console.OutputFormat("{0} is not a valid local id", localId);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (localId == 0)
|
||||
{
|
||||
if (console != null)
|
||||
console.OutputFormat("{0} is not a valid local id - it must be greater than 0", localId);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to parse the input as either a UUID or a local ID.
|
||||
/// </summary>
|
||||
/// <returns>true if parsing succeeded, false otherwise.</returns>
|
||||
/// <param name='console'></param>
|
||||
/// <param name='rawId'></param>
|
||||
/// <param name='uuid'></param>
|
||||
/// <param name='localId'>
|
||||
/// Will be set to ConsoleUtil.LocalIdNotFound if parsing result was a UUID or no parse succeeded.
|
||||
/// </param>
|
||||
public static bool TryParseConsoleId(ICommandConsole console, string rawId, out UUID uuid, out uint localId)
|
||||
{
|
||||
if (TryParseConsoleUuid(null, rawId, out uuid))
|
||||
{
|
||||
localId = LocalIdNotFound;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (TryParseConsoleLocalId(null, rawId, out localId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (console != null)
|
||||
console.OutputFormat("{0} is not a valid UUID or local id", rawId);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a minimum vector input from the console to an OpenMetaverse.Vector3
|
||||
/// </summary>
|
||||
/// <param name='rawConsoleVector'>/param>
|
||||
/// <param name='vector'></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryParseConsoleMinVector(string rawConsoleVector, out Vector3 vector)
|
||||
{
|
||||
return TryParseConsoleVector(rawConsoleVector, c => float.MinValue.ToString(), out vector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a maximum vector input from the console to an OpenMetaverse.Vector3
|
||||
/// </summary>
|
||||
/// <param name='rawConsoleVector'>/param>
|
||||
/// <param name='vector'></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryParseConsoleMaxVector(string rawConsoleVector, out Vector3 vector)
|
||||
{
|
||||
return TryParseConsoleVector(rawConsoleVector, c => float.MaxValue.ToString(), out vector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert a vector input from the console to an OpenMetaverse.Vector3
|
||||
/// </summary>
|
||||
/// <param name='rawConsoleVector'>
|
||||
/// A string in the form <x>,<y>,<z> where there is no space between values.
|
||||
/// Any component can be missing (e.g. ,,40). blankComponentFunc is invoked to replace the blank with a suitable value
|
||||
/// Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40,30 or 40)
|
||||
/// The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue
|
||||
/// Other than that, component values must be numeric.
|
||||
/// </param>
|
||||
/// <param name='blankComponentFunc'></param>
|
||||
/// <param name='vector'></param>
|
||||
/// <returns></returns>
|
||||
public static bool TryParseConsoleVector(
|
||||
string rawConsoleVector, Func<string, string> blankComponentFunc, out Vector3 vector)
|
||||
{
|
||||
List<string> components = rawConsoleVector.Split(VectorSeparatorChars).ToList();
|
||||
|
||||
if (components.Count < 1 || components.Count > 3)
|
||||
{
|
||||
vector = Vector3.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = components.Count; i < 3; i++)
|
||||
components.Add("");
|
||||
|
||||
List<string> semiDigestedComponents
|
||||
= components.ConvertAll<string>(
|
||||
c =>
|
||||
{
|
||||
if (c == "")
|
||||
return blankComponentFunc.Invoke(c);
|
||||
else if (c == MaxRawConsoleVectorValue)
|
||||
return float.MaxValue.ToString();
|
||||
else if (c == MinRawConsoleVectorValue)
|
||||
return float.MinValue.ToString();
|
||||
else
|
||||
return c;
|
||||
});
|
||||
|
||||
string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray());
|
||||
|
||||
// m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector);
|
||||
|
||||
return Vector3.TryParse(semiDigestedConsoleVector, out vector);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ namespace OpenSim.Framework
|
||||
public class Constants
|
||||
{
|
||||
public const uint RegionSize = 256;
|
||||
public const uint RegionHeight = 4096;
|
||||
public const byte TerrainPatchSize = 16;
|
||||
public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace OpenSim.Framework
|
||||
public Vector3 Position;
|
||||
public byte[] binaryBucket;
|
||||
|
||||
|
||||
public uint ParentEstateID;
|
||||
public Guid RegionID;
|
||||
public uint timestamp;
|
||||
@@ -58,7 +57,7 @@ namespace OpenSim.Framework
|
||||
string _fromAgentName, UUID _toAgentID,
|
||||
byte _dialog, bool _fromGroup, string _message,
|
||||
UUID _imSessionID, bool _offline, Vector3 _position,
|
||||
byte[] _binaryBucket)
|
||||
byte[] _binaryBucket, bool addTimestamp)
|
||||
{
|
||||
fromAgentID = _fromAgentID.Guid;
|
||||
fromAgentName = _fromAgentName;
|
||||
@@ -79,7 +78,9 @@ namespace OpenSim.Framework
|
||||
ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID;
|
||||
RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid;
|
||||
}
|
||||
timestamp = (uint)Util.UnixTimeSinceEpoch();
|
||||
|
||||
if (addTimestamp)
|
||||
timestamp = (uint)Util.UnixTimeSinceEpoch();
|
||||
}
|
||||
|
||||
public GridInstantMessage(IScene scene, UUID _fromAgentID,
|
||||
@@ -87,7 +88,7 @@ namespace OpenSim.Framework
|
||||
string _message, bool _offline,
|
||||
Vector3 _position) : this(scene, _fromAgentID, _fromAgentName,
|
||||
_toAgentID, _dialog, false, _message,
|
||||
_fromAgentID ^ _toAgentID, _offline, _position, new byte[0])
|
||||
_fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,8 +805,23 @@ namespace OpenSim.Framework
|
||||
event Action<IClientAPI> OnRegionHandShakeReply;
|
||||
event GenericCall1 OnRequestWearables;
|
||||
event Action<IClientAPI, bool> OnCompleteMovementToRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Called when an AgentUpdate message is received and before OnAgentUpdate.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
|
||||
/// </remarks>
|
||||
event UpdateAgent OnPreAgentUpdate;
|
||||
|
||||
/// <summary>
|
||||
/// Called when an AgentUpdate message is received and after OnPreAgentUpdate.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
|
||||
/// </remarks>
|
||||
event UpdateAgent OnAgentUpdate;
|
||||
|
||||
event AgentRequestSit OnAgentRequestSit;
|
||||
event AgentSit OnAgentSit;
|
||||
event AvatarPickerRequest OnAvatarPickerRequest;
|
||||
@@ -1084,8 +1099,20 @@ namespace OpenSim.Framework
|
||||
void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
|
||||
void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
|
||||
|
||||
void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source,
|
||||
byte audible);
|
||||
/// <summary>
|
||||
/// Send chat to the viewer.
|
||||
/// </summary>
|
||||
/// <param name='message'></param>
|
||||
/// <param name='type'></param>
|
||||
/// <param name='fromPos'></param>
|
||||
/// <param name='fromName'></param>
|
||||
/// <param name='fromAgentID'></param>
|
||||
/// <param name='ownerID'></param>
|
||||
/// <param name='source'></param>
|
||||
/// <param name='audible'></param>
|
||||
void SendChatMessage(
|
||||
string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
|
||||
byte audible);
|
||||
|
||||
void SendInstantMessage(GridInstantMessage im);
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ namespace OpenSim.Framework
|
||||
// use only one serializer to give the runtime a chance to
|
||||
// optimize it (it won't do that if you use a new instance
|
||||
// every time)
|
||||
private static XmlSerializer serializer = new XmlSerializer(typeof (LandData));
|
||||
|
||||
private static XmlSerializer serializer = new XmlSerializer(typeof(LandData));
|
||||
|
||||
private Vector3 _AABBMax = new Vector3();
|
||||
private Vector3 _AABBMin = new Vector3();
|
||||
private int _area = 0;
|
||||
@@ -65,11 +65,11 @@ namespace OpenSim.Framework
|
||||
private byte[] _bitmap = new byte[512];
|
||||
private string _description = String.Empty;
|
||||
|
||||
private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark |
|
||||
(uint) ParcelFlags.AllowAPrimitiveEntry |
|
||||
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform |
|
||||
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
|
||||
(uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat;
|
||||
private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
|
||||
(uint)ParcelFlags.AllowAPrimitiveEntry |
|
||||
(uint)ParcelFlags.AllowDeedToGroup | (uint)ParcelFlags.AllowTerraform |
|
||||
(uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
|
||||
(uint)ParcelFlags.SoundLocal | (uint)ParcelFlags.AllowVoiceChat;
|
||||
|
||||
private byte _landingType = 0;
|
||||
private string _name = "Your Parcel";
|
||||
@@ -97,16 +97,36 @@ namespace OpenSim.Framework
|
||||
private bool _mediaLoop = false;
|
||||
private bool _obscureMusic = false;
|
||||
private bool _obscureMedia = false;
|
||||
private float _dwell = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Traffic count of parcel
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public float Dwell
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dwell;
|
||||
}
|
||||
set
|
||||
{
|
||||
_dwell = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether to obscure parcel media URL
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public bool ObscureMedia {
|
||||
get {
|
||||
public bool ObscureMedia
|
||||
{
|
||||
get
|
||||
{
|
||||
return _obscureMedia;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_obscureMedia = value;
|
||||
}
|
||||
}
|
||||
@@ -115,11 +135,14 @@ namespace OpenSim.Framework
|
||||
/// Whether to obscure parcel music URL
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public bool ObscureMusic {
|
||||
get {
|
||||
public bool ObscureMusic
|
||||
{
|
||||
get
|
||||
{
|
||||
return _obscureMusic;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_obscureMusic = value;
|
||||
}
|
||||
}
|
||||
@@ -128,11 +151,14 @@ namespace OpenSim.Framework
|
||||
/// Whether to loop parcel media
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public bool MediaLoop {
|
||||
get {
|
||||
public bool MediaLoop
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaLoop;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaLoop = value;
|
||||
}
|
||||
}
|
||||
@@ -141,11 +167,14 @@ namespace OpenSim.Framework
|
||||
/// Height of parcel media render
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public int MediaHeight {
|
||||
get {
|
||||
public int MediaHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaHeight;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaHeight = value;
|
||||
}
|
||||
}
|
||||
@@ -154,11 +183,14 @@ namespace OpenSim.Framework
|
||||
/// Width of parcel media render
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public int MediaWidth {
|
||||
get {
|
||||
public int MediaWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaWidth;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaWidth = value;
|
||||
}
|
||||
}
|
||||
@@ -167,11 +199,14 @@ namespace OpenSim.Framework
|
||||
/// Upper corner of the AABB for the parcel
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector3 AABBMax {
|
||||
get {
|
||||
public Vector3 AABBMax
|
||||
{
|
||||
get
|
||||
{
|
||||
return _AABBMax;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_AABBMax = value;
|
||||
}
|
||||
}
|
||||
@@ -179,11 +214,14 @@ namespace OpenSim.Framework
|
||||
/// Lower corner of the AABB for the parcel
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public Vector3 AABBMin {
|
||||
get {
|
||||
public Vector3 AABBMin
|
||||
{
|
||||
get
|
||||
{
|
||||
return _AABBMin;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_AABBMin = value;
|
||||
}
|
||||
}
|
||||
@@ -191,11 +229,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Area in meters^2 the parcel contains
|
||||
/// </summary>
|
||||
public int Area {
|
||||
get {
|
||||
public int Area
|
||||
{
|
||||
get
|
||||
{
|
||||
return _area;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_area = value;
|
||||
}
|
||||
}
|
||||
@@ -203,11 +244,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// ID of auction (3rd Party Integration) when parcel is being auctioned
|
||||
/// </summary>
|
||||
public uint AuctionID {
|
||||
get {
|
||||
public uint AuctionID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _auctionID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_auctionID = value;
|
||||
}
|
||||
}
|
||||
@@ -215,11 +259,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
|
||||
/// </summary>
|
||||
public UUID AuthBuyerID {
|
||||
get {
|
||||
public UUID AuthBuyerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _authBuyerID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_authBuyerID = value;
|
||||
}
|
||||
}
|
||||
@@ -227,11 +274,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Category of parcel. Used for classifying the parcel in classified listings
|
||||
/// </summary>
|
||||
public ParcelCategory Category {
|
||||
get {
|
||||
public ParcelCategory Category
|
||||
{
|
||||
get
|
||||
{
|
||||
return _category;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_category = value;
|
||||
}
|
||||
}
|
||||
@@ -239,11 +289,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Date that the current owner purchased or claimed the parcel
|
||||
/// </summary>
|
||||
public int ClaimDate {
|
||||
get {
|
||||
public int ClaimDate
|
||||
{
|
||||
get
|
||||
{
|
||||
return _claimDate;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_claimDate = value;
|
||||
}
|
||||
}
|
||||
@@ -251,11 +304,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// The last price that the parcel was sold at
|
||||
/// </summary>
|
||||
public int ClaimPrice {
|
||||
get {
|
||||
public int ClaimPrice
|
||||
{
|
||||
get
|
||||
{
|
||||
return _claimPrice;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_claimPrice = value;
|
||||
}
|
||||
}
|
||||
@@ -263,11 +319,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Global ID for the parcel. (3rd Party Integration)
|
||||
/// </summary>
|
||||
public UUID GlobalID {
|
||||
get {
|
||||
public UUID GlobalID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _globalID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_globalID = value;
|
||||
}
|
||||
}
|
||||
@@ -275,11 +334,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Unique ID of the Group that owns
|
||||
/// </summary>
|
||||
public UUID GroupID {
|
||||
get {
|
||||
public UUID GroupID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _groupID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_groupID = value;
|
||||
}
|
||||
}
|
||||
@@ -287,11 +349,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Returns true if the Land Parcel is owned by a group
|
||||
/// </summary>
|
||||
public bool IsGroupOwned {
|
||||
get {
|
||||
public bool IsGroupOwned
|
||||
{
|
||||
get
|
||||
{
|
||||
return _isGroupOwned;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_isGroupOwned = value;
|
||||
}
|
||||
}
|
||||
@@ -299,11 +364,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// jp2 data for the image representative of the parcel in the parcel dialog
|
||||
/// </summary>
|
||||
public byte[] Bitmap {
|
||||
get {
|
||||
public byte[] Bitmap
|
||||
{
|
||||
get
|
||||
{
|
||||
return _bitmap;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_bitmap = value;
|
||||
}
|
||||
}
|
||||
@@ -311,11 +379,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Parcel Description
|
||||
/// </summary>
|
||||
public string Description {
|
||||
get {
|
||||
public string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return _description;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_description = value;
|
||||
}
|
||||
}
|
||||
@@ -323,11 +394,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
|
||||
/// </summary>
|
||||
public uint Flags {
|
||||
get {
|
||||
public uint Flags
|
||||
{
|
||||
get
|
||||
{
|
||||
return _flags;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_flags = value;
|
||||
}
|
||||
}
|
||||
@@ -336,11 +410,14 @@ namespace OpenSim.Framework
|
||||
/// Determines if people are able to teleport where they please on the parcel or if they
|
||||
/// get constrainted to a specific point on teleport within the parcel
|
||||
/// </summary>
|
||||
public byte LandingType {
|
||||
get {
|
||||
public byte LandingType
|
||||
{
|
||||
get
|
||||
{
|
||||
return _landingType;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_landingType = value;
|
||||
}
|
||||
}
|
||||
@@ -348,11 +425,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Parcel Name
|
||||
/// </summary>
|
||||
public string Name {
|
||||
get {
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return _name;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_name = value;
|
||||
}
|
||||
}
|
||||
@@ -360,11 +440,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Status of Parcel, Leased, Abandoned, For Sale
|
||||
/// </summary>
|
||||
public ParcelStatus Status {
|
||||
get {
|
||||
public ParcelStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
return _status;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_status = value;
|
||||
}
|
||||
}
|
||||
@@ -372,11 +455,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Internal ID of the parcel. Sometimes the client will try to use this value
|
||||
/// </summary>
|
||||
public int LocalID {
|
||||
get {
|
||||
public int LocalID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _localID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_localID = value;
|
||||
}
|
||||
}
|
||||
@@ -384,11 +470,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Determines if we scale the media based on the surface it's on
|
||||
/// </summary>
|
||||
public byte MediaAutoScale {
|
||||
get {
|
||||
public byte MediaAutoScale
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaAutoScale;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaAutoScale = value;
|
||||
}
|
||||
}
|
||||
@@ -396,11 +485,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Texture Guid to replace with the output of the media stream
|
||||
/// </summary>
|
||||
public UUID MediaID {
|
||||
get {
|
||||
public UUID MediaID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaID = value;
|
||||
}
|
||||
}
|
||||
@@ -408,11 +500,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// URL to the media file to display
|
||||
/// </summary>
|
||||
public string MediaURL {
|
||||
get {
|
||||
public string MediaURL
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaURL;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaURL = value;
|
||||
}
|
||||
}
|
||||
@@ -432,11 +527,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// URL to the shoutcast music stream to play on the parcel
|
||||
/// </summary>
|
||||
public string MusicURL {
|
||||
get {
|
||||
public string MusicURL
|
||||
{
|
||||
get
|
||||
{
|
||||
return _musicURL;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_musicURL = value;
|
||||
}
|
||||
}
|
||||
@@ -445,11 +543,14 @@ namespace OpenSim.Framework
|
||||
/// Owner Avatar or Group of the parcel. Naturally, all land masses must be
|
||||
/// owned by someone
|
||||
/// </summary>
|
||||
public UUID OwnerID {
|
||||
get {
|
||||
public UUID OwnerID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ownerID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_ownerID = value;
|
||||
}
|
||||
}
|
||||
@@ -457,11 +558,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// List of access data for the parcel. User data, some bitflags, and a time
|
||||
/// </summary>
|
||||
public List<LandAccessEntry> ParcelAccessList {
|
||||
get {
|
||||
public List<LandAccessEntry> ParcelAccessList
|
||||
{
|
||||
get
|
||||
{
|
||||
return _parcelAccessList;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_parcelAccessList = value;
|
||||
}
|
||||
}
|
||||
@@ -469,11 +573,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// How long in hours a Pass to the parcel is given
|
||||
/// </summary>
|
||||
public float PassHours {
|
||||
get {
|
||||
public float PassHours
|
||||
{
|
||||
get
|
||||
{
|
||||
return _passHours;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_passHours = value;
|
||||
}
|
||||
}
|
||||
@@ -481,11 +588,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Price to purchase a Pass to a restricted parcel
|
||||
/// </summary>
|
||||
public int PassPrice {
|
||||
get {
|
||||
public int PassPrice
|
||||
{
|
||||
get
|
||||
{
|
||||
return _passPrice;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_passPrice = value;
|
||||
}
|
||||
}
|
||||
@@ -493,11 +603,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// When the parcel is being sold, this is the price to purchase the parcel
|
||||
/// </summary>
|
||||
public int SalePrice {
|
||||
get {
|
||||
public int SalePrice
|
||||
{
|
||||
get
|
||||
{
|
||||
return _salePrice;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_salePrice = value;
|
||||
}
|
||||
}
|
||||
@@ -506,11 +619,14 @@ namespace OpenSim.Framework
|
||||
/// Number of meters^2 in the Simulator
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public int SimwideArea {
|
||||
get {
|
||||
public int SimwideArea
|
||||
{
|
||||
get
|
||||
{
|
||||
return _simwideArea;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_simwideArea = value;
|
||||
}
|
||||
}
|
||||
@@ -519,11 +635,14 @@ namespace OpenSim.Framework
|
||||
/// Number of SceneObjectPart in the Simulator
|
||||
/// </summary>
|
||||
[XmlIgnore]
|
||||
public int SimwidePrims {
|
||||
get {
|
||||
public int SimwidePrims
|
||||
{
|
||||
get
|
||||
{
|
||||
return _simwidePrims;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_simwidePrims = value;
|
||||
}
|
||||
}
|
||||
@@ -531,11 +650,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// ID of the snapshot used in the client parcel dialog of the parcel
|
||||
/// </summary>
|
||||
public UUID SnapshotID {
|
||||
get {
|
||||
public UUID SnapshotID
|
||||
{
|
||||
get
|
||||
{
|
||||
return _snapshotID;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_snapshotID = value;
|
||||
}
|
||||
}
|
||||
@@ -544,11 +666,14 @@ namespace OpenSim.Framework
|
||||
/// When teleporting is restricted to a certain point, this is the location
|
||||
/// that the user will be redirected to
|
||||
/// </summary>
|
||||
public Vector3 UserLocation {
|
||||
get {
|
||||
public Vector3 UserLocation
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userLocation;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_userLocation = value;
|
||||
}
|
||||
}
|
||||
@@ -557,11 +682,14 @@ namespace OpenSim.Framework
|
||||
/// When teleporting is restricted to a certain point, this is the rotation
|
||||
/// that the user will be positioned
|
||||
/// </summary>
|
||||
public Vector3 UserLookAt {
|
||||
get {
|
||||
public Vector3 UserLookAt
|
||||
{
|
||||
get
|
||||
{
|
||||
return _userLookAt;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_userLookAt = value;
|
||||
}
|
||||
}
|
||||
@@ -570,11 +698,14 @@ namespace OpenSim.Framework
|
||||
/// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
|
||||
/// the parcel and isn't set to the same 'group' as the parcel.
|
||||
/// </summary>
|
||||
public int OtherCleanTime {
|
||||
get {
|
||||
public int OtherCleanTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return _otherCleanTime;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_otherCleanTime = value;
|
||||
}
|
||||
}
|
||||
@@ -582,11 +713,14 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// parcel media description
|
||||
/// </summary>
|
||||
public string MediaDescription {
|
||||
get {
|
||||
public string MediaDescription
|
||||
{
|
||||
get
|
||||
{
|
||||
return _mediaDescription;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_mediaDescription = value;
|
||||
}
|
||||
}
|
||||
@@ -622,7 +756,7 @@ namespace OpenSim.Framework
|
||||
landData._mediaURL = _mediaURL;
|
||||
landData._musicURL = _musicURL;
|
||||
landData._ownerID = _ownerID;
|
||||
landData._bitmap = (byte[]) _bitmap.Clone();
|
||||
landData._bitmap = (byte[])_bitmap.Clone();
|
||||
landData._description = _description;
|
||||
landData._flags = _flags;
|
||||
landData._name = _name;
|
||||
@@ -643,6 +777,7 @@ namespace OpenSim.Framework
|
||||
landData._obscureMedia = _obscureMedia;
|
||||
landData._simwideArea = _simwideArea;
|
||||
landData._simwidePrims = _simwidePrims;
|
||||
landData._dwell = _dwell;
|
||||
|
||||
landData._parcelAccessList.Clear();
|
||||
foreach (LandAccessEntry entry in _parcelAccessList)
|
||||
|
||||
@@ -49,7 +49,11 @@ namespace OpenSim.Framework.Monitoring
|
||||
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
|
||||
|
||||
sb.AppendFormat(
|
||||
"OpenSim object memory churn : {0} MB/s\n",
|
||||
"OpenSim last object memory churn : {0} MB/s\n",
|
||||
Math.Round((MemoryWatchdog.LastMemoryChurn * 1000) / 1024.0 / 1024, 3));
|
||||
|
||||
sb.AppendFormat(
|
||||
"OpenSim average object memory churn : {0} MB/s\n",
|
||||
Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3));
|
||||
|
||||
sb.AppendFormat(
|
||||
|
||||
@@ -60,13 +60,21 @@ namespace OpenSim.Framework.Monitoring
|
||||
private static bool m_enabled;
|
||||
|
||||
/// <summary>
|
||||
/// Average memory churn in bytes per millisecond.
|
||||
/// Last memory churn in bytes per millisecond.
|
||||
/// </summary>
|
||||
public static double AverageMemoryChurn
|
||||
{
|
||||
get { if (m_samples.Count > 0) return m_samples.Average(); else return 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Average memory churn in bytes per millisecond.
|
||||
/// </summary>
|
||||
public static double LastMemoryChurn
|
||||
{
|
||||
get { if (m_samples.Count > 0) return m_samples.Last(); else return 0; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maximum number of statistical samples.
|
||||
/// </summary>
|
||||
|
||||
@@ -355,10 +355,25 @@ Asset service request failures: {3}" + Environment.NewLine,
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(
|
||||
string.Format(
|
||||
"{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}",
|
||||
"{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}\n\n",
|
||||
inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime,
|
||||
netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime));
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
Dictionary<string, Dictionary<string, Stat>> sceneStats;
|
||||
|
||||
if (StatsManager.TryGetStats("scene", out sceneStats))
|
||||
{
|
||||
foreach (KeyValuePair<string, Dictionary<string, Stat>> kvp in sceneStats)
|
||||
{
|
||||
foreach (Stat stat in kvp.Value.Values)
|
||||
{
|
||||
if (stat.Verbosity == StatVerbosity.Info)
|
||||
{
|
||||
sb.AppendFormat("{0} ({1}): {2}{3}\n", stat.Name, stat.Container, stat.Value, stat.UnitName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
sb.Append(Environment.NewLine);
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenSim.Framework.Monitoring
|
||||
{
|
||||
/// <summary>
|
||||
@@ -32,6 +35,24 @@ namespace OpenSim.Framework.Monitoring
|
||||
/// </summary>
|
||||
public class StatsManager
|
||||
{
|
||||
// Subcommand used to list other stats.
|
||||
public const string AllSubCommand = "all";
|
||||
|
||||
// Subcommand used to list other stats.
|
||||
public const string ListSubCommand = "list";
|
||||
|
||||
// All subcommands
|
||||
public static HashSet<string> SubCommands = new HashSet<string> { AllSubCommand, ListSubCommand };
|
||||
|
||||
/// <summary>
|
||||
/// Registered stats categorized by category/container/shortname
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Do not add or remove directly from this dictionary.
|
||||
/// </remarks>
|
||||
public static Dictionary<string, Dictionary<string, Dictionary<string, Stat>>> RegisteredStats
|
||||
= new Dictionary<string, Dictionary<string, Dictionary<string, Stat>>>();
|
||||
|
||||
private static AssetStatsCollector assetStats;
|
||||
private static UserStatsCollector userStats;
|
||||
private static SimExtraStatsCollector simExtraStats = new SimExtraStatsCollector();
|
||||
@@ -40,6 +61,75 @@ namespace OpenSim.Framework.Monitoring
|
||||
public static UserStatsCollector UserStats { get { return userStats; } }
|
||||
public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } }
|
||||
|
||||
public static void RegisterConsoleCommands(ICommandConsole console)
|
||||
{
|
||||
console.Commands.AddCommand(
|
||||
"General",
|
||||
false,
|
||||
"show stats",
|
||||
"show stats [list|all|<category>]",
|
||||
"Show statistical information for this server",
|
||||
"If no final argument is specified then legacy statistics information is currently shown.\n"
|
||||
+ "If list is specified then statistic categories are shown.\n"
|
||||
+ "If all is specified then all registered statistics are shown.\n"
|
||||
+ "If a category name is specified then only statistics from that category are shown.\n"
|
||||
+ "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
|
||||
HandleShowStatsCommand);
|
||||
}
|
||||
|
||||
public static void HandleShowStatsCommand(string module, string[] cmd)
|
||||
{
|
||||
ICommandConsole con = MainConsole.Instance;
|
||||
|
||||
if (cmd.Length > 2)
|
||||
{
|
||||
var categoryName = cmd[2];
|
||||
|
||||
if (categoryName == AllSubCommand)
|
||||
{
|
||||
foreach (var category in RegisteredStats.Values)
|
||||
{
|
||||
OutputCategoryStatsToConsole(con, category);
|
||||
}
|
||||
}
|
||||
else if (categoryName == ListSubCommand)
|
||||
{
|
||||
con.Output("Statistic categories available are:");
|
||||
foreach (string category in RegisteredStats.Keys)
|
||||
con.OutputFormat(" {0}", category);
|
||||
}
|
||||
else
|
||||
{
|
||||
Dictionary<string, Dictionary<string, Stat>> category;
|
||||
if (!RegisteredStats.TryGetValue(categoryName, out category))
|
||||
{
|
||||
con.OutputFormat("No such category as {0}", categoryName);
|
||||
}
|
||||
else
|
||||
{
|
||||
OutputCategoryStatsToConsole(con, category);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Legacy
|
||||
con.Output(SimExtraStats.Report());
|
||||
}
|
||||
}
|
||||
|
||||
private static void OutputCategoryStatsToConsole(
|
||||
ICommandConsole con, Dictionary<string, Dictionary<string, Stat>> category)
|
||||
{
|
||||
foreach (var container in category.Values)
|
||||
{
|
||||
foreach (Stat stat in container.Values)
|
||||
{
|
||||
con.Output(stat.ToConsoleString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start collecting statistics related to assets.
|
||||
/// Should only be called once.
|
||||
@@ -61,5 +151,275 @@ namespace OpenSim.Framework.Monitoring
|
||||
|
||||
return userStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers a statistic.
|
||||
/// </summary>
|
||||
/// <param name='stat'></param>
|
||||
/// <returns></returns>
|
||||
public static bool RegisterStat(Stat stat)
|
||||
{
|
||||
Dictionary<string, Dictionary<string, Stat>> category = null, newCategory;
|
||||
Dictionary<string, Stat> container = null, newContainer;
|
||||
|
||||
lock (RegisteredStats)
|
||||
{
|
||||
// Stat name is not unique across category/container/shortname key.
|
||||
// XXX: For now just return false. This is to avoid problems in regression tests where all tests
|
||||
// in a class are run in the same instance of the VM.
|
||||
if (TryGetStat(stat, out category, out container))
|
||||
return false;
|
||||
|
||||
// We take a copy-on-write approach here of replacing dictionaries when keys are added or removed.
|
||||
// This means that we don't need to lock or copy them on iteration, which will be a much more
|
||||
// common operation after startup.
|
||||
if (container != null)
|
||||
newContainer = new Dictionary<string, Stat>(container);
|
||||
else
|
||||
newContainer = new Dictionary<string, Stat>();
|
||||
|
||||
if (category != null)
|
||||
newCategory = new Dictionary<string, Dictionary<string, Stat>>(category);
|
||||
else
|
||||
newCategory = new Dictionary<string, Dictionary<string, Stat>>();
|
||||
|
||||
newContainer[stat.ShortName] = stat;
|
||||
newCategory[stat.Container] = newContainer;
|
||||
RegisteredStats[stat.Category] = newCategory;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deregister a statistic
|
||||
/// </summary>>
|
||||
/// <param name='stat'></param>
|
||||
/// <returns></returns
|
||||
public static bool DeregisterStat(Stat stat)
|
||||
{
|
||||
Dictionary<string, Dictionary<string, Stat>> category = null, newCategory;
|
||||
Dictionary<string, Stat> container = null, newContainer;
|
||||
|
||||
lock (RegisteredStats)
|
||||
{
|
||||
if (!TryGetStat(stat, out category, out container))
|
||||
return false;
|
||||
|
||||
newContainer = new Dictionary<string, Stat>(container);
|
||||
newContainer.Remove(stat.ShortName);
|
||||
|
||||
newCategory = new Dictionary<string, Dictionary<string, Stat>>(category);
|
||||
newCategory.Remove(stat.Container);
|
||||
|
||||
newCategory[stat.Container] = newContainer;
|
||||
RegisteredStats[stat.Category] = newCategory;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool TryGetStats(string category, out Dictionary<string, Dictionary<string, Stat>> stats)
|
||||
{
|
||||
return RegisteredStats.TryGetValue(category, out stats);
|
||||
}
|
||||
|
||||
public static bool TryGetStat(
|
||||
Stat stat,
|
||||
out Dictionary<string, Dictionary<string, Stat>> category,
|
||||
out Dictionary<string, Stat> container)
|
||||
{
|
||||
category = null;
|
||||
container = null;
|
||||
|
||||
lock (RegisteredStats)
|
||||
{
|
||||
if (RegisteredStats.TryGetValue(stat.Category, out category))
|
||||
{
|
||||
if (category.TryGetValue(stat.Container, out container))
|
||||
{
|
||||
if (container.ContainsKey(stat.ShortName))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stat type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A push stat is one which is continually updated and so it's value can simply by read.
|
||||
/// A pull stat is one where reading the value triggers a collection method - the stat is not continually updated.
|
||||
/// </remarks>
|
||||
public enum StatType
|
||||
{
|
||||
Push,
|
||||
Pull
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verbosity of stat.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Info will always be displayed.
|
||||
/// </remarks>
|
||||
public enum StatVerbosity
|
||||
{
|
||||
Debug,
|
||||
Info
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds individual static details
|
||||
/// </summary>
|
||||
public class Stat
|
||||
{
|
||||
/// <summary>
|
||||
/// Category of this stat (e.g. cache, scene, etc).
|
||||
/// </summary>
|
||||
public string Category { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Containing name for this stat.
|
||||
/// FIXME: In the case of a scene, this is currently the scene name (though this leaves
|
||||
/// us with a to-be-resolved problem of non-unique region names).
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The container.
|
||||
/// </value>
|
||||
public string Container { get; private set; }
|
||||
|
||||
public StatType StatType { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Action used to update this stat when the value is requested if it's a pull type.
|
||||
/// </summary>
|
||||
public Action<Stat> PullAction { get; private set; }
|
||||
|
||||
public StatVerbosity Verbosity { get; private set; }
|
||||
public string ShortName { get; private set; }
|
||||
public string Name { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
public virtual string UnitName { get; private set; }
|
||||
|
||||
public virtual double Value
|
||||
{
|
||||
get
|
||||
{
|
||||
// Asking for an update here means that the updater cannot access this value without infinite recursion.
|
||||
// XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
|
||||
// called by the pull action and just return the value.
|
||||
if (StatType == StatType.Pull)
|
||||
PullAction(this);
|
||||
|
||||
return m_value;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
m_value = value;
|
||||
}
|
||||
}
|
||||
|
||||
private double m_value;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name='shortName'>Short name for the stat. Must not contain spaces. e.g. "LongFrames"</param>
|
||||
/// <param name='name'>Human readable name for the stat. e.g. "Long frames"</param>
|
||||
/// <param name='description'>Description of stat</param>
|
||||
/// <param name='unitName'>
|
||||
/// Unit name for the stat. Should be preceeded by a space if the unit name isn't normally appeneded immediately to the value.
|
||||
/// e.g. " frames"
|
||||
/// </param>
|
||||
/// <param name='category'>Category under which this stat should appear, e.g. "scene". Do not capitalize.</param>
|
||||
/// <param name='container'>Entity to which this stat relates. e.g. scene name if this is a per scene stat.</param>
|
||||
/// <param name='type'>Push or pull</param>
|
||||
/// <param name='pullAction'>Pull stats need an action to update the stat on request. Push stats should set null here.</param>
|
||||
/// <param name='verbosity'>Verbosity of stat. Controls whether it will appear in short stat display or only full display.</param>
|
||||
public Stat(
|
||||
string shortName,
|
||||
string name,
|
||||
string description,
|
||||
string unitName,
|
||||
string category,
|
||||
string container,
|
||||
StatType type,
|
||||
Action<Stat> pullAction,
|
||||
StatVerbosity verbosity)
|
||||
{
|
||||
if (StatsManager.SubCommands.Contains(category))
|
||||
throw new Exception(
|
||||
string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
|
||||
|
||||
ShortName = shortName;
|
||||
Name = name;
|
||||
Description = description;
|
||||
UnitName = unitName;
|
||||
Category = category;
|
||||
Container = container;
|
||||
StatType = type;
|
||||
|
||||
if (StatType == StatType.Push && pullAction != null)
|
||||
throw new Exception("A push stat cannot have a pull action");
|
||||
else
|
||||
PullAction = pullAction;
|
||||
|
||||
Verbosity = verbosity;
|
||||
}
|
||||
|
||||
public virtual string ToConsoleString()
|
||||
{
|
||||
return string.Format(
|
||||
"{0}.{1}.{2} : {3}{4}", Category, Container, ShortName, Value, UnitName);
|
||||
}
|
||||
}
|
||||
|
||||
public class PercentageStat : Stat
|
||||
{
|
||||
public int Antecedent { get; set; }
|
||||
public int Consequent { get; set; }
|
||||
|
||||
public override double Value
|
||||
{
|
||||
get
|
||||
{
|
||||
int c = Consequent;
|
||||
|
||||
// Avoid any chance of a multi-threaded divide-by-zero
|
||||
if (c == 0)
|
||||
return 0;
|
||||
|
||||
return (double)Antecedent / c * 100;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
throw new Exception("Cannot set value on a PercentageStat");
|
||||
}
|
||||
}
|
||||
|
||||
public PercentageStat(
|
||||
string shortName,
|
||||
string name,
|
||||
string description,
|
||||
string category,
|
||||
string container,
|
||||
StatType type,
|
||||
Action<Stat> pullAction,
|
||||
StatVerbosity verbosity)
|
||||
: base(shortName, name, description, "%", category, container, type, pullAction, verbosity) {}
|
||||
|
||||
public override string ToConsoleString()
|
||||
{
|
||||
return string.Format(
|
||||
"{0}.{1}.{2} : {3:0.##}{4} ({5}/{6})",
|
||||
Category, Container, ShortName, Value, UnitName, Antecedent, Consequent);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,25 @@ namespace OpenSim.Framework.Monitoring
|
||||
private static bool RemoveThread(int threadID)
|
||||
{
|
||||
lock (m_threads)
|
||||
return m_threads.Remove(threadID);
|
||||
{
|
||||
ThreadWatchdogInfo twi;
|
||||
if (m_threads.TryGetValue(threadID, out twi))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
|
||||
|
||||
m_threads.Remove(threadID);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool AbortThread(int threadID)
|
||||
|
||||
91
OpenSim/Framework/Pool.cs
Normal file
91
OpenSim/Framework/Pool.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Naive pool implementation.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Currently assumes that objects are in a useable state when returned.
|
||||
/// </remarks>
|
||||
public class Pool<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Number of objects in the pool.
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_pool)
|
||||
return m_pool.Count;
|
||||
}
|
||||
}
|
||||
|
||||
private Stack<T> m_pool;
|
||||
|
||||
/// <summary>
|
||||
/// Maximum pool size. Beyond this, any returned objects are not pooled.
|
||||
/// </summary>
|
||||
private int m_maxPoolSize;
|
||||
|
||||
private Func<T> m_createFunction;
|
||||
|
||||
public Pool(Func<T> createFunction, int maxSize)
|
||||
{
|
||||
m_maxPoolSize = maxSize;
|
||||
m_createFunction = createFunction;
|
||||
m_pool = new Stack<T>(m_maxPoolSize);
|
||||
}
|
||||
|
||||
public T GetObject()
|
||||
{
|
||||
lock (m_pool)
|
||||
{
|
||||
if (m_pool.Count > 0)
|
||||
return m_pool.Pop();
|
||||
else
|
||||
return m_createFunction();
|
||||
}
|
||||
}
|
||||
|
||||
public void ReturnObject(T obj)
|
||||
{
|
||||
lock (m_pool)
|
||||
{
|
||||
if (m_pool.Count >= m_maxPoolSize)
|
||||
return;
|
||||
else
|
||||
m_pool.Push(obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
OpenSim/Framework/RegionFlags.cs
Normal file
53
OpenSim/Framework/RegionFlags.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// Region flags used internally by OpenSimulator to store installation specific information about regions.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Don't confuse with OpenMetaverse.RegionFlags which are client facing flags (i.e. they go over the wire).
|
||||
/// Returned by IGridService.GetRegionFlags()
|
||||
/// </remarks>
|
||||
[Flags]
|
||||
public enum RegionFlags : int
|
||||
{
|
||||
DefaultRegion = 1, // Used for new Rez. Random if multiple defined
|
||||
FallbackRegion = 2, // Regions we redirect to when the destination is down
|
||||
RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
|
||||
NoDirectLogin = 8, // Region unavailable for direct logins (by name)
|
||||
Persistent = 16, // Don't remove on unregister
|
||||
LockedOut = 32, // Don't allow registration
|
||||
NoMove = 64, // Don't allow moving this region
|
||||
Reservation = 128, // This is an inactive reservation
|
||||
Authenticate = 256, // Require authentication
|
||||
Hyperlink = 512 // Record represents a HG link
|
||||
}
|
||||
}
|
||||
@@ -126,6 +126,7 @@ namespace OpenSim.Framework
|
||||
private int m_physPrimMax = 0;
|
||||
private bool m_clampPrimSize = false;
|
||||
private int m_objectCapacity = 0;
|
||||
private int m_linksetCapacity = 0;
|
||||
private int m_agentCapacity = 0;
|
||||
private string m_regionType = String.Empty;
|
||||
private RegionLightShareData m_windlight = new RegionLightShareData();
|
||||
@@ -317,6 +318,11 @@ namespace OpenSim.Framework
|
||||
get { return m_objectCapacity; }
|
||||
}
|
||||
|
||||
public int LinksetCapacity
|
||||
{
|
||||
get { return m_linksetCapacity; }
|
||||
}
|
||||
|
||||
public int AgentCapacity
|
||||
{
|
||||
get { return m_agentCapacity; }
|
||||
@@ -637,11 +643,11 @@ namespace OpenSim.Framework
|
||||
|
||||
#region Prim stuff
|
||||
|
||||
m_nonphysPrimMin = config.GetFloat("NonphysicalPrimMin", 0);
|
||||
allKeys.Remove("NonphysicalPrimMin");
|
||||
m_nonphysPrimMin = config.GetFloat("NonPhysicalPrimMin", 0);
|
||||
allKeys.Remove("NonPhysicalPrimMin");
|
||||
|
||||
m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0);
|
||||
allKeys.Remove("NonphysicalPrimMax");
|
||||
m_nonphysPrimMax = config.GetInt("NonPhysicalPrimMax", 0);
|
||||
allKeys.Remove("NonPhysicalPrimMax");
|
||||
|
||||
m_physPrimMin = config.GetFloat("PhysicalPrimMin", 0);
|
||||
allKeys.Remove("PhysicalPrimMin");
|
||||
@@ -654,6 +660,9 @@ namespace OpenSim.Framework
|
||||
|
||||
m_objectCapacity = config.GetInt("MaxPrims", 15000);
|
||||
allKeys.Remove("MaxPrims");
|
||||
|
||||
m_linksetCapacity = config.GetInt("LinksetPrims", 0);
|
||||
allKeys.Remove("LinksetPrims");
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -692,24 +701,27 @@ namespace OpenSim.Framework
|
||||
|
||||
config.Set("ExternalHostName", m_externalHostName);
|
||||
|
||||
if (m_nonphysPrimMin != 0)
|
||||
if (m_nonphysPrimMin > 0)
|
||||
config.Set("NonphysicalPrimMax", m_nonphysPrimMin);
|
||||
|
||||
if (m_nonphysPrimMax != 0)
|
||||
if (m_nonphysPrimMax > 0)
|
||||
config.Set("NonphysicalPrimMax", m_nonphysPrimMax);
|
||||
|
||||
if (m_physPrimMin != 0)
|
||||
if (m_physPrimMin > 0)
|
||||
config.Set("PhysicalPrimMax", m_physPrimMin);
|
||||
|
||||
if (m_physPrimMax != 0)
|
||||
if (m_physPrimMax > 0)
|
||||
config.Set("PhysicalPrimMax", m_physPrimMax);
|
||||
|
||||
config.Set("ClampPrimSize", m_clampPrimSize.ToString());
|
||||
|
||||
if (m_objectCapacity != 0)
|
||||
if (m_objectCapacity > 0)
|
||||
config.Set("MaxPrims", m_objectCapacity);
|
||||
|
||||
if (m_agentCapacity != 0)
|
||||
if (m_linksetCapacity > 0)
|
||||
config.Set("LinksetPrims", m_linksetCapacity);
|
||||
|
||||
if (m_agentCapacity > 0)
|
||||
config.Set("MaxAgents", m_agentCapacity);
|
||||
|
||||
if (ScopeID != UUID.Zero)
|
||||
@@ -804,6 +816,9 @@ namespace OpenSim.Framework
|
||||
configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
"Max objects this sim will hold", m_objectCapacity.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("linkset_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
"Max prims an object will hold", m_linksetCapacity.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("agent_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
"Max avatars this sim will hold", m_agentCapacity.ToString(), true);
|
||||
|
||||
@@ -922,6 +937,9 @@ namespace OpenSim.Framework
|
||||
case "object_capacity":
|
||||
m_objectCapacity = (int)configuration_result;
|
||||
break;
|
||||
case "linkset_capacity":
|
||||
m_linksetCapacity = (int)configuration_result;
|
||||
break;
|
||||
case "agent_capacity":
|
||||
m_agentCapacity = (int)configuration_result;
|
||||
break;
|
||||
@@ -1052,4 +1070,4 @@ namespace OpenSim.Framework
|
||||
return kvp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace OpenSim.Framework.Serialization
|
||||
/// </value>
|
||||
public const string INVENTORY_PATH = "inventory/";
|
||||
|
||||
/// <value>
|
||||
/// Path for regions in a multi-region archive
|
||||
/// </value>
|
||||
public const string REGIONS_PATH = "regions/";
|
||||
|
||||
/// <value>
|
||||
/// Path for the prims file
|
||||
/// </value>
|
||||
|
||||
@@ -96,11 +96,6 @@ namespace OpenSim.Framework.Servers
|
||||
get { return m_httpServer; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds the non-viewer statistics collection object for this service/server
|
||||
/// </summary>
|
||||
protected IStatsCollector m_stats;
|
||||
|
||||
public BaseOpenSimServer()
|
||||
{
|
||||
m_startuptime = DateTime.Now;
|
||||
@@ -177,10 +172,6 @@ namespace OpenSim.Framework.Servers
|
||||
"show info",
|
||||
"Show general information about the server", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("General", false, "show stats",
|
||||
"show stats",
|
||||
"Show statistics", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("General", false, "show threads",
|
||||
"show threads",
|
||||
"Show thread status", HandleShow);
|
||||
@@ -201,8 +192,19 @@ namespace OpenSim.Framework.Servers
|
||||
"threads show",
|
||||
"Show thread status. Synonym for \"show threads\"",
|
||||
(string module, string[] args) => Notice(GetThreadsReport()));
|
||||
|
||||
m_console.Commands.AddCommand("General", false, "force gc",
|
||||
"force gc",
|
||||
"Manually invoke runtime garbage collection. For debugging purposes",
|
||||
HandleForceGc);
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleForceGc(string module, string[] args)
|
||||
{
|
||||
MainConsole.Instance.Output("Manually invoking runtime garbage collection");
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Should be overriden and referenced by descendents if they need to perform extra shutdown processing
|
||||
@@ -226,12 +228,7 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
StringBuilder sb = new StringBuilder("DIAGNOSTICS\n\n");
|
||||
sb.Append(GetUptimeReport());
|
||||
|
||||
if (m_stats != null)
|
||||
{
|
||||
sb.Append(m_stats.Report());
|
||||
}
|
||||
|
||||
sb.Append(StatsManager.SimExtraStats.Report());
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(GetThreadsReport());
|
||||
|
||||
@@ -382,10 +379,6 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
Notice("set log level [level] - change the console logging level only. For example, off or debug.");
|
||||
Notice("show info - show server information (e.g. startup path).");
|
||||
|
||||
if (m_stats != null)
|
||||
Notice("show stats - show statistical information for this server");
|
||||
|
||||
Notice("show threads - list tracked threads");
|
||||
Notice("show uptime - show server startup time and uptime.");
|
||||
Notice("show version - show server version.");
|
||||
@@ -409,11 +402,6 @@ namespace OpenSim.Framework.Servers
|
||||
ShowInfo();
|
||||
break;
|
||||
|
||||
case "stats":
|
||||
if (m_stats != null)
|
||||
Notice(m_stats.Report());
|
||||
break;
|
||||
|
||||
case "threads":
|
||||
Notice(GetThreadsReport());
|
||||
break;
|
||||
@@ -604,8 +592,7 @@ namespace OpenSim.Framework.Servers
|
||||
|
||||
public string osSecret {
|
||||
// Secret uuid for the simulator
|
||||
get { return m_osSecret; }
|
||||
|
||||
get { return m_osSecret; }
|
||||
}
|
||||
|
||||
public string StatReport(IOSHttpRequest httpRequest)
|
||||
@@ -613,11 +600,11 @@ namespace OpenSim.Framework.Servers
|
||||
// If we catch a request for "callback", wrap the response in the value for jsonp
|
||||
if (httpRequest.Query.ContainsKey("callback"))
|
||||
{
|
||||
return httpRequest.Query["callback"].ToString() + "(" + m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");";
|
||||
return httpRequest.Query["callback"].ToString() + "(" + StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version) + ");";
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_stats.XReport((DateTime.Now - m_startuptime).ToString() , m_version);
|
||||
return StatsManager.SimExtraStats.XReport((DateTime.Now - m_startuptime).ToString() , m_version);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +54,23 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private HttpServerLogWriter httpserverlog = new HttpServerLogWriter();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the debug level.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// See MainServer.DebugLevel.
|
||||
/// </value>
|
||||
public int DebugLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Request number for diagnostic purposes.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is an internal number. In some debug situations an external number may also be supplied in the
|
||||
/// opensim-request-id header but we are not currently logging this.
|
||||
/// </remarks>
|
||||
public int RequestNumber { get; private set; }
|
||||
|
||||
private volatile int NotSocketErrors = 0;
|
||||
public volatile bool HTTPDRunning = false;
|
||||
|
||||
@@ -67,7 +82,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
protected Dictionary<string, LLSDMethod> m_llsdHandlers = new Dictionary<string, LLSDMethod>();
|
||||
protected Dictionary<string, IRequestHandler> m_streamHandlers = new Dictionary<string, IRequestHandler>();
|
||||
protected Dictionary<string, GenericHTTPMethod> m_HTTPHandlers = new Dictionary<string, GenericHTTPMethod>();
|
||||
protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>();
|
||||
// protected Dictionary<string, IHttpAgentHandler> m_agentHandlers = new Dictionary<string, IHttpAgentHandler>();
|
||||
protected Dictionary<string, PollServiceEventArgs> m_pollHandlers =
|
||||
new Dictionary<string, PollServiceEventArgs>();
|
||||
|
||||
@@ -245,29 +260,29 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
return new List<string>(m_pollHandlers.Keys);
|
||||
}
|
||||
|
||||
// Note that the agent string is provided simply to differentiate
|
||||
// the handlers - it is NOT required to be an actual agent header
|
||||
// value.
|
||||
public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
|
||||
{
|
||||
lock (m_agentHandlers)
|
||||
{
|
||||
if (!m_agentHandlers.ContainsKey(agent))
|
||||
{
|
||||
m_agentHandlers.Add(agent, handler);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//must already have a handler for that path so return false
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<string> GetAgentHandlerKeys()
|
||||
{
|
||||
lock (m_agentHandlers)
|
||||
return new List<string>(m_agentHandlers.Keys);
|
||||
}
|
||||
// // Note that the agent string is provided simply to differentiate
|
||||
// // the handlers - it is NOT required to be an actual agent header
|
||||
// // value.
|
||||
// public bool AddAgentHandler(string agent, IHttpAgentHandler handler)
|
||||
// {
|
||||
// lock (m_agentHandlers)
|
||||
// {
|
||||
// if (!m_agentHandlers.ContainsKey(agent))
|
||||
// {
|
||||
// m_agentHandlers.Add(agent, handler);
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// //must already have a handler for that path so return false
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public List<string> GetAgentHandlerKeys()
|
||||
// {
|
||||
// lock (m_agentHandlers)
|
||||
// return new List<string>(m_agentHandlers.Keys);
|
||||
// }
|
||||
|
||||
public bool AddLLSDHandler(string path, LLSDMethod handler)
|
||||
{
|
||||
@@ -296,6 +311,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
private void OnRequest(object source, RequestEventArgs args)
|
||||
{
|
||||
RequestNumber++;
|
||||
|
||||
try
|
||||
{
|
||||
IHttpClientContext context = (IHttpClientContext)source;
|
||||
@@ -405,7 +422,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
string requestMethod = request.HttpMethod;
|
||||
string uriString = request.RawUrl;
|
||||
|
||||
// string reqnum = "unknown";
|
||||
int requestStartTick = Environment.TickCount;
|
||||
|
||||
// Will be adjusted later on.
|
||||
@@ -422,22 +438,22 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
|
||||
|
||||
// This is the REST agent interface. We require an agent to properly identify
|
||||
// itself. If the REST handler recognizes the prefix it will attempt to
|
||||
// satisfy the request. If it is not recognizable, and no damage has occurred
|
||||
// the request can be passed through to the other handlers. This is a low
|
||||
// probability event; if a request is matched it is normally expected to be
|
||||
// handled
|
||||
IHttpAgentHandler agentHandler;
|
||||
|
||||
if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
{
|
||||
if (HandleAgentRequest(agentHandler, request, response))
|
||||
{
|
||||
requestEndTick = Environment.TickCount;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// // This is the REST agent interface. We require an agent to properly identify
|
||||
// // itself. If the REST handler recognizes the prefix it will attempt to
|
||||
// // satisfy the request. If it is not recognizable, and no damage has occurred
|
||||
// // the request can be passed through to the other handlers. This is a low
|
||||
// // probability event; if a request is matched it is normally expected to be
|
||||
// // handled
|
||||
// IHttpAgentHandler agentHandler;
|
||||
//
|
||||
// if (TryGetAgentHandler(request, response, out agentHandler))
|
||||
// {
|
||||
// if (HandleAgentRequest(agentHandler, request, response))
|
||||
// {
|
||||
// requestEndTick = Environment.TickCount;
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
//response.KeepAlive = true;
|
||||
response.SendChunked = false;
|
||||
@@ -449,9 +465,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
if (TryGetStreamHandler(handlerKey, out requestHandler))
|
||||
{
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}",
|
||||
request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description);
|
||||
LogIncomingToStreamHandler(request, requestHandler);
|
||||
|
||||
response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type.
|
||||
|
||||
@@ -528,11 +542,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
case null:
|
||||
case "text/html":
|
||||
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
|
||||
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
|
||||
LogIncomingToContentTypeHandler(request);
|
||||
|
||||
buffer = HandleHTTPRequest(request, response);
|
||||
break;
|
||||
@@ -540,11 +551,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
case "application/llsd+xml":
|
||||
case "application/xml+llsd":
|
||||
case "application/llsd+json":
|
||||
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
|
||||
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
|
||||
LogIncomingToContentTypeHandler(request);
|
||||
|
||||
buffer = HandleLLSDRequests(request, response);
|
||||
break;
|
||||
@@ -563,9 +571,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
if (DoWeHaveALLSDHandler(request.RawUrl))
|
||||
{
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
|
||||
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
|
||||
LogIncomingToContentTypeHandler(request);
|
||||
|
||||
buffer = HandleLLSDRequests(request, response);
|
||||
}
|
||||
@@ -573,18 +579,14 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
else if (DoWeHaveAHTTPHandler(request.RawUrl))
|
||||
{
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found a {0} content type handler for {1} {2}",
|
||||
request.ContentType, request.HttpMethod, request.Url.PathAndQuery);
|
||||
LogIncomingToContentTypeHandler(request);
|
||||
|
||||
buffer = HandleHTTPRequest(request, response);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Assuming a generic XMLRPC request for {0} {1}",
|
||||
request.HttpMethod, request.Url.PathAndQuery);
|
||||
LogIncomingToXmlRpcHandler(request);
|
||||
|
||||
// generic login request.
|
||||
buffer = HandleXmlRpcRequests(request, response);
|
||||
@@ -628,11 +630,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.StackTrace), e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.StackTrace), e);
|
||||
SendHTML500(response);
|
||||
}
|
||||
finally
|
||||
@@ -640,17 +642,93 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
// Every month or so this will wrap and give bad numbers, not really a problem
|
||||
// since its just for reporting
|
||||
int tickdiff = requestEndTick - requestStartTick;
|
||||
if (tickdiff > 3000)
|
||||
if (tickdiff > 3000 && requestHandler != null && requestHandler.Name != "GetTexture")
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms",
|
||||
"[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} {4} from {5} took {6}ms",
|
||||
RequestNumber,
|
||||
requestMethod,
|
||||
uriString,
|
||||
requestHandler != null ? requestHandler.Name : "",
|
||||
requestHandler != null ? requestHandler.Description : "",
|
||||
request.RemoteIPEndPoint.ToString(),
|
||||
request.RemoteIPEndPoint,
|
||||
tickdiff);
|
||||
}
|
||||
else if (DebugLevel >= 4)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: HTTP IN {0} :{1} took {2}ms",
|
||||
RequestNumber,
|
||||
Port,
|
||||
tickdiff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LogIncomingToStreamHandler(OSHttpRequest request, IRequestHandler requestHandler)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: HTTP IN {0} :{1} stream handler {2} {3} {4} {5} from {6}",
|
||||
RequestNumber,
|
||||
Port,
|
||||
request.HttpMethod,
|
||||
request.Url.PathAndQuery,
|
||||
requestHandler.Name,
|
||||
requestHandler.Description,
|
||||
request.RemoteIPEndPoint);
|
||||
|
||||
if (DebugLevel >= 5)
|
||||
LogIncomingInDetail(request);
|
||||
}
|
||||
|
||||
private void LogIncomingToContentTypeHandler(OSHttpRequest request)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: HTTP IN {0} :{1} {2} content type handler {3} {4} from {5}",
|
||||
RequestNumber,
|
||||
Port,
|
||||
(request.ContentType == null || request.ContentType == "") ? "not set" : request.ContentType,
|
||||
request.HttpMethod,
|
||||
request.Url.PathAndQuery,
|
||||
request.RemoteIPEndPoint);
|
||||
|
||||
if (DebugLevel >= 5)
|
||||
LogIncomingInDetail(request);
|
||||
}
|
||||
|
||||
private void LogIncomingToXmlRpcHandler(OSHttpRequest request)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: HTTP IN {0} :{1} assumed generic XMLRPC request {2} {3} from {4}",
|
||||
RequestNumber,
|
||||
Port,
|
||||
request.HttpMethod,
|
||||
request.Url.PathAndQuery,
|
||||
request.RemoteIPEndPoint);
|
||||
|
||||
if (DebugLevel >= 5)
|
||||
LogIncomingInDetail(request);
|
||||
}
|
||||
|
||||
private void LogIncomingInDetail(OSHttpRequest request)
|
||||
{
|
||||
using (StreamReader reader = new StreamReader(Util.Copy(request.InputStream), Encoding.UTF8))
|
||||
{
|
||||
string output;
|
||||
|
||||
if (DebugLevel == 5)
|
||||
{
|
||||
const int sampleLength = 80;
|
||||
char[] sampleChars = new char[sampleLength];
|
||||
reader.Read(sampleChars, 0, sampleLength);
|
||||
output = new string(sampleChars);
|
||||
}
|
||||
else
|
||||
{
|
||||
output = reader.ReadToEnd();
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[BASE HTTP SERVER]: {0}...", output.Replace("\n", @"\n"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -746,24 +824,24 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
|
||||
{
|
||||
agentHandler = null;
|
||||
|
||||
lock (m_agentHandlers)
|
||||
{
|
||||
foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
|
||||
{
|
||||
if (handler.Match(request, response))
|
||||
{
|
||||
agentHandler = handler;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// private bool TryGetAgentHandler(OSHttpRequest request, OSHttpResponse response, out IHttpAgentHandler agentHandler)
|
||||
// {
|
||||
// agentHandler = null;
|
||||
//
|
||||
// lock (m_agentHandlers)
|
||||
// {
|
||||
// foreach (IHttpAgentHandler handler in m_agentHandlers.Values)
|
||||
// {
|
||||
// if (handler.Match(request, response))
|
||||
// {
|
||||
// agentHandler = handler;
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Try all the registered xmlrpc handlers when an xmlrpc request is received.
|
||||
@@ -1688,21 +1766,21 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
m_pollHandlers.Remove(path);
|
||||
}
|
||||
|
||||
public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
|
||||
{
|
||||
lock (m_agentHandlers)
|
||||
{
|
||||
IHttpAgentHandler foundHandler;
|
||||
|
||||
if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
|
||||
{
|
||||
m_agentHandlers.Remove(agent);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
// public bool RemoveAgentHandler(string agent, IHttpAgentHandler handler)
|
||||
// {
|
||||
// lock (m_agentHandlers)
|
||||
// {
|
||||
// IHttpAgentHandler foundHandler;
|
||||
//
|
||||
// if (m_agentHandlers.TryGetValue(agent, out foundHandler) && foundHandler == handler)
|
||||
// {
|
||||
// m_agentHandlers.Remove(agent);
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return false;
|
||||
// }
|
||||
|
||||
public void RemoveXmlRPCHandler(string method)
|
||||
{
|
||||
|
||||
@@ -41,10 +41,10 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
uint Port { get; }
|
||||
bool UseSSL { get; }
|
||||
|
||||
// Note that the agent string is provided simply to differentiate
|
||||
// the handlers - it is NOT required to be an actual agent header
|
||||
// value.
|
||||
bool AddAgentHandler(string agent, IHttpAgentHandler handler);
|
||||
// // Note that the agent string is provided simply to differentiate
|
||||
// // the handlers - it is NOT required to be an actual agent header
|
||||
// // value.
|
||||
// bool AddAgentHandler(string agent, IHttpAgentHandler handler);
|
||||
|
||||
/// <summary>
|
||||
/// Add a handler for an HTTP request.
|
||||
@@ -106,13 +106,13 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
bool SetDefaultLLSDHandler(DefaultLLSDMethod handler);
|
||||
|
||||
/// <summary>
|
||||
/// Remove the agent if it is registered.
|
||||
/// </summary>
|
||||
/// <param name="agent"></param>
|
||||
/// <param name="handler"></param>
|
||||
/// <returns></returns>
|
||||
bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
|
||||
// /// <summary>
|
||||
// /// Remove the agent if it is registered.
|
||||
// /// </summary>
|
||||
// /// <param name="agent"></param>
|
||||
// /// <param name="handler"></param>
|
||||
// /// <returns></returns>
|
||||
// bool RemoveAgentHandler(string agent, IHttpAgentHandler handler);
|
||||
|
||||
/// <summary>
|
||||
/// Remove an HTTP handler
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
@@ -47,9 +48,12 @@ namespace OpenSim.Framework.Servers
|
||||
/// Control the printing of certain debug messages.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If DebugLevel >= 1, then short warnings are logged when receiving bad input data.
|
||||
/// If DebugLevel >= 2, then long warnings are logged when receiving bad input data.
|
||||
/// If DebugLevel >= 3, then short notices about all incoming non-poll HTTP requests are logged.
|
||||
/// If DebugLevel >= 1 then short warnings are logged when receiving bad input data.
|
||||
/// If DebugLevel >= 2 then long warnings are logged when receiving bad input data.
|
||||
/// If DebugLevel >= 3 then short notices about all incoming non-poll HTTP requests are logged.
|
||||
/// If DebugLevel >= 4 then the time taken to fulfill the request is logged.
|
||||
/// If DebugLevel >= 5 then the start of the body of incoming non-poll HTTP requests will be logged.
|
||||
/// If DebugLevel >= 6 then the entire body of incoming non-poll HTTP requests will be logged.
|
||||
/// </remarks>
|
||||
public static int DebugLevel
|
||||
{
|
||||
@@ -101,17 +105,28 @@ namespace OpenSim.Framework.Servers
|
||||
get { return new Dictionary<uint, BaseHttpServer>(m_Servers); }
|
||||
}
|
||||
|
||||
|
||||
public static void RegisterHttpConsoleCommands(ICommandConsole console)
|
||||
{
|
||||
console.Commands.AddCommand(
|
||||
"Debug", false, "debug http", "debug http [<level>]",
|
||||
"Turn on inbound non-poll http request debugging.",
|
||||
"If level <= 0, then no extra logging is done.\n"
|
||||
+ "If level >= 1, then short warnings are logged when receiving bad input data.\n"
|
||||
+ "If level >= 2, then long warnings are logged when receiving bad input data.\n"
|
||||
+ "If level >= 3, then short notices about all incoming non-poll HTTP requests are logged.\n"
|
||||
+ "If no level is specified then the current level is returned.",
|
||||
"Comms", false, "show http-handlers",
|
||||
"show http-handlers",
|
||||
"Show all registered http handlers", HandleShowHttpHandlersCommand);
|
||||
|
||||
console.Commands.AddCommand(
|
||||
"Debug", false, "debug http", "debug http <in|out|all> [<level>]",
|
||||
"Turn on http request logging.",
|
||||
"If in or all and\n"
|
||||
+ " level <= 0 then no extra logging is done.\n"
|
||||
+ " level >= 1 then short warnings are logged when receiving bad input data.\n"
|
||||
+ " level >= 2 then long warnings are logged when receiving bad input data.\n"
|
||||
+ " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n"
|
||||
+ " level >= 4 then the time taken to fulfill the request is logged.\n"
|
||||
+ " level >= 5 then a sample from the beginning of the incoming data is logged.\n"
|
||||
+ " level >= 6 then the entire incoming data is logged.\n"
|
||||
+ " no level is specified then the current level is returned.\n\n"
|
||||
+ "If out or all and\n"
|
||||
+ " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n"
|
||||
+ " level >= 4 then the time taken to fulfill the request is logged.\n",
|
||||
HandleDebugHttpCommand);
|
||||
}
|
||||
|
||||
@@ -119,25 +134,120 @@ namespace OpenSim.Framework.Servers
|
||||
/// Turn on some debugging values for OpenSim.
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
private static void HandleDebugHttpCommand(string module, string[] args)
|
||||
private static void HandleDebugHttpCommand(string module, string[] cmdparams)
|
||||
{
|
||||
if (args.Length == 3)
|
||||
if (cmdparams.Length < 3)
|
||||
{
|
||||
int newDebug;
|
||||
if (int.TryParse(args[2], out newDebug))
|
||||
{
|
||||
MainServer.DebugLevel = newDebug;
|
||||
MainConsole.Instance.OutputFormat("Debug http level set to {0}", newDebug);
|
||||
}
|
||||
MainConsole.Instance.Output("Usage: debug http <in|out|all> 0..6");
|
||||
return;
|
||||
}
|
||||
else if (args.Length == 2)
|
||||
|
||||
bool inReqs = false;
|
||||
bool outReqs = false;
|
||||
bool allReqs = false;
|
||||
|
||||
string subCommand = cmdparams[2];
|
||||
|
||||
if (subCommand.ToLower() == "in")
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("Current debug http level is {0}", MainServer.DebugLevel);
|
||||
inReqs = true;
|
||||
}
|
||||
else if (subCommand.ToLower() == "out")
|
||||
{
|
||||
outReqs = true;
|
||||
}
|
||||
else if (subCommand.ToLower() == "all")
|
||||
{
|
||||
allReqs = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug http 0..3");
|
||||
MainConsole.Instance.Output("You must specify in, out or all");
|
||||
return;
|
||||
}
|
||||
|
||||
if (cmdparams.Length >= 4)
|
||||
{
|
||||
string rawNewDebug = cmdparams[3];
|
||||
int newDebug;
|
||||
|
||||
if (!int.TryParse(rawNewDebug, out newDebug))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawNewDebug);
|
||||
return;
|
||||
}
|
||||
|
||||
if (newDebug < 0 || newDebug > 6)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0..6", newDebug);
|
||||
return;
|
||||
}
|
||||
|
||||
if (allReqs || inReqs)
|
||||
{
|
||||
MainServer.DebugLevel = newDebug;
|
||||
MainConsole.Instance.OutputFormat("IN debug level set to {0}", newDebug);
|
||||
}
|
||||
|
||||
if (allReqs || outReqs)
|
||||
{
|
||||
WebUtil.DebugLevel = newDebug;
|
||||
MainConsole.Instance.OutputFormat("OUT debug level set to {0}", newDebug);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (allReqs || inReqs)
|
||||
MainConsole.Instance.OutputFormat("Current IN debug level is {0}", MainServer.DebugLevel);
|
||||
|
||||
if (allReqs || outReqs)
|
||||
MainConsole.Instance.OutputFormat("Current OUT debug level is {0}", WebUtil.DebugLevel);
|
||||
}
|
||||
}
|
||||
|
||||
private static void HandleShowHttpHandlersCommand(string module, string[] args)
|
||||
{
|
||||
if (args.Length != 2)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: show http-handlers");
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder handlers = new StringBuilder();
|
||||
|
||||
lock (m_Servers)
|
||||
{
|
||||
foreach (BaseHttpServer httpServer in m_Servers.Values)
|
||||
{
|
||||
handlers.AppendFormat(
|
||||
"Registered HTTP Handlers for server at {0}:{1}\n", httpServer.ListenIPAddress, httpServer.Port);
|
||||
|
||||
handlers.AppendFormat("* XMLRPC:\n");
|
||||
foreach (String s in httpServer.GetXmlRpcHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* HTTP:\n");
|
||||
List<String> poll = httpServer.GetPollServiceHandlerKeys();
|
||||
foreach (String s in httpServer.GetHTTPHandlerKeys())
|
||||
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
|
||||
|
||||
// handlers.AppendFormat("* Agent:\n");
|
||||
// foreach (String s in httpServer.GetAgentHandlerKeys())
|
||||
// handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* LLSD:\n");
|
||||
foreach (String s in httpServer.GetLLSDHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* StreamHandlers ({0}):\n", httpServer.GetStreamHandlerKeys().Count);
|
||||
foreach (String s in httpServer.GetStreamHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.Append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
MainConsole.Instance.Output(handlers.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -35,10 +35,12 @@ using OpenMetaverse;
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
/// <summary>
|
||||
/// A dictionary for task inventory.
|
||||
/// A dictionary containing task inventory items. Indexed by item UUID.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class is not thread safe. Callers must synchronize on Dictionary methods or Clone() this object before
|
||||
/// iterating over it.
|
||||
/// </remarks>
|
||||
public class TaskInventoryDictionary : Dictionary<UUID, TaskInventoryItem>,
|
||||
ICloneable, IXmlSerializable
|
||||
{
|
||||
|
||||
@@ -73,9 +73,6 @@ namespace OpenSim.Framework
|
||||
|
||||
private bool _ownerChanged = false;
|
||||
|
||||
// This used ONLY during copy. It can't be relied on at other times!
|
||||
private bool _scriptRunning = true;
|
||||
|
||||
public UUID AssetID {
|
||||
get {
|
||||
return _assetID;
|
||||
@@ -353,14 +350,13 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public bool ScriptRunning {
|
||||
get {
|
||||
return _scriptRunning;
|
||||
}
|
||||
set {
|
||||
_scriptRunning = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// This used ONLY during copy. It can't be relied on at other times!
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For true script running status, use IEntityInventory.TryGetScriptInstanceRunning() for now.
|
||||
/// </remarks>
|
||||
public bool ScriptRunning { get; set; }
|
||||
|
||||
// See ICloneable
|
||||
|
||||
@@ -388,6 +384,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public TaskInventoryItem()
|
||||
{
|
||||
ScriptRunning = true;
|
||||
CreationDate = (uint)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,6 +533,19 @@ namespace OpenSim.Framework
|
||||
return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a point is inside a bounding box.
|
||||
/// </summary>
|
||||
/// <param name='v'></param>
|
||||
/// <param name='min'></param>
|
||||
/// <param name='max'></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsInsideBox(Vector3 v, Vector3 min, Vector3 max)
|
||||
{
|
||||
return v.X >= min.X & v.Y >= min.Y && v.Z >= min.Z
|
||||
&& v.X <= max.X && v.Y <= max.Y && v.Z <= max.Z;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Are the co-ordinates of the new region visible from the old region?
|
||||
/// </summary>
|
||||
@@ -1007,6 +1020,38 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy data from one stream to another, leaving the read position of both streams at the beginning.
|
||||
/// </summary>
|
||||
/// <param name='inputStream'>
|
||||
/// Input stream. Must be seekable.
|
||||
/// </param>
|
||||
/// <exception cref='ArgumentException'>
|
||||
/// Thrown if the input stream is not seekable.
|
||||
/// </exception>
|
||||
public static Stream Copy(Stream inputStream)
|
||||
{
|
||||
if (!inputStream.CanSeek)
|
||||
throw new ArgumentException("Util.Copy(Stream inputStream) must receive an inputStream that can seek");
|
||||
|
||||
const int readSize = 256;
|
||||
byte[] buffer = new byte[readSize];
|
||||
MemoryStream ms = new MemoryStream();
|
||||
|
||||
int count = inputStream.Read(buffer, 0, readSize);
|
||||
|
||||
while (count > 0)
|
||||
{
|
||||
ms.Write(buffer, 0, count);
|
||||
count = inputStream.Read(buffer, 0, readSize);
|
||||
}
|
||||
|
||||
ms.Position = 0;
|
||||
inputStream.Position = 0;
|
||||
|
||||
return ms;
|
||||
}
|
||||
|
||||
public static XmlRpcResponse XmlRpcCommand(string url, string methodName, params object[] args)
|
||||
{
|
||||
return SendXmlRpcCommand(url, methodName, args);
|
||||
|
||||
@@ -53,10 +53,18 @@ namespace OpenSim.Framework
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Control the printing of certain debug messages.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If DebugLevel >= 3 then short notices about outgoing HTTP requests are logged.
|
||||
/// </remarks>
|
||||
public static int DebugLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Request number for diagnostic purposes.
|
||||
/// </summary>
|
||||
public static int RequestNumber = 0;
|
||||
public static int RequestNumber { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// this is the header field used to communicate the local request id
|
||||
@@ -146,7 +154,11 @@ namespace OpenSim.Framework
|
||||
private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
|
||||
{
|
||||
int reqnum = RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} ServiceOSD {1} {2} (timeout {3}, compressed {4})",
|
||||
reqnum, method, url, timeout, compressed);
|
||||
|
||||
string errorMessage = "unknown error";
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
@@ -229,7 +241,7 @@ namespace OpenSim.Framework
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > LongCallTime)
|
||||
m_log.InfoFormat(
|
||||
"[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
"[WEB UTIL]: Slow ServiceOSD request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
method,
|
||||
url,
|
||||
@@ -238,10 +250,14 @@ namespace OpenSim.Framework
|
||||
strBuffer != null
|
||||
? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer)
|
||||
: "");
|
||||
else if (DebugLevel >= 4)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing",
|
||||
reqnum, tickdiff, tickdata);
|
||||
}
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
"[WEB UTIL]: ServiceOSD request {0} {1} {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
|
||||
return ErrorResponseMap(errorMessage);
|
||||
}
|
||||
@@ -317,7 +333,11 @@ namespace OpenSim.Framework
|
||||
{
|
||||
int reqnum = RequestNumber++;
|
||||
string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
if (DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} ServiceForm {1} {2} (timeout {3})",
|
||||
reqnum, method, url, timeout);
|
||||
|
||||
string errorMessage = "unknown error";
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
@@ -380,7 +400,7 @@ namespace OpenSim.Framework
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > LongCallTime)
|
||||
m_log.InfoFormat(
|
||||
"[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
"[WEB UTIL]: Slow ServiceForm request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
method,
|
||||
url,
|
||||
@@ -389,9 +409,13 @@ namespace OpenSim.Framework
|
||||
queryString != null
|
||||
? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString
|
||||
: "");
|
||||
else if (DebugLevel >= 4)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing",
|
||||
reqnum, tickdiff, tickdata);
|
||||
}
|
||||
|
||||
m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
|
||||
m_log.WarnFormat("[WEB UTIL]: ServiceForm request {0} {1} {2} failed: {2}", reqnum, method, url, errorMessage);
|
||||
|
||||
return ErrorResponseMap(errorMessage);
|
||||
}
|
||||
@@ -643,7 +667,6 @@ namespace OpenSim.Framework
|
||||
/// <returns></returns>
|
||||
public static string[] GetPreferredImageTypes(string accept)
|
||||
{
|
||||
|
||||
if (accept == null || accept == string.Empty)
|
||||
return new string[0];
|
||||
|
||||
@@ -693,18 +716,31 @@ namespace OpenSim.Framework
|
||||
//
|
||||
public static void MakeRequest<TRequest, TResponse>(string verb,
|
||||
string requestUrl, TRequest obj, Action<TResponse> action)
|
||||
{
|
||||
MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, action, 0);
|
||||
}
|
||||
|
||||
public static void MakeRequest<TRequest, TResponse>(string verb,
|
||||
string requestUrl, TRequest obj, Action<TResponse> action,
|
||||
int maxConnections)
|
||||
{
|
||||
int reqnum = WebUtil.RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
if (WebUtil.DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} AsynchronousRequestObject {1} {2}",
|
||||
reqnum, verb, requestUrl);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
|
||||
// m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
|
||||
|
||||
Type type = typeof(TRequest);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
HttpWebRequest ht = (HttpWebRequest)request;
|
||||
if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections)
|
||||
ht.ServicePoint.ConnectionLimit = maxConnections;
|
||||
|
||||
WebResponse response = null;
|
||||
TResponse deserial = default(TResponse);
|
||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||
@@ -854,7 +890,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
"[ASYNC REQUEST]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
@@ -862,6 +898,12 @@ namespace OpenSim.Framework
|
||||
tickdata,
|
||||
originalRequest);
|
||||
}
|
||||
else if (WebUtil.DebugLevel >= 4)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing",
|
||||
reqnum, tickdiff, tickdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -882,7 +924,11 @@ namespace OpenSim.Framework
|
||||
public static string MakeRequest(string verb, string requestUrl, string obj)
|
||||
{
|
||||
int reqnum = WebUtil.RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
if (WebUtil.DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} SynchronousRestForms {1} {2}",
|
||||
reqnum, verb, requestUrl);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
@@ -967,13 +1013,17 @@ namespace OpenSim.Framework
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > WebUtil.LongCallTime)
|
||||
m_log.InfoFormat(
|
||||
"[FORMS]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
"[FORMS]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
|
||||
else if (WebUtil.DebugLevel >= 4)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing",
|
||||
reqnum, tickdiff, tickdata);
|
||||
|
||||
return respstring;
|
||||
}
|
||||
@@ -996,9 +1046,23 @@ namespace OpenSim.Framework
|
||||
/// <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, 0);
|
||||
}
|
||||
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
|
||||
{
|
||||
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, pTimeout, 0);
|
||||
}
|
||||
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout, int maxConnections)
|
||||
{
|
||||
int reqnum = WebUtil.RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
if (WebUtil.DebugLevel >= 3)
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} SynchronousRestObject {1} {2}",
|
||||
reqnum, verb, requestUrl);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
@@ -1007,6 +1071,10 @@ namespace OpenSim.Framework
|
||||
TResponse deserial = default(TResponse);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
HttpWebRequest ht = (HttpWebRequest)request;
|
||||
if (maxConnections > 0 && ht.ServicePoint.ConnectionLimit < maxConnections)
|
||||
ht.ServicePoint.ConnectionLimit = maxConnections;
|
||||
|
||||
request.Method = verb;
|
||||
MemoryStream buffer = null;
|
||||
|
||||
@@ -1111,7 +1179,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
"[SynchronousRestObjectRequester]: Slow request {0} {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
@@ -1119,8 +1187,14 @@ namespace OpenSim.Framework
|
||||
tickdata,
|
||||
originalRequest);
|
||||
}
|
||||
else if (WebUtil.DebugLevel >= 4)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: HTTP OUT {0} took {1}ms, {2}ms writing",
|
||||
reqnum, tickdiff, tickdata);
|
||||
}
|
||||
|
||||
return deserial;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
@@ -73,6 +74,7 @@ namespace OpenSim
|
||||
AppDomain.CurrentDomain.UnhandledException +=
|
||||
new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
|
||||
ServicePointManager.DefaultConnectionLimit = 12;
|
||||
|
||||
// Add the arguments supplied when running the application to the configuration
|
||||
ArgvConfigSource configSource = new ArgvConfigSource(args);
|
||||
|
||||
@@ -254,8 +254,14 @@ namespace OpenSim
|
||||
m_console.Commands.AddCommand("Debug", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("Debug", false, "debug scene",
|
||||
"debug scene <scripting> <collisions> <physics>",
|
||||
"Turn on scene debugging", Debug);
|
||||
"debug scene active|collisions|physics|scripting|teleport true|false",
|
||||
"Turn on scene debugging.",
|
||||
"If active is false then main scene update and maintenance loops are suspended.\n"
|
||||
+ "If collisions is false then collisions with other objects are turned off.\n"
|
||||
+ "If physics is false then all physics objects are non-physical.\n"
|
||||
+ "If scripting is false then no scripting operations happen.\n"
|
||||
+ "If teleport is true then some extra teleport debug information is logged.",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("General", false, "change region",
|
||||
"change region <region name>",
|
||||
@@ -292,7 +298,7 @@ namespace OpenSim
|
||||
|
||||
m_console.Commands.AddCommand("Archiving", false, "save oar",
|
||||
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
|
||||
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
|
||||
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [--all] [<OAR path>]",
|
||||
"Save a region's data to an OAR archive.",
|
||||
// "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
|
||||
"-h|--home=<url> adds the url of the profile service to the saved user information.\n"
|
||||
@@ -302,6 +308,7 @@ namespace OpenSim
|
||||
+ " this is useful if you're making oars generally available that might be reloaded to the same grid from which you published\n"
|
||||
+ "--perm=<permissions> stops objects with insufficient permissions from being saved to the OAR.\n"
|
||||
+ " <permissions> can contain one or more of these characters: \"C\" = Copy, \"T\" = Transfer\n"
|
||||
+ "--all saves all the regions in the simulator, instead of just the current region.\n"
|
||||
+ "The OAR path must be a filesystem path."
|
||||
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
||||
SaveOar);
|
||||
@@ -332,10 +339,6 @@ namespace OpenSim
|
||||
"show circuits",
|
||||
"Show agent circuit data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("Comms", false, "show http-handlers",
|
||||
"show http-handlers",
|
||||
"Show all registered http handlers", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("Comms", false, "show pending-objects",
|
||||
"show pending-objects",
|
||||
"Show # of objects on the pending queues of all scene viewers", HandleShow);
|
||||
@@ -754,33 +757,13 @@ namespace OpenSim
|
||||
switch (cmdparams[0].ToLower())
|
||||
{
|
||||
case "list":
|
||||
foreach (IRegionModule irm in m_moduleLoader.GetLoadedSharedModules)
|
||||
{
|
||||
MainConsole.Instance.Output(String.Format("Shared region module: {0}", irm.Name));
|
||||
}
|
||||
//TODO: Convert to new region modules
|
||||
break;
|
||||
case "unload":
|
||||
if (cmdparams.Length > 1)
|
||||
{
|
||||
foreach (IRegionModule rm in new ArrayList(m_moduleLoader.GetLoadedSharedModules))
|
||||
{
|
||||
if (rm.Name.ToLower() == cmdparams[1].ToLower())
|
||||
{
|
||||
MainConsole.Instance.Output(String.Format("Unloading module: {0}", rm.Name));
|
||||
m_moduleLoader.UnloadModule(rm);
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO: Convert to new region modules
|
||||
break;
|
||||
case "load":
|
||||
if (cmdparams.Length > 1)
|
||||
{
|
||||
foreach (Scene s in new ArrayList(SceneManager.Scenes))
|
||||
{
|
||||
MainConsole.Instance.Output(String.Format("Loading module: {0}", cmdparams[1]));
|
||||
m_moduleLoader.LoadRegionModules(cmdparams[1], s);
|
||||
}
|
||||
}
|
||||
//TODO: Convert to new region modules
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -933,7 +916,8 @@ namespace OpenSim
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false");
|
||||
MainConsole.Instance.Output(
|
||||
"Usage: debug scene active|scripting|collisions|physics|teleport true|false");
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -1013,56 +997,10 @@ namespace OpenSim
|
||||
HandleShowCircuits();
|
||||
break;
|
||||
|
||||
case "http-handlers":
|
||||
System.Text.StringBuilder handlers = new System.Text.StringBuilder("Registered HTTP Handlers:\n");
|
||||
|
||||
handlers.AppendFormat("* XMLRPC:\n");
|
||||
foreach (String s in HttpServer.GetXmlRpcHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* HTTP:\n");
|
||||
List<String> poll = HttpServer.GetPollServiceHandlerKeys();
|
||||
foreach (String s in HttpServer.GetHTTPHandlerKeys())
|
||||
handlers.AppendFormat("\t{0} {1}\n", s, (poll.Contains(s) ? "(poll service)" : string.Empty));
|
||||
|
||||
handlers.AppendFormat("* Agent:\n");
|
||||
foreach (String s in HttpServer.GetAgentHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* LLSD:\n");
|
||||
foreach (String s in HttpServer.GetLLSDHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
handlers.AppendFormat("* StreamHandlers ({0}):\n", HttpServer.GetStreamHandlerKeys().Count);
|
||||
foreach (String s in HttpServer.GetStreamHandlerKeys())
|
||||
handlers.AppendFormat("\t{0}\n", s);
|
||||
|
||||
MainConsole.Instance.Output(handlers.ToString());
|
||||
break;
|
||||
|
||||
case "modules":
|
||||
MainConsole.Instance.Output("The currently loaded shared modules are:");
|
||||
foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
|
||||
{
|
||||
MainConsole.Instance.Output("Shared Module: " + module.Name);
|
||||
}
|
||||
|
||||
SceneManager.ForEachScene(
|
||||
delegate(Scene scene) {
|
||||
m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:");
|
||||
foreach (IRegionModule module in scene.Modules.Values)
|
||||
{
|
||||
if (!module.IsSharedModule)
|
||||
{
|
||||
m_log.Error("Region Module: " + module.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
SceneManager.ForEachScene(
|
||||
delegate(Scene scene) {
|
||||
MainConsole.Instance.Output("Loaded new region modules in" + scene.RegionInfo.RegionName + " are:");
|
||||
MainConsole.Instance.Output("Loaded region modules in" + scene.RegionInfo.RegionName + " are:");
|
||||
foreach (IRegionModuleBase module in scene.RegionModules.Values)
|
||||
{
|
||||
Type type = module.GetType().GetInterface("ISharedRegionModule");
|
||||
@@ -1134,7 +1072,7 @@ namespace OpenSim
|
||||
aCircuit.Name,
|
||||
aCircuit.child ? "child" : "root",
|
||||
aCircuit.circuitcode.ToString(),
|
||||
aCircuit.IPAddress.ToString(),
|
||||
aCircuit.IPAddress != null ? aCircuit.IPAddress.ToString() : "not set",
|
||||
aCircuit.Viewer);
|
||||
});
|
||||
|
||||
|
||||
@@ -127,14 +127,6 @@ namespace OpenSim
|
||||
get { return m_httpServerPort; }
|
||||
}
|
||||
|
||||
public ModuleLoader ModuleLoader
|
||||
{
|
||||
get { return m_moduleLoader; }
|
||||
set { m_moduleLoader = value; }
|
||||
}
|
||||
|
||||
protected ModuleLoader m_moduleLoader;
|
||||
|
||||
protected IRegistryCore m_applicationRegistry = new RegistryCore();
|
||||
|
||||
public IRegistryCore ApplicationRegistry
|
||||
@@ -223,62 +215,57 @@ namespace OpenSim
|
||||
|
||||
base.StartupSpecific();
|
||||
|
||||
m_stats = StatsManager.SimExtraStats;
|
||||
|
||||
// Create a ModuleLoader instance
|
||||
m_moduleLoader = new ModuleLoader(m_config.Source);
|
||||
|
||||
LoadPlugins();
|
||||
foreach (IApplicationPlugin plugin in m_plugins)
|
||||
{
|
||||
plugin.PostInitialise();
|
||||
}
|
||||
|
||||
AddPluginCommands();
|
||||
}
|
||||
|
||||
protected virtual void AddPluginCommands()
|
||||
{
|
||||
// If console exists add plugin commands.
|
||||
if (m_console != null)
|
||||
{
|
||||
List<string> topics = GetHelpTopics();
|
||||
StatsManager.RegisterConsoleCommands(m_console);
|
||||
AddPluginCommands(m_console);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string topic in topics)
|
||||
protected virtual void AddPluginCommands(CommandConsole console)
|
||||
{
|
||||
List<string> topics = GetHelpTopics();
|
||||
|
||||
foreach (string topic in topics)
|
||||
{
|
||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||
|
||||
// This is a hack to allow the user to enter the help command in upper or lowercase. This will go
|
||||
// away at some point.
|
||||
console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
|
||||
ICommander commander = null;
|
||||
|
||||
Scene s = SceneManager.CurrentOrFirstScene;
|
||||
|
||||
if (s != null && s.GetCommanders() != null)
|
||||
{
|
||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||
if (s.GetCommanders().ContainsKey(topic))
|
||||
commander = s.GetCommanders()[topic];
|
||||
}
|
||||
|
||||
// This is a hack to allow the user to enter the help command in upper or lowercase. This will go
|
||||
// away at some point.
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
if (commander == null)
|
||||
continue;
|
||||
|
||||
ICommander commander = null;
|
||||
|
||||
Scene s = SceneManager.CurrentOrFirstScene;
|
||||
|
||||
if (s != null && s.GetCommanders() != null)
|
||||
{
|
||||
if (s.GetCommanders().ContainsKey(topic))
|
||||
commander = s.GetCommanders()[topic];
|
||||
}
|
||||
|
||||
if (commander == null)
|
||||
continue;
|
||||
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
}
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
console.Commands.AddCommand(capitalizedTopic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -372,12 +359,6 @@ namespace OpenSim
|
||||
|
||||
m_log.Info("[MODULES]: Loading Region's modules (old style)");
|
||||
|
||||
List<IRegionModule> modules = m_moduleLoader.PickupModules(scene, ".");
|
||||
|
||||
// This needs to be ahead of the script engine load, so the
|
||||
// script module can pick up events exposed by a module
|
||||
m_moduleLoader.InitialiseSharedModules(scene);
|
||||
|
||||
// Use this in the future, the line above will be deprecated soon
|
||||
m_log.Info("[REGIONMODULES]: Loading Region's modules (new style)");
|
||||
IRegionModulesController controller;
|
||||
@@ -428,13 +409,6 @@ namespace OpenSim
|
||||
clientServer.Start();
|
||||
}
|
||||
|
||||
if (do_post_init)
|
||||
{
|
||||
foreach (IRegionModule module in modules)
|
||||
{
|
||||
module.PostInitialise();
|
||||
}
|
||||
}
|
||||
scene.EventManager.OnShutdown += delegate() { ShutdownRegion(scene); };
|
||||
|
||||
mscene = scene;
|
||||
@@ -545,7 +519,7 @@ namespace OpenSim
|
||||
if (account == null)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first.");
|
||||
"[OPENSIM]: Unable to store account. If this simulator is connected to a grid, you must create the estate owner account first at the grid level.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -724,7 +698,7 @@ namespace OpenSim
|
||||
|
||||
return new Scene(
|
||||
regionInfo, circuitManager, sceneGridService,
|
||||
simDataService, estateDataService, m_moduleLoader, false,
|
||||
simDataService, estateDataService, false,
|
||||
m_config.Source, m_version);
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_HostCapsObj.RegisterHandler(
|
||||
"SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest, "SEED", null));
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
|
||||
// m_log.DebugFormat(
|
||||
// "[CAPS]: Registered seed capability {0} for {1}", capsBase + m_requestPath, m_HostCapsObj.AgentID);
|
||||
|
||||
//m_capsHandlers["MapLayer"] =
|
||||
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
||||
@@ -254,11 +254,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
public string SeedCapRequest(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||
m_log.DebugFormat(
|
||||
"[CAPS]: Received SEED caps request in {0} for agent {1}", m_regionName, m_HostCapsObj.AgentID);
|
||||
|
||||
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
m_log.WarnFormat(
|
||||
"[CAPS]: Unauthorized CAPS client {0} from {1}",
|
||||
m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint);
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BunchOfCapsModule")]
|
||||
public class BunchOfCapsModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
|
||||
@@ -55,8 +55,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
public OSDMap body;
|
||||
}
|
||||
|
||||
//[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class EventQueueGetModule : IEventQueue, IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EventQueueGetModule")]
|
||||
public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -66,8 +66,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
public int DebugLevel { get; set; }
|
||||
|
||||
protected Scene m_scene;
|
||||
private IConfigSource m_gConfig;
|
||||
bool enabledYN;
|
||||
|
||||
private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
|
||||
|
||||
@@ -75,59 +73,46 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>();
|
||||
private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>();
|
||||
|
||||
#region IRegionModule methods
|
||||
public virtual void Initialise(Scene scene, IConfigSource config)
|
||||
#region INonSharedRegionModule methods
|
||||
public virtual void Initialise(IConfigSource config)
|
||||
{
|
||||
m_gConfig = config;
|
||||
|
||||
IConfig startupConfig = m_gConfig.Configs["Startup"];
|
||||
|
||||
ReadConfigAndPopulate(scene, startupConfig, "Startup");
|
||||
|
||||
if (enabledYN)
|
||||
{
|
||||
m_scene = scene;
|
||||
scene.RegisterModuleInterface<IEventQueue>(this);
|
||||
|
||||
// Register fallback handler
|
||||
// Why does EQG Fail on region crossings!
|
||||
|
||||
//scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
|
||||
// TODO: Leaving these open, or closing them when we
|
||||
// become a child is incorrect. It messes up TP in a big
|
||||
// way. CAPS/EQ need to be active as long as the UDP
|
||||
// circuit is there.
|
||||
|
||||
scene.EventManager.OnClientClosed += ClientClosed;
|
||||
scene.EventManager.OnMakeChildAgent += MakeChildAgent;
|
||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug eq",
|
||||
"debug eq [0|1|2]",
|
||||
"Turn on event queue debugging"
|
||||
+ "<= 0 - turns off all event queue logging"
|
||||
+ ">= 1 - turns on outgoing event logging"
|
||||
+ ">= 2 - turns on poll notification",
|
||||
HandleDebugEq);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gConfig = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p)
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
enabledYN = startupConfig.GetBoolean("EventQueue", true);
|
||||
m_scene = scene;
|
||||
scene.RegisterModuleInterface<IEventQueue>(this);
|
||||
|
||||
scene.EventManager.OnClientClosed += ClientClosed;
|
||||
scene.EventManager.OnMakeChildAgent += MakeChildAgent;
|
||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug eq",
|
||||
"debug eq [0|1|2]",
|
||||
"Turn on event queue debugging\n"
|
||||
+ " <= 0 - turns off all event queue logging\n"
|
||||
+ " >= 1 - turns on outgoing event logging\n"
|
||||
+ " >= 2 - turns on poll notification",
|
||||
HandleDebugEq);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scene != scene)
|
||||
return;
|
||||
|
||||
scene.EventManager.OnClientClosed -= ClientClosed;
|
||||
scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
|
||||
scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
|
||||
|
||||
scene.UnregisterModuleInterface<IEventQueue>(this);
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -140,10 +125,11 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
get { return "EventQueueGetModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return false; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void HandleDebugEq(string module, string[] args)
|
||||
@@ -226,16 +212,6 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
//client.OnLogout += ClientClosed;
|
||||
}
|
||||
|
||||
// private void ClientClosed(IClientAPI client)
|
||||
// {
|
||||
// ClientClosed(client.AgentId);
|
||||
// }
|
||||
|
||||
private void ClientClosed(UUID agentID, Scene scene)
|
||||
{
|
||||
// m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
/// <summary>
|
||||
/// This module implements both WebFetchInventoryDescendents and FetchInventoryDescendents2 capabilities.
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FetchInventory2Module")]
|
||||
public class FetchInventory2Module : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -47,7 +47,7 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetMeshModule")]
|
||||
public class GetMeshModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
private bool m_Enabled = true;
|
||||
private string m_URL;
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
#region Region Module interfaceBase Members
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ using OpenSim.Capabilities.Handlers;
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GetTextureModule")]
|
||||
public class GetTextureModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
/// <summary>
|
||||
/// MeshUploadFlag capability. This is required for uploading Mesh.
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MeshUploadFlagModule")]
|
||||
public class MeshUploadFlagModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
|
||||
@@ -47,7 +47,7 @@ using OpenSim.Framework.Capabilities;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "NewFileAgentInventoryVariablePriceModule")]
|
||||
public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
private bool m_enabled = true;
|
||||
private int m_levelUpload = 0;
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
#region Region Module interfaceBase Members
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
@@ -98,7 +98,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
#endregion
|
||||
|
||||
|
||||
#region IRegionModule Members
|
||||
#region Region Module interface
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
@@ -41,30 +42,60 @@ using Caps=OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
public class ObjectAdd : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ObjectAdd")]
|
||||
public class ObjectAdd : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Scene m_scene;
|
||||
#region IRegionModule Members
|
||||
|
||||
public void Initialise(Scene pScene, IConfigSource pSource)
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource pSource)
|
||||
{
|
||||
m_scene = pScene;
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.EventManager.OnRegisterCaps += RegisterCaps;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
|
||||
if (m_scene == scene)
|
||||
{
|
||||
m_scene.EventManager.OnRegisterCaps -= RegisterCaps;
|
||||
m_scene = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ObjectAddModule"; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void RegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
UUID capuuid = UUID.Random();
|
||||
|
||||
// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
|
||||
|
||||
// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
|
||||
|
||||
caps.RegisterHandler(
|
||||
"ObjectAdd",
|
||||
@@ -73,7 +104,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
"/CAPS/OA/" + capuuid + "/",
|
||||
httpMethod => ProcessAdd(httpMethod, agentID, caps),
|
||||
"ObjectAdd",
|
||||
agentID.ToString()));;
|
||||
agentID.ToString())); ;
|
||||
}
|
||||
|
||||
public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap)
|
||||
@@ -84,7 +115,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Request wasn't what was expected";
|
||||
ScenePresence avatar;
|
||||
|
||||
|
||||
if (!m_scene.TryGetScenePresence(AgentId, out avatar))
|
||||
return responsedata;
|
||||
|
||||
@@ -127,7 +158,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
if (r.Type != OSDType.Map) // not a proper req
|
||||
return responsedata;
|
||||
|
||||
|
||||
OSDMap rm = (OSDMap)r;
|
||||
|
||||
if (rm.ContainsKey("ObjectData")) //v2
|
||||
@@ -138,7 +169,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return responsedata;
|
||||
}
|
||||
|
||||
OSDMap ObjMap = (OSDMap) rm["ObjectData"];
|
||||
OSDMap ObjMap = (OSDMap)rm["ObjectData"];
|
||||
|
||||
bypass_raycast = ObjMap["BypassRaycast"].AsBoolean();
|
||||
everyone_mask = readuintval(ObjMap["EveryoneMask"]);
|
||||
@@ -181,7 +212,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
responsedata["str_response_string"] = "Has Profile key, but data not in expected format";
|
||||
return responsedata;
|
||||
}
|
||||
|
||||
|
||||
OSDMap ProfileMap = (OSDMap)ObjMap["Profile"];
|
||||
|
||||
profile_begin = ProfileMap["Begin"].AsInteger();
|
||||
@@ -190,14 +221,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
hollow = ProfileMap["Hollow"].AsInteger();
|
||||
}
|
||||
ray_end_is_intersection = ObjMap["RayEndIsIntersection"].AsBoolean();
|
||||
|
||||
|
||||
ray_target_id = ObjMap["RayTargetId"].AsUUID();
|
||||
state = ObjMap["State"].AsInteger();
|
||||
try
|
||||
{
|
||||
ray_end = ((OSDArray) ObjMap["RayEnd"]).AsVector3();
|
||||
ray_start = ((OSDArray) ObjMap["RayStart"]).AsVector3();
|
||||
scale = ((OSDArray) ObjMap["Scale"]).AsVector3();
|
||||
ray_end = ((OSDArray)ObjMap["RayEnd"]).AsVector3();
|
||||
ray_start = ((OSDArray)ObjMap["RayStart"]).AsVector3();
|
||||
scale = ((OSDArray)ObjMap["Scale"]).AsVector3();
|
||||
rotation = ((OSDArray)ObjMap["Rotation"]).AsQuaternion();
|
||||
}
|
||||
catch (Exception)
|
||||
@@ -214,7 +245,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return responsedata;
|
||||
}
|
||||
|
||||
OSDMap AgentDataMap = (OSDMap) rm["AgentData"];
|
||||
OSDMap AgentDataMap = (OSDMap)rm["AgentData"];
|
||||
|
||||
//session_id = AgentDataMap["SessionId"].AsUUID();
|
||||
group_id = AgentDataMap["GroupId"].AsUUID();
|
||||
@@ -251,21 +282,21 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
profile_begin = rm["profile_begin"].AsInteger();
|
||||
profile_curve = rm["profile_curve"].AsInteger();
|
||||
profile_end = rm["profile_end"].AsInteger();
|
||||
|
||||
|
||||
ray_end_is_intersection = rm["ray_end_is_intersection"].AsBoolean();
|
||||
|
||||
|
||||
ray_target_id = rm["ray_target_id"].AsUUID();
|
||||
|
||||
|
||||
|
||||
|
||||
//session_id = rm["session_id"].AsUUID();
|
||||
state = rm["state"].AsInteger();
|
||||
try
|
||||
try
|
||||
{
|
||||
ray_end = ((OSDArray)rm["ray_end"]).AsVector3();
|
||||
ray_start = ((OSDArray)rm["ray_start"]).AsVector3();
|
||||
rotation = ((OSDArray)rm["rotation"]).AsQuaternion();
|
||||
scale = ((OSDArray)rm["scale"]).AsVector3();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
responsedata["str_response_string"] = "RayEnd, RayStart, Scale or Rotation wasn't in the expected format";
|
||||
@@ -273,9 +304,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false);
|
||||
|
||||
Vector3 pos = m_scene.GetNewRezLocation(ray_start, ray_end, ray_target_id, rotation, (bypass_raycast) ? (byte)1 : (byte)0, (ray_end_is_intersection) ? (byte)1 : (byte)0, true, scale, false);
|
||||
|
||||
PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateBox();
|
||||
|
||||
@@ -286,17 +317,17 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
pbs.PathRevolutions = (byte)path_revolutions;
|
||||
pbs.PathScaleX = (byte)path_scale_x;
|
||||
pbs.PathScaleY = (byte)path_scale_y;
|
||||
pbs.PathShearX = (byte) path_shear_x;
|
||||
pbs.PathShearX = (byte)path_shear_x;
|
||||
pbs.PathShearY = (byte)path_shear_y;
|
||||
pbs.PathSkew = (sbyte)path_skew;
|
||||
pbs.PathTaperX = (sbyte)path_taper_x;
|
||||
pbs.PathTaperY = (sbyte)path_taper_y;
|
||||
pbs.PathTwist = (sbyte)path_twist;
|
||||
pbs.PathTwistBegin = (sbyte)path_twist_begin;
|
||||
pbs.HollowShape = (HollowShape) hollow;
|
||||
pbs.HollowShape = (HollowShape)hollow;
|
||||
pbs.PCode = (byte)p_code;
|
||||
pbs.ProfileBegin = (ushort) profile_begin;
|
||||
pbs.ProfileCurve = (byte) profile_curve;
|
||||
pbs.ProfileBegin = (ushort)profile_begin;
|
||||
pbs.ProfileCurve = (byte)profile_curve;
|
||||
pbs.ProfileEnd = (ushort)profile_end;
|
||||
pbs.Scale = scale;
|
||||
pbs.State = (byte)state;
|
||||
@@ -306,7 +337,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
if (m_scene.Permissions.CanRezObject(1, avatar.UUID, pos))
|
||||
{
|
||||
// rez ON the ground, not IN the ground
|
||||
// pos.Z += 0.25F;
|
||||
// pos.Z += 0.25F;
|
||||
|
||||
obj = m_scene.AddNewPrim(avatar.UUID, group_id, pos, rotation, pbs);
|
||||
}
|
||||
@@ -323,13 +354,13 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
rootpart.GroupMask = group_mask;
|
||||
rootpart.NextOwnerMask = next_owner_mask;
|
||||
rootpart.Material = (byte)material;
|
||||
|
||||
|
||||
m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
|
||||
|
||||
|
||||
responsedata["int_response_code"] = 200; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>",ConvertUintToBytes(obj.LocalId));
|
||||
responsedata["str_response_string"] = String.Format("<llsd><map><key>local_id</key>{0}</map></llsd>", ConvertUintToBytes(obj.LocalId));
|
||||
|
||||
return responsedata;
|
||||
}
|
||||
@@ -347,24 +378,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
byte[] resultbytes = Utils.UIntToBytes(val);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
Array.Reverse(resultbytes);
|
||||
return String.Format("<binary encoding=\"base64\">{0}</binary>",Convert.ToBase64String(resultbytes));
|
||||
return String.Format("<binary encoding=\"base64\">{0}</binary>", Convert.ToBase64String(resultbytes));
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "ObjectAddModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,14 +51,14 @@ using ExtraParamType = OpenMetaverse.ExtraParamType;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UploadObjectAssetModule")]
|
||||
public class UploadObjectAssetModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private Scene m_scene;
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
#region Region Module interfaceBase Members
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
#endregion
|
||||
|
||||
|
||||
#region IRegionModule Members
|
||||
#region Region Module interface
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
UUID capID = UUID.Random();
|
||||
|
||||
m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[REGION CONSOLE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||
caps.RegisterHandler(
|
||||
"SimConsoleAsync",
|
||||
new ConsoleHandler("/CAPS/" + capID + "/", "SimConsoleAsync", agentID, this, m_scene));
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
/// NOTE: Part of this code was adapted from the Aurora project, specifically
|
||||
/// the normal part of the response in the capability handler.
|
||||
/// </remarks>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimulatorFeaturesModule")]
|
||||
public class SimulatorFeaturesModule : ISharedRegionModule, ISimulatorFeaturesModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
|
||||
@@ -50,7 +50,7 @@ using OpenSim.Capabilities.Handlers;
|
||||
|
||||
namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UploadBakedTextureModule")]
|
||||
public class UploadBakedTextureModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
/// <summary>
|
||||
/// This module implements both WebFetchInventoryDescendents and FetchInventoryDescendents2 capabilities.
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "WebFetchInvDescModule")]
|
||||
public class WebFetchInvDescModule : INonSharedRegionModule
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -45,7 +45,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public Packet Packet;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// No arg constructor.
|
||||
/// </summary>
|
||||
public IncomingPacket() {}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="client">Reference to the client this packet came from</param>
|
||||
/// <param name="packet">Packet data</param>
|
||||
|
||||
@@ -47,6 +47,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Timer = System.Timers.Timer;
|
||||
using AssetLandmark = OpenSim.Framework.AssetLandmark;
|
||||
using RegionFlags = OpenMetaverse.RegionFlags;
|
||||
using Nini.Config;
|
||||
|
||||
using System.IO;
|
||||
@@ -346,7 +347,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private int m_moneyBalance;
|
||||
private int m_animationSequenceNumber = 1;
|
||||
private bool m_SendLogoutPacketWhenClosing = true;
|
||||
private AgentUpdateArgs lastarg;
|
||||
|
||||
/// <summary>
|
||||
/// We retain a single AgentUpdateArgs so that we can constantly reuse it rather than construct a new one for
|
||||
/// every single incoming AgentUpdate. Every client sends 10 AgentUpdate UDP messages per second, even if it
|
||||
/// is doing absolutely nothing.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This does mean that agent updates must be processed synchronously, at least for each client, and called methods
|
||||
/// cannot retain a reference to it outside of that method.
|
||||
/// </remarks>
|
||||
private AgentUpdateArgs m_lastAgentUpdateArgs;
|
||||
|
||||
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
|
||||
@@ -806,8 +817,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(mov, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
public void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName,
|
||||
UUID fromAgentID, byte source, byte audible)
|
||||
public void SendChatMessage(
|
||||
string message, byte type, Vector3 fromPos, string fromName,
|
||||
UUID fromAgentID, UUID ownerID, byte source, byte audible)
|
||||
{
|
||||
ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator);
|
||||
reply.ChatData.Audible = audible;
|
||||
@@ -816,7 +828,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.ChatData.SourceType = source;
|
||||
reply.ChatData.Position = fromPos;
|
||||
reply.ChatData.FromName = Util.StringToBytes256(fromName);
|
||||
reply.ChatData.OwnerID = fromAgentID;
|
||||
reply.ChatData.OwnerID = ownerID;
|
||||
reply.ChatData.SourceID = fromAgentID;
|
||||
|
||||
OutPacket(reply, ThrottleOutPacketType.Task);
|
||||
@@ -3921,7 +3933,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
ImprovedTerseObjectUpdatePacket packet
|
||||
= (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
|
||||
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
@@ -3966,7 +3980,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
ImprovedTerseObjectUpdatePacket packet
|
||||
= (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(
|
||||
PacketType.ImprovedTerseObjectUpdate);
|
||||
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
@@ -4958,7 +4975,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Y, -64.0f, 64.0f), data, pos); pos += 2;
|
||||
Utils.UInt16ToBytes(Utils.FloatToUInt16(angularVelocity.Z, -64.0f, 64.0f), data, pos); pos += 2;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock block = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
|
||||
ImprovedTerseObjectUpdatePacket.ObjectDataBlock block
|
||||
= PacketPool.Instance.GetDataBlock<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
|
||||
|
||||
block.Data = data;
|
||||
|
||||
if (textureEntry != null && textureEntry.Length > 0)
|
||||
@@ -5190,14 +5209,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
protected virtual void RegisterLocalPacketHandlers()
|
||||
{
|
||||
AddLocalPacketHandler(PacketType.LogoutRequest, HandleLogout);
|
||||
|
||||
// If AgentUpdate is ever handled asynchronously, then we will also need to construct a new AgentUpdateArgs
|
||||
// for each AgentUpdate packet.
|
||||
AddLocalPacketHandler(PacketType.AgentUpdate, HandleAgentUpdate, false);
|
||||
|
||||
AddLocalPacketHandler(PacketType.ViewerEffect, HandleViewerEffect, false);
|
||||
AddLocalPacketHandler(PacketType.AgentCachedTexture, HandleAgentTextureCached, false);
|
||||
AddLocalPacketHandler(PacketType.MultipleObjectUpdate, HandleMultipleObjUpdate, false);
|
||||
AddLocalPacketHandler(PacketType.MoneyTransferRequest, HandleMoneyTransferRequest, false);
|
||||
AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false);
|
||||
AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest, false);
|
||||
AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest, false);
|
||||
AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
|
||||
AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
|
||||
AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
|
||||
AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest);
|
||||
AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
|
||||
@@ -5417,80 +5440,83 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Scene/Avatar
|
||||
|
||||
private bool HandleAgentUpdate(IClientAPI sener, Packet Pack)
|
||||
private bool HandleAgentUpdate(IClientAPI sener, Packet packet)
|
||||
{
|
||||
if (OnAgentUpdate != null)
|
||||
{
|
||||
bool update = false;
|
||||
AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack;
|
||||
AgentUpdatePacket agentUpdate = (AgentUpdatePacket)packet;
|
||||
|
||||
#region Packet Session and User Check
|
||||
if (agenUpdate.AgentData.SessionID != SessionId || agenUpdate.AgentData.AgentID != AgentId)
|
||||
if (agentUpdate.AgentData.SessionID != SessionId || agentUpdate.AgentData.AgentID != AgentId)
|
||||
{
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
AgentUpdatePacket.AgentDataBlock x = agenUpdate.AgentData;
|
||||
bool update = false;
|
||||
AgentUpdatePacket.AgentDataBlock x = agentUpdate.AgentData;
|
||||
|
||||
// We can only check when we have something to check
|
||||
// against.
|
||||
|
||||
if (lastarg != null)
|
||||
if (m_lastAgentUpdateArgs != null)
|
||||
{
|
||||
// These should be ordered from most-likely to
|
||||
// least likely to change. I've made an initial
|
||||
// guess at that.
|
||||
update =
|
||||
(
|
||||
(x.BodyRotation != lastarg.BodyRotation) ||
|
||||
(x.CameraAtAxis != lastarg.CameraAtAxis) ||
|
||||
(x.CameraCenter != lastarg.CameraCenter) ||
|
||||
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
|
||||
(x.ControlFlags != lastarg.ControlFlags) ||
|
||||
(x.Far != lastarg.Far) ||
|
||||
(x.Flags != lastarg.Flags) ||
|
||||
(x.State != lastarg.State) ||
|
||||
(x.HeadRotation != lastarg.HeadRotation) ||
|
||||
(x.SessionID != lastarg.SessionID) ||
|
||||
(x.AgentID != lastarg.AgentID)
|
||||
(x.BodyRotation != m_lastAgentUpdateArgs.BodyRotation) ||
|
||||
(x.CameraAtAxis != m_lastAgentUpdateArgs.CameraAtAxis) ||
|
||||
(x.CameraCenter != m_lastAgentUpdateArgs.CameraCenter) ||
|
||||
(x.CameraLeftAxis != m_lastAgentUpdateArgs.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != m_lastAgentUpdateArgs.CameraUpAxis) ||
|
||||
(x.ControlFlags != m_lastAgentUpdateArgs.ControlFlags) ||
|
||||
(x.Far != m_lastAgentUpdateArgs.Far) ||
|
||||
(x.Flags != m_lastAgentUpdateArgs.Flags) ||
|
||||
(x.State != m_lastAgentUpdateArgs.State) ||
|
||||
(x.HeadRotation != m_lastAgentUpdateArgs.HeadRotation) ||
|
||||
(x.SessionID != m_lastAgentUpdateArgs.SessionID) ||
|
||||
(x.AgentID != m_lastAgentUpdateArgs.AgentID)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_lastAgentUpdateArgs = new AgentUpdateArgs();
|
||||
update = true;
|
||||
}
|
||||
|
||||
// These should be ordered from most-likely to
|
||||
// least likely to change. I've made an initial
|
||||
// guess at that.
|
||||
|
||||
if (update)
|
||||
{
|
||||
// m_log.DebugFormat("[LLCLIENTVIEW]: Triggered AgentUpdate for {0}", sener.Name);
|
||||
|
||||
AgentUpdateArgs arg = new AgentUpdateArgs();
|
||||
arg.AgentID = x.AgentID;
|
||||
arg.BodyRotation = x.BodyRotation;
|
||||
arg.CameraAtAxis = x.CameraAtAxis;
|
||||
arg.CameraCenter = x.CameraCenter;
|
||||
arg.CameraLeftAxis = x.CameraLeftAxis;
|
||||
arg.CameraUpAxis = x.CameraUpAxis;
|
||||
arg.ControlFlags = x.ControlFlags;
|
||||
arg.Far = x.Far;
|
||||
arg.Flags = x.Flags;
|
||||
arg.HeadRotation = x.HeadRotation;
|
||||
arg.SessionID = x.SessionID;
|
||||
arg.State = x.State;
|
||||
m_lastAgentUpdateArgs.AgentID = x.AgentID;
|
||||
m_lastAgentUpdateArgs.BodyRotation = x.BodyRotation;
|
||||
m_lastAgentUpdateArgs.CameraAtAxis = x.CameraAtAxis;
|
||||
m_lastAgentUpdateArgs.CameraCenter = x.CameraCenter;
|
||||
m_lastAgentUpdateArgs.CameraLeftAxis = x.CameraLeftAxis;
|
||||
m_lastAgentUpdateArgs.CameraUpAxis = x.CameraUpAxis;
|
||||
m_lastAgentUpdateArgs.ControlFlags = x.ControlFlags;
|
||||
m_lastAgentUpdateArgs.Far = x.Far;
|
||||
m_lastAgentUpdateArgs.Flags = x.Flags;
|
||||
m_lastAgentUpdateArgs.HeadRotation = x.HeadRotation;
|
||||
m_lastAgentUpdateArgs.SessionID = x.SessionID;
|
||||
m_lastAgentUpdateArgs.State = x.State;
|
||||
|
||||
UpdateAgent handlerAgentUpdate = OnAgentUpdate;
|
||||
UpdateAgent handlerPreAgentUpdate = OnPreAgentUpdate;
|
||||
lastarg = arg; // save this set of arguments for nexttime
|
||||
|
||||
if (handlerPreAgentUpdate != null)
|
||||
OnPreAgentUpdate(this, arg);
|
||||
OnPreAgentUpdate(this, m_lastAgentUpdateArgs);
|
||||
|
||||
if (handlerAgentUpdate != null)
|
||||
OnAgentUpdate(this, arg);
|
||||
OnAgentUpdate(this, m_lastAgentUpdateArgs);
|
||||
|
||||
handlerAgentUpdate = null;
|
||||
handlerPreAgentUpdate = null;
|
||||
}
|
||||
}
|
||||
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5862,7 +5888,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
msgpack.MessageBlock.ID,
|
||||
msgpack.MessageBlock.Offline != 0 ? true : false,
|
||||
msgpack.MessageBlock.Position,
|
||||
msgpack.MessageBlock.BinaryBucket);
|
||||
msgpack.MessageBlock.BinaryBucket,
|
||||
true);
|
||||
|
||||
handlerInstantMessage(this, im);
|
||||
}
|
||||
@@ -9054,7 +9081,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
#endregion
|
||||
|
||||
switch (Utils.BytesToString(messagePacket.MethodData.Method))
|
||||
string method = Utils.BytesToString(messagePacket.MethodData.Method);
|
||||
|
||||
switch (method)
|
||||
{
|
||||
case "getinfo":
|
||||
if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
|
||||
@@ -9370,7 +9399,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return true;
|
||||
|
||||
default:
|
||||
m_log.Error("EstateOwnerMessage: Unknown method requested\n" + messagePacket);
|
||||
m_log.WarnFormat(
|
||||
"[LLCLIENTVIEW]: EstateOwnerMessage: Unknown method {0} requested for {1} in {2}",
|
||||
method, Name, Scene.Name);
|
||||
|
||||
for (int i = 0; i < messagePacket.ParamList.Length; i++)
|
||||
{
|
||||
EstateOwnerMessagePacket.ParamListBlock block = messagePacket.ParamList[i];
|
||||
string data = (string)Utils.BytesToString(block.Parameter);
|
||||
m_log.DebugFormat("[LLCLIENTVIEW]: Param {0}={1}", i, data);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -11756,7 +11795,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
logPacket = false;
|
||||
|
||||
if (DebugPacketLevel <= 50
|
||||
& (packet.Type == PacketType.ImprovedTerseObjectUpdate || packet.Type == PacketType.ObjectUpdate))
|
||||
&& (packet.Type == PacketType.ImprovedTerseObjectUpdate || packet.Type == PacketType.ObjectUpdate))
|
||||
logPacket = false;
|
||||
|
||||
if (DebugPacketLevel <= 25 && packet.Type == PacketType.ObjectPropertiesFamily)
|
||||
@@ -11830,8 +11869,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (!ProcessPacketMethod(packet))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + packet.Type);
|
||||
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
}
|
||||
|
||||
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
|
||||
@@ -12284,7 +12321,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
ushort timeDilation = Utils.FloatToUInt16(TIME_DILATION, 0.0f, 1.0f);
|
||||
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
ImprovedTerseObjectUpdatePacket packet
|
||||
= (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(
|
||||
PacketType.ImprovedTerseObjectUpdate);
|
||||
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
|
||||
|
||||
@@ -37,6 +37,7 @@ using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenMetaverse;
|
||||
@@ -100,9 +101,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
/// <summary>The measured resolution of Environment.TickCount</summary>
|
||||
public readonly float TickCountResolution;
|
||||
|
||||
/// <summary>Number of prim updates to put on the queue each time the
|
||||
/// OnQueueEmpty event is triggered for updates</summary>
|
||||
public readonly int PrimUpdatesPerCallback;
|
||||
|
||||
/// <summary>Number of texture packets to put on the queue each time the
|
||||
/// OnQueueEmpty event is triggered for textures</summary>
|
||||
public readonly int TextureSendLimit;
|
||||
@@ -111,6 +114,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
//PacketEventDictionary packetEvents = new PacketEventDictionary();
|
||||
/// <summary>Incoming packets that are awaiting handling</summary>
|
||||
private OpenMetaverse.BlockingQueue<IncomingPacket> packetInbox = new OpenMetaverse.BlockingQueue<IncomingPacket>();
|
||||
|
||||
/// <summary></summary>
|
||||
//private UDPClientCollection m_clients = new UDPClientCollection();
|
||||
/// <summary>Bandwidth throttle for this UDP server</summary>
|
||||
@@ -121,28 +125,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
/// <summary>Manages authentication for agent circuits</summary>
|
||||
private AgentCircuitManager m_circuitManager;
|
||||
|
||||
/// <summary>Reference to the scene this UDP server is attached to</summary>
|
||||
protected Scene m_scene;
|
||||
|
||||
/// <summary>The X/Y coordinates of the scene this UDP server is attached to</summary>
|
||||
private Location m_location;
|
||||
|
||||
/// <summary>The size of the receive buffer for the UDP socket. This value
|
||||
/// is passed up to the operating system and used in the system networking
|
||||
/// stack. Use zero to leave this value as the default</summary>
|
||||
private int m_recvBufferSize;
|
||||
|
||||
/// <summary>Flag to process packets asynchronously or synchronously</summary>
|
||||
private bool m_asyncPacketHandling;
|
||||
|
||||
/// <summary>Tracks whether or not a packet was sent each round so we know
|
||||
/// whether or not to sleep</summary>
|
||||
private bool m_packetSent;
|
||||
|
||||
/// <summary>Environment.TickCount of the last time that packet stats were reported to the scene</summary>
|
||||
private int m_elapsedMSSinceLastStatReport = 0;
|
||||
|
||||
/// <summary>Environment.TickCount of the last time the outgoing packet handler executed</summary>
|
||||
private int m_tickLastOutgoingPacketHandler;
|
||||
|
||||
/// <summary>Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped</summary>
|
||||
private int m_elapsedMSOutgoingPacketHandler;
|
||||
|
||||
/// <summary>Keeps track of the number of 100 millisecond periods elapsed in the outgoing packet handler executed</summary>
|
||||
private int m_elapsed100MSOutgoingPacketHandler;
|
||||
|
||||
/// <summary>Keeps track of the number of 500 millisecond periods elapsed in the outgoing packet handler executed</summary>
|
||||
private int m_elapsed500MSOutgoingPacketHandler;
|
||||
|
||||
@@ -155,6 +168,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <summary>Flag to signal when clients should send pings</summary>
|
||||
protected bool m_sendPing;
|
||||
|
||||
private Pool<IncomingPacket> m_incomingPacketPool;
|
||||
|
||||
private Stat m_incomingPacketPoolStat;
|
||||
|
||||
private int m_defaultRTO = 0;
|
||||
private int m_maxRTO = 0;
|
||||
private int m_ackTimeout = 0;
|
||||
@@ -175,7 +192,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// </summary>
|
||||
private IClientAPI m_currentIncomingClient;
|
||||
|
||||
public LLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager)
|
||||
public LLUDPServer(
|
||||
IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port,
|
||||
IConfigSource configSource, AgentCircuitManager circuitManager)
|
||||
: base(listenIP, (int)port)
|
||||
{
|
||||
#region Environment.TickCount Measurement
|
||||
@@ -197,6 +216,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
m_circuitManager = circuitManager;
|
||||
int sceneThrottleBps = 0;
|
||||
bool usePools = false;
|
||||
|
||||
IConfig config = configSource.Configs["ClientStack.LindenUDP"];
|
||||
if (config != null)
|
||||
@@ -222,6 +242,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_pausedAckTimeout = 1000 * 300; // 5 minutes
|
||||
}
|
||||
|
||||
// FIXME: This actually only needs to be done once since the PacketPool is shared across all servers.
|
||||
// However, there is no harm in temporarily doing it multiple times.
|
||||
IConfig packetConfig = configSource.Configs["PacketPool"];
|
||||
if (packetConfig != null)
|
||||
{
|
||||
PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
|
||||
PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
|
||||
usePools = packetConfig.GetBoolean("RecycleBaseUDPPackets", usePools);
|
||||
}
|
||||
|
||||
#region BinaryStats
|
||||
config = configSource.Configs["Statistics.Binary"];
|
||||
m_shouldCollectStats = false;
|
||||
@@ -249,20 +279,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
m_throttle = new TokenBucket(null, sceneThrottleBps);
|
||||
ThrottleRates = new ThrottleRates(configSource);
|
||||
|
||||
if (usePools)
|
||||
EnablePools();
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (m_scene == null)
|
||||
throw new InvalidOperationException("[LLUDPSERVER]: Cannot LLUDPServer.Start() without an IScene reference");
|
||||
StartInbound();
|
||||
StartOutbound();
|
||||
|
||||
m_elapsedMSSinceLastStatReport = Environment.TickCount;
|
||||
}
|
||||
|
||||
private void StartInbound()
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[LLUDPSERVER]: Starting the LLUDP server in {0} mode",
|
||||
m_asyncPacketHandling ? "asynchronous" : "synchronous");
|
||||
"[LLUDPSERVER]: Starting inbound packet processing for the LLUDP server in {0} mode with UsePools = {1}",
|
||||
m_asyncPacketHandling ? "asynchronous" : "synchronous", UsePools);
|
||||
|
||||
base.Start(m_recvBufferSize, m_asyncPacketHandling);
|
||||
base.StartInbound(m_recvBufferSize, m_asyncPacketHandling);
|
||||
|
||||
// Start the packet processing threads
|
||||
// This thread will process the packets received that are placed on the packetInbox
|
||||
Watchdog.StartThread(
|
||||
IncomingPacketHandler,
|
||||
string.Format("Incoming Packets ({0})", m_scene.RegionInfo.RegionName),
|
||||
@@ -271,6 +309,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
true,
|
||||
GetWatchdogIncomingAlarmData,
|
||||
Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
private new void StartOutbound()
|
||||
{
|
||||
m_log.Info("[LLUDPSERVER]: Starting outbound packet processing for the LLUDP server");
|
||||
|
||||
base.StartOutbound();
|
||||
|
||||
Watchdog.StartThread(
|
||||
OutgoingPacketHandler,
|
||||
@@ -280,8 +325,57 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
true,
|
||||
GetWatchdogOutgoingAlarmData,
|
||||
Watchdog.DEFAULT_WATCHDOG_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
m_elapsedMSSinceLastStatReport = Environment.TickCount;
|
||||
public void Stop()
|
||||
{
|
||||
m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + m_scene.RegionInfo.RegionName);
|
||||
base.StopOutbound();
|
||||
base.StopInbound();
|
||||
}
|
||||
|
||||
protected override bool EnablePools()
|
||||
{
|
||||
if (!UsePools)
|
||||
{
|
||||
base.EnablePools();
|
||||
|
||||
m_incomingPacketPool = new Pool<IncomingPacket>(() => new IncomingPacket(), 500);
|
||||
|
||||
m_incomingPacketPoolStat
|
||||
= new Stat(
|
||||
"IncomingPacketPoolCount",
|
||||
"Objects within incoming packet pool",
|
||||
"The number of objects currently stored within the incoming packet pool",
|
||||
"",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Pull,
|
||||
stat => stat.Value = m_incomingPacketPool.Count,
|
||||
StatVerbosity.Debug);
|
||||
|
||||
StatsManager.RegisterStat(m_incomingPacketPoolStat);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override bool DisablePools()
|
||||
{
|
||||
if (UsePools)
|
||||
{
|
||||
base.DisablePools();
|
||||
|
||||
StatsManager.DeregisterStat(m_incomingPacketPoolStat);
|
||||
|
||||
// We won't null out the pool to avoid a race condition with code that may be in the middle of using it.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -306,12 +400,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_currentOutgoingClient != null ? m_currentOutgoingClient.Name : "none");
|
||||
}
|
||||
|
||||
public new void Stop()
|
||||
{
|
||||
m_log.Info("[LLUDPSERVER]: Shutting down the LLUDP server for " + m_scene.RegionInfo.RegionName);
|
||||
base.Stop();
|
||||
}
|
||||
|
||||
public void AddScene(IScene scene)
|
||||
{
|
||||
if (m_scene != null)
|
||||
@@ -328,6 +416,117 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
m_scene = (Scene)scene;
|
||||
m_location = new Location(m_scene.RegionInfo.RegionHandle);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug lludp start",
|
||||
"debug lludp start <in|out|all>",
|
||||
"Control LLUDP packet processing.",
|
||||
"No effect if packet processing has already started.\n"
|
||||
+ "in - start inbound processing.\n"
|
||||
+ "out - start outbound processing.\n"
|
||||
+ "all - start in and outbound processing.\n",
|
||||
HandleStartCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug lludp stop",
|
||||
"debug lludp stop <in|out|all>",
|
||||
"Stop LLUDP packet processing.",
|
||||
"No effect if packet processing has already stopped.\n"
|
||||
+ "in - stop inbound processing.\n"
|
||||
+ "out - stop outbound processing.\n"
|
||||
+ "all - stop in and outbound processing.\n",
|
||||
HandleStopCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug lludp pool",
|
||||
"debug lludp pool <on|off>",
|
||||
"Turn object pooling within the lludp component on or off.",
|
||||
HandlePoolCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"Debug",
|
||||
false,
|
||||
"debug lludp status",
|
||||
"debug lludp status",
|
||||
"Return status of LLUDP packet processing.",
|
||||
HandleStatusCommand);
|
||||
}
|
||||
|
||||
private void HandleStartCommand(string module, string[] args)
|
||||
{
|
||||
if (args.Length != 4)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug lludp start <in|out|all>");
|
||||
return;
|
||||
}
|
||||
|
||||
string subCommand = args[3];
|
||||
|
||||
if (subCommand == "in" || subCommand == "all")
|
||||
StartInbound();
|
||||
|
||||
if (subCommand == "out" || subCommand == "all")
|
||||
StartOutbound();
|
||||
}
|
||||
|
||||
private void HandleStopCommand(string module, string[] args)
|
||||
{
|
||||
if (args.Length != 4)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug lludp stop <in|out|all>");
|
||||
return;
|
||||
}
|
||||
|
||||
string subCommand = args[3];
|
||||
|
||||
if (subCommand == "in" || subCommand == "all")
|
||||
StopInbound();
|
||||
|
||||
if (subCommand == "out" || subCommand == "all")
|
||||
StopOutbound();
|
||||
}
|
||||
|
||||
private void HandlePoolCommand(string module, string[] args)
|
||||
{
|
||||
if (args.Length != 4)
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug lludp pool <on|off>");
|
||||
return;
|
||||
}
|
||||
|
||||
string enabled = args[3];
|
||||
|
||||
if (enabled == "on")
|
||||
{
|
||||
if (EnablePools())
|
||||
MainConsole.Instance.OutputFormat("Packet pools enabled on {0}", m_scene.Name);
|
||||
}
|
||||
else if (enabled == "off")
|
||||
{
|
||||
if (DisablePools())
|
||||
MainConsole.Instance.OutputFormat("Packet pools disabled on {0}", m_scene.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug lludp pool <on|off>");
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleStatusCommand(string module, string[] args)
|
||||
{
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"IN LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningInbound ? "enabled" : "disabled");
|
||||
|
||||
MainConsole.Instance.OutputFormat(
|
||||
"OUT LLUDP packet processing for {0} is {1}", m_scene.Name, IsRunningOutbound ? "enabled" : "disabled");
|
||||
|
||||
MainConsole.Instance.OutputFormat("LLUDP pools in {0} are {1}", m_scene.Name, UsePools ? "on" : "off");
|
||||
}
|
||||
|
||||
public bool HandlesRegion(Location x)
|
||||
@@ -411,6 +610,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
byte[] data = packet.ToBytes();
|
||||
SendPacketData(udpClient, data, packet.Type, category, method);
|
||||
}
|
||||
|
||||
PacketPool.Instance.ReturnPacket(packet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -695,7 +896,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
LLUDPClient udpClient = null;
|
||||
Packet packet = null;
|
||||
int packetEnd = buffer.DataLength - 1;
|
||||
IPEndPoint address = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
IPEndPoint endPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
#region Decoding
|
||||
|
||||
@@ -705,7 +906,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// "[LLUDPSERVER]: Dropping undersized packet with {0} bytes received from {1} in {2}",
|
||||
// buffer.DataLength, buffer.RemoteEndPoint, m_scene.RegionInfo.RegionName);
|
||||
|
||||
return; // Drop undersizd packet
|
||||
return; // Drop undersized packet
|
||||
}
|
||||
|
||||
int headerLen = 7;
|
||||
@@ -728,7 +929,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
try
|
||||
{
|
||||
packet = Packet.BuildPacket(buffer.Data, ref packetEnd,
|
||||
// packet = Packet.BuildPacket(buffer.Data, ref packetEnd,
|
||||
// // Only allocate a buffer for zerodecoding if the packet is zerocoded
|
||||
// ((buffer.Data[0] & Helpers.MSG_ZEROCODED) != 0) ? new byte[4096] : null);
|
||||
// If OpenSimUDPBase.UsePool == true (which is currently separate from the PacketPool) then we
|
||||
// assume that packet construction does not retain a reference to byte[] buffer.Data (instead, all
|
||||
// bytes are copied out).
|
||||
packet = PacketPool.Instance.GetPacket(buffer.Data, ref packetEnd,
|
||||
// Only allocate a buffer for zerodecoding if the packet is zerocoded
|
||||
((buffer.Data[0] & Helpers.MSG_ZEROCODED) != 0) ? new byte[4096] : null);
|
||||
}
|
||||
@@ -743,11 +950,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
return; // Drop short packet
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
if (m_malformedCount < 100)
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Dropped malformed packet: " + e.ToString());
|
||||
|
||||
m_malformedCount++;
|
||||
|
||||
if ((m_malformedCount % 100000) == 0)
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Received {0} malformed packets so far, probable network attack.", m_malformedCount);
|
||||
}
|
||||
@@ -768,7 +977,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// UseCircuitCode handling
|
||||
if (packet.Type == PacketType.UseCircuitCode)
|
||||
{
|
||||
object[] array = new object[] { buffer, packet };
|
||||
// We need to copy the endpoint so that it doesn't get changed when another thread reuses the
|
||||
// buffer.
|
||||
object[] array = new object[] { new IPEndPoint(endPoint.Address, endPoint.Port), packet };
|
||||
|
||||
Util.FireAndForget(HandleUseCircuitCode, array);
|
||||
|
||||
@@ -777,7 +988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// Determine which agent this packet came from
|
||||
IClientAPI client;
|
||||
if (!m_scene.TryGetClient(address, out client) || !(client is LLClientView))
|
||||
if (!m_scene.TryGetClient(endPoint, out client) || !(client is LLClientView))
|
||||
{
|
||||
//m_log.Debug("[LLUDPSERVER]: Received a " + packet.Type + " packet from an unrecognized source: " + address + " in " + m_scene.RegionInfo.RegionName);
|
||||
return;
|
||||
@@ -801,6 +1012,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Handle appended ACKs
|
||||
if (packet.Header.AppendedAcks && packet.Header.AckList != null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling {0} appended acks from {1} in {2}",
|
||||
// packet.Header.AckList.Length, client.Name, m_scene.Name);
|
||||
|
||||
for (int i = 0; i < packet.Header.AckList.Length; i++)
|
||||
udpClient.NeedAcks.Acknowledge(packet.Header.AckList[i], now, packet.Header.Resent);
|
||||
}
|
||||
@@ -810,6 +1025,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
PacketAckPacket ackPacket = (PacketAckPacket)packet;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling {0} packet acks for {1} in {2}",
|
||||
// ackPacket.Packets.Length, client.Name, m_scene.Name);
|
||||
|
||||
for (int i = 0; i < ackPacket.Packets.Length; i++)
|
||||
udpClient.NeedAcks.Acknowledge(ackPacket.Packets[i].ID, now, packet.Header.Resent);
|
||||
|
||||
@@ -823,6 +1042,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (packet.Header.Reliable)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Adding ack request for {0} {1} from {2} in {3}",
|
||||
// packet.Type, packet.Header.Sequence, client.Name, m_scene.Name);
|
||||
|
||||
udpClient.PendingAcks.Enqueue(packet.Header.Sequence);
|
||||
|
||||
// This is a somewhat odd sequence of steps to pull the client.BytesSinceLastACK value out,
|
||||
@@ -869,6 +1092,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (packet.Type == PacketType.StartPingCheck)
|
||||
{
|
||||
// m_log.DebugFormat("[LLUDPSERVER]: Handling ping from {0} in {1}", client.Name, m_scene.Name);
|
||||
|
||||
// We don't need to do anything else with ping checks
|
||||
StartPingCheckPacket startPing = (StartPingCheckPacket)packet;
|
||||
CompletePing(udpClient, startPing.PingID.PingID);
|
||||
@@ -888,8 +1113,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#endregion Ping Check Handling
|
||||
|
||||
IncomingPacket incomingPacket;
|
||||
|
||||
// Inbox insertion
|
||||
packetInbox.Enqueue(new IncomingPacket((LLClientView)client, packet));
|
||||
if (UsePools)
|
||||
{
|
||||
incomingPacket = m_incomingPacketPool.GetObject();
|
||||
incomingPacket.Client = (LLClientView)client;
|
||||
incomingPacket.Packet = packet;
|
||||
}
|
||||
else
|
||||
{
|
||||
incomingPacket = new IncomingPacket((LLClientView)client, packet);
|
||||
}
|
||||
|
||||
packetInbox.Enqueue(incomingPacket);
|
||||
}
|
||||
|
||||
#region BinaryStats
|
||||
@@ -975,21 +1213,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private void HandleUseCircuitCode(object o)
|
||||
{
|
||||
IPEndPoint remoteEndPoint = null;
|
||||
IPEndPoint endPoint = null;
|
||||
IClientAPI client = null;
|
||||
|
||||
try
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
endPoint = (IPEndPoint)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[LLUDPSERVER]: Handling UseCircuitCode request for circuit {0} to {1} from IP {2}",
|
||||
uccp.CircuitCode.Code, m_scene.RegionInfo.RegionName, buffer.RemoteEndPoint);
|
||||
|
||||
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
uccp.CircuitCode.Code, m_scene.RegionInfo.RegionName, endPoint);
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
@@ -1000,13 +1236,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
endPoint,
|
||||
sessionInfo);
|
||||
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
SendAckImmediate(endPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
@@ -1017,7 +1253,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Ignoring connection request for {0} to {1} with unknown circuit code {2} from IP {3}",
|
||||
uccp.CircuitCode.ID, m_scene.RegionInfo.RegionName, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
uccp.CircuitCode.ID, m_scene.RegionInfo.RegionName, uccp.CircuitCode.Code, endPoint);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
@@ -1029,7 +1265,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
|
||||
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
|
||||
endPoint != null ? endPoint.ToString() : "n/a",
|
||||
client != null ? client.Name : "unknown",
|
||||
client != null ? client.AgentId.ToString() : "unknown",
|
||||
e.Message,
|
||||
@@ -1094,20 +1330,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
IClientAPI client = null;
|
||||
|
||||
// In priciple there shouldn't be more than one thread here, ever.
|
||||
// But in case that happens, we need to synchronize this piece of code
|
||||
// because it's too important
|
||||
lock (this)
|
||||
// We currently synchronize this code across the whole scene to avoid issues such as
|
||||
// http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done
|
||||
// consistently, this lock could probably be removed.
|
||||
lock (this)
|
||||
{
|
||||
if (!m_scene.TryGetClient(agentID, out client))
|
||||
{
|
||||
LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, m_throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO);
|
||||
|
||||
|
||||
client = new LLClientView(m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode);
|
||||
client.OnLogout += LogoutHandler;
|
||||
|
||||
|
||||
((LLClientView)client).DisableFacelights = m_disableFacelights;
|
||||
|
||||
|
||||
client.Start();
|
||||
}
|
||||
}
|
||||
@@ -1146,7 +1382,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// on to en-US to avoid number parsing issues
|
||||
Culture.SetCurrentCulture();
|
||||
|
||||
while (base.IsRunning)
|
||||
while (IsRunningInbound)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1161,7 +1397,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
|
||||
if (packetInbox.Dequeue(100, ref incomingPacket))
|
||||
{
|
||||
ProcessInPacket(incomingPacket);//, incomingPacket); Util.FireAndForget(ProcessInPacket, incomingPacket);
|
||||
|
||||
if (UsePools)
|
||||
m_incomingPacketPool.ReturnObject(incomingPacket);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1188,7 +1429,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// Action generic every round
|
||||
Action<IClientAPI> clientPacketHandler = ClientOutgoingPacketHandler;
|
||||
|
||||
while (base.IsRunning)
|
||||
while (base.IsRunningOutbound)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -30,6 +30,8 @@ using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
|
||||
namespace OpenMetaverse
|
||||
{
|
||||
@@ -58,17 +60,31 @@ namespace OpenMetaverse
|
||||
/// <summary>Flag to process packets asynchronously or synchronously</summary>
|
||||
private bool m_asyncPacketHandling;
|
||||
|
||||
/// <summary>The all important shutdown flag</summary>
|
||||
private volatile bool m_shutdownFlag = true;
|
||||
/// <summary>
|
||||
/// Pool to use for handling data. May be null if UsePools = false;
|
||||
/// </summary>
|
||||
protected OpenSim.Framework.Pool<UDPPacketBuffer> m_pool;
|
||||
|
||||
/// <summary>Returns true if the server is currently listening, otherwise false</summary>
|
||||
public bool IsRunning { get { return !m_shutdownFlag; } }
|
||||
/// <summary>
|
||||
/// Are we to use object pool(s) to reduce memory churn when receiving data?
|
||||
/// </summary>
|
||||
public bool UsePools { get; protected set; }
|
||||
|
||||
/// <summary>Returns true if the server is currently listening for inbound packets, otherwise false</summary>
|
||||
public bool IsRunningInbound { get; private set; }
|
||||
|
||||
/// <summary>Returns true if the server is currently sending outbound packets, otherwise false</summary>
|
||||
/// <remarks>If IsRunningOut = false, then any request to send a packet is simply dropped.</remarks>
|
||||
public bool IsRunningOutbound { get; private set; }
|
||||
|
||||
private Stat m_poolCountStat;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
/// </summary>
|
||||
/// <param name="bindAddress">Local IP address to bind the server to</param>
|
||||
/// <param name="port">Port to listening for incoming UDP packets on</param>
|
||||
/// /// <param name="usePool">Are we to use an object pool to get objects for handing inbound data?</param>
|
||||
public OpenSimUDPBase(IPAddress bindAddress, int port)
|
||||
{
|
||||
m_localBindAddress = bindAddress;
|
||||
@@ -76,7 +92,7 @@ namespace OpenMetaverse
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start the UDP server
|
||||
/// Start inbound UDP packet handling.
|
||||
/// </summary>
|
||||
/// <param name="recvBufferSize">The size of the receive buffer for
|
||||
/// the UDP socket. This value is passed up to the operating system
|
||||
@@ -91,11 +107,11 @@ namespace OpenMetaverse
|
||||
/// manner (not throwing an exception when the remote side resets the
|
||||
/// connection). This call is ignored on Mono where the flag is not
|
||||
/// necessary</remarks>
|
||||
public void Start(int recvBufferSize, bool asyncPacketHandling)
|
||||
public void StartInbound(int recvBufferSize, bool asyncPacketHandling)
|
||||
{
|
||||
m_asyncPacketHandling = asyncPacketHandling;
|
||||
|
||||
if (m_shutdownFlag)
|
||||
if (!IsRunningInbound)
|
||||
{
|
||||
const int SIO_UDP_CONNRESET = -1744830452;
|
||||
|
||||
@@ -127,8 +143,7 @@ namespace OpenMetaverse
|
||||
|
||||
m_udpSocket.Bind(ipep);
|
||||
|
||||
// we're not shutting down, we're starting up
|
||||
m_shutdownFlag = false;
|
||||
IsRunningInbound = true;
|
||||
|
||||
// kick off an async receive. The Start() method will return, the
|
||||
// actual receives will occur asynchronously and will be caught in
|
||||
@@ -138,28 +153,84 @@ namespace OpenMetaverse
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stops the UDP server
|
||||
/// Start outbound UDP packet handling.
|
||||
/// </summary>
|
||||
public void Stop()
|
||||
public void StartOutbound()
|
||||
{
|
||||
if (!m_shutdownFlag)
|
||||
IsRunningOutbound = true;
|
||||
}
|
||||
|
||||
public void StopInbound()
|
||||
{
|
||||
if (IsRunningInbound)
|
||||
{
|
||||
// wait indefinitely for a writer lock. Once this is called, the .NET runtime
|
||||
// will deny any more reader locks, in effect blocking all other send/receive
|
||||
// threads. Once we have the lock, we set shutdownFlag to inform the other
|
||||
// threads. Once we have the lock, we set IsRunningInbound = false to inform the other
|
||||
// threads that the socket is closed.
|
||||
m_shutdownFlag = true;
|
||||
IsRunningInbound = false;
|
||||
m_udpSocket.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public void StopOutbound()
|
||||
{
|
||||
IsRunningOutbound = false;
|
||||
}
|
||||
|
||||
protected virtual bool EnablePools()
|
||||
{
|
||||
if (!UsePools)
|
||||
{
|
||||
m_pool = new Pool<UDPPacketBuffer>(() => new UDPPacketBuffer(), 500);
|
||||
|
||||
m_poolCountStat
|
||||
= new Stat(
|
||||
"UDPPacketBufferPoolCount",
|
||||
"Objects within the UDPPacketBuffer pool",
|
||||
"The number of objects currently stored within the UDPPacketBuffer pool",
|
||||
"",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Pull,
|
||||
stat => stat.Value = m_pool.Count,
|
||||
StatVerbosity.Debug);
|
||||
|
||||
StatsManager.RegisterStat(m_poolCountStat);
|
||||
|
||||
UsePools = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual bool DisablePools()
|
||||
{
|
||||
if (UsePools)
|
||||
{
|
||||
UsePools = false;
|
||||
StatsManager.DeregisterStat(m_poolCountStat);
|
||||
|
||||
// We won't null out the pool to avoid a race condition with code that may be in the middle of using it.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void AsyncBeginReceive()
|
||||
{
|
||||
// allocate a packet buffer
|
||||
//WrappedObject<UDPPacketBuffer> wrappedBuffer = Pool.CheckOut();
|
||||
UDPPacketBuffer buf = new UDPPacketBuffer();
|
||||
UDPPacketBuffer buf;
|
||||
|
||||
if (!m_shutdownFlag)
|
||||
if (UsePools)
|
||||
buf = m_pool.GetObject();
|
||||
else
|
||||
buf = new UDPPacketBuffer();
|
||||
|
||||
if (IsRunningInbound)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -212,7 +283,7 @@ namespace OpenMetaverse
|
||||
{
|
||||
// Asynchronous receive operations will complete here through the call
|
||||
// to AsyncBeginReceive
|
||||
if (!m_shutdownFlag)
|
||||
if (IsRunningInbound)
|
||||
{
|
||||
// Asynchronous mode will start another receive before the
|
||||
// callback for this packet is even fired. Very parallel :-)
|
||||
@@ -221,8 +292,6 @@ namespace OpenMetaverse
|
||||
|
||||
// get the buffer that was created in AsyncBeginReceive
|
||||
// this is the received data
|
||||
//WrappedObject<UDPPacketBuffer> wrappedBuffer = (WrappedObject<UDPPacketBuffer>)iar.AsyncState;
|
||||
//UDPPacketBuffer buffer = wrappedBuffer.Instance;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)iar.AsyncState;
|
||||
|
||||
try
|
||||
@@ -239,7 +308,8 @@ namespace OpenMetaverse
|
||||
catch (ObjectDisposedException) { }
|
||||
finally
|
||||
{
|
||||
//wrappedBuffer.Dispose();
|
||||
if (UsePools)
|
||||
m_pool.ReturnObject(buffer);
|
||||
|
||||
// Synchronous mode waits until the packet callback completes
|
||||
// before starting the receive to fetch another packet
|
||||
@@ -252,7 +322,7 @@ namespace OpenMetaverse
|
||||
|
||||
public void AsyncBeginSend(UDPPacketBuffer buf)
|
||||
{
|
||||
if (!m_shutdownFlag)
|
||||
if (IsRunningOutbound)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -31,10 +31,10 @@ using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using log4net;
|
||||
using OpenSim.Framework.Monitoring;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
|
||||
public sealed class PacketPool
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -44,14 +44,32 @@ namespace OpenSim.Framework
|
||||
private bool packetPoolEnabled = true;
|
||||
private bool dataBlockPoolEnabled = true;
|
||||
|
||||
private PercentageStat m_packetsReusedStat = new PercentageStat(
|
||||
"PacketsReused",
|
||||
"Packets reused",
|
||||
"Number of packets reused out of all requests to the packet pool",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Push,
|
||||
null,
|
||||
StatVerbosity.Debug);
|
||||
|
||||
private PercentageStat m_blocksReusedStat = new PercentageStat(
|
||||
"PacketDataBlocksReused",
|
||||
"Packet data blocks reused",
|
||||
"Number of data blocks reused out of all requests to the packet pool",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Push,
|
||||
null,
|
||||
StatVerbosity.Debug);
|
||||
|
||||
/// <summary>
|
||||
/// Pool of packets available for reuse.
|
||||
/// </summary>
|
||||
private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>();
|
||||
|
||||
private static Dictionary<Type, Stack<Object>> DataBlocks =
|
||||
new Dictionary<Type, Stack<Object>>();
|
||||
|
||||
static PacketPool()
|
||||
{
|
||||
}
|
||||
private static Dictionary<Type, Stack<Object>> DataBlocks = new Dictionary<Type, Stack<Object>>();
|
||||
|
||||
public static PacketPool Instance
|
||||
{
|
||||
@@ -70,8 +88,45 @@ namespace OpenSim.Framework
|
||||
get { return dataBlockPoolEnabled; }
|
||||
}
|
||||
|
||||
private PacketPool()
|
||||
{
|
||||
StatsManager.RegisterStat(m_packetsReusedStat);
|
||||
StatsManager.RegisterStat(m_blocksReusedStat);
|
||||
|
||||
StatsManager.RegisterStat(
|
||||
new Stat(
|
||||
"PacketsPoolCount",
|
||||
"Objects within the packet pool",
|
||||
"The number of objects currently stored within the packet pool",
|
||||
"",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Pull,
|
||||
stat => { lock (pool) { stat.Value = pool.Count; } },
|
||||
StatVerbosity.Debug));
|
||||
|
||||
StatsManager.RegisterStat(
|
||||
new Stat(
|
||||
"PacketDataBlocksPoolCount",
|
||||
"Objects within the packet data block pool",
|
||||
"The number of objects currently stored within the packet data block pool",
|
||||
"",
|
||||
"clientstack",
|
||||
"packetpool",
|
||||
StatType.Pull,
|
||||
stat => { lock (DataBlocks) { stat.Value = DataBlocks.Count; } },
|
||||
StatVerbosity.Debug));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a packet of the given type.
|
||||
/// </summary>
|
||||
/// <param name='type'></param>
|
||||
/// <returns>Guaranteed to always return a packet, whether from the pool or newly constructed.</returns>
|
||||
public Packet GetPacket(PacketType type)
|
||||
{
|
||||
m_packetsReusedStat.Consequent++;
|
||||
|
||||
Packet packet;
|
||||
|
||||
if (!packetPoolEnabled)
|
||||
@@ -81,13 +136,19 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (!pool.ContainsKey(type) || pool[type] == null || (pool[type]).Count == 0)
|
||||
{
|
||||
// m_log.DebugFormat("[PACKETPOOL]: Building {0} packet", type);
|
||||
|
||||
// Creating a new packet if we cannot reuse an old package
|
||||
packet = Packet.BuildPacket(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
// m_log.DebugFormat("[PACKETPOOL]: Pulling {0} packet", type);
|
||||
|
||||
// Recycle old packages
|
||||
packet = (pool[type]).Pop();
|
||||
m_packetsReusedStat.Antecedent++;
|
||||
|
||||
packet = pool[type].Pop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +197,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
PacketType type = GetType(bytes);
|
||||
|
||||
Array.Clear(zeroBuffer, 0, zeroBuffer.Length);
|
||||
// Array.Clear(zeroBuffer, 0, zeroBuffer.Length);
|
||||
|
||||
int i = 0;
|
||||
Packet packet = GetPacket(type);
|
||||
@@ -183,6 +244,7 @@ namespace OpenSim.Framework
|
||||
switch (packet.Type)
|
||||
{
|
||||
// List pooling packets here
|
||||
case PacketType.AgentUpdate:
|
||||
case PacketType.PacketAck:
|
||||
case PacketType.ObjectUpdate:
|
||||
case PacketType.ImprovedTerseObjectUpdate:
|
||||
@@ -197,7 +259,9 @@ namespace OpenSim.Framework
|
||||
|
||||
if ((pool[type]).Count < 50)
|
||||
{
|
||||
(pool[type]).Push(packet);
|
||||
// m_log.DebugFormat("[PACKETPOOL]: Pushing {0} packet", type);
|
||||
|
||||
pool[type].Push(packet);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -209,16 +273,21 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public static T GetDataBlock<T>() where T: new()
|
||||
public T GetDataBlock<T>() where T: new()
|
||||
{
|
||||
lock (DataBlocks)
|
||||
{
|
||||
m_blocksReusedStat.Consequent++;
|
||||
|
||||
Stack<Object> s;
|
||||
|
||||
if (DataBlocks.TryGetValue(typeof(T), out s))
|
||||
{
|
||||
if (s.Count > 0)
|
||||
{
|
||||
m_blocksReusedStat.Antecedent++;
|
||||
return (T)s.Pop();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -229,7 +298,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReturnDataBlock<T>(T block) where T: new()
|
||||
public void ReturnDataBlock<T>(T block) where T: new()
|
||||
{
|
||||
if (block == null)
|
||||
return;
|
||||
@@ -244,4 +313,4 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
|
||||
/// This will contain basic tests for the LindenUDP client stack
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class BasicCircuitTests
|
||||
public class BasicCircuitTests : OpenSimTestCase
|
||||
{
|
||||
private Scene m_scene;
|
||||
private TestLLUDPServer m_udpServer;
|
||||
@@ -65,8 +65,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
public override void SetUp()
|
||||
{
|
||||
base.SetUp();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
}
|
||||
|
||||
@@ -143,7 +144,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
|
||||
public void TestAddClient()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// XmlConfigurator.Configure();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
AddUdpServer();
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.ClientStack
|
||||
|
||||
protected override void StartupSpecific()
|
||||
{
|
||||
SceneManager = new SceneManager();
|
||||
SceneManager = SceneManager.Instance;
|
||||
m_clientStackManager = CreateClientStackManager();
|
||||
|
||||
Initialize();
|
||||
|
||||
@@ -57,39 +57,36 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a xfer uploader if one does not already exist.
|
||||
/// Return the xfer uploader for the given transaction.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If an uploader does not already exist for this transaction then it is created, otherwise the existing
|
||||
/// uploader is returned.
|
||||
/// </remarks>
|
||||
/// <param name="transactionID"></param>
|
||||
/// <param name="assetID">
|
||||
/// We must transfer the new asset ID into the uploader on creation, otherwise
|
||||
/// we can see race conditions with other threads which can retrieve an item before it is updated with the new
|
||||
/// asset id.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// The xfer uploader requested. Null if one is already in existence.
|
||||
/// FIXME: This is a bizarre thing to do, and is probably meant to signal an error condition if multiple
|
||||
/// transfers are made. Needs to be corrected.
|
||||
/// </returns>
|
||||
public AssetXferUploader RequestXferUploader(UUID transactionID, UUID assetID)
|
||||
/// <returns>The asset xfer uploader</returns>
|
||||
public AssetXferUploader RequestXferUploader(UUID transactionID)
|
||||
{
|
||||
AssetXferUploader uploader;
|
||||
|
||||
lock (XferUploaders)
|
||||
{
|
||||
if (!XferUploaders.ContainsKey(transactionID))
|
||||
{
|
||||
AssetXferUploader uploader = new AssetXferUploader(this, m_Scene, assetID, m_dumpAssetsToFile);
|
||||
uploader = new AssetXferUploader(this, m_Scene, transactionID, m_dumpAssetsToFile);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[AGENT ASSETS TRANSACTIONS]: Adding asset xfer uploader {0} since it didn't previously exist", transactionID);
|
||||
|
||||
XferUploaders.Add(transactionID, uploader);
|
||||
|
||||
return uploader;
|
||||
}
|
||||
else
|
||||
{
|
||||
uploader = XferUploaders[transactionID];
|
||||
}
|
||||
}
|
||||
|
||||
m_log.WarnFormat("[AGENT ASSETS TRANSACTIONS]: Ignoring request for asset xfer uploader {0} since it already exists", transactionID);
|
||||
|
||||
return null;
|
||||
return uploader;
|
||||
}
|
||||
|
||||
public void HandleXfer(ulong xferID, uint packetID, byte[] data)
|
||||
@@ -151,115 +148,28 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
string description, string name, sbyte invType,
|
||||
sbyte type, byte wearableType, uint nextOwnerMask)
|
||||
{
|
||||
AssetXferUploader uploader = null;
|
||||
AssetXferUploader uploader = RequestXferUploader(transactionID);
|
||||
|
||||
lock (XferUploaders)
|
||||
{
|
||||
if (XferUploaders.ContainsKey(transactionID))
|
||||
uploader = XferUploaders[transactionID];
|
||||
}
|
||||
|
||||
if (uploader != null)
|
||||
uploader.RequestCreateInventoryItem(
|
||||
remoteClient, transactionID, folderID,
|
||||
callbackID, description, name, invType, type,
|
||||
wearableType, nextOwnerMask);
|
||||
else
|
||||
m_log.ErrorFormat(
|
||||
"[AGENT ASSET TRANSACTIONS]: Could not find uploader with transaction ID {0} when handling request to create inventory item {1} from {2}",
|
||||
transactionID, name, remoteClient.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an uploaded asset. If the data is successfully retrieved,
|
||||
/// the transaction will be removed.
|
||||
/// </summary>
|
||||
/// <param name="transactionID"></param>
|
||||
/// <returns>The asset if the upload has completed, null if it has not.</returns>
|
||||
private AssetBase GetTransactionAsset(UUID transactionID)
|
||||
{
|
||||
lock (XferUploaders)
|
||||
{
|
||||
if (XferUploaders.ContainsKey(transactionID))
|
||||
{
|
||||
AssetXferUploader uploader = XferUploaders[transactionID];
|
||||
AssetBase asset = uploader.GetAssetData();
|
||||
RemoveXferUploader(transactionID);
|
||||
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
uploader.RequestCreateInventoryItem(
|
||||
remoteClient, folderID, callbackID,
|
||||
description, name, invType, type, wearableType, nextOwnerMask);
|
||||
}
|
||||
|
||||
public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient,
|
||||
SceneObjectPart part, UUID transactionID,
|
||||
TaskInventoryItem item)
|
||||
{
|
||||
AssetXferUploader uploader = null;
|
||||
AssetXferUploader uploader = RequestXferUploader(transactionID);
|
||||
|
||||
lock (XferUploaders)
|
||||
{
|
||||
if (XferUploaders.ContainsKey(transactionID))
|
||||
uploader = XferUploaders[transactionID];
|
||||
}
|
||||
|
||||
if (uploader != null)
|
||||
{
|
||||
AssetBase asset = GetTransactionAsset(transactionID);
|
||||
|
||||
// Only legacy viewers use this, and they prefer CAPS, which
|
||||
// we have, so this really never runs.
|
||||
// Allow it, but only for "safe" types.
|
||||
if ((InventoryType)item.InvType != InventoryType.Notecard &&
|
||||
(InventoryType)item.InvType != InventoryType.LSL)
|
||||
return;
|
||||
|
||||
if (asset != null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[AGENT ASSETS TRANSACTIONS]: Updating item {0} in {1} for transaction {2}",
|
||||
// item.Name, part.Name, transactionID);
|
||||
|
||||
asset.FullID = UUID.Random();
|
||||
asset.Name = item.Name;
|
||||
asset.Description = item.Description;
|
||||
asset.Type = (sbyte)item.Type;
|
||||
item.AssetID = asset.FullID;
|
||||
|
||||
m_Scene.AssetService.Store(asset);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[AGENT ASSET TRANSACTIONS]: Could not find uploader with transaction ID {0} when handling request to update task inventory item {1} in {2}",
|
||||
transactionID, item.Name, part.Name);
|
||||
}
|
||||
uploader.RequestUpdateTaskInventoryItem(remoteClient, item);
|
||||
}
|
||||
|
||||
public void RequestUpdateInventoryItem(IClientAPI remoteClient,
|
||||
UUID transactionID, InventoryItemBase item)
|
||||
{
|
||||
AssetXferUploader uploader = null;
|
||||
AssetXferUploader uploader = RequestXferUploader(transactionID);
|
||||
|
||||
lock (XferUploaders)
|
||||
{
|
||||
if (XferUploaders.ContainsKey(transactionID))
|
||||
uploader = XferUploaders[transactionID];
|
||||
}
|
||||
|
||||
if (uploader != null)
|
||||
{
|
||||
uploader.RequestUpdateInventoryItem(remoteClient, transactionID, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[AGENT ASSET TRANSACTIONS]: Could not find uploader with transaction ID {0} when handling request to update inventory item {1} for {2}",
|
||||
transactionID, item.Name, remoteClient.Name);
|
||||
}
|
||||
uploader.RequestUpdateInventoryItem(remoteClient, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
private Dictionary<UUID, AgentAssetTransactions> AgentTransactions =
|
||||
new Dictionary<UUID, AgentAssetTransactions>();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region Region Module interface
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
IClientAPI remoteClient, SceneObjectPart part, UUID transactionID, TaskInventoryItem item)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[TRANSACTIONS MANAGER] Called HandleTaskItemUpdateFromTransaction with item {0} in {1} for {2} in {3}",
|
||||
"[ASSET TRANSACTION MODULE] Called HandleTaskItemUpdateFromTransaction with item {0} in {1} for {2} in {3}",
|
||||
item.Name, part.Name, remoteClient.Name, m_Scene.RegionInfo.RegionName);
|
||||
|
||||
AgentAssetTransactions transactions =
|
||||
@@ -274,13 +274,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
|
||||
AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId);
|
||||
AssetXferUploader uploader = transactions.RequestXferUploader(transaction, assetID);
|
||||
|
||||
if (uploader != null)
|
||||
{
|
||||
uploader.Initialise(remoteClient, assetID, transaction, type,
|
||||
data, storeLocal, tempFile);
|
||||
}
|
||||
AssetXferUploader uploader = transactions.RequestXferUploader(transaction);
|
||||
uploader.StartUpload(remoteClient, assetID, transaction, type, data, storeLocal, tempFile);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,39 +40,75 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Upload state.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// New -> Uploading -> Complete
|
||||
/// </remarks>
|
||||
private enum UploadState
|
||||
{
|
||||
New,
|
||||
Uploading,
|
||||
Complete
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reference to the object that holds this uploader. Used to remove ourselves from it's list if we
|
||||
/// are performing a delayed update.
|
||||
/// </summary>
|
||||
AgentAssetTransactions m_transactions;
|
||||
|
||||
private UploadState m_uploadState = UploadState.New;
|
||||
|
||||
private AssetBase m_asset;
|
||||
private UUID InventFolder = UUID.Zero;
|
||||
private sbyte invType = 0;
|
||||
|
||||
private bool m_createItem = false;
|
||||
private uint m_createItemCallback = 0;
|
||||
private bool m_updateItem = false;
|
||||
private bool m_createItem;
|
||||
private uint m_createItemCallback;
|
||||
|
||||
private bool m_updateItem;
|
||||
private InventoryItemBase m_updateItemData;
|
||||
|
||||
private bool m_updateTaskItem;
|
||||
private TaskInventoryItem m_updateTaskItemData;
|
||||
|
||||
private string m_description = String.Empty;
|
||||
private bool m_dumpAssetToFile;
|
||||
private bool m_finished = false;
|
||||
private string m_name = String.Empty;
|
||||
private bool m_storeLocal;
|
||||
// private bool m_storeLocal;
|
||||
private uint nextPerm = 0;
|
||||
private IClientAPI ourClient;
|
||||
private UUID TransactionID = UUID.Zero;
|
||||
|
||||
private UUID m_transactionID;
|
||||
|
||||
private sbyte type = 0;
|
||||
private byte wearableType = 0;
|
||||
public ulong XferID;
|
||||
private Scene m_Scene;
|
||||
|
||||
public AssetXferUploader(AgentAssetTransactions transactions, Scene scene, UUID assetID, bool dumpAssetToFile)
|
||||
/// <summary>
|
||||
/// AssetXferUploader constructor
|
||||
/// </summary>
|
||||
/// <param name='transactions'>/param>
|
||||
/// <param name='scene'></param>
|
||||
/// <param name='transactionID'></param>
|
||||
/// <param name='dumpAssetToFile'>
|
||||
/// If true then when the asset is uploaded it is dumped to a file with the format
|
||||
/// String.Format("{6}_{7}_{0:d2}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}.dat",
|
||||
/// now.Year, now.Month, now.Day, now.Hour, now.Minute,
|
||||
/// now.Second, m_asset.Name, m_asset.Type);
|
||||
/// for debugging purposes.
|
||||
/// </param>
|
||||
public AssetXferUploader(
|
||||
AgentAssetTransactions transactions, Scene scene, UUID transactionID, bool dumpAssetToFile)
|
||||
{
|
||||
m_asset = new AssetBase();
|
||||
|
||||
m_transactions = transactions;
|
||||
m_transactionID = transactionID;
|
||||
m_Scene = scene;
|
||||
m_asset = new AssetBase() { FullID = assetID };
|
||||
m_dumpAssetToFile = dumpAssetToFile;
|
||||
}
|
||||
|
||||
@@ -118,30 +154,50 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialise asset transfer from the client
|
||||
/// Start asset transfer from the client
|
||||
/// </summary>
|
||||
/// <param name="xferID"></param>
|
||||
/// <param name="packetID"></param>
|
||||
/// <param name="data"></param>
|
||||
public void Initialise(IClientAPI remoteClient, UUID assetID,
|
||||
UUID transaction, sbyte type, byte[] data, bool storeLocal,
|
||||
bool tempFile)
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="data">
|
||||
/// Optional data. If present then the asset is created immediately with this data
|
||||
/// rather than requesting an upload from the client. The data must be longer than 2 bytes.
|
||||
/// </param>
|
||||
/// <param name="storeLocal"></param>
|
||||
/// <param name="tempFile"></param>
|
||||
public void StartUpload(
|
||||
IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal,
|
||||
bool tempFile)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET XFER UPLOADER]: Initialised xfer from {0}, asset {1}, transaction {2}, type {3}, storeLocal {4}, tempFile {5}, already received data length {6}",
|
||||
// remoteClient.Name, assetID, transaction, type, storeLocal, tempFile, data.Length);
|
||||
|
||||
lock (this)
|
||||
{
|
||||
if (m_uploadState != UploadState.New)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[ASSET XFER UPLOADER]: Tried to start upload of asset {0}, transaction {1} for {2} but this is already in state {3}. Aborting.",
|
||||
assetID, transaction, remoteClient.Name, m_uploadState);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_uploadState = UploadState.Uploading;
|
||||
}
|
||||
|
||||
ourClient = remoteClient;
|
||||
m_asset.Name = "blank";
|
||||
m_asset.Description = "empty";
|
||||
|
||||
m_asset.FullID = assetID;
|
||||
m_asset.Type = type;
|
||||
m_asset.CreatorID = remoteClient.AgentId.ToString();
|
||||
m_asset.Data = data;
|
||||
m_asset.Local = storeLocal;
|
||||
m_asset.Temporary = tempFile;
|
||||
|
||||
TransactionID = transaction;
|
||||
m_storeLocal = storeLocal;
|
||||
// m_storeLocal = storeLocal;
|
||||
|
||||
if (m_asset.Data.Length > 2)
|
||||
{
|
||||
@@ -166,36 +222,35 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
|
||||
protected void SendCompleteMessage()
|
||||
{
|
||||
ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true,
|
||||
m_asset.FullID);
|
||||
|
||||
// We must lock in order to avoid a race with a separate thread dealing with an inventory item or create
|
||||
// message from other client UDP.
|
||||
lock (this)
|
||||
{
|
||||
m_finished = true;
|
||||
m_uploadState = UploadState.Complete;
|
||||
|
||||
ourClient.SendAssetUploadCompleteMessage(m_asset.Type, true, m_asset.FullID);
|
||||
|
||||
if (m_createItem)
|
||||
{
|
||||
DoCreateItem(m_createItemCallback);
|
||||
CompleteCreateItem(m_createItemCallback);
|
||||
}
|
||||
else if (m_updateItem)
|
||||
{
|
||||
StoreAssetForItemUpdate(m_updateItemData);
|
||||
|
||||
// Remove ourselves from the list of transactions if completion was delayed until the transaction
|
||||
// was complete.
|
||||
// TODO: Should probably do the same for create item.
|
||||
m_transactions.RemoveXferUploader(TransactionID);
|
||||
CompleteItemUpdate(m_updateItemData);
|
||||
}
|
||||
else if (m_storeLocal)
|
||||
else if (m_updateTaskItem)
|
||||
{
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
CompleteTaskItemUpdate(m_updateTaskItemData);
|
||||
}
|
||||
// else if (m_storeLocal)
|
||||
// {
|
||||
// m_Scene.AssetService.Store(m_asset);
|
||||
// }
|
||||
}
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ASSET XFER UPLOADER]: Uploaded asset {0} for transaction {1}",
|
||||
m_asset.FullID, TransactionID);
|
||||
m_asset.FullID, m_transactionID);
|
||||
|
||||
if (m_dumpAssetToFile)
|
||||
{
|
||||
@@ -223,40 +278,37 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
|
||||
public void RequestCreateInventoryItem(IClientAPI remoteClient,
|
||||
UUID transactionID, UUID folderID, uint callbackID,
|
||||
UUID folderID, uint callbackID,
|
||||
string description, string name, sbyte invType,
|
||||
sbyte type, byte wearableType, uint nextOwnerMask)
|
||||
{
|
||||
if (TransactionID == transactionID)
|
||||
{
|
||||
InventFolder = folderID;
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
this.type = type;
|
||||
this.invType = invType;
|
||||
this.wearableType = wearableType;
|
||||
nextPerm = nextOwnerMask;
|
||||
m_asset.Name = name;
|
||||
m_asset.Description = description;
|
||||
m_asset.Type = type;
|
||||
InventFolder = folderID;
|
||||
m_name = name;
|
||||
m_description = description;
|
||||
this.type = type;
|
||||
this.invType = invType;
|
||||
this.wearableType = wearableType;
|
||||
nextPerm = nextOwnerMask;
|
||||
m_asset.Name = name;
|
||||
m_asset.Description = description;
|
||||
m_asset.Type = type;
|
||||
|
||||
// We must lock to avoid a race with a separate thread uploading the asset.
|
||||
lock (this)
|
||||
// We must lock to avoid a race with a separate thread uploading the asset.
|
||||
lock (this)
|
||||
{
|
||||
if (m_uploadState == UploadState.Complete)
|
||||
{
|
||||
if (m_finished)
|
||||
{
|
||||
DoCreateItem(callbackID);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_createItem = true; //set flag so the inventory item is created when upload is complete
|
||||
m_createItemCallback = callbackID;
|
||||
}
|
||||
CompleteCreateItem(callbackID);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_createItem = true; //set flag so the inventory item is created when upload is complete
|
||||
m_createItemCallback = callbackID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestUpdateInventoryItem(IClientAPI remoteClient, UUID transactionID, InventoryItemBase item)
|
||||
public void RequestUpdateInventoryItem(IClientAPI remoteClient, InventoryItemBase item)
|
||||
{
|
||||
// We must lock to avoid a race with a separate thread uploading the asset.
|
||||
lock (this)
|
||||
@@ -271,9 +323,9 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
item.AssetID = m_asset.FullID;
|
||||
m_Scene.InventoryService.UpdateItem(item);
|
||||
|
||||
if (m_finished)
|
||||
if (m_uploadState == UploadState.Complete)
|
||||
{
|
||||
StoreAssetForItemUpdate(item);
|
||||
CompleteItemUpdate(item);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -287,20 +339,59 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
}
|
||||
}
|
||||
|
||||
public void RequestUpdateTaskInventoryItem(IClientAPI remoteClient, TaskInventoryItem taskItem)
|
||||
{
|
||||
// We must lock to avoid a race with a separate thread uploading the asset.
|
||||
lock (this)
|
||||
{
|
||||
m_asset.Name = taskItem.Name;
|
||||
m_asset.Description = taskItem.Description;
|
||||
m_asset.Type = (sbyte)taskItem.Type;
|
||||
taskItem.AssetID = m_asset.FullID;
|
||||
|
||||
if (m_uploadState == UploadState.Complete)
|
||||
{
|
||||
CompleteTaskItemUpdate(taskItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_updateTaskItem = true;
|
||||
m_updateTaskItemData = taskItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Store the asset for the given item.
|
||||
/// Store the asset for the given item when it has been uploaded.
|
||||
/// </summary>
|
||||
/// <param name="item"></param>
|
||||
private void StoreAssetForItemUpdate(InventoryItemBase item)
|
||||
private void CompleteItemUpdate(InventoryItemBase item)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET XFER UPLOADER]: Storing asset {0} for earlier item update for {1} for {2}",
|
||||
// m_asset.FullID, item.Name, ourClient.Name);
|
||||
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
|
||||
m_transactions.RemoveXferUploader(m_transactionID);
|
||||
}
|
||||
|
||||
private void DoCreateItem(uint callbackID)
|
||||
/// <summary>
|
||||
/// Store the asset for the given task item when it has been uploaded.
|
||||
/// </summary>
|
||||
/// <param name="taskItem"></param>
|
||||
private void CompleteTaskItemUpdate(TaskInventoryItem taskItem)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ASSET XFER UPLOADER]: Storing asset {0} for earlier task item update for {1} for {2}",
|
||||
// m_asset.FullID, taskItem.Name, ourClient.Name);
|
||||
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
|
||||
m_transactions.RemoveXferUploader(m_transactionID);
|
||||
}
|
||||
|
||||
private void CompleteCreateItem(uint callbackID)
|
||||
{
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
|
||||
@@ -326,20 +417,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
ourClient.SendInventoryItemCreateUpdate(item, callbackID);
|
||||
else
|
||||
ourClient.SendAlertMessage("Unable to create inventory item");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the asset data uploaded in this transfer.
|
||||
/// </summary>
|
||||
/// <returns>null if the asset has not finished uploading</returns>
|
||||
public AssetBase GetAssetData()
|
||||
{
|
||||
if (m_finished)
|
||||
{
|
||||
return m_asset;
|
||||
}
|
||||
|
||||
return null;
|
||||
m_transactions.RemoveXferUploader(m_transactionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,13 +36,17 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||
{
|
||||
public class IPBanModule : IRegionModule
|
||||
public class IPBanModule : ISharedRegionModule
|
||||
{
|
||||
#region Implementation of IRegionModule
|
||||
#region Implementation of ISharedRegionModule
|
||||
|
||||
private List<string> m_bans = new List<string>();
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
new SceneBanner(scene, m_bans);
|
||||
|
||||
@@ -50,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||
{
|
||||
foreach (EstateBan ban in scene.RegionInfo.EstateSettings.EstateBans)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(ban.BannedHostIPMask))
|
||||
if (!String.IsNullOrEmpty(ban.BannedHostIPMask))
|
||||
m_bans.Add(ban.BannedHostIPMask);
|
||||
if (!String.IsNullOrEmpty(ban.BannedHostNameMask))
|
||||
m_bans.Add(ban.BannedHostNameMask);
|
||||
@@ -58,6 +62,14 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (File.Exists("bans.txt"))
|
||||
@@ -80,9 +92,9 @@ namespace OpenSim.Region.CoreModules.Agent.IPBan
|
||||
get { return "IPBanModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
public delegate void J2KDecodeDelegate(UUID assetID);
|
||||
|
||||
public class J2KDecoderModule : IRegionModule, IJ2KDecoder
|
||||
public class J2KDecoderModule : ISharedRegionModule, IJ2KDecoder
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -55,27 +55,32 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
private readonly Dictionary<UUID, List<DecodedCallback>> m_notifyList = new Dictionary<UUID, List<DecodedCallback>>();
|
||||
/// <summary>Cache that will store decoded JPEG2000 layer boundary data</summary>
|
||||
private IImprovedAssetCache m_cache;
|
||||
private IImprovedAssetCache Cache
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_cache == null)
|
||||
m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
|
||||
|
||||
return m_cache;
|
||||
}
|
||||
}
|
||||
/// <summary>Reference to a scene (doesn't matter which one as long as it can load the cache module)</summary>
|
||||
private UUID m_CreatorID = UUID.Zero;
|
||||
private Scene m_scene;
|
||||
|
||||
#region IRegionModule
|
||||
#region ISharedRegionModule
|
||||
|
||||
private bool m_useCSJ2K = true;
|
||||
|
||||
public string Name { get { return "J2KDecoderModule"; } }
|
||||
public bool IsSharedModule { get { return true; } }
|
||||
|
||||
public J2KDecoderModule()
|
||||
{
|
||||
}
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IJ2KDecoder>(this);
|
||||
|
||||
IConfig startupConfig = source.Configs["Startup"];
|
||||
if (startupConfig != null)
|
||||
{
|
||||
@@ -83,16 +88,42 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_CreatorID = scene.RegionInfo.RegionID;
|
||||
}
|
||||
|
||||
scene.RegisterModuleInterface<IJ2KDecoder>(this);
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == scene)
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_cache = m_scene.RequestModuleInterface<IImprovedAssetCache>();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion IRegionModule
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion Region Module interface
|
||||
|
||||
#region IJ2KDecoder
|
||||
|
||||
@@ -275,11 +306,11 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
m_decodedCache.AddOrUpdate(AssetId, Layers, TimeSpan.FromMinutes(10));
|
||||
|
||||
if (m_cache != null)
|
||||
if (Cache != null)
|
||||
{
|
||||
string assetID = "j2kCache_" + AssetId.ToString();
|
||||
|
||||
AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_scene.RegionInfo.RegionID.ToString());
|
||||
AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_CreatorID.ToString());
|
||||
layerDecodeAsset.Local = true;
|
||||
layerDecodeAsset.Temporary = true;
|
||||
|
||||
@@ -299,7 +330,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
|
||||
#endregion Serialize Layer Data
|
||||
|
||||
m_cache.Cache(layerDecodeAsset);
|
||||
Cache.Cache(layerDecodeAsset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,10 +340,10 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (m_cache != null)
|
||||
else if (Cache != null)
|
||||
{
|
||||
string assetName = "j2kCache_" + AssetId.ToString();
|
||||
AssetBase layerDecodeAsset = m_cache.Get(assetName);
|
||||
AssetBase layerDecodeAsset = Cache.Get(assetName);
|
||||
|
||||
if (layerDecodeAsset != null)
|
||||
{
|
||||
@@ -324,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
if (lines.Length == 0)
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (empty) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -345,7 +376,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
catch (FormatException)
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (format) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -356,7 +387,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
|
||||
else
|
||||
{
|
||||
m_log.Warn("[J2KDecodeCache]: Expiring corrupted layer data (layout) " + assetName);
|
||||
m_cache.Expire(assetName);
|
||||
Cache.Expire(assetName);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,9 +35,12 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||
{
|
||||
public class XferModule : IRegionModule, IXfer
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XferModule")]
|
||||
public class XferModule : INonSharedRegionModule, IXfer
|
||||
{
|
||||
private Scene m_scene;
|
||||
private Dictionary<string, FileData> NewFiles = new Dictionary<string, FileData>();
|
||||
@@ -59,9 +62,13 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||
public int Count;
|
||||
}
|
||||
|
||||
#region IRegionModule Members
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.EventManager.OnNewClient += NewClient;
|
||||
@@ -69,8 +76,21 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||
m_scene.RegisterModuleInterface<IXfer>(this);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.EventManager.OnNewClient -= NewClient;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IXfer>(this);
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -82,11 +102,6 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||
get { return "XferModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IXfer Members
|
||||
|
||||
@@ -49,12 +49,12 @@ using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
|
||||
[assembly: Addin("FlotsamAssetCache", "1.1")]
|
||||
[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
//[assembly: Addin("FlotsamAssetCache", "1.1")]
|
||||
//[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
|
||||
namespace Flotsam.RegionModules.AssetCache
|
||||
namespace OpenSim.Region.CoreModules.Asset
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "FlotsamAssetCache")]
|
||||
public class FlotsamAssetCache : ISharedRegionModule, IImprovedAssetCache, IAssetService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
@@ -107,8 +107,6 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
private IAssetService m_AssetService;
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
|
||||
private bool m_DeepScanBeforePurge;
|
||||
|
||||
public FlotsamAssetCache()
|
||||
{
|
||||
m_InvalidChars.AddRange(Path.GetInvalidPathChars());
|
||||
@@ -170,8 +168,6 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
m_CacheDirectoryTierLen = assetConfig.GetInt("CacheDirectoryTierLength", m_CacheDirectoryTierLen);
|
||||
|
||||
m_CacheWarnAt = assetConfig.GetInt("CacheWarnAt", m_CacheWarnAt);
|
||||
|
||||
m_DeepScanBeforePurge = assetConfig.GetBoolean("DeepScanBeforePurge", m_DeepScanBeforePurge);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Cache Directory {0}", m_CacheDirectory);
|
||||
@@ -506,13 +502,10 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
// Purge all files last accessed prior to this point
|
||||
DateTime purgeLine = DateTime.Now - m_FileExpiration;
|
||||
|
||||
// An optional deep scan at this point will ensure assets present in scenes,
|
||||
// or referenced by objects in the scene, but not recently accessed
|
||||
// are not purged.
|
||||
if (m_DeepScanBeforePurge)
|
||||
{
|
||||
CacheScenes();
|
||||
}
|
||||
// An asset cache may contain local non-temporary assets that are not in the asset service. Therefore,
|
||||
// before cleaning up expired files we must scan the objects in the scene to make sure that we retain
|
||||
// such local assets if they have not been recently accessed.
|
||||
TouchAllSceneAssets(false);
|
||||
|
||||
foreach (string dir in Directory.GetDirectories(m_CacheDirectory))
|
||||
{
|
||||
@@ -705,11 +698,14 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
|
||||
/// <summary>
|
||||
/// Iterates through all Scenes, doing a deep scan through assets
|
||||
/// to cache all assets present in the scene or referenced by assets
|
||||
/// in the scene
|
||||
/// to update the access time of all assets present in the scene or referenced by assets
|
||||
/// in the scene.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private int CacheScenes()
|
||||
/// <param name="storeUncached">
|
||||
/// If true, then assets scanned which are not found in cache are added to the cache.
|
||||
/// </param>
|
||||
/// <returns>Number of distinct asset references found in the scene.</returns>
|
||||
private int TouchAllSceneAssets(bool storeUncached)
|
||||
{
|
||||
UuidGatherer gatherer = new UuidGatherer(m_AssetService);
|
||||
|
||||
@@ -732,7 +728,7 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
{
|
||||
File.SetLastAccessTime(filename, DateTime.Now);
|
||||
}
|
||||
else
|
||||
else if (storeUncached)
|
||||
{
|
||||
m_AssetService.Get(assetID.ToString());
|
||||
}
|
||||
@@ -860,13 +856,14 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "assets":
|
||||
m_log.Info("[FLOTSAM ASSET CACHE]: Caching all assets, in all scenes.");
|
||||
m_log.Info("[FLOTSAM ASSET CACHE]: Ensuring assets are cached for all scenes.");
|
||||
|
||||
Util.FireAndForget(delegate {
|
||||
int assetsCached = CacheScenes();
|
||||
m_log.InfoFormat("[FLOTSAM ASSET CACHE]: Completed Scene Caching, {0} assets found.", assetsCached);
|
||||
int assetReferenceTotal = TouchAllSceneAssets(true);
|
||||
m_log.InfoFormat(
|
||||
"[FLOTSAM ASSET CACHE]: Completed check with {0} assets.",
|
||||
assetReferenceTotal);
|
||||
});
|
||||
|
||||
break;
|
||||
|
||||
@@ -35,7 +35,6 @@ using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Assets;
|
||||
using Flotsam.RegionModules.AssetCache;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
|
||||
@@ -238,8 +238,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
sp.ClearAttachments();
|
||||
}
|
||||
|
||||
|
||||
public bool AttachObject(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool temp)
|
||||
{
|
||||
if (!Enabled)
|
||||
return false;
|
||||
|
||||
if (AttachObjectInternal(sp, group, attachmentPt, silent, temp))
|
||||
{
|
||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, group.FromItemID, sp.UUID);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool AttachObjectInternal(IScenePresence sp, SceneObjectGroup group, uint attachmentPt, bool silent, bool temp)
|
||||
{
|
||||
lock (sp.AttachmentsSyncLock)
|
||||
{
|
||||
@@ -392,6 +406,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
public void DetachSingleAttachmentToGround(IScenePresence sp, uint soLocalId)
|
||||
{
|
||||
DetachSingleAttachmentToGround(sp, soLocalId, sp.AbsolutePosition, Quaternion.Identity);
|
||||
}
|
||||
|
||||
public void DetachSingleAttachmentToGround(IScenePresence sp, uint soLocalId, Vector3 absolutePos, Quaternion absoluteRot)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
@@ -434,7 +453,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
so.FromItemID = UUID.Zero;
|
||||
|
||||
SceneObjectPart rootPart = so.RootPart;
|
||||
so.AbsolutePosition = sp.AbsolutePosition;
|
||||
so.AbsolutePosition = absolutePos;
|
||||
if (absoluteRot != Quaternion.Identity)
|
||||
{
|
||||
so.UpdateGroupRotationR(absoluteRot);
|
||||
}
|
||||
so.AttachedAvatar = UUID.Zero;
|
||||
rootPart.SetParentLocalId(0);
|
||||
so.ClearPartAttachmentData();
|
||||
@@ -548,9 +571,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
if (grp.HasGroupChanged)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
||||
// grp.UUID, grp.AttachmentPoint);
|
||||
m_log.DebugFormat(
|
||||
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
||||
grp.UUID, grp.AttachmentPoint);
|
||||
|
||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, scriptedState);
|
||||
|
||||
@@ -794,7 +817,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
// This will throw if the attachment fails
|
||||
try
|
||||
{
|
||||
AttachObject(sp, objatt, attachmentPt, false, false);
|
||||
AttachObjectInternal(sp, objatt, attachmentPt, false, false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -859,6 +882,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, sp.UUID);
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
bool changed = sp.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID);
|
||||
if (changed && m_scene.AvatarFactory != null)
|
||||
{
|
||||
@@ -948,15 +974,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
AttachmentPt &= 0x7f;
|
||||
|
||||
// Calls attach with a Zero position
|
||||
if (AttachObject(sp, part.ParentGroup, AttachmentPt, false, false))
|
||||
{
|
||||
// m_log.Debug(
|
||||
// "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
||||
// + ", AttachmentPoint: " + AttachmentPt);
|
||||
|
||||
// Save avatar attachment information
|
||||
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId);
|
||||
}
|
||||
AttachObject(sp, part.ParentGroup, AttachmentPt, false, false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
public class AttachmentsModuleTests : OpenSimTestCase
|
||||
{
|
||||
private AutoResetEvent m_chatEvent = new AutoResetEvent(false);
|
||||
private OSChatMessage m_osChatMessageReceived;
|
||||
// private OSChatMessage m_osChatMessageReceived;
|
||||
|
||||
// Used to test whether the operations have fired the attach event. Must be reset after each test.
|
||||
private int m_numberOfAttachEventsFired;
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void FixtureInit()
|
||||
@@ -83,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
{
|
||||
// Console.WriteLine("Got chat [{0}]", oscm.Message);
|
||||
|
||||
m_osChatMessageReceived = oscm;
|
||||
// m_osChatMessageReceived = oscm;
|
||||
m_chatEvent.Set();
|
||||
}
|
||||
|
||||
@@ -99,6 +102,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
"attachments-test-scene", TestHelpers.ParseTail(999), 1000, 1000, config);
|
||||
SceneHelpers.SetupSceneModules(scene, config, modules.ToArray());
|
||||
|
||||
scene.EventManager.OnAttach += (localID, itemID, avatarID) => m_numberOfAttachEventsFired++;
|
||||
|
||||
return scene;
|
||||
}
|
||||
|
||||
@@ -181,6 +186,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
|
||||
Scene scene = CreateTestScene();
|
||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
|
||||
ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
|
||||
@@ -189,6 +196,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName, sp.UUID);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.AttachmentsModule.AttachObject(sp, so, (uint)AttachmentPoint.Chest, false, false);
|
||||
|
||||
// Check status on scene presence
|
||||
@@ -216,7 +224,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
|
||||
|
||||
// TestHelpers.DisableLogging();
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -228,6 +237,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
TestHelpers.InMethod();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
|
||||
Scene scene = CreateTestScene();
|
||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(scene, 0x1);
|
||||
ScenePresence sp = SceneHelpers.AddScenePresence(scene, ua1);
|
||||
@@ -247,6 +258,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
Assert.That(sp.HasAttachments(), Is.False);
|
||||
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -261,6 +275,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
InventoryItemBase attItem = CreateAttachmentItem(scene, ua1.PrincipalID, "att", 0x10, 0x20);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.AttachmentsModule.RezSingleAttachmentFromInventory(
|
||||
sp, attItem.ID, (uint)AttachmentPoint.Chest);
|
||||
|
||||
@@ -280,6 +295,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
Assert.That(sp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((int)AttachmentPoint.Chest));
|
||||
|
||||
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -338,6 +356,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
ISceneEntity so
|
||||
= scene.AttachmentsModule.RezSingleAttachmentFromInventory(
|
||||
sp, attItem.ID, (uint)AttachmentPoint.Chest);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.AttachmentsModule.DetachSingleAttachmentToGround(sp, so.LocalId);
|
||||
|
||||
// Check scene presence status
|
||||
@@ -353,6 +373,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
// Check object in scene
|
||||
Assert.That(scene.GetSceneObjectGroup("att"), Is.Not.Null);
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -369,6 +392,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
SceneObjectGroup so
|
||||
= (SceneObjectGroup)scene.AttachmentsModule.RezSingleAttachmentFromInventory(
|
||||
sp, attItem.ID, (uint)AttachmentPoint.Chest);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.AttachmentsModule.DetachSingleAttachmentToInv(sp, so);
|
||||
|
||||
// Check status on scene presence
|
||||
@@ -380,6 +405,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
Assert.That(sp.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo(0));
|
||||
|
||||
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(0));
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -461,10 +489,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
SceneObjectGroup rezzedAtt = presence.GetAttachments()[0];
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.IncomingCloseAgent(presence.UUID, false);
|
||||
|
||||
// Check that we can't retrieve this attachment from the scene.
|
||||
Assert.That(scene.GetSceneObjectGroup(rezzedAtt.UUID), Is.Null);
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -480,6 +512,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
|
||||
acd.Appearance = new AvatarAppearance();
|
||||
acd.Appearance.SetAttachment((int)AttachmentPoint.Chest, attItem.ID, attItem.AssetID);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
ScenePresence presence = SceneHelpers.AddScenePresence(scene, acd);
|
||||
|
||||
Assert.That(presence.HasAttachments(), Is.True);
|
||||
@@ -502,6 +536,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
Assert.That(presence.Appearance.GetAttachpoint(attItem.ID), Is.EqualTo((int)AttachmentPoint.Chest));
|
||||
|
||||
Assert.That(scene.GetSceneObjectGroups().Count, Is.EqualTo(1));
|
||||
|
||||
// Check events. We expect OnAttach to fire on login.
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(1));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -522,10 +559,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
|
||||
Vector3 newPosition = new Vector3(1, 2, 4);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
scene.SceneGraph.UpdatePrimGroupPosition(attSo.LocalId, newPosition, sp.ControllingClient);
|
||||
|
||||
Assert.That(attSo.AbsolutePosition, Is.EqualTo(sp.AbsolutePosition));
|
||||
Assert.That(attSo.RootPart.AttachedPos, Is.EqualTo(newPosition));
|
||||
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -574,6 +615,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||
|
||||
m_numberOfAttachEventsFired = 0;
|
||||
sceneA.RequestTeleportLocation(
|
||||
beforeTeleportSp.ControllingClient,
|
||||
sceneB.RegionInfo.RegionHandle,
|
||||
@@ -616,29 +658,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
Assert.That(actualSceneAAttachments.Count, Is.EqualTo(0));
|
||||
|
||||
Assert.That(sceneA.GetSceneObjectGroups().Count, Is.EqualTo(0));
|
||||
}
|
||||
|
||||
// I'm commenting this test because scene setup NEEDS InventoryService to
|
||||
// be non-null
|
||||
//[Test]
|
||||
// public void T032_CrossAttachments()
|
||||
// {
|
||||
// TestHelpers.InMethod();
|
||||
//
|
||||
// ScenePresence presence = scene.GetScenePresence(agent1);
|
||||
// ScenePresence presence2 = scene2.GetScenePresence(agent1);
|
||||
// presence2.AddAttachment(sog1);
|
||||
// presence2.AddAttachment(sog2);
|
||||
//
|
||||
// ISharedRegionModule serialiser = new SerialiserModule();
|
||||
// SceneHelpers.SetupSceneModules(scene, new IniConfigSource(), serialiser);
|
||||
// SceneHelpers.SetupSceneModules(scene2, new IniConfigSource(), serialiser);
|
||||
//
|
||||
// Assert.That(presence.HasAttachments(), Is.False, "Presence has attachments before cross");
|
||||
//
|
||||
// //Assert.That(presence2.CrossAttachmentsIntoNewRegion(region1, true), Is.True, "Cross was not successful");
|
||||
// Assert.That(presence2.HasAttachments(), Is.False, "Presence2 objects were not deleted");
|
||||
// Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects");
|
||||
// }
|
||||
// Check events
|
||||
Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,9 +39,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AvatarFactoryModule")]
|
||||
public class AvatarFactoryModule : IAvatarFactoryModule, INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -59,12 +62,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
private object m_setAppearanceLock = new object();
|
||||
|
||||
#region IRegionModule
|
||||
#region Region Module interface
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
|
||||
IConfig appearanceConfig = config.Configs["Appearance"];
|
||||
if (appearanceConfig != null)
|
||||
@@ -74,11 +75,29 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
|
||||
}
|
||||
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
m_scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (scene == m_scene)
|
||||
{
|
||||
scene.UnregisterModuleInterface<IAvatarFactoryModule>(this);
|
||||
scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
m_updateTimer.Enabled = false;
|
||||
m_updateTimer.AutoReset = true;
|
||||
@@ -100,6 +119,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
private void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnRequestWearables += Client_OnRequestWearables;
|
||||
@@ -525,7 +550,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
{
|
||||
for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
|
||||
{
|
||||
for (int j = 0; j < appearance.Wearables[j].Count; j++)
|
||||
for (int j = 0; j < appearance.Wearables[i].Count; j++)
|
||||
{
|
||||
if (appearance.Wearables[i][j].ItemID == UUID.Zero)
|
||||
continue;
|
||||
@@ -533,6 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// Ignore ruth's assets
|
||||
if (appearance.Wearables[i][j].ItemID == AvatarWearable.DefaultWearables[i][0].ItemID)
|
||||
continue;
|
||||
|
||||
InventoryItemBase baseItem = new InventoryItemBase(appearance.Wearables[i][j].ItemID, userID);
|
||||
baseItem = invService.GetItem(baseItem);
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
{
|
||||
string fromName = c.From;
|
||||
UUID fromID = UUID.Zero;
|
||||
UUID ownerID = UUID.Zero;
|
||||
UUID targetID = c.TargetUUID;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
@@ -208,12 +209,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
fromPos = avatar.AbsolutePosition;
|
||||
fromName = avatar.Name;
|
||||
fromID = c.Sender.AgentId;
|
||||
ownerID = c.Sender.AgentId;
|
||||
|
||||
break;
|
||||
|
||||
case ChatSourceType.Object:
|
||||
fromID = c.SenderUUID;
|
||||
|
||||
if (c.SenderObject != null && c.SenderObject is SceneObjectPart)
|
||||
ownerID = ((SceneObjectPart)c.SenderObject).OwnerID;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -236,7 +241,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachRootScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType, false))
|
||||
if (TrySendChatMessage(
|
||||
presence, fromPos, regionPos, fromID, ownerID, fromName, c.Type, message, sourceType, false))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
);
|
||||
@@ -248,8 +254,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
ScenePresence presence = s.GetScenePresence(targetID);
|
||||
if (presence != null && !presence.IsChildAgent)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, ChatTypeEnum.Say, message, sourceType, true))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
if (TrySendChatMessage(
|
||||
presence, fromPos, regionPos, fromID, ownerID, fromName, ChatTypeEnum.Say, message, sourceType, true))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -305,9 +312,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
|
||||
client.SendChatMessage(
|
||||
c.Message, (byte)cType, CenterOfRegion, fromName, fromID, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
|
||||
receiverIDs.Add(client.AgentId);
|
||||
});
|
||||
|
||||
@@ -322,15 +331,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
/// <param name="fromPos"></param>
|
||||
/// <param name="regionPos">/param>
|
||||
/// <param name="fromAgentID"></param>
|
||||
/// <param name='ownerID'>
|
||||
/// Owner of the message. For at least some messages from objects, this has to be correctly filled with the owner's UUID.
|
||||
/// This is the case for script error messages in viewer 3 since LLViewer change EXT-7762
|
||||
/// </param>
|
||||
/// <param name="fromName"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="src"></param>
|
||||
/// <returns>true if the message was sent to the receiver, false if it was not sent due to failing a
|
||||
/// precondition</returns>
|
||||
protected virtual bool TrySendChatMessage(ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
|
||||
UUID fromAgentID, string fromName, ChatTypeEnum type,
|
||||
string message, ChatSourceType src, bool ignoreDistance)
|
||||
protected virtual bool TrySendChatMessage(
|
||||
ScenePresence presence, Vector3 fromPos, Vector3 regionPos,
|
||||
UUID fromAgentID, UUID ownerID, string fromName, ChatTypeEnum type,
|
||||
string message, ChatSourceType src, bool ignoreDistance)
|
||||
{
|
||||
// don't send stuff to child agents
|
||||
if (presence.IsChildAgent) return false;
|
||||
@@ -353,10 +367,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// TODO: should change so the message is sent through the avatar rather than direct to the ClientView
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
fromAgentID, (byte)src, (byte)ChatAudibleLevel.Fully);
|
||||
presence.ControllingClient.SendChatMessage(
|
||||
message, (byte) type, fromPos, fromName,
|
||||
fromAgentID, ownerID, (byte)src, (byte)ChatAudibleLevel.Fully);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,9 +33,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenMetaverse;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
{
|
||||
public class CombatModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CombatModule")]
|
||||
public class CombatModule : ISharedRegionModule
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -54,7 +57,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="config"></param>
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
lock (m_scenel)
|
||||
{
|
||||
@@ -72,6 +79,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
scene.EventManager.OnAvatarEnteringNewParcel += AvatarEnteringParcel;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_scenel.ContainsKey(scene.RegionInfo.RegionHandle))
|
||||
m_scenel.Remove(scene.RegionInfo.RegionHandle);
|
||||
|
||||
scene.EventManager.OnAvatarKilled -= KillAvatar;
|
||||
scene.EventManager.OnAvatarEnteringNewParcel -= AvatarEnteringParcel;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
@@ -85,11 +105,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||
get { return "CombatModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
|
||||
private void KillAvatar(uint killerObjectLocalID, ScenePresence deadAvatar)
|
||||
{
|
||||
string deadAvatarMessage;
|
||||
|
||||
@@ -32,6 +32,7 @@ using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Addins;
|
||||
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
@@ -39,16 +40,27 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
public class DialogModule : IRegionModule, IDialogModule
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DialogModule")]
|
||||
public class DialogModule : IDialogModule, INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
|
||||
public void Initialise(IConfigSource source) { }
|
||||
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Users", this, "alert", "alert <message>",
|
||||
@@ -56,46 +68,59 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Users", this, "alert-user", "alert-user <first> <last> <message>",
|
||||
"Users", this, "alert-user",
|
||||
"alert-user <first> <last> <message>",
|
||||
"Send an alert to a user",
|
||||
HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void Close() { }
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
{
|
||||
SendAlertToUser(client, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message, bool modal)
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message,
|
||||
bool modal)
|
||||
{
|
||||
client.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message)
|
||||
{
|
||||
SendAlertToUser(agentID, message, false);
|
||||
}
|
||||
|
||||
|
||||
public void SendAlertToUser(UUID agentID, string message, bool modal)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName,
|
||||
string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName,
|
||||
lastName);
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
{
|
||||
presence.ControllingClient.SendAgentAlertMessage(message,
|
||||
modal);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
{
|
||||
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||
@@ -104,11 +129,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
});
|
||||
}
|
||||
|
||||
public void SendDialogToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
|
||||
string message, UUID textureID, int ch, string[] buttonlabels)
|
||||
public void SendDialogToUser(UUID avatarID, string objectName,
|
||||
UUID objectID, UUID ownerID, string message, UUID textureID,
|
||||
int ch, string[] buttonlabels)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerID);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
@@ -123,29 +149,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(
|
||||
objectName, objectID, ownerID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
{
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerID,
|
||||
ownerFirstName, ownerLastName, message, textureID, ch,
|
||||
buttonlabels);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendUrlToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||
public void SendUrlToUser(UUID avatarID, string objectName,
|
||||
UUID objectID, UUID ownerID, bool groupOwned, string message,
|
||||
string url)
|
||||
{
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
|
||||
{
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID,
|
||||
ownerID, groupOwned, message, url);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message,
|
||||
int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerid);
|
||||
string ownerFirstName, ownerLastName;
|
||||
UUID ownerID = UUID.Zero;
|
||||
UUID ownerID = UUID.Zero;
|
||||
if (account != null)
|
||||
{
|
||||
ownerFirstName = account.FirstName;
|
||||
ownerLastName = account.LastName;
|
||||
ownerID = account.PrincipalID;
|
||||
ownerID = account.PrincipalID;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -154,29 +189,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
}
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerID, ownerFirstName, ownerLastName, objectid);
|
||||
{
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel,
|
||||
name, ownerID, ownerFirstName, ownerLastName,
|
||||
objectid);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
public void SendNotificationToUsersInRegion(UUID fromAvatarID,
|
||||
string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||
{
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName,
|
||||
message);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Handle an alert command from the console.
|
||||
/// </summary>
|
||||
/// <param name="module"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
|
||||
public void HandleAlertConsoleCommand(string module,
|
||||
string[] cmdparams)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
|
||||
if (m_scene.ConsoleScene() != null &&
|
||||
m_scene.ConsoleScene() != m_scene)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string message = string.Empty;
|
||||
|
||||
@@ -184,7 +228,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
message = CombineParams(cmdparams, 1);
|
||||
m_log.InfoFormat("[DIALOG]: Sending general alert in region {0} with message {1}",
|
||||
m_scene.RegionInfo.RegionName, message);
|
||||
m_scene.RegionInfo.RegionName, message);
|
||||
SendGeneralAlert(message);
|
||||
}
|
||||
else if (cmdparams.Length > 3)
|
||||
@@ -192,9 +236,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
string firstName = cmdparams[1];
|
||||
string lastName = cmdparams[2];
|
||||
message = CombineParams(cmdparams, 3);
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName, message);
|
||||
m_log.InfoFormat("[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName,
|
||||
message);
|
||||
SendAlertToUser(firstName, lastName, message, false);
|
||||
}
|
||||
else
|
||||
@@ -212,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
{
|
||||
result += commandParams[i] + " ";
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
client.FirstName+" "+client.LastName,
|
||||
destID, (byte)211, false,
|
||||
String.Empty,
|
||||
transactionID, false, new Vector3(), new byte[0]),
|
||||
transactionID, false, new Vector3(), new byte[0], true),
|
||||
delegate(bool success) {} );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
@@ -482,9 +483,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
Util.FireAndForget(
|
||||
delegate
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
|
||||
friendList.Count, agentID, online);
|
||||
// m_log.DebugFormat(
|
||||
// "[FRIENDS MODULE]: Notifying {0} friends of {1} of online status {2}",
|
||||
// friendList.Count, agentID, online);
|
||||
|
||||
// Notify about this user status
|
||||
StatusNotify(friendList, agentID, online);
|
||||
@@ -495,42 +496,36 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
protected virtual void StatusNotify(List<FriendInfo> friendList, UUID userID, bool online)
|
||||
{
|
||||
foreach (FriendInfo friend in friendList)
|
||||
List<string> friendStringIds = friendList.ConvertAll<string>(friend => friend.Friend);
|
||||
List<string> remoteFriendStringIds = new List<string>();
|
||||
foreach (string friendStringId in friendStringIds)
|
||||
{
|
||||
UUID friendID;
|
||||
if (UUID.TryParse(friend.Friend, out friendID))
|
||||
UUID friendUuid;
|
||||
if (UUID.TryParse(friendStringId, out friendUuid))
|
||||
{
|
||||
// Try local
|
||||
if (LocalStatusNotification(userID, friendID, online))
|
||||
if (LocalStatusNotification(userID, friendUuid, online))
|
||||
continue;
|
||||
|
||||
// The friend is not here [as root]. Let's forward.
|
||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||
if (friendSessions != null && friendSessions.Length > 0)
|
||||
{
|
||||
PresenceInfo friendSession = null;
|
||||
foreach (PresenceInfo pinfo in friendSessions)
|
||||
{
|
||||
if (pinfo.RegionID != UUID.Zero) // let's guard against sessions-gone-bad
|
||||
{
|
||||
friendSession = pinfo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (friendSession != null)
|
||||
{
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
//m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName);
|
||||
m_FriendsSimConnector.StatusNotify(region, userID, friendID, online);
|
||||
}
|
||||
}
|
||||
|
||||
// Friend is not online. Ignore.
|
||||
remoteFriendStringIds.Add(friendStringId);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friend.Friend);
|
||||
m_log.WarnFormat("[FRIENDS]: Error parsing friend ID {0}", friendStringId);
|
||||
}
|
||||
}
|
||||
|
||||
// We do this regrouping so that we can efficiently send a single request rather than one for each
|
||||
// friend in what may be a very large friends list.
|
||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(remoteFriendStringIds.ToArray());
|
||||
|
||||
foreach (PresenceInfo friendSession in friendSessions)
|
||||
{
|
||||
// let's guard against sessions-gone-bad
|
||||
if (friendSession.RegionID != UUID.Zero)
|
||||
{
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
//m_log.DebugFormat("[FRIENDS]: Remote Notify to region {0}", region.RegionName);
|
||||
m_FriendsSimConnector.StatusNotify(region, userID, friendSession.UserID, online);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
@@ -35,26 +36,46 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gestures
|
||||
{
|
||||
public class GesturesModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GesturesModule")]
|
||||
public class GesturesModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Scene m_scene;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
|
||||
m_scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.EventManager.OnNewClient -= OnNewClient;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gestures Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnActivateGesture += ActivateGesture;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -32,29 +33,59 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
{
|
||||
public class GodsModule : IRegionModule, IGodsModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GodsModule")]
|
||||
public class GodsModule : INonSharedRegionModule, IGodsModule
|
||||
{
|
||||
/// <summary>Special UUID for actions that apply to all agents</summary>
|
||||
private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
|
||||
|
||||
protected Scene m_scene;
|
||||
protected IDialogModule m_dialogModule;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
protected IDialogModule DialogModule
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_dialogModule == null)
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
|
||||
return m_dialogModule;
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
m_scene.UnregisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient -= SubscribeToClientEvents;
|
||||
m_scene = null;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close() {}
|
||||
public string Name { get { return "Gods Module"; } }
|
||||
public bool IsSharedModule { get { return false; } }
|
||||
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void SubscribeToClientEvents(IClientAPI client)
|
||||
{
|
||||
client.OnGodKickUser += KickUser;
|
||||
@@ -96,8 +127,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(agentID, "Request for god powers denied");
|
||||
if (DialogModule != null)
|
||||
DialogModule.SendAlertToUser(agentID, "Request for god powers denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,20 +193,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
if (kickflags == 1)
|
||||
{
|
||||
sp.AllowMovement = false;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Frozen");
|
||||
if (DialogModule != null)
|
||||
{
|
||||
DialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
DialogModule.SendAlertToUser(godID, "User Frozen");
|
||||
}
|
||||
}
|
||||
|
||||
if (kickflags == 2)
|
||||
{
|
||||
sp.AllowMovement = true;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
|
||||
if (DialogModule != null)
|
||||
{
|
||||
DialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
DialogModule.SendAlertToUser(godID, "User Unfrozen");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(godID, "Kick request denied");
|
||||
if (DialogModule != null)
|
||||
DialogModule.SendAlertToUser(godID, "Kick request denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
@@ -34,9 +35,12 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
{
|
||||
public class GroupsModule : IRegionModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "GroupsModule")]
|
||||
public class GroupsModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -55,9 +59,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
private static GroupMembershipData osGroup =
|
||||
new GroupMembershipData();
|
||||
|
||||
#region IRegionModule Members
|
||||
private bool m_Enabled = false;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource config)
|
||||
#region ISharedRegionModule Members
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig groupsConfig = config.Configs["Groups"];
|
||||
|
||||
@@ -67,7 +73,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!groupsConfig.GetBoolean("Enabled", false))
|
||||
m_Enabled = groupsConfig.GetBoolean("Enabled", false);
|
||||
if (!m_Enabled)
|
||||
{
|
||||
m_log.Info("[GROUPS]: Groups disabled in configuration");
|
||||
return;
|
||||
@@ -77,6 +84,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (!m_SceneList.Contains(scene))
|
||||
@@ -96,7 +110,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
// scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
// scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
lock (m_SceneList)
|
||||
{
|
||||
if (m_SceneList.Contains(scene))
|
||||
m_SceneList.Remove(scene);
|
||||
}
|
||||
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= OnClientClosed;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
@@ -105,6 +138,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
// m_log.Debug("[GROUPS]: Shutting down group module.");
|
||||
|
||||
lock (m_ClientMap)
|
||||
@@ -123,9 +159,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
|
||||
get { return "GroupsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return true; }
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -48,7 +48,7 @@ using OpenSim.Server.Handlers.Hypergrid;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGMessageTransferModule")]
|
||||
public class HGMessageTransferModule : ISharedRegionModule, IMessageTransferModule, IInstantMessageSimConnector
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
#region IRegionModule Members
|
||||
#region Region Module interface
|
||||
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
if (options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat(
|
||||
"[INVENTORY ARCHIVER]: Saving item {0} {1} with asset {2}",
|
||||
"[INVENTORY ARCHIVER]: Saving item {0} {1} (asset UUID {2})",
|
||||
inventoryItem.ID, inventoryItem.Name, inventoryItem.AssetID);
|
||||
|
||||
string filename = path + CreateArchiveItemName(inventoryItem);
|
||||
@@ -337,11 +337,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
m_log.DebugFormat("[INVENTORY ARCHIVER]: Saving {0} assets for items", m_assetUuids.Count);
|
||||
|
||||
new AssetsRequest(
|
||||
new AssetsArchiver(m_archiveWriter),
|
||||
m_assetUuids, m_scene.AssetService,
|
||||
m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
|
||||
options, ReceivedAllAssets).Execute();
|
||||
AssetsRequest ar
|
||||
= new AssetsRequest(
|
||||
new AssetsArchiver(m_archiveWriter),
|
||||
m_assetUuids, m_scene.AssetService,
|
||||
m_scene.UserAccountService, m_scene.RegionInfo.ScopeID,
|
||||
options, ReceivedAllAssets);
|
||||
|
||||
Util.FireAndForget(o => ar.Execute());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -35,23 +35,22 @@ using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Mono.Addins;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
/// <summary>
|
||||
/// This module loads and saves OpenSimulator inventory archives
|
||||
/// </summary>
|
||||
public class InventoryArchiverModule : IRegionModule, IInventoryArchiverModule
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "InventoryArchiverModule")]
|
||||
public class InventoryArchiverModule : ISharedRegionModule, IInventoryArchiverModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public string Name { get { return "Inventory Archiver Module"; } }
|
||||
|
||||
public bool IsSharedModule { get { return true; } }
|
||||
|
||||
/// <value>
|
||||
/// Enable or disable checking whether the iar user is actually logged in
|
||||
/// </value>
|
||||
@@ -98,9 +97,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
// public InventoryArchiverModule(bool disablePresenceChecks)
|
||||
// {
|
||||
// DisablePresenceChecks = disablePresenceChecks;
|
||||
// }
|
||||
// }
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
#region ISharedRegionModule
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scenes.Count == 0)
|
||||
{
|
||||
@@ -143,10 +148,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_scenes[scene.RegionInfo.RegionID] = scene;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close() {}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public string Name { get { return "Inventory Archiver Module"; } }
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the inventory archive saved event.
|
||||
/// </summary>
|
||||
@@ -209,6 +233,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
Guid id, string firstName, string lastName, string invPath, string pass, string savePath,
|
||||
Dictionary<string, object> options)
|
||||
{
|
||||
// if (!ConsoleUtil.CheckFileDoesNotExist(MainConsole.Instance, savePath))
|
||||
// return false;
|
||||
|
||||
if (m_scenes.Count > 0)
|
||||
{
|
||||
UserAccount userInfo = GetUserInfo(firstName, lastName, pass);
|
||||
|
||||
@@ -82,7 +82,25 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
|
||||
protected string m_item1Name = "Ray Gun Item";
|
||||
protected string m_coaItemName = "Coalesced Item";
|
||||
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void FixtureSetup()
|
||||
{
|
||||
// Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
|
||||
Util.FireAndForgetMethod = FireAndForgetMethod.RegressionTest;
|
||||
|
||||
ConstructDefaultIarBytesForTestLoad();
|
||||
}
|
||||
|
||||
[TestFixtureTearDown]
|
||||
public void TearDown()
|
||||
{
|
||||
// We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
|
||||
// threads. Possibly, later tests should be rewritten so none of them require async stuff (which regression
|
||||
// tests really shouldn't).
|
||||
Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public override void SetUp()
|
||||
{
|
||||
@@ -90,12 +108,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
m_iarStream = new MemoryStream(m_iarStreamBytes);
|
||||
}
|
||||
|
||||
[TestFixtureSetUp]
|
||||
public void FixtureSetup()
|
||||
{
|
||||
ConstructDefaultIarBytesForTestLoad();
|
||||
}
|
||||
|
||||
protected void ConstructDefaultIarBytesForTestLoad()
|
||||
{
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
{
|
||||
[TestFixture]
|
||||
public class InventoryArchiverTests : InventoryArchiveTestCase
|
||||
{
|
||||
{
|
||||
protected TestScene m_scene;
|
||||
protected InventoryArchiverModule m_archiverModule;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
|
||||
public void TestLoadCoalesecedItem()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
// TestHelpers.EnableLogging();
|
||||
|
||||
UserAccountHelpers.CreateUserWithInventory(m_scene, m_uaLL1, "password");
|
||||
m_archiverModule.DearchiveInventory(m_uaLL1.FirstName, m_uaLL1.LastName, "/", "password", m_iarStream);
|
||||
|
||||
@@ -38,20 +38,20 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
public class InventoryTransferModule : IInventoryTransferModule, ISharedRegionModule
|
||||
public class InventoryTransferModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log
|
||||
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
private List<Scene> m_Scenelist = new List<Scene>();
|
||||
private Dictionary<UUID, Scene> m_AgentRegions =
|
||||
new Dictionary<UUID, Scene>();
|
||||
// private Dictionary<UUID, Scene> m_AgentRegions =
|
||||
// new Dictionary<UUID, Scene>();
|
||||
|
||||
private IMessageTransferModule m_TransferModule = null;
|
||||
private bool m_Enabled = true;
|
||||
|
||||
#region IRegionModule Members
|
||||
#region Region Module interface
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
@@ -76,12 +76,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
m_Scenelist.Add(scene);
|
||||
|
||||
scene.RegisterModuleInterface<IInventoryTransferModule>(this);
|
||||
// scene.RegisterModuleInterface<IInventoryTransferModule>(this);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||
// scene.EventManager.OnClientClosed += ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
|
||||
// scene.EventManager.OnSetRootAgentScene += OnSetRootAgentScene;
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
@@ -96,9 +96,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
m_Scenelist.Clear();
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
// scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
// scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -106,9 +106,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
scene.EventManager.OnNewClient -= OnNewClient;
|
||||
scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
// scene.EventManager.OnClientClosed -= ClientLoggedOut;
|
||||
scene.EventManager.OnIncomingInstantMessage -= OnGridInstantMessage;
|
||||
scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
// scene.EventManager.OnSetRootAgentScene -= OnSetRootAgentScene;
|
||||
m_Scenelist.Remove(scene);
|
||||
}
|
||||
|
||||
@@ -138,10 +138,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
client.OnInstantMessage += OnInstantMessage;
|
||||
}
|
||||
|
||||
protected void OnSetRootAgentScene(UUID id, Scene scene)
|
||||
{
|
||||
m_AgentRegions[id] = scene;
|
||||
}
|
||||
// protected void OnSetRootAgentScene(UUID id, Scene scene)
|
||||
// {
|
||||
// m_AgentRegions[id] = scene;
|
||||
// }
|
||||
|
||||
private Scene FindClientScene(UUID agentId)
|
||||
{
|
||||
@@ -297,6 +297,74 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name>
|
||||
// to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis
|
||||
// of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously
|
||||
// done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here.
|
||||
else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
|
||||
{
|
||||
UUID destinationFolderID = UUID.Zero;
|
||||
|
||||
if (im.binaryBucket != null && im.binaryBucket.Length >= 16)
|
||||
{
|
||||
destinationFolderID = new UUID(im.binaryBucket, 0);
|
||||
}
|
||||
|
||||
if (destinationFolderID != UUID.Zero)
|
||||
{
|
||||
InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId);
|
||||
if (destinationFolder == null)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist",
|
||||
client.Name, scene.Name, destinationFolderID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
IInventoryService invService = scene.InventoryService;
|
||||
|
||||
UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
|
||||
item = invService.GetItem(item);
|
||||
InventoryFolderBase folder = null;
|
||||
UUID? previousParentFolderID = null;
|
||||
|
||||
if (item != null) // It's an item
|
||||
{
|
||||
previousParentFolderID = item.Folder;
|
||||
item.Folder = destinationFolderID;
|
||||
|
||||
invService.DeleteItems(item.Owner, new List<UUID>() { item.ID });
|
||||
scene.AddInventoryItem(client, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
folder = new InventoryFolderBase(inventoryID, client.AgentId);
|
||||
folder = invService.GetFolder(folder);
|
||||
|
||||
if (folder != null) // It's a folder
|
||||
{
|
||||
previousParentFolderID = folder.ParentID;
|
||||
folder.ParentID = destinationFolderID;
|
||||
invService.MoveFolder(folder);
|
||||
}
|
||||
}
|
||||
|
||||
// Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
|
||||
if (previousParentFolderID != null)
|
||||
{
|
||||
InventoryFolderBase previousParentFolder
|
||||
= new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
|
||||
previousParentFolder = invService.GetFolder(previousParentFolder);
|
||||
scene.SendInventoryUpdate(client, previousParentFolder, true, true);
|
||||
|
||||
scene.SendInventoryUpdate(client, destinationFolder, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (
|
||||
im.dialog == (byte)InstantMessageDialog.InventoryDeclined
|
||||
|| im.dialog == (byte)InstantMessageDialog.TaskInventoryDeclined)
|
||||
@@ -315,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
|
||||
item = invService.GetItem(item);
|
||||
InventoryFolderBase folder = null;
|
||||
UUID? previousParentFolderID = null;
|
||||
|
||||
if (item != null && trashFolder != null)
|
||||
{
|
||||
previousParentFolderID = item.Folder;
|
||||
item.Folder = trashFolder.ID;
|
||||
|
||||
// Diva comment: can't we just update this item???
|
||||
@@ -333,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
if (folder != null & trashFolder != null)
|
||||
{
|
||||
previousParentFolderID = folder.ParentID;
|
||||
folder.ParentID = trashFolder.ID;
|
||||
invService.MoveFolder(folder);
|
||||
}
|
||||
@@ -352,84 +423,97 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
client.SendAgentAlertMessage("Unable to delete "+
|
||||
"received inventory" + reason, false);
|
||||
}
|
||||
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
|
||||
if (user != null) // Local
|
||||
// Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
|
||||
else if (previousParentFolderID != null)
|
||||
{
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
InventoryFolderBase previousParentFolder
|
||||
= new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
|
||||
previousParentFolder = invService.GetFolder(previousParentFolder);
|
||||
scene.SendInventoryUpdate(client, previousParentFolder, true, true);
|
||||
|
||||
scene.SendInventoryUpdate(client, trashFolder, true, true);
|
||||
}
|
||||
else
|
||||
|
||||
if (im.dialog == (byte)InstantMessageDialog.InventoryDeclined)
|
||||
{
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {});
|
||||
}
|
||||
}
|
||||
}
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
|
||||
public bool NeedSceneCacheClear(UUID agentID, Scene scene)
|
||||
{
|
||||
if (!m_AgentRegions.ContainsKey(agentID))
|
||||
{
|
||||
// Since we can get here two ways, we need to scan
|
||||
// the scenes here. This is somewhat more expensive
|
||||
// but helps avoid a nasty bug
|
||||
//
|
||||
|
||||
foreach (Scene s in m_Scenelist)
|
||||
{
|
||||
ScenePresence presence;
|
||||
|
||||
if (s.TryGetScenePresence(agentID, out presence))
|
||||
if (user != null) // Local
|
||||
{
|
||||
// If the agent is in this scene, then we
|
||||
// are being called twice in a single
|
||||
// teleport. This is wasteful of cycles
|
||||
// but harmless due to this 2nd level check
|
||||
//
|
||||
// If the agent is found in another scene
|
||||
// then the list wasn't current
|
||||
//
|
||||
// If the agent is totally unknown, then what
|
||||
// are we even doing here??
|
||||
//
|
||||
if (s == scene)
|
||||
{
|
||||
//m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
//m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName);
|
||||
return false;
|
||||
}
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) { });
|
||||
}
|
||||
}
|
||||
//m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
return true;
|
||||
}
|
||||
|
||||
// The agent is left in current Scene, so we must be
|
||||
// going to another instance
|
||||
//
|
||||
if (m_AgentRegions[agentID] == scene)
|
||||
{
|
||||
//m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
m_AgentRegions.Remove(agentID);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Another region has claimed the agent
|
||||
//
|
||||
//m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void ClientLoggedOut(UUID agentID, Scene scene)
|
||||
{
|
||||
if (m_AgentRegions.ContainsKey(agentID))
|
||||
m_AgentRegions.Remove(agentID);
|
||||
}
|
||||
// public bool NeedSceneCacheClear(UUID agentID, Scene scene)
|
||||
// {
|
||||
// if (!m_AgentRegions.ContainsKey(agentID))
|
||||
// {
|
||||
// // Since we can get here two ways, we need to scan
|
||||
// // the scenes here. This is somewhat more expensive
|
||||
// // but helps avoid a nasty bug
|
||||
// //
|
||||
//
|
||||
// foreach (Scene s in m_Scenelist)
|
||||
// {
|
||||
// ScenePresence presence;
|
||||
//
|
||||
// if (s.TryGetScenePresence(agentID, out presence))
|
||||
// {
|
||||
// // If the agent is in this scene, then we
|
||||
// // are being called twice in a single
|
||||
// // teleport. This is wasteful of cycles
|
||||
// // but harmless due to this 2nd level check
|
||||
// //
|
||||
// // If the agent is found in another scene
|
||||
// // then the list wasn't current
|
||||
// //
|
||||
// // If the agent is totally unknown, then what
|
||||
// // are we even doing here??
|
||||
// //
|
||||
// if (s == scene)
|
||||
// {
|
||||
// //m_log.Debug("[INVTRANSFERMOD]: s == scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
// return true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //m_log.Debug("[INVTRANSFERMOD]: s != scene. Returning false in " + scene.RegionInfo.RegionName);
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// //m_log.Debug("[INVTRANSFERMOD]: agent not in scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// // The agent is left in current Scene, so we must be
|
||||
// // going to another instance
|
||||
// //
|
||||
// if (m_AgentRegions[agentID] == scene)
|
||||
// {
|
||||
// //m_log.Debug("[INVTRANSFERMOD]: m_AgentRegions[agentID] == scene. Returning true in " + scene.RegionInfo.RegionName);
|
||||
// m_AgentRegions.Remove(agentID);
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// // Another region has claimed the agent
|
||||
// //
|
||||
// //m_log.Debug("[INVTRANSFERMOD]: last resort. Returning false in " + scene.RegionInfo.RegionName);
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public void ClientLoggedOut(UUID agentID, Scene scene)
|
||||
// {
|
||||
// if (m_AgentRegions.ContainsKey(agentID))
|
||||
// m_AgentRegions.Remove(agentID);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -42,7 +42,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGLureModule")]
|
||||
public class HGLureModule : ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(
|
||||
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.RequestTeleport, false,
|
||||
message, sessionID, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
new Byte[0], true);
|
||||
m.RegionID = client.Scene.RegionInfo.RegionID.Guid;
|
||||
|
||||
m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message);
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.RequestTeleport, false,
|
||||
message, dest, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
new Byte[0], true);
|
||||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Profile
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "BasicProfileModule")]
|
||||
public class BasicProfileModule : IProfileModule, ISharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -43,7 +43,7 @@ using Caps=OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Framework
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CapabilitiesModule")]
|
||||
public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user