Compare commits
808 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01280e9b94 | ||
|
|
96d1ba90d7 | ||
|
|
655625ab87 | ||
|
|
c3d9acc9a9 | ||
|
|
a7f4804f53 | ||
|
|
3229e32b4e | ||
|
|
9707a2d57c | ||
|
|
d9d4fb10d9 | ||
|
|
f94ef37b46 | ||
|
|
5c646e2603 | ||
|
|
729d90173f | ||
|
|
2de5479c3f | ||
|
|
01a2b0b289 | ||
|
|
72219eae7d | ||
|
|
6375db1533 | ||
|
|
4e06a46dc5 | ||
|
|
200376b3c4 | ||
|
|
d34b84b531 | ||
|
|
9ff8efc720 | ||
|
|
d1b5f8d9d7 | ||
|
|
31343aa7c3 | ||
|
|
5f44be99ef | ||
|
|
5cc9b820e5 | ||
|
|
f2c8c7a7b8 | ||
|
|
8333b928fa | ||
|
|
c33c8db825 | ||
|
|
e1f8d2adb0 | ||
|
|
8301f7b17f | ||
|
|
93fa9e8991 | ||
|
|
878b67b333 | ||
|
|
0b02a4d42e | ||
|
|
bf0b8170f7 | ||
|
|
b660c4991b | ||
|
|
79f3ce2e9f | ||
|
|
8f87f55d05 | ||
|
|
7fd38788b4 | ||
|
|
0b72f773c7 | ||
|
|
43a6f28620 | ||
|
|
3ac3be99ae | ||
|
|
33b66009e4 | ||
|
|
d6476b6277 | ||
|
|
f2a5fad18f | ||
|
|
ff53add54d | ||
|
|
120f8145fc | ||
|
|
67ebe80dd9 | ||
|
|
ab59c0a658 | ||
|
|
888210ea4a | ||
|
|
9f1fc7ea88 | ||
|
|
96cde407ab | ||
|
|
40c78b0624 | ||
|
|
7cceab1295 | ||
|
|
93ff27053a | ||
|
|
cc53d91d2f | ||
|
|
cd225215b1 | ||
|
|
5c9086ade6 | ||
|
|
99cebec4ab | ||
|
|
87f9aa9d08 | ||
|
|
f4cd4c8e28 | ||
|
|
38ce9d45a5 | ||
|
|
459c7635af | ||
|
|
bc543c1797 | ||
|
|
b490050165 | ||
|
|
682d4075e3 | ||
|
|
4d1986c0e4 | ||
|
|
ee98b9c394 | ||
|
|
8f88c17df9 | ||
|
|
059a1e90b9 | ||
|
|
2222d979cc | ||
|
|
c6ce41bfba | ||
|
|
050007b44d | ||
|
|
68918d632f | ||
|
|
ec8745cf51 | ||
|
|
ff429a259b | ||
|
|
9ab0c81c1d | ||
|
|
7e97f0e898 | ||
|
|
16d303f7cd | ||
|
|
0db60eea85 | ||
|
|
5759313f7f | ||
|
|
824a3a114b | ||
|
|
fb8705dd4d | ||
|
|
d7f90dee1c | ||
|
|
4e5ac27928 | ||
|
|
3f2a727b6d | ||
|
|
26dfcf5395 | ||
|
|
33247c8d85 | ||
|
|
2b60a5c5d6 | ||
|
|
247a56593f | ||
|
|
e338c15433 | ||
|
|
895dadbdbd | ||
|
|
9fa0577c7e | ||
|
|
fc5d274229 | ||
|
|
896cd45939 | ||
|
|
c05f87b50c | ||
|
|
0147dc6302 | ||
|
|
90722875e8 | ||
|
|
45af29291a | ||
|
|
565c73751c | ||
|
|
6501b1b1bb | ||
|
|
b18c8c8e78 | ||
|
|
521ad080f1 | ||
|
|
4d34763f8c | ||
|
|
2af11fea37 | ||
|
|
295bb3227d | ||
|
|
bd39f5f803 | ||
|
|
0aa7baf49a | ||
|
|
c45b5a3d1c | ||
|
|
d19fb6fb0c | ||
|
|
f0c9cb8dc0 | ||
|
|
6b6a00a3d5 | ||
|
|
bdcf2d1348 | ||
|
|
e444cb9da4 | ||
|
|
23ae24b406 | ||
|
|
e644e34545 | ||
|
|
1b5ce8c10e | ||
|
|
02f3b116c6 | ||
|
|
ef94c31ef8 | ||
|
|
1ce576b115 | ||
|
|
65e1d7b2d7 | ||
|
|
069bcd45e5 | ||
|
|
e7819ce909 | ||
|
|
52a32878a9 | ||
|
|
d7fd9b159a | ||
|
|
af6c85308a | ||
|
|
deeac69312 | ||
|
|
c2aa3b90d9 | ||
|
|
42557d7d4c | ||
|
|
fad557485c | ||
|
|
847127f83c | ||
|
|
171480f235 | ||
|
|
b80db81cdd | ||
|
|
30a272ba31 | ||
|
|
7c229c8b81 | ||
|
|
9d66792c2a | ||
|
|
8b958e7e74 | ||
|
|
b0b7b45b94 | ||
|
|
480216f50f | ||
|
|
f231ac39de | ||
|
|
9c392f6a68 | ||
|
|
0ddf3c5289 | ||
|
|
93b615c51d | ||
|
|
dc39ec82fa | ||
|
|
ab4e6a02a5 | ||
|
|
903cff9264 | ||
|
|
abc029d1f4 | ||
|
|
bce3e7cb06 | ||
|
|
117c183fde | ||
|
|
f374b63ac8 | ||
|
|
de44734fe9 | ||
|
|
d8a78374aa | ||
|
|
6987aef38d | ||
|
|
e813f41478 | ||
|
|
61e99bcdcb | ||
|
|
e5dbb652d5 | ||
|
|
3bc5620d74 | ||
|
|
20952c75c5 | ||
|
|
c21c9e13ef | ||
|
|
ef279c5a62 | ||
|
|
c0658a102e | ||
|
|
6406d5a5b9 | ||
|
|
01b78235db | ||
|
|
abbd050a13 | ||
|
|
5d1d47e1f9 | ||
|
|
15844da3af | ||
|
|
65c88b2ff4 | ||
|
|
a82dc263ab | ||
|
|
5053506d88 | ||
|
|
cdf97ab3a6 | ||
|
|
4032455332 | ||
|
|
4186fa10f0 | ||
|
|
b697d0e895 | ||
|
|
b60f51dafc | ||
|
|
c11b3760da | ||
|
|
f19fe50629 | ||
|
|
86dd5adceb | ||
|
|
8d070cf47b | ||
|
|
531c52abe3 | ||
|
|
9317b888f9 | ||
|
|
01b00ad0d5 | ||
|
|
e18686528e | ||
|
|
dec6ad2933 | ||
|
|
da4819a170 | ||
|
|
c84ef57e52 | ||
|
|
92fde6ed26 | ||
|
|
6096a1f30e | ||
|
|
e83bc049df | ||
|
|
ad23774433 | ||
|
|
cccef2e56d | ||
|
|
fb99ee6774 | ||
|
|
c9faf0df74 | ||
|
|
c221eaf0b0 | ||
|
|
fcd5b0817b | ||
|
|
100e4ca67e | ||
|
|
bf5f8b54ae | ||
|
|
9ffc2c1062 | ||
|
|
231a3bf147 | ||
|
|
40f3c24562 | ||
|
|
a29f7f7551 | ||
|
|
9d2e1c67a8 | ||
|
|
5786521103 | ||
|
|
37dd174697 | ||
|
|
b678ea18b2 | ||
|
|
cc482d2d56 | ||
|
|
9c2a73b61e | ||
|
|
d0598c63f3 | ||
|
|
fe8e835bfc | ||
|
|
4ad45934c6 | ||
|
|
522eff6138 | ||
|
|
8380166251 | ||
|
|
cd755fe598 | ||
|
|
133f05dc41 | ||
|
|
2bad430ed8 | ||
|
|
ab71779221 | ||
|
|
737e177163 | ||
|
|
a90b0e302c | ||
|
|
da29cbccfa | ||
|
|
d25469f66e | ||
|
|
e31e7c68c8 | ||
|
|
db566fbb09 | ||
|
|
6473674bbf | ||
|
|
9622e8ac72 | ||
|
|
37d770f814 | ||
|
|
9d1791def8 | ||
|
|
e39e4f6bfb | ||
|
|
b35a1d5681 | ||
|
|
9bc94c502a | ||
|
|
a9dbe39319 | ||
|
|
292752bb78 | ||
|
|
ac64fe03d8 | ||
|
|
2970a18e54 | ||
|
|
c84f63f4dc | ||
|
|
e4e754ee93 | ||
|
|
07e62df558 | ||
|
|
8a65f5a70d | ||
|
|
0da8fe3124 | ||
|
|
ee13d817f1 | ||
|
|
cb6791fb30 | ||
|
|
d19aa9e792 | ||
|
|
2542ca2a49 | ||
|
|
fba802bb03 | ||
|
|
b8114d2b67 | ||
|
|
ca228c4770 | ||
|
|
f49912f92a | ||
|
|
b0cbf16c19 | ||
|
|
4c4ffb9868 | ||
|
|
e52fe03fff | ||
|
|
74dbfe6bb5 | ||
|
|
133370f158 | ||
|
|
a2d544c938 | ||
|
|
88553bb884 | ||
|
|
1afae01311 | ||
|
|
bec100a662 | ||
|
|
7aa25c6762 | ||
|
|
fd281ded3f | ||
|
|
cf1c34605b | ||
|
|
550ff3b4da | ||
|
|
3be3189ee0 | ||
|
|
af86e2939c | ||
|
|
683cfc6f82 | ||
|
|
a65ca24701 | ||
|
|
f24289c47f | ||
|
|
6b299a4287 | ||
|
|
39a6d7cab4 | ||
|
|
0f470326aa | ||
|
|
54d5ff6774 | ||
|
|
ef1668adb3 | ||
|
|
2f398231ac | ||
|
|
d3a4d67a20 | ||
|
|
da5fd53702 | ||
|
|
c70e85a327 | ||
|
|
6011bfa5e3 | ||
|
|
cbe889e10b | ||
|
|
0e3053e4c9 | ||
|
|
c6f30e044b | ||
|
|
fd27988978 | ||
|
|
6c21e15cb9 | ||
|
|
40e37d8b78 | ||
|
|
b798b32b19 | ||
|
|
1f8d1bcdcf | ||
|
|
60065f06b3 | ||
|
|
679da63da6 | ||
|
|
49ed68e98c | ||
|
|
58c890df5d | ||
|
|
8205fe79ce | ||
|
|
ae2b8f7007 | ||
|
|
f609594595 | ||
|
|
77a7de87e1 | ||
|
|
d5c724e5b8 | ||
|
|
9ac48b2aff | ||
|
|
17bf2a62db | ||
|
|
71900968b2 | ||
|
|
ae789f6c16 | ||
|
|
06552f217e | ||
|
|
7a574be3fd | ||
|
|
c8307cdf1e | ||
|
|
566327a948 | ||
|
|
75f117484b | ||
|
|
cba64ebc79 | ||
|
|
4ac2f839bd | ||
|
|
63cda3a6d0 | ||
|
|
f3dda2d85d | ||
|
|
2b98e2f106 | ||
|
|
beb7b8d189 | ||
|
|
7a255efdb2 | ||
|
|
ea73a03553 | ||
|
|
c85f9d681a | ||
|
|
b430c0162c | ||
|
|
859646ef5c | ||
|
|
84891930aa | ||
|
|
4db518b9a3 | ||
|
|
2d45ba47ac | ||
|
|
5ff2bda587 | ||
|
|
4bb72c9ffe | ||
|
|
cca6b6bd0d | ||
|
|
2f2181683c | ||
|
|
7e1ab216e3 | ||
|
|
24a0cc5261 | ||
|
|
5655239f44 | ||
|
|
e6ec83125b | ||
|
|
572440cd23 | ||
|
|
1bb3873338 | ||
|
|
f213f55586 | ||
|
|
2c74e1bba8 | ||
|
|
da342d0b21 | ||
|
|
f61b234252 | ||
|
|
317aebcce6 | ||
|
|
40d01fb20b | ||
|
|
3ae98611f2 | ||
|
|
e8898710d5 | ||
|
|
2254a718c8 | ||
|
|
4d652c7041 | ||
|
|
4bdd9d51bc | ||
|
|
eeec1f32c6 | ||
|
|
a366c05ae2 | ||
|
|
eced091689 | ||
|
|
1ad3fdb40b | ||
|
|
ab7c0e7547 | ||
|
|
08e509978d | ||
|
|
30d8506bc2 | ||
|
|
8be14095fe | ||
|
|
1f4d3d3582 | ||
|
|
f2ede8c7e0 | ||
|
|
78fd487a70 | ||
|
|
4ab479bf58 | ||
|
|
fb44e7b636 | ||
|
|
2b339bfd97 | ||
|
|
f9dd4ed89c | ||
|
|
78c0028179 | ||
|
|
0f277dfa17 | ||
|
|
d4a370a5f2 | ||
|
|
7c534e558d | ||
|
|
0d566aa385 | ||
|
|
806082cd6e | ||
|
|
9637e50956 | ||
|
|
cce760dbfc | ||
|
|
7d8bb33c5b | ||
|
|
70b5a2dace | ||
|
|
33e91f1088 | ||
|
|
4a58d4c5a4 | ||
|
|
3af1cd65f9 | ||
|
|
47108bb351 | ||
|
|
f2903db390 | ||
|
|
c3a8c00ce0 | ||
|
|
627efc172b | ||
|
|
908cebbea8 | ||
|
|
6a9f36788d | ||
|
|
4c32f79c10 | ||
|
|
7435582b70 | ||
|
|
25b3edc21c | ||
|
|
953fe46811 | ||
|
|
6eaff18961 | ||
|
|
8fd86c9156 | ||
|
|
e324fb2415 | ||
|
|
cdbe34716f | ||
|
|
67537f3596 | ||
|
|
8f45eb913c | ||
|
|
e4406c846d | ||
|
|
600a86bcae | ||
|
|
a5d6b624f6 | ||
|
|
36c8fa16c0 | ||
|
|
9a9923405a | ||
|
|
633f4bb3d8 | ||
|
|
e480e25d8b | ||
|
|
7468299673 | ||
|
|
6e7f13a72d | ||
|
|
32a953fed7 | ||
|
|
f0406f9fe2 | ||
|
|
387d7fdad5 | ||
|
|
38d241a317 | ||
|
|
69fc8c4985 | ||
|
|
c2b98cfd4e | ||
|
|
874140f950 | ||
|
|
5a8ed50639 | ||
|
|
e5343bccdf | ||
|
|
269e479cdc | ||
|
|
3525c876c8 | ||
|
|
1ef62ca75e | ||
|
|
bce7964ac2 | ||
|
|
59157d9d63 | ||
|
|
b8d383da0a | ||
|
|
30db0ac5e2 | ||
|
|
bf09d6a22b | ||
|
|
012b01f224 | ||
|
|
cd3f3cbdde | ||
|
|
22a85b947a | ||
|
|
62b1c807c2 | ||
|
|
bd83676d6c | ||
|
|
93ac47f0d3 | ||
|
|
a1de9bc33f | ||
|
|
c52ff5cf7b | ||
|
|
5a82d939e6 | ||
|
|
532e3dad26 | ||
|
|
964cae4f37 | ||
|
|
d9f7b8549b | ||
|
|
7aa0c05fba | ||
|
|
33df0c2efd | ||
|
|
4138880464 | ||
|
|
6bf4d88397 | ||
|
|
874bf1f8e5 | ||
|
|
51dc1e709c | ||
|
|
03766c010f | ||
|
|
af96b99356 | ||
|
|
614c404923 | ||
|
|
4007f62158 | ||
|
|
300968e933 | ||
|
|
b24605d526 | ||
|
|
514a9fdf8e | ||
|
|
12d3ea3029 | ||
|
|
a43e804e59 | ||
|
|
0463a00d34 | ||
|
|
8c0f1e9058 | ||
|
|
710c14fb57 | ||
|
|
445e8bc560 | ||
|
|
cb41fb64be | ||
|
|
37603ca6da | ||
|
|
db5f46fa23 | ||
|
|
b74a89bc12 | ||
|
|
5e07336672 | ||
|
|
91950b3147 | ||
|
|
19837ff4dd | ||
|
|
5d37a31436 | ||
|
|
7223b63563 | ||
|
|
971d32fda3 | ||
|
|
0247d738e2 | ||
|
|
de242a29ca | ||
|
|
2e2634896d | ||
|
|
8131a24cde | ||
|
|
b78224176e | ||
|
|
09c85a6a6c | ||
|
|
1aa1a9eb3d | ||
|
|
872d513daa | ||
|
|
84c9bd52d3 | ||
|
|
ad865ab4fc | ||
|
|
2fcdecf090 | ||
|
|
f8879e06d2 | ||
|
|
3691e39178 | ||
|
|
3810e98474 | ||
|
|
7e0936e4b6 | ||
|
|
055269805d | ||
|
|
98a6c78943 | ||
|
|
c9c01d5226 | ||
|
|
ac0f1ff0a6 | ||
|
|
d7cc194e83 | ||
|
|
cb44808504 | ||
|
|
a07fa0395f | ||
|
|
a14437ad5a | ||
|
|
4f17537555 | ||
|
|
f03c3c062e | ||
|
|
f53c6b2594 | ||
|
|
cf61c74e90 | ||
|
|
07388071d4 | ||
|
|
ff54b3c366 | ||
|
|
3f53b7bc91 | ||
|
|
142de1d02f | ||
|
|
1273f259e4 | ||
|
|
2f6e8564fe | ||
|
|
1a738caeca | ||
|
|
de24feb275 | ||
|
|
6ecdadb329 | ||
|
|
b22d040169 | ||
|
|
6c50442625 | ||
|
|
975184b3f9 | ||
|
|
164706043d | ||
|
|
6b87a29c86 | ||
|
|
d4beb2f5bc | ||
|
|
e5b182fb41 | ||
|
|
54887bf386 | ||
|
|
4ed833bc9d | ||
|
|
349454ca27 | ||
|
|
c0672cb7db | ||
|
|
176bba4f67 | ||
|
|
18b3f1132e | ||
|
|
4ee8b3e23e | ||
|
|
a9995ede65 | ||
|
|
bc2963d42a | ||
|
|
08b8ebcc7e | ||
|
|
c903813e00 | ||
|
|
40b9b519b8 | ||
|
|
efe61b2481 | ||
|
|
15c2499ccd | ||
|
|
c1d064e1ca | ||
|
|
5bf45b9b98 | ||
|
|
760010d6fb | ||
|
|
3bcf71c647 | ||
|
|
c4b2d24f33 | ||
|
|
df624c13c9 | ||
|
|
25e5b6a76c | ||
|
|
6bc1ccf234 | ||
|
|
b5d0bc2488 | ||
|
|
45b588cf00 | ||
|
|
6146e7ef25 | ||
|
|
a8c87bab64 | ||
|
|
c98e3a6422 | ||
|
|
06c81a2afe | ||
|
|
4bfd9e28ca | ||
|
|
9949ac2f9f | ||
|
|
71ec84d77f | ||
|
|
1a8769e6ef | ||
|
|
7783c93802 | ||
|
|
cb2727cf6e | ||
|
|
6c55fd93a3 | ||
|
|
898a16802b | ||
|
|
3e7e166124 | ||
|
|
eafc3d6c47 | ||
|
|
5170cd7577 | ||
|
|
4a9ca3ca8f | ||
|
|
d8bcb78b10 | ||
|
|
8ad426f329 | ||
|
|
1089e9b842 | ||
|
|
5abe1b4fce | ||
|
|
91cc09b7bf | ||
|
|
d49dd5573b | ||
|
|
54a8a5baba | ||
|
|
de53aa32e0 | ||
|
|
ab243f4a57 | ||
|
|
9671e43497 | ||
|
|
7a0d7be44c | ||
|
|
69a9a6993e | ||
|
|
91a001d3cf | ||
|
|
9e8b194356 | ||
|
|
742acc0a3c | ||
|
|
f7c61790b7 | ||
|
|
022366a074 | ||
|
|
841b4232f6 | ||
|
|
3fa51f66ec | ||
|
|
d08ad6459a | ||
|
|
7bf628ab31 | ||
|
|
4c41b53a4b | ||
|
|
02f9caf6ce | ||
|
|
3701f893d3 | ||
|
|
c39fba8f9d | ||
|
|
8bdd38b804 | ||
|
|
30b2a8c778 | ||
|
|
bd1f848bf6 | ||
|
|
9ed3532c1b | ||
|
|
86bd287b53 | ||
|
|
5f2a65c976 | ||
|
|
a3abd65e3d | ||
|
|
8c911ddaf0 | ||
|
|
4cbaf053cf | ||
|
|
1c0f3a1f21 | ||
|
|
e9271ec653 | ||
|
|
e2b1c569da | ||
|
|
437f18bc41 | ||
|
|
4972491efb | ||
|
|
ab54ce1907 | ||
|
|
d1256536b5 | ||
|
|
441ef301a3 | ||
|
|
7dfa0309c6 | ||
|
|
92b1ade78e | ||
|
|
1a4fdd2666 | ||
|
|
d87a5758fb | ||
|
|
33c14cb107 | ||
|
|
4a57112f19 | ||
|
|
1e4180fc93 | ||
|
|
a4dca88a57 | ||
|
|
a2009ffe2e | ||
|
|
59b6f6a6e0 | ||
|
|
bece2023e7 | ||
|
|
9497a7c7bd | ||
|
|
922d8c9312 | ||
|
|
6e8f80f1ab | ||
|
|
05bb2e4275 | ||
|
|
05a1493fff | ||
|
|
421b562a04 | ||
|
|
78e992dbd0 | ||
|
|
b19be657b6 | ||
|
|
aa881e8065 | ||
|
|
34f6f87b6c | ||
|
|
8550a4a07e | ||
|
|
c386b68373 | ||
|
|
7df4a544fe | ||
|
|
a4b01ef38a | ||
|
|
0548eeb571 | ||
|
|
18d1d6d3b4 | ||
|
|
df144eb9e2 | ||
|
|
f52917288a | ||
|
|
5a9560db28 | ||
|
|
e5612553ce | ||
|
|
8b5298a62e | ||
|
|
402ff75d78 | ||
|
|
fd4ad82367 | ||
|
|
10731732b4 | ||
|
|
697ac7fd9d | ||
|
|
acb1355ff2 | ||
|
|
2d32401e23 | ||
|
|
f0c1746063 | ||
|
|
5ddda89238 | ||
|
|
2f81e53f63 | ||
|
|
12cebb12d5 | ||
|
|
d6dd3c42d1 | ||
|
|
479dd65a63 | ||
|
|
5a09572393 | ||
|
|
95ec96bf86 | ||
|
|
37828c9b9a | ||
|
|
4eb2605c79 | ||
|
|
25592bbd85 | ||
|
|
e0dd38f672 | ||
|
|
1547fe959e | ||
|
|
13fb582c12 | ||
|
|
824eb7ed20 | ||
|
|
291dc39691 | ||
|
|
05e821c444 | ||
|
|
6e26f17923 | ||
|
|
5507752dc5 | ||
|
|
1693799623 | ||
|
|
3a5928f813 | ||
|
|
d6ebf2d6ca | ||
|
|
7b8e9d88e3 | ||
|
|
bdc968f1fc | ||
|
|
5c5a493791 | ||
|
|
35f2479858 | ||
|
|
a58152bd2a | ||
|
|
81869c4a3f | ||
|
|
f545d669de | ||
|
|
7db5ba7702 | ||
|
|
06dda14505 | ||
|
|
205c36d3a4 | ||
|
|
94e58ff6b9 | ||
|
|
b454326273 | ||
|
|
c22446ede0 | ||
|
|
8a34d1b710 | ||
|
|
73c47f7205 | ||
|
|
42a7a85062 | ||
|
|
df4b06aed1 | ||
|
|
034c9d6bcc | ||
|
|
3c5bd7c35a | ||
|
|
0cbdf9dad2 | ||
|
|
9c8ef96301 | ||
|
|
675d40357c | ||
|
|
fa2a64564a | ||
|
|
dfdb0e140c | ||
|
|
650d761c06 | ||
|
|
430304c176 | ||
|
|
749c3fef8a | ||
|
|
6bdea15ecf | ||
|
|
a1b28a61a6 | ||
|
|
7769362687 | ||
|
|
f3678d217f | ||
|
|
23aba007dd | ||
|
|
3376979923 | ||
|
|
98251cdab3 | ||
|
|
e9d8eb5a27 | ||
|
|
0f4cdc0c5b | ||
|
|
b3449e998a | ||
|
|
a92153ed88 | ||
|
|
85198a45cb | ||
|
|
1dc03e5c4f | ||
|
|
d44b7c486a | ||
|
|
413bc1e77e | ||
|
|
441449e240 | ||
|
|
fd2b285b1b | ||
|
|
ac934e2dbb | ||
|
|
33a154e446 | ||
|
|
3780df8a32 | ||
|
|
75dc8b1aed | ||
|
|
2535a4cafc | ||
|
|
94b323d1d8 | ||
|
|
7113b44bdd | ||
|
|
98ad6ed255 | ||
|
|
e81b3502ef | ||
|
|
c2c102d33e | ||
|
|
089fd61a3b | ||
|
|
d242d47e5c | ||
|
|
6fc350725d | ||
|
|
64a036b4cf | ||
|
|
8d249f8456 | ||
|
|
6e3523e25e | ||
|
|
2a2656f629 | ||
|
|
be4199c3bc | ||
|
|
8fccd2b555 | ||
|
|
e8779cd9e5 | ||
|
|
dd63cd1656 | ||
|
|
ec48a2f32b | ||
|
|
94971bf3b9 | ||
|
|
d8c4985527 | ||
|
|
dcfd05c8ea | ||
|
|
8a375f3c30 | ||
|
|
7a88d21e59 | ||
|
|
a2b0ed537e | ||
|
|
0007711eb5 | ||
|
|
255afbf08a | ||
|
|
aabbbb32ff | ||
|
|
1e95b01f13 | ||
|
|
69c999033b | ||
|
|
1a54e76948 | ||
|
|
df75f5ae37 | ||
|
|
afc9a7d3f9 | ||
|
|
9f597c2d42 | ||
|
|
a181fae722 | ||
|
|
40c838896c | ||
|
|
670c7842a4 | ||
|
|
2fce7dd593 | ||
|
|
a813e7ffdd | ||
|
|
4268427ac3 | ||
|
|
142f8a4aec | ||
|
|
4177571a78 | ||
|
|
01f454242d | ||
|
|
4a5f9fe6a2 | ||
|
|
6159110258 | ||
|
|
ca19b9078f | ||
|
|
6138662716 | ||
|
|
3fbcd21916 | ||
|
|
b48b0b1e58 | ||
|
|
f9066e7d86 | ||
|
|
7b5e42c744 | ||
|
|
bafef292f4 | ||
|
|
9e6ffe7798 | ||
|
|
84735b644c | ||
|
|
f67f37074f | ||
|
|
fe229f10e6 | ||
|
|
0b9f4d7e74 | ||
|
|
f034958bdc | ||
|
|
90ea00a109 | ||
|
|
af377470e1 | ||
|
|
9ed4245d9e | ||
|
|
1dfc990264 | ||
|
|
165ae251ec | ||
|
|
67bea681e2 | ||
|
|
5d31267185 | ||
|
|
cf9b3e7708 | ||
|
|
1c533eb520 | ||
|
|
5397a6d4c6 | ||
|
|
76f411147d | ||
|
|
15ce73caca | ||
|
|
7cf970fb27 | ||
|
|
a27e5a9c95 | ||
|
|
daee2eda93 | ||
|
|
a15b00d3ef | ||
|
|
1b906ef2ad | ||
|
|
68a4ef5ef6 | ||
|
|
90dc5f47e7 | ||
|
|
19d271d3fc | ||
|
|
4a329098e8 | ||
|
|
99b9c1a9d5 | ||
|
|
1c3ee5d1ce | ||
|
|
b489c85226 | ||
|
|
dcea23906b | ||
|
|
20c65ac438 | ||
|
|
bcb9577495 | ||
|
|
d22715126c | ||
|
|
a114367b9b | ||
|
|
2ffc055f7e | ||
|
|
14e9bf894c | ||
|
|
f4cd35322f | ||
|
|
7bdcf9eb26 | ||
|
|
9846a1e56e | ||
|
|
4cc97df8f3 | ||
|
|
0ef64fbe03 | ||
|
|
fbccff4994 | ||
|
|
84184708de | ||
|
|
8f8b478d36 | ||
|
|
b817c337dc | ||
|
|
d03e878d53 | ||
|
|
b313d16493 | ||
|
|
784263f5e3 | ||
|
|
6baa13ab7a | ||
|
|
0e16e0fb6a | ||
|
|
ba98d6fffe | ||
|
|
972f73ed2b | ||
|
|
c5ff37bf3e | ||
|
|
6b867773a8 | ||
|
|
912aac3447 | ||
|
|
4486b7d8e8 | ||
|
|
1267094a51 | ||
|
|
2b842958cc | ||
|
|
80ec2ac167 | ||
|
|
df960d5767 | ||
|
|
c0760f9f91 | ||
|
|
c906128191 | ||
|
|
f574d3c8fc | ||
|
|
ebe5e1731d | ||
|
|
2ebb421331 | ||
|
|
a9e8bd59a3 | ||
|
|
4589ce61bc | ||
|
|
33e66107be | ||
|
|
db90dea9bd | ||
|
|
04544b4510 | ||
|
|
0b17a66e68 | ||
|
|
04986bbb15 | ||
|
|
b0d02adeee | ||
|
|
48b962c401 | ||
|
|
04a195266b | ||
|
|
21393af631 | ||
|
|
189c67db95 | ||
|
|
b92b9228ef | ||
|
|
f49897a419 | ||
|
|
aab30f5e67 | ||
|
|
e7fd732209 |
@@ -2,13 +2,37 @@
|
||||
<!-- please leave the top comment for us emacs folks -->
|
||||
<property name="nunitcmd" value="nunit-console" />
|
||||
|
||||
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
|
||||
trying to copy across only the essential ones -->
|
||||
<property name="distbindir" value="distbin" />
|
||||
<target name="distbin">
|
||||
<!-- This target produces a source distribution of OpenSimulator -->
|
||||
<!-- TODO: A few parameters still need to be tweaked after running this - need to do this automatically with sed or similar -->
|
||||
<target name="distsrc">
|
||||
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
|
||||
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
|
||||
<copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/>
|
||||
<!-- delete files generated by runprebuild.sh which had to be run in order to generate the build file for this target-->
|
||||
<delete>
|
||||
<fileset basedir="OpenSim">
|
||||
<include name="**/*.build"/>
|
||||
<include name="**/*.csproj*"/>
|
||||
<include name="**/*.dll.build"/>
|
||||
<include name="**/*.pidb"/>
|
||||
<exclude name="Tools/OpenSim.32BitLaunch/**"/>
|
||||
<exclude name="Tools/Robust.32BitLaunch/**"/>
|
||||
<exclude name="Tools/LaunchSLClient/**"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
<delete>
|
||||
<fileset>
|
||||
<include name="OpenSim.build"/>
|
||||
<include name="OpenSim.sln"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<property name="distbindir" value="distbin" />
|
||||
<!-- This target produces a binary directory called distbin/ in OpenSim/bin which contains everything needed for binary distribution -->
|
||||
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
|
||||
trying to copy across only the essential ones -->
|
||||
<target name="distbin">
|
||||
<delete dir="${distbindir}"/>
|
||||
<copy todir="${distbindir}">
|
||||
<fileset>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
The following people have contributed to OpenSim (Thank you
|
||||
<<<>>>>The following people have contributed to OpenSim (Thank you
|
||||
for your effort!)
|
||||
|
||||
= Current OpenSim Developers (in very rough order of appearance) =
|
||||
@@ -71,6 +71,7 @@ what it is today.
|
||||
* CharlieO
|
||||
* ChrisDown
|
||||
* Chris Yeoh (IBM)
|
||||
* controlbreak
|
||||
* coyled
|
||||
* Daedius
|
||||
* Dong Jun Lan (IBM)
|
||||
@@ -86,8 +87,10 @@ what it is today.
|
||||
* Grumly57
|
||||
* GuduleLapointe
|
||||
* Ewe Loon
|
||||
* Fernando Oliveira
|
||||
* Fly-Man
|
||||
* Flyte Xevious
|
||||
* Garmin Kawaguichi
|
||||
* Imaze Rhiano
|
||||
* Intimidated
|
||||
* Jeremy Bongio (IBM)
|
||||
@@ -106,6 +109,7 @@ what it is today.
|
||||
* M.Igarashi
|
||||
* maimedleech
|
||||
* Mana Janus
|
||||
* MarcelEdward
|
||||
* Mic Bowman
|
||||
* Michelle Argus
|
||||
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
|
||||
@@ -135,10 +139,15 @@ what it is today.
|
||||
* Ruud Lathorp
|
||||
* SachaMagne
|
||||
* Salahzar Stenvaag
|
||||
* satguru p srivastava
|
||||
* sempuki
|
||||
* SignpostMarv
|
||||
* SpotOn3D
|
||||
* Stefan_Boom / stoehr
|
||||
* Strawberry Fride
|
||||
* Talun
|
||||
* TechplexEngineer (Blake Bourque)
|
||||
* TBG Renfold
|
||||
* tglion
|
||||
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
||||
* tyre
|
||||
@@ -197,3 +206,4 @@ In addition, we would like to thank:
|
||||
* The Mono Project
|
||||
* The NANT Developers
|
||||
* Microsoft (.NET, MSSQL-Adapters)
|
||||
*x
|
||||
|
||||
@@ -122,9 +122,10 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
Thread.CurrentThread.ManagedThreadId.ToString() +
|
||||
")");
|
||||
|
||||
m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
if (changed)
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
|
||||
if (scene != null)
|
||||
{
|
||||
|
||||
@@ -101,18 +101,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
llsdItem.item_id = invItem.ID;
|
||||
llsdItem.name = invItem.Name;
|
||||
llsdItem.parent_id = invItem.Folder;
|
||||
|
||||
try
|
||||
{
|
||||
llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType);
|
||||
llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}",
|
||||
invItem.AssetType, invItem.InvType, invItem.Name, e.Message);
|
||||
}
|
||||
llsdItem.type = invItem.AssetType;
|
||||
llsdItem.inv_type = invItem.InvType;
|
||||
|
||||
llsdItem.permissions = new LLSDPermissions();
|
||||
llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
|
||||
@@ -126,21 +116,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.sale_info = new LLSDSaleInfo();
|
||||
llsdItem.sale_info.sale_price = invItem.SalePrice;
|
||||
switch (invItem.SaleType)
|
||||
{
|
||||
default:
|
||||
llsdItem.sale_info.sale_type = "not";
|
||||
break;
|
||||
case 1:
|
||||
llsdItem.sale_info.sale_type = "original";
|
||||
break;
|
||||
case 2:
|
||||
llsdItem.sale_info.sale_type = "copy";
|
||||
break;
|
||||
case 3:
|
||||
llsdItem.sale_info.sale_type = "contents";
|
||||
break;
|
||||
}
|
||||
llsdItem.sale_info.sale_type = invItem.SaleType;
|
||||
|
||||
return llsdItem;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
|
||||
FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
|
||||
IRequestHandler reqHandler
|
||||
= new RestStreamHandler("POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest);
|
||||
= new RestStreamHandler(
|
||||
"POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,13 +66,14 @@ namespace OpenSim.Capabilities.Handlers
|
||||
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
|
||||
|
||||
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
|
||||
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
|
||||
delegate(Hashtable m_dhttpMethod)
|
||||
{
|
||||
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null);
|
||||
});
|
||||
IRequestHandler reqHandler
|
||||
= new RestHTTPHandler(
|
||||
"GET",
|
||||
"/CAPS/" + UUID.Random(),
|
||||
httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
|
||||
"GetMesh",
|
||||
null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,8 +58,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
// TODO: Change this to a config option
|
||||
const string REDIRECT_URL = null;
|
||||
|
||||
public GetTextureHandler(string path, IAssetService assService) :
|
||||
base("GET", path)
|
||||
public GetTextureHandler(string path, IAssetService assService, string name, string description)
|
||||
: base("GET", path, name, description)
|
||||
{
|
||||
m_assetService = assService;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
if (m_AssetService == null)
|
||||
throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
|
||||
|
||||
server.AddStreamHandler(new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService));
|
||||
server.AddStreamHandler(
|
||||
new GetTextureHandler("/CAPS/GetTexture/" /*+ UUID.Random() */, m_AssetService, "GetTexture", null));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,9 +50,9 @@ namespace OpenSim.Capabilities.Handlers.GetTexture.Tests
|
||||
TestHelpers.InMethod();
|
||||
|
||||
// Overkill - we only really need the asset service, not a whole scene.
|
||||
Scene scene = SceneHelpers.SetupScene();
|
||||
Scene scene = new SceneHelpers().SetupScene();
|
||||
|
||||
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService);
|
||||
GetTextureHandler handler = new GetTextureHandler(null, scene.AssetService, "TestGetTexture", null);
|
||||
TestOSHttpRequest req = new TestOSHttpRequest();
|
||||
TestOSHttpResponse resp = new TestOSHttpResponse();
|
||||
req.Url = new Uri("http://localhost/?texture_id=00000000-0000-1111-9999-000000000012");
|
||||
|
||||
@@ -85,8 +85,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
uploader.OnUpLoad += BakedTextureUploaded;
|
||||
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler("POST", capsBase + uploaderPath,
|
||||
uploader.uploaderCaps));
|
||||
new BinaryStreamHandler(
|
||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
|
||||
@@ -156,21 +156,24 @@ namespace OpenSim.Capabilities.Handlers
|
||||
inv.Folders = new List<InventoryFolderBase>();
|
||||
inv.Items = new List<InventoryItemBase>();
|
||||
int version = 0;
|
||||
int descendents = 0;
|
||||
|
||||
inv
|
||||
= Fetch(
|
||||
invFetch.owner_id, invFetch.folder_id, invFetch.owner_id,
|
||||
invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version);
|
||||
invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order, out version, out descendents);
|
||||
|
||||
if (inv.Folders != null)
|
||||
if (inv != null && inv.Folders != null)
|
||||
{
|
||||
foreach (InventoryFolderBase invFolder in inv.Folders)
|
||||
{
|
||||
contents.categories.Array.Add(ConvertInventoryFolder(invFolder));
|
||||
}
|
||||
|
||||
descendents += inv.Folders.Count;
|
||||
}
|
||||
|
||||
if (inv.Items != null)
|
||||
if (inv != null && inv.Items != null)
|
||||
{
|
||||
foreach (InventoryItemBase invItem in inv.Items)
|
||||
{
|
||||
@@ -178,7 +181,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
}
|
||||
}
|
||||
|
||||
contents.descendents = contents.items.Array.Count + contents.categories.Array.Count;
|
||||
contents.descendents = descendents;
|
||||
contents.version = version;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
@@ -206,7 +209,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
/// <returns>An empty InventoryCollection if the inventory look up failed</returns>
|
||||
private InventoryCollection Fetch(
|
||||
UUID agentID, UUID folderID, UUID ownerID,
|
||||
bool fetchFolders, bool fetchItems, int sortOrder, out int version)
|
||||
bool fetchFolders, bool fetchItems, int sortOrder, out int version, out int descendents)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
|
||||
@@ -215,6 +218,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
// FIXME MAYBE: We're not handling sortOrder!
|
||||
|
||||
version = 0;
|
||||
descendents = 0;
|
||||
|
||||
InventoryFolderImpl fold;
|
||||
if (m_LibraryService != null && m_LibraryService.LibraryRootFolder != null && agentID == m_LibraryService.LibraryRootFolder.Owner)
|
||||
{
|
||||
@@ -223,6 +228,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
InventoryCollection ret = new InventoryCollection();
|
||||
ret.Folders = new List<InventoryFolderBase>();
|
||||
ret.Items = fold.RequestListOfItems();
|
||||
descendents = ret.Folders.Count + ret.Items.Count;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -246,24 +252,71 @@ namespace OpenSim.Capabilities.Handlers
|
||||
|
||||
version = containingFolder.Version;
|
||||
|
||||
// if (fetchItems)
|
||||
if (fetchItems)
|
||||
{
|
||||
List<InventoryItemBase> itemsToReturn = contents.Items;
|
||||
List<InventoryItemBase> originalItems = new List<InventoryItemBase>(itemsToReturn);
|
||||
|
||||
// descendents must only include the links, not the linked items we add
|
||||
descendents = originalItems.Count;
|
||||
|
||||
// Add target items for links in this folder before the links themselves.
|
||||
foreach (InventoryItemBase item in originalItems)
|
||||
{
|
||||
if (item.AssetType == (int)AssetType.Link)
|
||||
{
|
||||
InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
||||
|
||||
// Take care of genuinely broken links where the target doesn't exist
|
||||
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
||||
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
||||
// rather than having to keep track of every folder requested in the recursion.
|
||||
if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
|
||||
itemsToReturn.Insert(0, linkedItem);
|
||||
}
|
||||
}
|
||||
|
||||
// Now scan for folder links and insert the items they target and those links at the head of the return data
|
||||
foreach (InventoryItemBase item in originalItems)
|
||||
{
|
||||
if (item.AssetType == (int)AssetType.LinkFolder)
|
||||
{
|
||||
InventoryCollection linkedFolderContents = m_InventoryService.GetFolderContent(ownerID, item.AssetID);
|
||||
List<InventoryItemBase> links = linkedFolderContents.Items;
|
||||
|
||||
itemsToReturn.InsertRange(0, links);
|
||||
|
||||
foreach (InventoryItemBase link in linkedFolderContents.Items)
|
||||
{
|
||||
// Take care of genuinely broken links where the target doesn't exist
|
||||
// HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
||||
// but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
||||
// rather than having to keep track of every folder requested in the recursion.
|
||||
if (link != null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Adding item {0} {1} from folder {2} linked from {3}",
|
||||
// link.Name, (AssetType)link.AssetType, item.AssetID, containingFolder.Name);
|
||||
|
||||
InventoryItemBase linkedItem
|
||||
= m_InventoryService.GetItem(new InventoryItemBase(link.AssetID));
|
||||
|
||||
itemsToReturn.Insert(0, linkedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// foreach (InventoryItemBase item in contents.Items)
|
||||
// {
|
||||
// List<InventoryItemBase> linkedItemsToAdd = new List<InventoryItemBase>();
|
||||
//
|
||||
// foreach (InventoryItemBase item in contents.Items)
|
||||
// {
|
||||
// if (item.AssetType == (int)AssetType.Link)
|
||||
// {
|
||||
// InventoryItemBase linkedItem = m_InventoryService.GetItem(new InventoryItemBase(item.AssetID));
|
||||
//
|
||||
// // Take care of genuinely broken links where the target doesn't exist
|
||||
// // HACK: Also, don't follow up links that just point to other links. In theory this is legitimate,
|
||||
// // but no viewer has been observed to set these up and this is the lazy way of avoiding cycles
|
||||
// // rather than having to keep track of every folder requested in the recursion.
|
||||
// if (linkedItem != null && linkedItem.AssetType != (int)AssetType.Link)
|
||||
// linkedItemsToAdd.Insert(0, linkedItem);
|
||||
// }
|
||||
// }
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Returning item {0}, type {1}, parent {2} in {3} {4}",
|
||||
// item.Name, (AssetType)item.AssetType, item.Folder, containingFolder.Name, containingFolder.ID);
|
||||
// }
|
||||
|
||||
// =====
|
||||
|
||||
//
|
||||
// foreach (InventoryItemBase linkedItem in linkedItemsToAdd)
|
||||
// {
|
||||
@@ -365,18 +418,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||
llsdItem.item_id = invItem.ID;
|
||||
llsdItem.name = invItem.Name;
|
||||
llsdItem.parent_id = invItem.Folder;
|
||||
|
||||
try
|
||||
{
|
||||
llsdItem.type = Utils.AssetTypeToString((AssetType)invItem.AssetType);
|
||||
llsdItem.inv_type = Utils.InventoryTypeToString((InventoryType)invItem.InvType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[WEB FETCH INV DESC HANDLER]: Problem setting asset {0} inventory {1} types while converting inventory item {2}: {3}",
|
||||
invItem.AssetType, invItem.InvType, invItem.Name, e.Message);
|
||||
}
|
||||
llsdItem.type = invItem.AssetType;
|
||||
llsdItem.inv_type = invItem.InvType;
|
||||
|
||||
llsdItem.permissions = new LLSDPermissions();
|
||||
llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
|
||||
@@ -390,21 +433,7 @@ namespace OpenSim.Capabilities.Handlers
|
||||
llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.sale_info = new LLSDSaleInfo();
|
||||
llsdItem.sale_info.sale_price = invItem.SalePrice;
|
||||
switch (invItem.SaleType)
|
||||
{
|
||||
default:
|
||||
llsdItem.sale_info.sale_type = "not";
|
||||
break;
|
||||
case 1:
|
||||
llsdItem.sale_info.sale_type = "original";
|
||||
break;
|
||||
case 2:
|
||||
llsdItem.sale_info.sale_type = "copy";
|
||||
break;
|
||||
case 3:
|
||||
llsdItem.sale_info.sale_type = "contents";
|
||||
break;
|
||||
}
|
||||
llsdItem.sale_info.sale_type = invItem.SaleType;
|
||||
|
||||
return llsdItem;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,13 @@ namespace OpenSim.Capabilities.Handlers
|
||||
ServerUtils.LoadPlugin<ILibraryService>(libService, args);
|
||||
|
||||
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
|
||||
IRequestHandler reqHandler = new RestStreamHandler("POST", "/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/, webFetchHandler.FetchInventoryDescendentsRequest);
|
||||
IRequestHandler reqHandler
|
||||
= new RestStreamHandler(
|
||||
"POST",
|
||||
"/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/,
|
||||
webFetchHandler.FetchInventoryDescendentsRequest,
|
||||
"WebFetchInvDesc",
|
||||
null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -25,39 +25,44 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
namespace OpenSim.Framework.Capabilities
|
||||
{
|
||||
public class AvatarAnimations
|
||||
[OSDMap]
|
||||
public class LLSDEnvironmentRequest
|
||||
{
|
||||
public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>();
|
||||
public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>();
|
||||
public Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>();
|
||||
public UUID messageID;
|
||||
public UUID regionID;
|
||||
}
|
||||
|
||||
public AvatarAnimations()
|
||||
[OSDMap]
|
||||
public class LLSDEnvironmentSetResponse
|
||||
{
|
||||
public UUID regionID;
|
||||
public UUID messageID;
|
||||
public Boolean success;
|
||||
public String fail_reason;
|
||||
}
|
||||
|
||||
public class EnvironmentSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// generates a empty llsd settings response for viewer
|
||||
/// </summary>
|
||||
/// <param name="messageID">the message UUID</param>
|
||||
/// <param name="regionID">the region UUID</param>
|
||||
public static string EmptySettings(UUID messageID, UUID regionID)
|
||||
{
|
||||
using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(reader);
|
||||
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
if (nod.Attributes["name"] != null)
|
||||
{
|
||||
string name = (string)nod.Attributes["name"].Value;
|
||||
UUID id = (UUID)nod.InnerText;
|
||||
string animState = (string)nod.Attributes["state"].Value;
|
||||
|
||||
AnimsUUID.Add(name, id);
|
||||
AnimsNames.Add(id, name);
|
||||
if (animState != "")
|
||||
AnimStateNames.Add(id, animState);
|
||||
}
|
||||
}
|
||||
}
|
||||
OSDArray arr = new OSDArray();
|
||||
LLSDEnvironmentRequest msg = new LLSDEnvironmentRequest();
|
||||
msg.messageID = messageID;
|
||||
msg.regionID = regionID;
|
||||
arr.Array.Add(msg);
|
||||
return LLSDHelpers.SerialiseLLSDReply(arr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,8 +37,8 @@ namespace OpenSim.Framework.Capabilities
|
||||
public UUID asset_id;
|
||||
public UUID item_id;
|
||||
public LLSDPermissions permissions;
|
||||
public string type;
|
||||
public string inv_type;
|
||||
public int type;
|
||||
public int inv_type;
|
||||
public int flags;
|
||||
|
||||
public LLSDSaleInfo sale_info;
|
||||
@@ -65,7 +65,7 @@ namespace OpenSim.Framework.Capabilities
|
||||
public class LLSDSaleInfo
|
||||
{
|
||||
public int sale_price;
|
||||
public string sale_type;
|
||||
public int sale_type;
|
||||
}
|
||||
|
||||
[OSDMap]
|
||||
|
||||
@@ -39,7 +39,11 @@ namespace OpenSim.Framework.Capabilities
|
||||
private LLSDMethod<TRequest, TResponse> m_method;
|
||||
|
||||
public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method)
|
||||
: base(httpMethod, path)
|
||||
: this(httpMethod, path, method, null, null) {}
|
||||
|
||||
public LLSDStreamhandler(
|
||||
string httpMethod, string path, LLSDMethod<TRequest, TResponse> method, string name, string description)
|
||||
: base(httpMethod, path, name, description)
|
||||
{
|
||||
m_method = method;
|
||||
}
|
||||
|
||||
@@ -25,52 +25,23 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
namespace OpenSim.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Will be the PhysX plugin but for now will be a very basic physics engine
|
||||
/// This interface exists to distinguish between the normal IAssetDataPlugin and the one used by XAssetService
|
||||
/// for now.
|
||||
/// </summary>
|
||||
public class PhysXPlugin : IPhysicsPlugin
|
||||
public interface IXAssetDataPlugin : IPlugin
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private PhysXScene _mScene;
|
||||
|
||||
public PhysXPlugin()
|
||||
{
|
||||
}
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
if (_mScene == null)
|
||||
{
|
||||
_mScene = new PhysXScene(sceneIdentifier);
|
||||
}
|
||||
return (_mScene);
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("RealPhysX");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
AssetBase GetAsset(UUID uuid);
|
||||
void StoreAsset(AssetBase asset);
|
||||
bool ExistsAsset(UUID uuid);
|
||||
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
void Initialise(string connect);
|
||||
bool Delete(string id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -89,5 +89,11 @@ namespace OpenSim.Data.MSSQL
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(Guid principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID", connection))
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID and type=-1", connection))
|
||||
{
|
||||
command.Parameters.Add(database.CreateParameter("folderID", folderID));
|
||||
|
||||
|
||||
@@ -104,6 +104,11 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
return SqlDbType.BigInt;
|
||||
}
|
||||
if (type == typeof(DateTime))
|
||||
{
|
||||
return SqlDbType.DateTime;
|
||||
}
|
||||
|
||||
return SqlDbType.VarChar;
|
||||
}
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags]) VALUES (@LandUUID,@AccessUUID,@Flags)";
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags],[Expires]) VALUES (@LandUUID,@AccessUUID,@Flags,@Expires)";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
@@ -1181,6 +1181,72 @@ VALUES
|
||||
// }
|
||||
#endregion
|
||||
}
|
||||
|
||||
#region Environment Settings
|
||||
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
string sql = "select * from [regionenvironment] where region_id = @region_id";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||
conn.Open();
|
||||
using (SqlDataReader result = cmd.ExecuteReader())
|
||||
{
|
||||
if (!result.Read())
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToString(result["llsd_settings"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||
{
|
||||
{
|
||||
string sql = "DELETE FROM [regionenvironment] WHERE region_id = @region_id";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [regionenvironment] (region_id, llsd_settings) VALUES (@region_id, @llsd_settings)";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@llsd_settings", settings));
|
||||
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
string sql = "delete from [regionenvironment] where region_id = @region_id";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionUUID));
|
||||
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Loads the settings of a region.
|
||||
/// </summary>
|
||||
@@ -1215,6 +1281,8 @@ VALUES
|
||||
//Store new values
|
||||
StoreNewRegionSettings(regionSettings);
|
||||
|
||||
LoadSpawnPoints(regionSettings);
|
||||
|
||||
return regionSettings;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1320,7 @@ VALUES
|
||||
,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se
|
||||
,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit
|
||||
,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position
|
||||
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
|
||||
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id, [map_tile_id] = @TerrainImageID, [telehubobject] = @telehubobject, [parcel_tile_id] = @ParcelImageID
|
||||
WHERE [regionUUID] = @regionUUID";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
@@ -1263,6 +1331,7 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
SaveSpawnPoints(regionSettings);
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
@@ -1367,7 +1436,7 @@ VALUES
|
||||
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
|
||||
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
|
||||
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
|
||||
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
|
||||
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
|
||||
newSettings.SunVector = new Vector3(
|
||||
@@ -1383,6 +1452,11 @@ VALUES
|
||||
newSettings.LoadedCreationID = "";
|
||||
else
|
||||
newSettings.LoadedCreationID = (String)row["loaded_creation_id"];
|
||||
|
||||
newSettings.TerrainImageID = new UUID((string)row["map_tile_ID"]);
|
||||
newSettings.ParcelImageID = new UUID((Guid)row["parcel_tile_ID"]);
|
||||
newSettings.TelehubObject = new UUID((Guid)row["TelehubObject"]);
|
||||
|
||||
return newSettings;
|
||||
}
|
||||
|
||||
@@ -1454,6 +1528,13 @@ VALUES
|
||||
}
|
||||
|
||||
newData.ParcelAccessList = new List<LandAccessEntry>();
|
||||
newData.MediaDescription = (string)row["MediaDescription"];
|
||||
newData.MediaType = (string)row["MediaType"];
|
||||
newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
|
||||
newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
|
||||
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
|
||||
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
|
||||
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
|
||||
|
||||
return newData;
|
||||
}
|
||||
@@ -1468,7 +1549,7 @@ VALUES
|
||||
LandAccessEntry entry = new LandAccessEntry();
|
||||
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
|
||||
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
|
||||
entry.Expires = 0;
|
||||
entry.Expires = Convert.ToInt32(row["Expires"]);
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -1497,7 +1578,8 @@ VALUES
|
||||
prim.TouchName = (string)primRow["TouchName"];
|
||||
// permissions
|
||||
prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
|
||||
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
//prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
prim.CreatorIdentification = (string)primRow["CreatorID"];
|
||||
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
|
||||
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
|
||||
prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
|
||||
@@ -1691,7 +1773,8 @@ VALUES
|
||||
taskItem.Name = (string)inventoryRow["name"];
|
||||
taskItem.Description = (string)inventoryRow["description"];
|
||||
taskItem.CreationDate = Convert.ToUInt32(inventoryRow["creationDate"]);
|
||||
taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
|
||||
//taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
|
||||
taskItem.CreatorIdentification = (string)inventoryRow["creatorID"];
|
||||
taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]);
|
||||
taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]);
|
||||
taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]);
|
||||
@@ -1782,7 +1865,7 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
|
||||
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
|
||||
parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun));
|
||||
parameters.Add(_Database.CreateParameter("sandbox", settings.Sandbox));
|
||||
parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox));
|
||||
parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun));
|
||||
parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition));
|
||||
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));
|
||||
@@ -1792,6 +1875,9 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime));
|
||||
parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
|
||||
parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID));
|
||||
parameters.Add(_Database.CreateParameter("TerrainImageID", settings.TerrainImageID));
|
||||
parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID));
|
||||
parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
@@ -1859,6 +1945,7 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("LandUUID", parcelID));
|
||||
parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID));
|
||||
parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags));
|
||||
parameters.Add(_Database.CreateParameter("Expires", parcelAccessEntry.Expires));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
@@ -2063,5 +2150,57 @@ VALUES
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
private void LoadSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
rs.ClearSpawnPoints();
|
||||
|
||||
string sql = "SELECT Yaw, Pitch, Distance FROM spawn_points WHERE RegionUUID = @RegionUUID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID.ToString()));
|
||||
conn.Open();
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
SpawnPoint sp = new SpawnPoint();
|
||||
|
||||
sp.Yaw = (float)reader["Yaw"];
|
||||
sp.Pitch = (float)reader["Pitch"];
|
||||
sp.Distance = (float)reader["Distance"];
|
||||
|
||||
rs.AddSpawnPoint(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
string sql = "DELETE FROM spawn_points WHERE RegionUUID = @RegionUUID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
foreach (SpawnPoint p in rs.SpawnPoints())
|
||||
{
|
||||
sql = "INSERT INTO spawn_points (RegionUUID, Yaw, Pitch, Distance) VALUES (@RegionUUID, @Yaw, @Pitch, @Distance)";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Yaw", p.Yaw));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Pitch", p.Pitch));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Distance", p.Distance));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
|
||||
regionName
|
||||
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
COMMIT
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -1044,10 +1044,107 @@ ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 29 #---------------------
|
||||
:VERSION 29 #----------------- Region Covenant changed time
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 30 #------------------Migrate creatorID storage to varchars instead of UUIDs for HG support
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
EXECUTE sp_rename N'dbo.prims.creatorid', N'creatoridold', 'COLUMN'
|
||||
EXECUTE sp_rename N'dbo.primitems.creatorid', N'creatoridold', 'COLUMN'
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 31 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims ADD CreatorID varchar(255)
|
||||
ALTER TABLE primitems ADD CreatorID varchar(255)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
UPDATE prims SET prims.CreatorID = CONVERT(varchar(255), creatoridold)
|
||||
UPDATE primitems SET primitems.CreatorID = CONVERT(varchar(255), creatoridold)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 33 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims
|
||||
ADD CONSTRAINT DF_prims_CreatorIDNew
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE prims ALTER COLUMN CreatorID varchar(255) NOT NULL
|
||||
|
||||
ALTER TABLE primitems
|
||||
ADD CONSTRAINT DF_primitems_CreatorIDNew
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE primitems ALTER COLUMN CreatorID varchar(255) NOT NULL
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 34 #--------------- Telehub support
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE [dbo].[Spawn_Points](
|
||||
[RegionUUID] [uniqueidentifier] NOT NULL,
|
||||
[Yaw] [float] NOT NULL,
|
||||
[Pitch] [float] NOT NULL,
|
||||
[Distance] [float] NOT NULL,
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[RegionUUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
ALTER TABLE regionsettings ADD TelehubObject uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 35 #---------------- Parcels for sale
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE regionsettings ADD parcel_tile_ID uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 36 #---------------- Timed bans/access
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE landaccesslist ADD Expires integer NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 37 #---------------- Environment Settings
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE [dbo].[regionenvironment](
|
||||
[region_id] [uniqueidentifier] NOT NULL,
|
||||
[llsd_settings] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[region_id] ASC
|
||||
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -163,52 +163,51 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand cmd =
|
||||
using (MySqlCommand cmd =
|
||||
new MySqlCommand(
|
||||
"replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, CreatorID, data)" +
|
||||
"VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?CreatorID, ?data)",
|
||||
dbcon);
|
||||
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
dbcon))
|
||||
{
|
||||
assetName = asset.Name.Substring(0, 64);
|
||||
m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add");
|
||||
}
|
||||
|
||||
string assetDescription = asset.Description;
|
||||
if (asset.Description.Length > 64)
|
||||
{
|
||||
assetDescription = asset.Description.Substring(0, 64);
|
||||
m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add");
|
||||
}
|
||||
|
||||
// need to ensure we dispose
|
||||
try
|
||||
{
|
||||
using (cmd)
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?name", assetName);
|
||||
cmd.Parameters.AddWithValue("?description", assetDescription);
|
||||
cmd.Parameters.AddWithValue("?assetType", asset.Type);
|
||||
cmd.Parameters.AddWithValue("?local", asset.Local);
|
||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||
cmd.Parameters.AddWithValue("?create_time", now);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.Parameters.AddWithValue("?CreatorID", asset.Metadata.CreatorID);
|
||||
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
assetName = asset.Name.Substring(0, 64);
|
||||
m_log.Warn("[ASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add");
|
||||
}
|
||||
|
||||
string assetDescription = asset.Description;
|
||||
if (asset.Description.Length > 64)
|
||||
{
|
||||
assetDescription = asset.Description.Substring(0, 64);
|
||||
m_log.Warn("[ASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (cmd)
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?name", assetName);
|
||||
cmd.Parameters.AddWithValue("?description", assetDescription);
|
||||
cmd.Parameters.AddWithValue("?assetType", asset.Type);
|
||||
cmd.Parameters.AddWithValue("?local", asset.Local);
|
||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||
cmd.Parameters.AddWithValue("?create_time", now);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.Parameters.AddWithValue("?CreatorID", asset.Metadata.CreatorID);
|
||||
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,33 +220,31 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd =
|
||||
new MySqlCommand("update assets set access_time=?access_time where id=?id",
|
||||
dbcon);
|
||||
|
||||
// need to ensure we dispose
|
||||
try
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand("update assets set access_time=?access_time where id=?id", dbcon))
|
||||
{
|
||||
using (cmd)
|
||||
try
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
using (cmd)
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASSETS DB]: " +
|
||||
"MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASSETS DB]: " +
|
||||
"MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -310,35 +307,41 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags,CreatorID FROM assets LIMIT ?start, ?count", dbcon);
|
||||
cmd.Parameters.AddWithValue("?start", start);
|
||||
cmd.Parameters.AddWithValue("?count", count);
|
||||
|
||||
try
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand(
|
||||
"SELECT name,description,assetType,temporary,id,asset_flags,CreatorID FROM assets LIMIT ?start, ?count",
|
||||
dbcon))
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
cmd.Parameters.AddWithValue("?start", start);
|
||||
cmd.Parameters.AddWithValue("?count", count);
|
||||
|
||||
try
|
||||
{
|
||||
while (dbReader.Read())
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
{
|
||||
AssetMetadata metadata = new AssetMetadata();
|
||||
metadata.Name = (string)dbReader["name"];
|
||||
metadata.Description = (string)dbReader["description"];
|
||||
metadata.Type = (sbyte)dbReader["assetType"];
|
||||
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
||||
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
|
||||
metadata.CreatorID = dbReader["CreatorID"].ToString();
|
||||
|
||||
// Current SHA1s are not stored/computed.
|
||||
metadata.SHA1 = new byte[] { };
|
||||
|
||||
retList.Add(metadata);
|
||||
while (dbReader.Read())
|
||||
{
|
||||
AssetMetadata metadata = new AssetMetadata();
|
||||
metadata.Name = (string)dbReader["name"];
|
||||
metadata.Description = (string)dbReader["description"];
|
||||
metadata.Type = (sbyte)dbReader["assetType"];
|
||||
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
||||
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
|
||||
metadata.CreatorID = dbReader["CreatorID"].ToString();
|
||||
|
||||
// Current SHA1s are not stored/computed.
|
||||
metadata.SHA1 = new byte[] { };
|
||||
|
||||
retList.Add(metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[ASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[ASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -353,11 +356,12 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon);
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.Dispose();
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,4 +370,4 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,41 +70,52 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID", dbcon);
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
|
||||
IDataReader result = cmd.ExecuteReader();
|
||||
|
||||
if (result.Read())
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID", dbcon))
|
||||
{
|
||||
ret.PrincipalID = principalID;
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
|
||||
if (m_ColumnNames == null)
|
||||
IDataReader result = cmd.ExecuteReader();
|
||||
|
||||
if (result.Read())
|
||||
{
|
||||
m_ColumnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
ret.PrincipalID = principalID;
|
||||
|
||||
CheckColumnNames(result);
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
if (s == "UUID")
|
||||
continue;
|
||||
|
||||
ret.Data[s] = result[s].ToString();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
else
|
||||
{
|
||||
if (s == "UUID")
|
||||
continue;
|
||||
|
||||
ret.Data[s] = result[s].ToString();
|
||||
return null;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckColumnNames(IDataReader result)
|
||||
{
|
||||
if (m_ColumnNames != null)
|
||||
return;
|
||||
|
||||
List<string> columnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
columnNames.Add(row["ColumnName"].ToString());
|
||||
|
||||
m_ColumnNames = columnNames;
|
||||
}
|
||||
|
||||
public bool Store(AuthenticationData data)
|
||||
{
|
||||
if (data.Data.ContainsKey("UUID"))
|
||||
@@ -112,57 +123,53 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
string[] fields = new List<string>(data.Data.Keys).ToArray();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
string update = "update `"+m_Realm+"` set ";
|
||||
bool first = true;
|
||||
foreach (string field in fields)
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
if (!first)
|
||||
update += ", ";
|
||||
update += "`" + field + "` = ?"+field;
|
||||
|
||||
first = false;
|
||||
|
||||
cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
|
||||
}
|
||||
|
||||
update += " where UUID = ?principalID";
|
||||
|
||||
cmd.CommandText = update;
|
||||
cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) < 1)
|
||||
{
|
||||
string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
|
||||
String.Join("`, `", fields) +
|
||||
"`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
|
||||
|
||||
cmd.CommandText = insert;
|
||||
|
||||
string update = "update `"+m_Realm+"` set ";
|
||||
bool first = true;
|
||||
foreach (string field in fields)
|
||||
{
|
||||
if (!first)
|
||||
update += ", ";
|
||||
update += "`" + field + "` = ?"+field;
|
||||
|
||||
first = false;
|
||||
|
||||
cmd.Parameters.AddWithValue("?"+field, data.Data[field]);
|
||||
}
|
||||
|
||||
update += " where UUID = ?principalID";
|
||||
|
||||
cmd.CommandText = update;
|
||||
cmd.Parameters.AddWithValue("?principalID", data.PrincipalID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) < 1)
|
||||
{
|
||||
cmd.Dispose();
|
||||
return false;
|
||||
string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
|
||||
String.Join("`, `", fields) +
|
||||
"`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
|
||||
|
||||
cmd.CommandText = insert;
|
||||
|
||||
if (ExecuteNonQuery(cmd) < 1)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetDataItem(UUID principalID, string item, string value)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand("update `" + m_Realm +
|
||||
"` set `" + item + "` = ?" + item + " where UUID = ?UUID");
|
||||
|
||||
|
||||
cmd.Parameters.AddWithValue("?"+item, value);
|
||||
cmd.Parameters.AddWithValue("?UUID", principalID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand("update `" + m_Realm + "` set `" + item + "` = ?" + item + " where UUID = ?UUID"))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?"+item, value);
|
||||
cmd.Parameters.AddWithValue("?UUID", principalID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -172,18 +179,18 @@ namespace OpenSim.Data.MySQL
|
||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||
DoExpire();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand("insert into tokens (UUID, token, validity) values (?principalID, ?token, date_add(now(), interval ?lifetime minute))");
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?token", token);
|
||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand(
|
||||
"insert into tokens (UUID, token, validity) values (?principalID, ?token, date_add(now(), interval ?lifetime minute))"))
|
||||
{
|
||||
cmd.Dispose();
|
||||
return true;
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?token", token);
|
||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -192,30 +199,29 @@ namespace OpenSim.Data.MySQL
|
||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||
DoExpire();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand("update tokens set validity = date_add(now(), interval ?lifetime minute) where UUID = ?principalID and token = ?token and validity > now()");
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?token", token);
|
||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand(
|
||||
"update tokens set validity = date_add(now(), interval ?lifetime minute) where UUID = ?principalID and token = ?token and validity > now()"))
|
||||
{
|
||||
cmd.Dispose();
|
||||
return true;
|
||||
}
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?token", token);
|
||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||
|
||||
cmd.Dispose();
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DoExpire()
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand("delete from tokens where validity < now()");
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Dispose();
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from tokens where validity < now()"))
|
||||
{
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
|
||||
m_LastExpire = System.Environment.TickCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,14 +52,15 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public bool Delete(UUID principalID, string name)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?Name", name);
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("delete from {0} where `PrincipalID` = ?PrincipalID and `Name` = ?Name", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?Name", name);
|
||||
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,34 +49,38 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public bool Delete(string principalID, string friend)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?Friend", friend);
|
||||
|
||||
cmd.CommandText = String.Format("delete from {0} where PrincipalID = ?PrincipalID and Friend = ?Friend", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?Friend", friend);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(UUID principalID)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = ?PrincipalID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
|
||||
cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID = ?PrincipalID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString());
|
||||
|
||||
return DoQuery(cmd);
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(string principalID)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID LIKE ?PrincipalID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString() + '%');
|
||||
|
||||
cmd.CommandText = String.Format("select a.*,case when b.Flags is null then -1 else b.Flags end as TheirFlags from {0} as a left join {0} as b on a.PrincipalID = b.Friend and a.Friend = b.PrincipalID where a.PrincipalID LIKE ?PrincipalID", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?PrincipalID", principalID.ToString() + '%');
|
||||
return DoQuery(cmd);
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,15 +91,17 @@ namespace OpenSim.Data.MySQL
|
||||
if (m_ColumnNames != null)
|
||||
return;
|
||||
|
||||
m_ColumnNames = new List<string>();
|
||||
List<string> columnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = reader.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
{
|
||||
if (row["ColumnName"] != null &&
|
||||
(!m_Fields.ContainsKey(row["ColumnName"].ToString())))
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
columnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
|
||||
m_ColumnNames = columnNames;
|
||||
}
|
||||
|
||||
public virtual T[] Get(string field, string key)
|
||||
|
||||
@@ -467,43 +467,43 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand result = new MySqlCommand(sql, dbcon);
|
||||
result.Parameters.AddWithValue("?inventoryID", item.ID.ToString());
|
||||
result.Parameters.AddWithValue("?assetID", item.AssetID.ToString());
|
||||
result.Parameters.AddWithValue("?assetType", item.AssetType.ToString());
|
||||
result.Parameters.AddWithValue("?parentFolderID", item.Folder.ToString());
|
||||
result.Parameters.AddWithValue("?avatarID", item.Owner.ToString());
|
||||
result.Parameters.AddWithValue("?inventoryName", itemName);
|
||||
result.Parameters.AddWithValue("?inventoryDescription", itemDesc);
|
||||
result.Parameters.AddWithValue("?inventoryNextPermissions", item.NextPermissions.ToString());
|
||||
result.Parameters.AddWithValue("?inventoryCurrentPermissions",
|
||||
item.CurrentPermissions.ToString());
|
||||
result.Parameters.AddWithValue("?invType", item.InvType);
|
||||
result.Parameters.AddWithValue("?creatorID", item.CreatorId);
|
||||
result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
|
||||
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
|
||||
result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions);
|
||||
result.Parameters.AddWithValue("?salePrice", item.SalePrice);
|
||||
result.Parameters.AddWithValue("?saleType", unchecked((sbyte)item.SaleType));
|
||||
result.Parameters.AddWithValue("?creationDate", item.CreationDate);
|
||||
result.Parameters.AddWithValue("?groupID", item.GroupID);
|
||||
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
|
||||
result.Parameters.AddWithValue("?flags", item.Flags);
|
||||
|
||||
lock (m_dbLock)
|
||||
using (MySqlCommand result = new MySqlCommand(sql, dbcon))
|
||||
{
|
||||
result.ExecuteNonQuery();
|
||||
result.Parameters.AddWithValue("?inventoryID", item.ID.ToString());
|
||||
result.Parameters.AddWithValue("?assetID", item.AssetID.ToString());
|
||||
result.Parameters.AddWithValue("?assetType", item.AssetType.ToString());
|
||||
result.Parameters.AddWithValue("?parentFolderID", item.Folder.ToString());
|
||||
result.Parameters.AddWithValue("?avatarID", item.Owner.ToString());
|
||||
result.Parameters.AddWithValue("?inventoryName", itemName);
|
||||
result.Parameters.AddWithValue("?inventoryDescription", itemDesc);
|
||||
result.Parameters.AddWithValue("?inventoryNextPermissions", item.NextPermissions.ToString());
|
||||
result.Parameters.AddWithValue("?inventoryCurrentPermissions",
|
||||
item.CurrentPermissions.ToString());
|
||||
result.Parameters.AddWithValue("?invType", item.InvType);
|
||||
result.Parameters.AddWithValue("?creatorID", item.CreatorId);
|
||||
result.Parameters.AddWithValue("?inventoryBasePermissions", item.BasePermissions);
|
||||
result.Parameters.AddWithValue("?inventoryEveryOnePermissions", item.EveryOnePermissions);
|
||||
result.Parameters.AddWithValue("?inventoryGroupPermissions", item.GroupPermissions);
|
||||
result.Parameters.AddWithValue("?salePrice", item.SalePrice);
|
||||
result.Parameters.AddWithValue("?saleType", unchecked((sbyte)item.SaleType));
|
||||
result.Parameters.AddWithValue("?creationDate", item.CreationDate);
|
||||
result.Parameters.AddWithValue("?groupID", item.GroupID);
|
||||
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
|
||||
result.Parameters.AddWithValue("?flags", item.Flags);
|
||||
|
||||
lock (m_dbLock)
|
||||
result.ExecuteNonQuery();
|
||||
|
||||
result.Dispose();
|
||||
}
|
||||
|
||||
result.Dispose();
|
||||
|
||||
result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon);
|
||||
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
|
||||
lock (m_dbLock)
|
||||
using (MySqlCommand result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon))
|
||||
{
|
||||
result.ExecuteNonQuery();
|
||||
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
|
||||
|
||||
lock (m_dbLock)
|
||||
result.ExecuteNonQuery();
|
||||
}
|
||||
result.Dispose();
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
@@ -533,12 +533,12 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", dbcon);
|
||||
cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
|
||||
|
||||
lock (m_dbLock)
|
||||
using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", dbcon))
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
|
||||
|
||||
lock (m_dbLock)
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,24 +579,26 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(sql, dbcon);
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?agentID", folder.Owner.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
cmd.Parameters.AddWithValue("?folderName", folderName);
|
||||
cmd.Parameters.AddWithValue("?type", folder.Type);
|
||||
cmd.Parameters.AddWithValue("?version", folder.Version);
|
||||
using (MySqlCommand cmd = new MySqlCommand(sql, dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?agentID", folder.Owner.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
cmd.Parameters.AddWithValue("?folderName", folderName);
|
||||
cmd.Parameters.AddWithValue("?type", folder.Type);
|
||||
cmd.Parameters.AddWithValue("?version", folder.Version);
|
||||
|
||||
try
|
||||
{
|
||||
lock (m_dbLock)
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
lock (m_dbLock)
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -624,20 +626,22 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(sql, dbcon);
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
|
||||
try
|
||||
using (MySqlCommand cmd = new MySqlCommand(sql, dbcon))
|
||||
{
|
||||
lock (m_dbLock)
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
lock (m_dbLock)
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,13 +63,14 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public void LogoutRegionAgents(UUID regionID)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("delete from {0} where `RegionID`=?RegionID", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public bool ReportAgent(UUID sessionID, UUID regionID)
|
||||
@@ -81,17 +82,18 @@ namespace OpenSim.Data.MySQL
|
||||
if (regionID == UUID.Zero)
|
||||
return false;
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) == 0)
|
||||
return false;
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("update {0} set RegionID=?RegionID, LastSeen=NOW() where `SessionID`=?SessionID", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?SessionID", sessionID.ToString());
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
|
||||
if (ExecuteNonQuery(cmd) == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -162,17 +162,7 @@ namespace OpenSim.Data.MySQL
|
||||
ret.sizeX = Convert.ToInt32(result["sizeX"]);
|
||||
ret.sizeY = Convert.ToInt32(result["sizeY"]);
|
||||
|
||||
if (m_ColumnNames == null)
|
||||
{
|
||||
m_ColumnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
{
|
||||
if (row["ColumnName"] != null)
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
}
|
||||
CheckColumnNames(result);
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
@@ -187,7 +177,11 @@ namespace OpenSim.Data.MySQL
|
||||
if (s == "locY")
|
||||
continue;
|
||||
|
||||
ret.Data[s] = result[s].ToString();
|
||||
object value = result[s];
|
||||
if (value is DBNull)
|
||||
ret.Data[s] = null;
|
||||
else
|
||||
ret.Data[s] = result[s].ToString();
|
||||
}
|
||||
|
||||
retList.Add(ret);
|
||||
@@ -198,6 +192,23 @@ namespace OpenSim.Data.MySQL
|
||||
return retList;
|
||||
}
|
||||
|
||||
private void CheckColumnNames(IDataReader result)
|
||||
{
|
||||
if (m_ColumnNames != null)
|
||||
return;
|
||||
|
||||
List<string> columnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
{
|
||||
if (row["ColumnName"] != null)
|
||||
columnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
|
||||
m_ColumnNames = columnNames;
|
||||
}
|
||||
|
||||
public bool Store(RegionData data)
|
||||
{
|
||||
if (data.Data.ContainsKey("uuid"))
|
||||
@@ -318,11 +329,12 @@ namespace OpenSim.Data.MySQL
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(command);
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,114 +129,114 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = dbcon.CreateCommand();
|
||||
|
||||
foreach (SceneObjectPart prim in obj.Parts)
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into prims (" +
|
||||
"UUID, CreationDate, " +
|
||||
"Name, Text, Description, " +
|
||||
"SitName, TouchName, ObjectFlags, " +
|
||||
"OwnerMask, NextOwnerMask, GroupMask, " +
|
||||
"EveryoneMask, BaseMask, PositionX, " +
|
||||
"PositionY, PositionZ, GroupPositionX, " +
|
||||
"GroupPositionY, GroupPositionZ, VelocityX, " +
|
||||
"VelocityY, VelocityZ, AngularVelocityX, " +
|
||||
"AngularVelocityY, AngularVelocityZ, " +
|
||||
"AccelerationX, AccelerationY, " +
|
||||
"AccelerationZ, RotationX, " +
|
||||
"RotationY, RotationZ, " +
|
||||
"RotationW, SitTargetOffsetX, " +
|
||||
"SitTargetOffsetY, SitTargetOffsetZ, " +
|
||||
"SitTargetOrientW, SitTargetOrientX, " +
|
||||
"SitTargetOrientY, SitTargetOrientZ, " +
|
||||
"RegionUUID, CreatorID, " +
|
||||
"OwnerID, GroupID, " +
|
||||
"LastOwnerID, SceneGroupID, " +
|
||||
"PayPrice, PayButton1, " +
|
||||
"PayButton2, PayButton3, " +
|
||||
"PayButton4, LoopedSound, " +
|
||||
"LoopedSoundGain, TextureAnimation, " +
|
||||
"OmegaX, OmegaY, OmegaZ, " +
|
||||
"CameraEyeOffsetX, CameraEyeOffsetY, " +
|
||||
"CameraEyeOffsetZ, CameraAtOffsetX, " +
|
||||
"CameraAtOffsetY, CameraAtOffsetZ, " +
|
||||
"ForceMouselook, ScriptAccessPin, " +
|
||||
"AllowedDrop, DieAtEdge, " +
|
||||
"SalePrice, SaleType, " +
|
||||
"ColorR, ColorG, ColorB, ColorA, " +
|
||||
"ParticleSystem, ClickAction, Material, " +
|
||||
"CollisionSound, CollisionSoundVolume, " +
|
||||
"PassTouches, " +
|
||||
"LinkNumber, MediaURL) values (" + "?UUID, " +
|
||||
"?CreationDate, ?Name, ?Text, " +
|
||||
"?Description, ?SitName, ?TouchName, " +
|
||||
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
|
||||
"?GroupMask, ?EveryoneMask, ?BaseMask, " +
|
||||
"?PositionX, ?PositionY, ?PositionZ, " +
|
||||
"?GroupPositionX, ?GroupPositionY, " +
|
||||
"?GroupPositionZ, ?VelocityX, " +
|
||||
"?VelocityY, ?VelocityZ, ?AngularVelocityX, " +
|
||||
"?AngularVelocityY, ?AngularVelocityZ, " +
|
||||
"?AccelerationX, ?AccelerationY, " +
|
||||
"?AccelerationZ, ?RotationX, " +
|
||||
"?RotationY, ?RotationZ, " +
|
||||
"?RotationW, ?SitTargetOffsetX, " +
|
||||
"?SitTargetOffsetY, ?SitTargetOffsetZ, " +
|
||||
"?SitTargetOrientW, ?SitTargetOrientX, " +
|
||||
"?SitTargetOrientY, ?SitTargetOrientZ, " +
|
||||
"?RegionUUID, ?CreatorID, ?OwnerID, " +
|
||||
"?GroupID, ?LastOwnerID, ?SceneGroupID, " +
|
||||
"?PayPrice, ?PayButton1, ?PayButton2, " +
|
||||
"?PayButton3, ?PayButton4, ?LoopedSound, " +
|
||||
"?LoopedSoundGain, ?TextureAnimation, " +
|
||||
"?OmegaX, ?OmegaY, ?OmegaZ, " +
|
||||
"?CameraEyeOffsetX, ?CameraEyeOffsetY, " +
|
||||
"?CameraEyeOffsetZ, ?CameraAtOffsetX, " +
|
||||
"?CameraAtOffsetY, ?CameraAtOffsetZ, " +
|
||||
"?ForceMouselook, ?ScriptAccessPin, " +
|
||||
"?AllowedDrop, ?DieAtEdge, ?SalePrice, " +
|
||||
"?SaleType, ?ColorR, ?ColorG, " +
|
||||
"?ColorB, ?ColorA, ?ParticleSystem, " +
|
||||
"?ClickAction, ?Material, ?CollisionSound, " +
|
||||
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
|
||||
|
||||
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into primshapes (" +
|
||||
"UUID, Shape, ScaleX, ScaleY, " +
|
||||
"ScaleZ, PCode, PathBegin, PathEnd, " +
|
||||
"PathScaleX, PathScaleY, PathShearX, " +
|
||||
"PathShearY, PathSkew, PathCurve, " +
|
||||
"PathRadiusOffset, PathRevolutions, " +
|
||||
"PathTaperX, PathTaperY, PathTwist, " +
|
||||
"PathTwistBegin, ProfileBegin, ProfileEnd, " +
|
||||
"ProfileCurve, ProfileHollow, Texture, " +
|
||||
"ExtraParams, State, Media) values (?UUID, " +
|
||||
"?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
|
||||
"?PCode, ?PathBegin, ?PathEnd, " +
|
||||
"?PathScaleX, ?PathScaleY, " +
|
||||
"?PathShearX, ?PathShearY, " +
|
||||
"?PathSkew, ?PathCurve, ?PathRadiusOffset, " +
|
||||
"?PathRevolutions, ?PathTaperX, " +
|
||||
"?PathTaperY, ?PathTwist, " +
|
||||
"?PathTwistBegin, ?ProfileBegin, " +
|
||||
"?ProfileEnd, ?ProfileCurve, " +
|
||||
"?ProfileHollow, ?Texture, ?ExtraParams, " +
|
||||
"?State, ?Media)";
|
||||
|
||||
FillShapeCommand(cmd, prim);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
foreach (SceneObjectPart prim in obj.Parts)
|
||||
{
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into prims (" +
|
||||
"UUID, CreationDate, " +
|
||||
"Name, Text, Description, " +
|
||||
"SitName, TouchName, ObjectFlags, " +
|
||||
"OwnerMask, NextOwnerMask, GroupMask, " +
|
||||
"EveryoneMask, BaseMask, PositionX, " +
|
||||
"PositionY, PositionZ, GroupPositionX, " +
|
||||
"GroupPositionY, GroupPositionZ, VelocityX, " +
|
||||
"VelocityY, VelocityZ, AngularVelocityX, " +
|
||||
"AngularVelocityY, AngularVelocityZ, " +
|
||||
"AccelerationX, AccelerationY, " +
|
||||
"AccelerationZ, RotationX, " +
|
||||
"RotationY, RotationZ, " +
|
||||
"RotationW, SitTargetOffsetX, " +
|
||||
"SitTargetOffsetY, SitTargetOffsetZ, " +
|
||||
"SitTargetOrientW, SitTargetOrientX, " +
|
||||
"SitTargetOrientY, SitTargetOrientZ, " +
|
||||
"RegionUUID, CreatorID, " +
|
||||
"OwnerID, GroupID, " +
|
||||
"LastOwnerID, SceneGroupID, " +
|
||||
"PayPrice, PayButton1, " +
|
||||
"PayButton2, PayButton3, " +
|
||||
"PayButton4, LoopedSound, " +
|
||||
"LoopedSoundGain, TextureAnimation, " +
|
||||
"OmegaX, OmegaY, OmegaZ, " +
|
||||
"CameraEyeOffsetX, CameraEyeOffsetY, " +
|
||||
"CameraEyeOffsetZ, CameraAtOffsetX, " +
|
||||
"CameraAtOffsetY, CameraAtOffsetZ, " +
|
||||
"ForceMouselook, ScriptAccessPin, " +
|
||||
"AllowedDrop, DieAtEdge, " +
|
||||
"SalePrice, SaleType, " +
|
||||
"ColorR, ColorG, ColorB, ColorA, " +
|
||||
"ParticleSystem, ClickAction, Material, " +
|
||||
"CollisionSound, CollisionSoundVolume, " +
|
||||
"PassTouches, " +
|
||||
"LinkNumber, MediaURL) values (" + "?UUID, " +
|
||||
"?CreationDate, ?Name, ?Text, " +
|
||||
"?Description, ?SitName, ?TouchName, " +
|
||||
"?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " +
|
||||
"?GroupMask, ?EveryoneMask, ?BaseMask, " +
|
||||
"?PositionX, ?PositionY, ?PositionZ, " +
|
||||
"?GroupPositionX, ?GroupPositionY, " +
|
||||
"?GroupPositionZ, ?VelocityX, " +
|
||||
"?VelocityY, ?VelocityZ, ?AngularVelocityX, " +
|
||||
"?AngularVelocityY, ?AngularVelocityZ, " +
|
||||
"?AccelerationX, ?AccelerationY, " +
|
||||
"?AccelerationZ, ?RotationX, " +
|
||||
"?RotationY, ?RotationZ, " +
|
||||
"?RotationW, ?SitTargetOffsetX, " +
|
||||
"?SitTargetOffsetY, ?SitTargetOffsetZ, " +
|
||||
"?SitTargetOrientW, ?SitTargetOrientX, " +
|
||||
"?SitTargetOrientY, ?SitTargetOrientZ, " +
|
||||
"?RegionUUID, ?CreatorID, ?OwnerID, " +
|
||||
"?GroupID, ?LastOwnerID, ?SceneGroupID, " +
|
||||
"?PayPrice, ?PayButton1, ?PayButton2, " +
|
||||
"?PayButton3, ?PayButton4, ?LoopedSound, " +
|
||||
"?LoopedSoundGain, ?TextureAnimation, " +
|
||||
"?OmegaX, ?OmegaY, ?OmegaZ, " +
|
||||
"?CameraEyeOffsetX, ?CameraEyeOffsetY, " +
|
||||
"?CameraEyeOffsetZ, ?CameraAtOffsetX, " +
|
||||
"?CameraAtOffsetY, ?CameraAtOffsetZ, " +
|
||||
"?ForceMouselook, ?ScriptAccessPin, " +
|
||||
"?AllowedDrop, ?DieAtEdge, ?SalePrice, " +
|
||||
"?SaleType, ?ColorR, ?ColorG, " +
|
||||
"?ColorB, ?ColorA, ?ParticleSystem, " +
|
||||
"?ClickAction, ?Material, ?CollisionSound, " +
|
||||
"?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)";
|
||||
|
||||
FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
cmd.CommandText = "replace into primshapes (" +
|
||||
"UUID, Shape, ScaleX, ScaleY, " +
|
||||
"ScaleZ, PCode, PathBegin, PathEnd, " +
|
||||
"PathScaleX, PathScaleY, PathShearX, " +
|
||||
"PathShearY, PathSkew, PathCurve, " +
|
||||
"PathRadiusOffset, PathRevolutions, " +
|
||||
"PathTaperX, PathTaperY, PathTwist, " +
|
||||
"PathTwistBegin, ProfileBegin, ProfileEnd, " +
|
||||
"ProfileCurve, ProfileHollow, Texture, " +
|
||||
"ExtraParams, State, Media) values (?UUID, " +
|
||||
"?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " +
|
||||
"?PCode, ?PathBegin, ?PathEnd, " +
|
||||
"?PathScaleX, ?PathScaleY, " +
|
||||
"?PathShearX, ?PathShearY, " +
|
||||
"?PathSkew, ?PathCurve, ?PathRadiusOffset, " +
|
||||
"?PathRevolutions, ?PathTaperX, " +
|
||||
"?PathTaperY, ?PathTwist, " +
|
||||
"?PathTwistBegin, ?ProfileBegin, " +
|
||||
"?ProfileEnd, ?ProfileCurve, " +
|
||||
"?ProfileHollow, ?Texture, ?ExtraParams, " +
|
||||
"?State, ?Media)";
|
||||
|
||||
FillShapeCommand(cmd, prim);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -969,6 +969,68 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
#region RegionEnvironmentSettings
|
||||
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
string command = "select * from `regionenvironment` where region_id = ?region_id";
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||
{
|
||||
cmd.Connection = dbcon;
|
||||
|
||||
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
|
||||
|
||||
IDataReader result = ExecuteReader(cmd);
|
||||
if (!result.Read())
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Convert.ToString(result["llsd_settings"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
|
||||
|
||||
cmd.Parameters.AddWithValue("region_id", regionUUID);
|
||||
cmd.Parameters.AddWithValue("llsd_settings", settings);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
|
||||
cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void StoreRegionSettings(RegionSettings rs)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
@@ -1283,7 +1345,7 @@ namespace OpenSim.Data.MySQL
|
||||
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
|
||||
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
|
||||
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
|
||||
newSettings.SunVector = new Vector3 (
|
||||
Convert.ToSingle(row["sunvectorx"]),
|
||||
Convert.ToSingle(row["sunvectory"]),
|
||||
@@ -1800,41 +1862,40 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
RemoveItems(primID);
|
||||
|
||||
if (items.Count == 0)
|
||||
return;
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
MySqlCommand cmd = dbcon.CreateCommand();
|
||||
|
||||
if (items.Count == 0)
|
||||
return;
|
||||
|
||||
cmd.CommandText = "insert into primitems (" +
|
||||
"invType, assetType, name, " +
|
||||
"description, creationDate, nextPermissions, " +
|
||||
"currentPermissions, basePermissions, " +
|
||||
"everyonePermissions, groupPermissions, " +
|
||||
"flags, itemID, primID, assetID, " +
|
||||
"parentFolderID, creatorID, ownerID, " +
|
||||
"groupID, lastOwnerID) values (?invType, " +
|
||||
"?assetType, ?name, ?description, " +
|
||||
"?creationDate, ?nextPermissions, " +
|
||||
"?currentPermissions, ?basePermissions, " +
|
||||
"?everyonePermissions, ?groupPermissions, " +
|
||||
"?flags, ?itemID, ?primID, ?assetID, " +
|
||||
"?parentFolderID, ?creatorID, ?ownerID, " +
|
||||
"?groupID, ?lastOwnerID)";
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
FillItemCommand(cmd, item);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
cmd.CommandText = "insert into primitems (" +
|
||||
"invType, assetType, name, " +
|
||||
"description, creationDate, nextPermissions, " +
|
||||
"currentPermissions, basePermissions, " +
|
||||
"everyonePermissions, groupPermissions, " +
|
||||
"flags, itemID, primID, assetID, " +
|
||||
"parentFolderID, creatorID, ownerID, " +
|
||||
"groupID, lastOwnerID) values (?invType, " +
|
||||
"?assetType, ?name, ?description, " +
|
||||
"?creationDate, ?nextPermissions, " +
|
||||
"?currentPermissions, ?basePermissions, " +
|
||||
"?everyonePermissions, ?groupPermissions, " +
|
||||
"?flags, ?itemID, ?primID, ?assetID, " +
|
||||
"?parentFolderID, ?creatorID, ?ownerID, " +
|
||||
"?groupID, ?lastOwnerID)";
|
||||
|
||||
foreach (TaskInventoryItem item in items)
|
||||
{
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
FillItemCommand(cmd, item);
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,23 +62,24 @@ namespace OpenSim.Data.MySQL
|
||||
if (words.Length > 2)
|
||||
return new UserAccountData[0];
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
if (words.Length == 1)
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?search", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst or LastName like ?searchLast)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
if (words.Length == 1)
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?search", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst or LastName like ?searchLast)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
|
||||
return DoQuery(cmd);
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
500
OpenSim/Data/MySQL/MySQLXAssetData.cs
Normal file
500
OpenSim/Data/MySQL/MySQLXAssetData.cs
Normal file
@@ -0,0 +1,500 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
public class MySQLXAssetData : IXAssetDataPlugin
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
private bool m_enableCompression = false;
|
||||
private string m_connectionString;
|
||||
private object m_dbLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
|
||||
/// </summary>
|
||||
private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
|
||||
|
||||
#region IPlugin Members
|
||||
|
||||
public string Version { get { return "1.0.0.0"; } }
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initialises Asset interface</para>
|
||||
/// <para>
|
||||
/// <list type="bullet">
|
||||
/// <item>Loads and initialises the MySQL storage plugin.</item>
|
||||
/// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item>
|
||||
/// <item>Check for migration</item>
|
||||
/// </list>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="connect">connect string</param>
|
||||
public void Initialise(string connect)
|
||||
{
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: THIS PLUGIN IS STRICTLY EXPERIMENTAL.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: DO NOT USE FOR ANY DATA THAT YOU DO NOT MIND LOSING.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: DATABASE TABLES CAN CHANGE AT ANY TIME, CAUSING EXISTING DATA TO BE LOST.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
|
||||
m_connectionString = connect;
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, "XAssetStore");
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public void Initialise()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
|
||||
/// <summary>
|
||||
/// The name of this DB provider
|
||||
/// </summary>
|
||||
public string Name
|
||||
{
|
||||
get { return "MySQL XAsset storage engine"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IAssetDataPlugin Members
|
||||
|
||||
/// <summary>
|
||||
/// Fetch Asset <paramref name="assetID"/> from database
|
||||
/// </summary>
|
||||
/// <param name="assetID">Asset UUID to fetch</param>
|
||||
/// <returns>Return the asset</returns>
|
||||
/// <remarks>On failure : throw an exception and attempt to reconnect to database</remarks>
|
||||
public AssetBase GetAsset(UUID assetID)
|
||||
{
|
||||
// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID);
|
||||
|
||||
AssetBase asset = null;
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(
|
||||
"SELECT name, description, asset_type, local, temporary, asset_flags, creator_id, data FROM xassetsmeta JOIN xassetsdata ON xassetsmeta.hash = xassetsdata.hash WHERE id=?id",
|
||||
dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", assetID.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["asset_type"], dbReader["creator_id"].ToString());
|
||||
asset.Data = (byte[])dbReader["data"];
|
||||
asset.Description = (string)dbReader["description"];
|
||||
|
||||
string local = dbReader["local"].ToString();
|
||||
if (local.Equals("1") || local.Equals("true", StringComparison.InvariantCultureIgnoreCase))
|
||||
asset.Local = true;
|
||||
else
|
||||
asset.Local = false;
|
||||
|
||||
asset.Temporary = Convert.ToBoolean(dbReader["temporary"]);
|
||||
asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[MYSQL XASSET DATA]: MySql failure fetching asset " + assetID + ": " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an asset in database, or update it if existing.
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset UUID to create</param>
|
||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||
public void StoreAsset(AssetBase asset)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlTransaction transaction = dbcon.BeginTransaction())
|
||||
{
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
{
|
||||
assetName = asset.Name.Substring(0, 64);
|
||||
m_log.Warn("[XASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add");
|
||||
}
|
||||
|
||||
string assetDescription = asset.Description;
|
||||
if (asset.Description.Length > 64)
|
||||
{
|
||||
assetDescription = asset.Description.Substring(0, 64);
|
||||
m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add");
|
||||
}
|
||||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
|
||||
using (GZipStream compressionStream = new GZipStream(outputStream, CompressionMode.Compress, false))
|
||||
{
|
||||
// Console.WriteLine(WebUtil.CopyTo(new MemoryStream(asset.Data), compressionStream, int.MaxValue));
|
||||
// We have to close the compression stream in order to make sure it writes everything out to the underlying memory output stream.
|
||||
compressionStream.Close();
|
||||
byte[] compressedData = outputStream.ToArray();
|
||||
asset.Data = compressedData;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] hash = hasher.ComputeHash(asset.Data);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Compressed data size for {0} {1}, hash {2} is {3}",
|
||||
// asset.ID, asset.Name, hash, compressedData.Length);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlCommand cmd =
|
||||
new MySqlCommand(
|
||||
"replace INTO xassetsmeta(id, hash, name, description, asset_type, local, temporary, create_time, access_time, asset_flags, creator_id)" +
|
||||
"VALUES(?id, ?hash, ?name, ?description, ?asset_type, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?creator_id)",
|
||||
dbcon))
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
cmd.Parameters.AddWithValue("?name", assetName);
|
||||
cmd.Parameters.AddWithValue("?description", assetDescription);
|
||||
cmd.Parameters.AddWithValue("?asset_type", asset.Type);
|
||||
cmd.Parameters.AddWithValue("?local", asset.Local);
|
||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||
cmd.Parameters.AddWithValue("?create_time", now);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.Parameters.AddWithValue("?creator_id", asset.Metadata.CreatorID);
|
||||
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset metadata {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
|
||||
transaction.Rollback();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ExistsData(dbcon, transaction, hash))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (MySqlCommand cmd =
|
||||
new MySqlCommand(
|
||||
"INSERT INTO xassetsdata(hash, data) VALUES(?hash, ?data)",
|
||||
dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[XASSET DB]: MySQL failure creating asset data {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
|
||||
transaction.Rollback();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// private void UpdateAccessTime(AssetBase asset)
|
||||
// {
|
||||
// lock (m_dbLock)
|
||||
// {
|
||||
// using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
// {
|
||||
// dbcon.Open();
|
||||
// MySqlCommand cmd =
|
||||
// new MySqlCommand("update assets set access_time=?access_time where id=?id",
|
||||
// dbcon);
|
||||
//
|
||||
// // need to ensure we dispose
|
||||
// try
|
||||
// {
|
||||
// using (cmd)
|
||||
// {
|
||||
// // create unix epoch time
|
||||
// int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
// cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
// cmd.Parameters.AddWithValue("?access_time", now);
|
||||
// cmd.ExecuteNonQuery();
|
||||
// cmd.Dispose();
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// m_log.ErrorFormat(
|
||||
// "[ASSETS DB]: " +
|
||||
// "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
// + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// We assume we already have the m_dbLock.
|
||||
/// </summary>
|
||||
/// TODO: need to actually use the transaction.
|
||||
/// <param name="dbcon"></param>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="hash"></param>
|
||||
/// <returns></returns>
|
||||
private bool ExistsData(MySqlConnection dbcon, MySqlTransaction transaction, byte[] hash)
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||
|
||||
bool exists = false;
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("SELECT hash FROM xassetsdata WHERE hash=?hash", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||
exists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[XASSETS DB]: MySql failure in ExistsData fetching hash {0}. Exception {1}{2}",
|
||||
hash, e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the asset exists in the database
|
||||
/// </summary>
|
||||
/// <param name="uuid">The asset UUID</param>
|
||||
/// <returns>true if it exists, false otherwise.</returns>
|
||||
public bool ExistsAsset(UUID uuid)
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||
|
||||
bool assetExists = false;
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
using (MySqlCommand cmd = new MySqlCommand("SELECT id FROM xassetsmeta WHERE id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", uuid.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||
assetExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[XASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString(), uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return assetExists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of AssetMetadata objects. The list is a subset of
|
||||
/// the entire data set offset by <paramref name="start" /> containing
|
||||
/// <paramref name="count" /> elements.
|
||||
/// </summary>
|
||||
/// <param name="start">The number of results to discard from the total data set.</param>
|
||||
/// <param name="count">The number of rows the returned list should contain.</param>
|
||||
/// <returns>A list of AssetMetadata objects.</returns>
|
||||
public List<AssetMetadata> FetchAssetMetadataSet(int start, int count)
|
||||
{
|
||||
List<AssetMetadata> retList = new List<AssetMetadata>(count);
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("SELECT name,description,asset_type,temporary,id,asset_flags,creator_id FROM xassetsmeta LIMIT ?start, ?count", dbcon);
|
||||
cmd.Parameters.AddWithValue("?start", start);
|
||||
cmd.Parameters.AddWithValue("?count", count);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
{
|
||||
while (dbReader.Read())
|
||||
{
|
||||
AssetMetadata metadata = new AssetMetadata();
|
||||
metadata.Name = (string)dbReader["name"];
|
||||
metadata.Description = (string)dbReader["description"];
|
||||
metadata.Type = (sbyte)dbReader["asset_type"];
|
||||
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
||||
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
|
||||
metadata.CreatorID = dbReader["creator_id"].ToString();
|
||||
|
||||
// We'll ignore this for now - it appears unused!
|
||||
// metadata.SHA1 = dbReader["hash"]);
|
||||
|
||||
retList.Add(metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[XASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retList;
|
||||
}
|
||||
|
||||
public bool Delete(string id)
|
||||
{
|
||||
// m_log.DebugFormat("[XASSETS DB]: Deleting asset {0}", id);
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from xassetsmeta where id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
// TODO: How do we deal with data from deleted assets? Probably not easily reapable unless we
|
||||
// keep a reference count (?)
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -883,4 +883,15 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 44 #--------------------- Environment Settings
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE `regionenvironment` (
|
||||
`region_id` varchar(36) NOT NULL,
|
||||
`llsd_settings` TEXT NOT NULL,
|
||||
PRIMARY KEY (`region_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
27
OpenSim/Data/MySQL/Resources/XAssetStore.migrations
Normal file
27
OpenSim/Data/MySQL/Resources/XAssetStore.migrations
Normal file
@@ -0,0 +1,27 @@
|
||||
# -----------------
|
||||
:VERSION 1
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE `xassetsmeta` (
|
||||
`id` char(36) NOT NULL,
|
||||
`hash` binary(32) NOT NULL,
|
||||
`name` varchar(64) NOT NULL,
|
||||
`description` varchar(64) NOT NULL,
|
||||
`asset_type` tinyint(4) NOT NULL,
|
||||
`local` tinyint(1) NOT NULL,
|
||||
`temporary` tinyint(1) NOT NULL,
|
||||
`create_time` int(11) NOT NULL,
|
||||
`access_time` int(11) NOT NULL,
|
||||
`asset_flags` int(11) NOT NULL,
|
||||
`creator_id` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
|
||||
|
||||
CREATE TABLE `xassetsdata` (
|
||||
`hash` binary(32) NOT NULL,
|
||||
`data` longblob NOT NULL,
|
||||
PRIMARY KEY (`hash`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
|
||||
|
||||
COMMIT;
|
||||
@@ -28,6 +28,9 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
@@ -36,12 +39,26 @@ namespace OpenSim.Data.Null
|
||||
{
|
||||
public class NullFriendsData : IFriendsData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static List<FriendsData> m_Data = new List<FriendsData>();
|
||||
|
||||
public NullFriendsData(string connectionString, string realm)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear all friends data
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is required by unit tests to clear the static data between test runs.
|
||||
/// </remarks>
|
||||
public static void Clear()
|
||||
{
|
||||
lock (m_Data)
|
||||
m_Data.Clear();
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(UUID principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
@@ -56,20 +73,30 @@ namespace OpenSim.Data.Null
|
||||
/// <returns></returns>
|
||||
public FriendsData[] GetFriends(string userID)
|
||||
{
|
||||
List<FriendsData> lst = m_Data.FindAll(fdata =>
|
||||
lock (m_Data)
|
||||
{
|
||||
return fdata.PrincipalID == userID.ToString();
|
||||
});
|
||||
|
||||
if (lst != null)
|
||||
{
|
||||
lst.ForEach(f =>
|
||||
List<FriendsData> lst = m_Data.FindAll(fdata =>
|
||||
{
|
||||
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
|
||||
if (f2 != null) { f.Data["TheirFlags"] = f2.Data["Flags"]; }
|
||||
return fdata.PrincipalID == userID.ToString();
|
||||
});
|
||||
|
||||
return lst.ToArray();
|
||||
|
||||
if (lst != null)
|
||||
{
|
||||
lst.ForEach(f =>
|
||||
{
|
||||
FriendsData f2 = m_Data.Find(candidateF2 => f.Friend == candidateF2.PrincipalID);
|
||||
if (f2 != null)
|
||||
f.Data["TheirFlags"] = f2.Data["Flags"];
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL FRIENDS DATA]: Got {0} {1} {2} for {3}",
|
||||
// f.Friend, f.Data["Flags"], f2 != null ? f.Data["TheirFlags"] : "not found!", f.PrincipalID);
|
||||
});
|
||||
|
||||
// m_log.DebugFormat("[NULL FRIENDS DATA]: Got {0} friends for {1}", lst.Count, userID);
|
||||
|
||||
return lst.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
return new FriendsData[0];
|
||||
@@ -80,7 +107,11 @@ namespace OpenSim.Data.Null
|
||||
if (data == null)
|
||||
return false;
|
||||
|
||||
m_Data.Add(data);
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL FRIENDS DATA]: Storing {0} {1} {2}", data.PrincipalID, data.Friend, data.Data["Flags"]);
|
||||
|
||||
lock (m_Data)
|
||||
m_Data.Add(data);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -92,14 +123,21 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public bool Delete(string userID, string friendID)
|
||||
{
|
||||
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID.ToString(); });
|
||||
if (lst != null)
|
||||
lock (m_Data)
|
||||
{
|
||||
FriendsData friend = lst.Find(delegate(FriendsData fdata) { return fdata.Friend == friendID; });
|
||||
if (friendID != null)
|
||||
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID.ToString(); });
|
||||
if (lst != null)
|
||||
{
|
||||
m_Data.Remove(friend);
|
||||
return true;
|
||||
FriendsData friend = lst.Find(delegate(FriendsData fdata) { return fdata.Friend == friendID; });
|
||||
if (friendID != null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL FRIENDS DATA]: Deleting friend {0} {1} for {2}",
|
||||
// friend.Friend, friend.Data["Flags"], friend.PrincipalID);
|
||||
|
||||
m_Data.Remove(friend);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@ namespace OpenSim.Data.Null
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public PresenceData[] Get(string field, string data)
|
||||
{
|
||||
if (Instance != this)
|
||||
|
||||
@@ -76,9 +76,27 @@ namespace OpenSim.Data.Null
|
||||
//This connector doesn't support the windlight module yet
|
||||
}
|
||||
|
||||
#region Environment Settings
|
||||
public string LoadRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
//This connector doesn't support the Environment module yet
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
|
||||
{
|
||||
//This connector doesn't support the Environment module yet
|
||||
}
|
||||
|
||||
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
|
||||
{
|
||||
//This connector doesn't support the Environment module yet
|
||||
}
|
||||
#endregion
|
||||
|
||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||
{
|
||||
RegionSettings rs = new RegionSettings();
|
||||
{
|
||||
RegionSettings rs = new RegionSettings();
|
||||
rs.RegionUUID = regionUUID;
|
||||
return rs;
|
||||
}
|
||||
|
||||
@@ -472,3 +472,106 @@ COMMIT;
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 23
|
||||
BEGIN;
|
||||
CREATE TABLE regionwindlight (
|
||||
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
|
||||
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
|
||||
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
|
||||
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
|
||||
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
|
||||
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
|
||||
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
|
||||
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
|
||||
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
|
||||
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
|
||||
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
|
||||
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
|
||||
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
|
||||
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
|
||||
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
|
||||
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
|
||||
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
horizon_r FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_g FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_b FLOAT NOT NULL DEFAULT '0.32',
|
||||
horizon_i FLOAT NOT NULL DEFAULT '0.32',
|
||||
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
|
||||
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
|
||||
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
|
||||
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
|
||||
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
|
||||
haze_density FLOAT NOT NULL DEFAULT '0.70',
|
||||
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
|
||||
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
|
||||
max_altitude INTEGER NOT NULL DEFAULT '1605',
|
||||
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
|
||||
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
|
||||
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
|
||||
ambient_r FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_g FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_b FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_i FLOAT NOT NULL DEFAULT '0.35',
|
||||
east_angle FLOAT NOT NULL DEFAULT '0.00',
|
||||
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
|
||||
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
|
||||
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
|
||||
star_brightness FLOAT NOT NULL DEFAULT '0.00',
|
||||
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_density FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
|
||||
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
|
||||
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
|
||||
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
|
||||
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
|
||||
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
|
||||
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
|
||||
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 24
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
`Yaw` float NOT NULL,
|
||||
`Pitch` float NOT NULL,
|
||||
`Distance` float NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 25
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
COMMIT;
|
||||
|
||||
:VERSION 26
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE `regionenvironment` (
|
||||
`region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
`llsd_settings` TEXT NOT NULL
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="dbconnect">connect string</param>
|
||||
override public void Initialise(string dbconnect)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:Asset.db,version=3";
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
if (!m_initialized)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Connection = new SqliteConnection(connectionString);
|
||||
m_Connection.Open();
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_connectionString = connectionString;
|
||||
|
||||
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
protected SQLiteFramework(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
m_Initialized = true;
|
||||
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:inventoryStore.db,version=3";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public SQLiteXInventoryData(string conn, string realm)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
||||
conn, "inventoryfolders", "XInventoryStore");
|
||||
m_Items = new SqliteItemHandler(
|
||||
|
||||
@@ -244,10 +244,10 @@ namespace OpenSim.Data.Tests
|
||||
SceneObjectPart[] newparts = newsog.Parts;
|
||||
Assert.That(newparts.Length,Is.EqualTo(4), "Assert.That(newparts.Length,Is.EqualTo(4))");
|
||||
|
||||
Assert.That(newsog.HasChildPrim(tmp0), "Assert.That(newsog.HasChildPrim(tmp0))");
|
||||
Assert.That(newsog.HasChildPrim(tmp1), "Assert.That(newsog.HasChildPrim(tmp1))");
|
||||
Assert.That(newsog.HasChildPrim(tmp2), "Assert.That(newsog.HasChildPrim(tmp2))");
|
||||
Assert.That(newsog.HasChildPrim(tmp3), "Assert.That(newsog.HasChildPrim(tmp3))");
|
||||
Assert.That(newsog.ContainsPart(tmp0), "Assert.That(newsog.ContainsPart(tmp0))");
|
||||
Assert.That(newsog.ContainsPart(tmp1), "Assert.That(newsog.ContainsPart(tmp1))");
|
||||
Assert.That(newsog.ContainsPart(tmp2), "Assert.That(newsog.ContainsPart(tmp2))");
|
||||
Assert.That(newsog.ContainsPart(tmp3), "Assert.That(newsog.ContainsPart(tmp3))");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -632,7 +632,6 @@ namespace OpenSim.Data.Tests
|
||||
.IgnoreProperty(x=>x.RegionUUID)
|
||||
.IgnoreProperty(x=>x.Scene)
|
||||
.IgnoreProperty(x=>x.Parts)
|
||||
.IgnoreProperty(x=>x.PassCollision)
|
||||
.IgnoreProperty(x=>x.RootPart));
|
||||
}
|
||||
|
||||
|
||||
40
OpenSim/Framework/Client/IClientInventory.cs
Normal file
40
OpenSim/Framework/Client/IClientInventory.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Framework.Client
|
||||
{
|
||||
public interface IClientInventory
|
||||
{
|
||||
void SendRemoveInventoryFolders(UUID[] folders);
|
||||
void SendRemoveInventoryItems(UUID[] folders);
|
||||
void SendBulkUpdateInventory(InventoryFolderBase[] folders, InventoryItemBase[] items);
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -40,6 +41,8 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
public class Commands : ICommands
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Encapsulates a command that can be invoked from the console
|
||||
/// </summary>
|
||||
@@ -76,12 +79,23 @@ namespace OpenSim.Framework.Console
|
||||
public List<CommandDelegate> fn;
|
||||
}
|
||||
|
||||
public const string GeneralHelpText
|
||||
= "To enter an argument that contains spaces, surround the argument with double quotes.\nFor example, show object name \"My long object name\"\n";
|
||||
|
||||
public const string ItemHelpText
|
||||
= "For more information, type 'help <item>' where <item> is one of the following:";
|
||||
|
||||
/// <value>
|
||||
/// Commands organized by keyword in a tree
|
||||
/// </value>
|
||||
private Dictionary<string, object> tree =
|
||||
new Dictionary<string, object>();
|
||||
|
||||
/// <summary>
|
||||
/// Commands organized by module
|
||||
/// </summary>
|
||||
private Dictionary<string, List<CommandInfo>> m_modulesCommands = new Dictionary<string, List<CommandInfo>>();
|
||||
|
||||
/// <summary>
|
||||
/// Get help for the given help string
|
||||
/// </summary>
|
||||
@@ -98,8 +112,10 @@ namespace OpenSim.Framework.Console
|
||||
// General help
|
||||
if (helpParts.Count == 0)
|
||||
{
|
||||
help.AddRange(CollectHelp(tree));
|
||||
help.Sort();
|
||||
help.Add(""); // Will become a newline.
|
||||
help.Add(GeneralHelpText);
|
||||
help.Add(ItemHelpText);
|
||||
help.AddRange(CollectModulesHelp(tree));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -118,6 +134,13 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
string originalHelpRequest = string.Join(" ", helpParts.ToArray());
|
||||
List<string> help = new List<string>();
|
||||
|
||||
// Check modules first to see if we just need to display a list of those commands
|
||||
if (TryCollectModuleHelp(originalHelpRequest, help))
|
||||
{
|
||||
help.Insert(0, ItemHelpText);
|
||||
return help;
|
||||
}
|
||||
|
||||
Dictionary<string, object> dict = tree;
|
||||
while (helpParts.Count > 0)
|
||||
@@ -161,25 +184,63 @@ namespace OpenSim.Framework.Console
|
||||
return help;
|
||||
}
|
||||
|
||||
private List<string> CollectHelp(Dictionary<string, object> dict)
|
||||
/// <summary>
|
||||
/// Try to collect help for the given module if that module exists.
|
||||
/// </summary>
|
||||
/// <param name="moduleName"></param>
|
||||
/// <param name="helpText">/param>
|
||||
/// <returns>true if there was the module existed, false otherwise.</returns>
|
||||
private bool TryCollectModuleHelp(string moduleName, List<string> helpText)
|
||||
{
|
||||
List<string> result = new List<string>();
|
||||
|
||||
foreach (KeyValuePair<string, object> kvp in dict)
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
if (kvp.Value is Dictionary<string, Object>)
|
||||
foreach (string key in m_modulesCommands.Keys)
|
||||
{
|
||||
result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((CommandInfo)kvp.Value).long_help != String.Empty)
|
||||
result.Add(((CommandInfo)kvp.Value).help_text+" - "+
|
||||
((CommandInfo)kvp.Value).long_help);
|
||||
// Allow topic help requests to succeed whether they are upper or lowercase.
|
||||
if (moduleName.ToLower() == key.ToLower())
|
||||
{
|
||||
List<CommandInfo> commands = m_modulesCommands[key];
|
||||
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
|
||||
ourHelpText.Sort();
|
||||
helpText.AddRange(ourHelpText);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<string> CollectModulesHelp(Dictionary<string, object> dict)
|
||||
{
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
List<string> helpText = new List<string>(m_modulesCommands.Keys);
|
||||
helpText.Sort();
|
||||
return helpText;
|
||||
}
|
||||
}
|
||||
|
||||
// private List<string> CollectHelp(Dictionary<string, object> dict)
|
||||
// {
|
||||
// List<string> result = new List<string>();
|
||||
//
|
||||
// foreach (KeyValuePair<string, object> kvp in dict)
|
||||
// {
|
||||
// if (kvp.Value is Dictionary<string, Object>)
|
||||
// {
|
||||
// result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (((CommandInfo)kvp.Value).long_help != String.Empty)
|
||||
// result.Add(((CommandInfo)kvp.Value).help_text+" - "+
|
||||
// ((CommandInfo)kvp.Value).long_help);
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Add a command to those which can be invoked from the console.
|
||||
@@ -212,21 +273,19 @@ namespace OpenSim.Framework.Console
|
||||
|
||||
Dictionary<string, Object> current = tree;
|
||||
|
||||
foreach (string s in parts)
|
||||
foreach (string part in parts)
|
||||
{
|
||||
if (current.ContainsKey(s))
|
||||
if (current.ContainsKey(part))
|
||||
{
|
||||
if (current[s] is Dictionary<string, Object>)
|
||||
{
|
||||
current = (Dictionary<string, Object>)current[s];
|
||||
}
|
||||
if (current[part] is Dictionary<string, Object>)
|
||||
current = (Dictionary<string, Object>)current[part];
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
current[s] = new Dictionary<string, Object>();
|
||||
current = (Dictionary<string, Object>)current[s];
|
||||
current[part] = new Dictionary<string, Object>();
|
||||
current = (Dictionary<string, Object>)current[part];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +309,24 @@ namespace OpenSim.Framework.Console
|
||||
info.fn = new List<CommandDelegate>();
|
||||
info.fn.Add(fn);
|
||||
current[String.Empty] = info;
|
||||
|
||||
// Now add command to modules dictionary
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
List<CommandInfo> commands;
|
||||
if (m_modulesCommands.ContainsKey(module))
|
||||
{
|
||||
commands = m_modulesCommands[module];
|
||||
}
|
||||
else
|
||||
{
|
||||
commands = new List<CommandInfo>();
|
||||
m_modulesCommands[module] = commands;
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[COMMAND CONSOLE]: Adding to category {0} command {1}", module, command);
|
||||
commands.Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
public string[] FindNextOption(string[] cmd, bool term)
|
||||
@@ -607,8 +684,9 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
Commands = new Commands();
|
||||
|
||||
Commands.AddCommand("console", false, "help", "help [<command>]",
|
||||
"Get general command list or more detailed help on a specific command", Help);
|
||||
Commands.AddCommand(
|
||||
"Help", false, "help", "help [<item>]",
|
||||
"Display help on a particular command or on a list of commands in a category", Help);
|
||||
}
|
||||
|
||||
private void Help(string module, string[] cmd)
|
||||
|
||||
112
OpenSim/Framework/Console/ConsoleDisplayList.cs
Normal file
112
OpenSim/Framework/Console/ConsoleDisplayList.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* 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.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to generated a formatted table for the console.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Currently subject to change. If you use this, be prepared to change your code when this class changes.
|
||||
/// </remarks>
|
||||
public class ConsoleDisplayList
|
||||
{
|
||||
/// <summary>
|
||||
/// The default divider between key and value for a list item.
|
||||
/// </summary>
|
||||
public const string DefaultKeyValueDivider = " : ";
|
||||
|
||||
/// <summary>
|
||||
/// The divider used between key and value for a list item.
|
||||
/// </summary>
|
||||
public string KeyValueDivider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Table rows
|
||||
/// </summary>
|
||||
public List<KeyValuePair<string, string>> Rows { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of spaces to indent the list.
|
||||
/// </summary>
|
||||
public int Indent { get; set; }
|
||||
|
||||
public ConsoleDisplayList()
|
||||
{
|
||||
Rows = new List<KeyValuePair<string, string>>();
|
||||
KeyValueDivider = DefaultKeyValueDivider;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
AddToStringBuilder(sb);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public void AddToStringBuilder(StringBuilder sb)
|
||||
{
|
||||
string formatString = GetFormatString();
|
||||
// System.Console.WriteLine("FORMAT STRING [{0}]", formatString);
|
||||
|
||||
// rows
|
||||
foreach (KeyValuePair<string, string> row in Rows)
|
||||
sb.AppendFormat(formatString, row.Key, row.Value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the format string for the table.
|
||||
/// </summary>
|
||||
private string GetFormatString()
|
||||
{
|
||||
StringBuilder formatSb = new StringBuilder();
|
||||
|
||||
int longestKey = -1;
|
||||
|
||||
foreach (KeyValuePair<string, string> row in Rows)
|
||||
if (row.Key.Length > longestKey)
|
||||
longestKey = row.Key.Length;
|
||||
|
||||
formatSb.Append(' ', Indent);
|
||||
|
||||
// Can only do left formatting for now
|
||||
formatSb.AppendFormat("{{0,-{0}}}{1}{{1}}\n", longestKey, KeyValueDivider);
|
||||
|
||||
return formatSb.ToString();
|
||||
}
|
||||
|
||||
public void AddRow(object key, object value)
|
||||
{
|
||||
Rows.Add(new KeyValuePair<string, string>(key.ToString(), value.ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
139
OpenSim/Framework/Console/ConsoleDisplayTable.cs
Normal file
139
OpenSim/Framework/Console/ConsoleDisplayTable.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* 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.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to generated a formatted table for the console.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Currently subject to change. If you use this, be prepared to change your code when this class changes.
|
||||
/// </remarks>
|
||||
public class ConsoleDisplayTable
|
||||
{
|
||||
/// <summary>
|
||||
/// Default number of spaces between table columns.
|
||||
/// </summary>
|
||||
public const int DefaultTableSpacing = 2;
|
||||
|
||||
/// <summary>
|
||||
/// Table columns.
|
||||
/// </summary>
|
||||
public List<ConsoleDisplayTableColumn> Columns { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Table rows
|
||||
/// </summary>
|
||||
public List<ConsoleDisplayTableRow> Rows { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Number of spaces to indent the table.
|
||||
/// </summary>
|
||||
public int Indent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Spacing between table columns
|
||||
/// </summary>
|
||||
public int TableSpacing { get; set; }
|
||||
|
||||
public ConsoleDisplayTable()
|
||||
{
|
||||
TableSpacing = DefaultTableSpacing;
|
||||
Columns = new List<ConsoleDisplayTableColumn>();
|
||||
Rows = new List<ConsoleDisplayTableRow>();
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
AddToStringBuilder(sb);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public void AddToStringBuilder(StringBuilder sb)
|
||||
{
|
||||
string formatString = GetFormatString();
|
||||
// System.Console.WriteLine("FORMAT STRING [{0}]", formatString);
|
||||
|
||||
// columns
|
||||
sb.AppendFormat(formatString, Columns.ConvertAll(c => c.Header).ToArray());
|
||||
|
||||
// rows
|
||||
foreach (ConsoleDisplayTableRow row in Rows)
|
||||
sb.AppendFormat(formatString, row.Cells.ToArray());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the format string for the table.
|
||||
/// </summary>
|
||||
private string GetFormatString()
|
||||
{
|
||||
StringBuilder formatSb = new StringBuilder();
|
||||
|
||||
formatSb.Append(' ', Indent);
|
||||
|
||||
for (int i = 0; i < Columns.Count; i++)
|
||||
{
|
||||
formatSb.Append(' ', TableSpacing);
|
||||
|
||||
// Can only do left formatting for now
|
||||
formatSb.AppendFormat("{{{0},-{1}}}", i, Columns[i].Width);
|
||||
}
|
||||
|
||||
formatSb.Append('\n');
|
||||
|
||||
return formatSb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public struct ConsoleDisplayTableColumn
|
||||
{
|
||||
public string Header { get; set; }
|
||||
public int Width { get; set; }
|
||||
|
||||
public ConsoleDisplayTableColumn(string header, int width) : this()
|
||||
{
|
||||
Header = header;
|
||||
Width = width;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ConsoleDisplayTableRow
|
||||
{
|
||||
public List<string> Cells { get; private set; }
|
||||
|
||||
public ConsoleDisplayTableRow(List<string> cells) : this()
|
||||
{
|
||||
Cells = cells;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,6 +296,10 @@ namespace OpenSim.Framework.Console
|
||||
matches[0].Groups["Category"].Value);
|
||||
System.Console.Write("]:");
|
||||
}
|
||||
else
|
||||
{
|
||||
outText = outText.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
if (level == "error")
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
@@ -37,28 +38,42 @@ namespace OpenSim.Framework.Console
|
||||
/// Don't use this except for Unit Testing or you're in for a world of hurt when the
|
||||
/// sim gets to ReadLine
|
||||
/// </summary>
|
||||
public class MockConsole : CommandConsole
|
||||
public class MockConsole : ICommandConsole
|
||||
{
|
||||
public MockConsole(string defaultPrompt) : base(defaultPrompt)
|
||||
{
|
||||
}
|
||||
public override void Output(string text)
|
||||
{
|
||||
}
|
||||
public override void Output(string text, string level)
|
||||
{
|
||||
}
|
||||
private MockCommands m_commands = new MockCommands();
|
||||
|
||||
public override string ReadLine(string p, bool isCommand, bool e)
|
||||
{
|
||||
//Thread.CurrentThread.Join(1000);
|
||||
return string.Empty;
|
||||
}
|
||||
public override void UnlockOutput()
|
||||
{
|
||||
}
|
||||
public override void LockOutput()
|
||||
{
|
||||
}
|
||||
public ICommands Commands { get { return m_commands; } }
|
||||
|
||||
public void Prompt() {}
|
||||
|
||||
public void RunCommand(string cmd) {}
|
||||
|
||||
public string ReadLine(string p, bool isCommand, bool e) { return ""; }
|
||||
|
||||
public object ConsoleScene { get { return null; } }
|
||||
|
||||
public void Output(string text, string level) {}
|
||||
public void Output(string text) {}
|
||||
public void OutputFormat(string format, params object[] components) {}
|
||||
|
||||
public string CmdPrompt(string p) { return ""; }
|
||||
public string CmdPrompt(string p, string def) { return ""; }
|
||||
public string CmdPrompt(string p, List<char> excludedCharacters) { return ""; }
|
||||
public string CmdPrompt(string p, string def, List<char> excludedCharacters) { return ""; }
|
||||
|
||||
public string CmdPrompt(string prompt, string defaultresponse, List<string> options) { return ""; }
|
||||
|
||||
public string PasswdPrompt(string p) { return ""; }
|
||||
}
|
||||
}
|
||||
|
||||
public class MockCommands : ICommands
|
||||
{
|
||||
public void FromXml(XmlElement root, CommandDelegate fn) {}
|
||||
public List<string> GetHelp(string[] cmd) { return null; }
|
||||
public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {}
|
||||
public void AddCommand(string module, bool shared, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) {}
|
||||
public string[] FindNextOption(string[] cmd, bool term) { return null; }
|
||||
public string[] Resolve(string[] cmd) { return null; }
|
||||
public XmlElement GetXml(XmlDocument doc) { return null; }
|
||||
}
|
||||
}
|
||||
@@ -322,7 +322,7 @@ namespace OpenSim.Framework
|
||||
l_EstateManagers.Remove(avatarID);
|
||||
}
|
||||
|
||||
public bool IsEstateManager(UUID avatarID)
|
||||
public bool IsEstateManagerOrOwner(UUID avatarID)
|
||||
{
|
||||
if (IsEstateOwner(avatarID))
|
||||
return true;
|
||||
@@ -368,7 +368,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public bool HasAccess(UUID user)
|
||||
{
|
||||
if (IsEstateManager(user))
|
||||
if (IsEstateManagerOrOwner(user))
|
||||
return true;
|
||||
|
||||
return l_EstateAccess.Contains(user);
|
||||
|
||||
@@ -25,34 +25,38 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using log4net;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
public class GcNotify
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
[assembly : AssemblyTitle("RealPhysXplugin")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("http://opensimulator.org")]
|
||||
[assembly : AssemblyProduct("RealPhysXplugin")]
|
||||
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
public static bool Enabled
|
||||
{
|
||||
get { return s_initialized; }
|
||||
set
|
||||
{
|
||||
if (!s_initialized && value)
|
||||
new GcNotify();
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
s_initialized = value;
|
||||
}
|
||||
}
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
private static bool s_initialized = false;
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
private GcNotify() {}
|
||||
|
||||
[assembly : AssemblyVersion("0.6.5.*")]
|
||||
~GcNotify()
|
||||
{
|
||||
if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
||||
{
|
||||
m_log.DebugFormat("[GC NOTIFY]: Garbage collection triggered.");
|
||||
|
||||
if (Enabled)
|
||||
new GcNotify();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,9 +296,9 @@ namespace OpenSim.Framework
|
||||
public delegate void ConfirmXfer(IClientAPI remoteClient, ulong xferID, uint packetID);
|
||||
|
||||
public delegate void FriendActionDelegate(
|
||||
IClientAPI remoteClient, UUID agentID, UUID transactionID, List<UUID> callingCardFolders);
|
||||
IClientAPI remoteClient, UUID transactionID, List<UUID> callingCardFolders);
|
||||
|
||||
public delegate void FriendshipTermination(IClientAPI remoteClient, UUID agentID, UUID ExID);
|
||||
public delegate void FriendshipTermination(IClientAPI remoteClient, UUID ExID);
|
||||
|
||||
public delegate void MoneyTransferRequest(
|
||||
UUID sourceID, UUID destID, int amount, int transactionType, string description);
|
||||
@@ -458,7 +458,7 @@ namespace OpenSim.Framework
|
||||
public delegate void AvatarNotesUpdate(IClientAPI client, UUID targetID, string notes);
|
||||
public delegate void MuteListRequest(IClientAPI client, uint muteCRC);
|
||||
public delegate void AvatarInterestUpdate(IClientAPI client, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages);
|
||||
public delegate void GrantUserFriendRights(IClientAPI client, UUID requester, UUID target, int rights);
|
||||
public delegate void GrantUserFriendRights(IClientAPI client, UUID target, int rights);
|
||||
public delegate void PlacesQuery(UUID QueryID, UUID TransactionID, string QueryText, uint QueryFlags, byte Category, string SimName, IClientAPI client);
|
||||
|
||||
public delegate void AgentFOV(IClientAPI client, float verticalAngle);
|
||||
@@ -710,7 +710,7 @@ namespace OpenSim.Framework
|
||||
/// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it
|
||||
/// is connected).
|
||||
/// </summary>
|
||||
ISceneAgent SceneAgent { get; }
|
||||
ISceneAgent SceneAgent { get; set; }
|
||||
|
||||
UUID SessionId { get; }
|
||||
|
||||
@@ -1215,10 +1215,9 @@ namespace OpenSim.Framework
|
||||
/// <param name="OrbitalPosition">The orbital position is given in radians, and must be "adjusted" for the linden client, see LLClientView</param>
|
||||
void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear,
|
||||
float OrbitalPosition);
|
||||
|
||||
|
||||
void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks);
|
||||
void SendViewerTime(int phase);
|
||||
UUID GetDefaultAnimation(string name);
|
||||
|
||||
void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout,
|
||||
uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Get help for the given help string
|
||||
/// </summary>
|
||||
/// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param>
|
||||
/// <param name="cmd">Parsed parts of the help string. If empty then general help is returned.</param>
|
||||
/// <returns></returns>
|
||||
List<string> GetHelp(string[] cmd);
|
||||
|
||||
|
||||
@@ -71,6 +71,7 @@ namespace OpenSim.Framework
|
||||
bool IsEitherBannedOrRestricted(UUID avatar);
|
||||
bool IsBannedFromLand(UUID avatar);
|
||||
bool IsRestrictedFromLand(UUID avatar);
|
||||
bool IsInLandAccessList(UUID avatar);
|
||||
void SendLandUpdateToClient(IClientAPI remote_client);
|
||||
void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client);
|
||||
List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag);
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Framework
|
||||
(uint) ParcelFlags.AllowAPrimitiveEntry |
|
||||
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform |
|
||||
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
|
||||
(uint) ParcelFlags.SoundLocal;
|
||||
(uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat;
|
||||
|
||||
private byte _landingType = 0;
|
||||
private string _name = "Your Parcel";
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Framework
|
||||
// Copy the temporary stream to the network stream
|
||||
formDataStream.Seek(0, SeekOrigin.Begin);
|
||||
using (Stream requestStream = request.GetRequestStream())
|
||||
formDataStream.CopyTo(requestStream, (int)formDataStream.Length);
|
||||
formDataStream.CopyStream(requestStream, (int)formDataStream.Length);
|
||||
}
|
||||
|
||||
#endregion Stream Writing
|
||||
|
||||
@@ -51,10 +51,12 @@ namespace OpenSim.Framework
|
||||
protected object m_senderObject;
|
||||
protected ChatTypeEnum m_type;
|
||||
protected UUID m_fromID;
|
||||
protected UUID m_toID;
|
||||
|
||||
public OSChatMessage()
|
||||
{
|
||||
m_position = new Vector3();
|
||||
m_toID = UUID.Zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,6 +104,15 @@ namespace OpenSim.Framework
|
||||
set { m_from = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the sender (needed for scripts)
|
||||
/// </summary>
|
||||
public string To
|
||||
{
|
||||
get { return m_from; }
|
||||
set { m_from = value; }
|
||||
}
|
||||
|
||||
#region IEventArgs Members
|
||||
|
||||
/// TODO: Sender and SenderObject should just be Sender and of
|
||||
@@ -131,6 +142,15 @@ namespace OpenSim.Framework
|
||||
set { m_fromID = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The single recipient or all if not set.
|
||||
/// </summary>
|
||||
public UUID TargetUUID
|
||||
{
|
||||
get { return m_toID; }
|
||||
set { m_toID = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
||||
@@ -241,10 +241,14 @@ namespace OpenSim.Framework
|
||||
|
||||
m_textureEntry = prim.Textures.GetBytes();
|
||||
|
||||
SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None);
|
||||
SculptData = prim.Sculpt.GetBytes();
|
||||
SculptTexture = prim.Sculpt.SculptTexture;
|
||||
SculptType = (byte)prim.Sculpt.Type;
|
||||
if (prim.Sculpt != null)
|
||||
{
|
||||
SculptEntry = (prim.Sculpt.Type != OpenMetaverse.SculptType.None);
|
||||
SculptData = prim.Sculpt.GetBytes();
|
||||
SculptTexture = prim.Sculpt.SculptTexture;
|
||||
SculptType = (byte)prim.Sculpt.Type;
|
||||
}
|
||||
else SculptType = (byte)OpenMetaverse.SculptType.None;
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
|
||||
@@ -421,12 +421,18 @@ namespace OpenSim.Framework
|
||||
set { m_internalEndPoint = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The x co-ordinate of this region in map tiles (e.g. 1000).
|
||||
/// </summary>
|
||||
public uint RegionLocX
|
||||
{
|
||||
get { return m_regionLocX.Value; }
|
||||
set { m_regionLocX = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The y co-ordinate of this region in map tiles (e.g. 1000).
|
||||
/// </summary>
|
||||
public uint RegionLocY
|
||||
{
|
||||
get { return m_regionLocY.Value; }
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using OpenMetaverse;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
@@ -71,6 +72,32 @@ namespace OpenSim.Framework
|
||||
|
||||
return pos + offset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string representation of this SpawnPoint.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0},{1},{2}", Yaw, Pitch, Distance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a SpawnPoint from a string
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
public static SpawnPoint Parse(string str)
|
||||
{
|
||||
string[] parts = str.Split(',');
|
||||
if (parts.Length != 3)
|
||||
throw new ArgumentException("Invalid string: " + str);
|
||||
|
||||
SpawnPoint sp = new SpawnPoint();
|
||||
sp.Yaw = float.Parse(parts[0]);
|
||||
sp.Pitch = float.Parse(parts[1]);
|
||||
sp.Distance = float.Parse(parts[2]);
|
||||
return sp;
|
||||
}
|
||||
}
|
||||
|
||||
public class RegionSettings
|
||||
@@ -456,7 +483,7 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
// Connected Telehub object
|
||||
private UUID m_TelehubObject;
|
||||
private UUID m_TelehubObject = UUID.Zero;
|
||||
public UUID TelehubObject
|
||||
{
|
||||
get
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -36,239 +38,189 @@ namespace OpenSim.Framework
|
||||
public static class SLUtil
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
|
||||
#region SL / file extension / content-type conversions
|
||||
|
||||
private class TypeMapping
|
||||
{
|
||||
private sbyte assetType;
|
||||
private InventoryType inventoryType;
|
||||
private string contentType;
|
||||
private string contentType2;
|
||||
private string extension;
|
||||
|
||||
public sbyte AssetTypeCode
|
||||
{
|
||||
get { return assetType; }
|
||||
}
|
||||
|
||||
public object AssetType
|
||||
{
|
||||
get {
|
||||
if (Enum.IsDefined(typeof(OpenMetaverse.AssetType), assetType))
|
||||
return (OpenMetaverse.AssetType)assetType;
|
||||
else
|
||||
return OpenMetaverse.AssetType.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
public InventoryType InventoryType
|
||||
{
|
||||
get { return inventoryType; }
|
||||
}
|
||||
|
||||
public string ContentType
|
||||
{
|
||||
get { return contentType; }
|
||||
}
|
||||
|
||||
public string ContentType2
|
||||
{
|
||||
get { return contentType2; }
|
||||
}
|
||||
|
||||
public string Extension
|
||||
{
|
||||
get { return extension; }
|
||||
}
|
||||
|
||||
private TypeMapping(sbyte assetType, InventoryType inventoryType, string contentType, string contentType2, string extension)
|
||||
{
|
||||
this.assetType = assetType;
|
||||
this.inventoryType = inventoryType;
|
||||
this.contentType = contentType;
|
||||
this.contentType2 = contentType2;
|
||||
this.extension = extension;
|
||||
}
|
||||
|
||||
public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string contentType2, string extension)
|
||||
: this((sbyte)assetType, inventoryType, contentType, contentType2, extension)
|
||||
{
|
||||
}
|
||||
|
||||
public TypeMapping(AssetType assetType, InventoryType inventoryType, string contentType, string extension)
|
||||
: this((sbyte)assetType, inventoryType, contentType, null, extension)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Maps between AssetType, InventoryType and Content-Type.
|
||||
/// Where more than one possibility exists, the first one takes precedence. E.g.:
|
||||
/// AssetType "AssetType.Texture" -> Content-Type "image-xj2c"
|
||||
/// Content-Type "image/x-j2c" -> InventoryType "InventoryType.Texture"
|
||||
/// </summary>
|
||||
private static TypeMapping[] MAPPINGS = new TypeMapping[] {
|
||||
new TypeMapping(AssetType.Unknown, InventoryType.Unknown, "application/octet-stream", "bin"),
|
||||
new TypeMapping(AssetType.Texture, InventoryType.Texture, "image/x-j2c", "image/jp2", "j2c"),
|
||||
new TypeMapping(AssetType.Texture, InventoryType.Snapshot, "image/x-j2c", "image/jp2", "j2c"),
|
||||
new TypeMapping(AssetType.TextureTGA, InventoryType.Texture, "image/tga", "tga"),
|
||||
new TypeMapping(AssetType.ImageTGA, InventoryType.Texture, "image/tga", "tga"),
|
||||
new TypeMapping(AssetType.ImageJPEG, InventoryType.Texture, "image/jpeg", "jpg"),
|
||||
new TypeMapping(AssetType.Sound, InventoryType.Sound, "audio/ogg", "application/ogg", "ogg"),
|
||||
new TypeMapping(AssetType.SoundWAV, InventoryType.Sound, "audio/x-wav", "wav"),
|
||||
new TypeMapping(AssetType.CallingCard, InventoryType.CallingCard, "application/vnd.ll.callingcard", "application/x-metaverse-callingcard", "callingcard"),
|
||||
new TypeMapping(AssetType.Landmark, InventoryType.Landmark, "application/vnd.ll.landmark", "application/x-metaverse-landmark", "landmark"),
|
||||
new TypeMapping(AssetType.Clothing, InventoryType.Wearable, "application/vnd.ll.clothing", "application/x-metaverse-clothing", "clothing"),
|
||||
new TypeMapping(AssetType.Object, InventoryType.Object, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
|
||||
new TypeMapping(AssetType.Object, InventoryType.Attachment, "application/vnd.ll.primitive", "application/x-metaverse-primitive", "primitive"),
|
||||
new TypeMapping(AssetType.Notecard, InventoryType.Notecard, "application/vnd.ll.notecard", "application/x-metaverse-notecard", "notecard"),
|
||||
new TypeMapping(AssetType.Folder, InventoryType.Folder, "application/vnd.ll.folder", "folder"),
|
||||
new TypeMapping(AssetType.RootFolder, InventoryType.RootCategory, "application/vnd.ll.rootfolder", "rootfolder"),
|
||||
new TypeMapping(AssetType.LSLText, InventoryType.LSL, "application/vnd.ll.lsltext", "application/x-metaverse-lsl", "lsl"),
|
||||
new TypeMapping(AssetType.LSLBytecode, InventoryType.LSL, "application/vnd.ll.lslbyte", "application/x-metaverse-lso", "lso"),
|
||||
new TypeMapping(AssetType.Bodypart, InventoryType.Wearable, "application/vnd.ll.bodypart", "application/x-metaverse-bodypart", "bodypart"),
|
||||
new TypeMapping(AssetType.TrashFolder, InventoryType.Folder, "application/vnd.ll.trashfolder", "trashfolder"),
|
||||
new TypeMapping(AssetType.SnapshotFolder, InventoryType.Folder, "application/vnd.ll.snapshotfolder", "snapshotfolder"),
|
||||
new TypeMapping(AssetType.LostAndFoundFolder, InventoryType.Folder, "application/vnd.ll.lostandfoundfolder", "lostandfoundfolder"),
|
||||
new TypeMapping(AssetType.Animation, InventoryType.Animation, "application/vnd.ll.animation", "application/x-metaverse-animation", "animation"),
|
||||
new TypeMapping(AssetType.Gesture, InventoryType.Gesture, "application/vnd.ll.gesture", "application/x-metaverse-gesture", "gesture"),
|
||||
new TypeMapping(AssetType.Simstate, InventoryType.Snapshot, "application/x-metaverse-simstate", "simstate"),
|
||||
new TypeMapping(AssetType.FavoriteFolder, InventoryType.Unknown, "application/vnd.ll.favoritefolder", "favoritefolder"),
|
||||
new TypeMapping(AssetType.Link, InventoryType.Unknown, "application/vnd.ll.link", "link"),
|
||||
new TypeMapping(AssetType.LinkFolder, InventoryType.Unknown, "application/vnd.ll.linkfolder", "linkfolder"),
|
||||
new TypeMapping(AssetType.CurrentOutfitFolder, InventoryType.Unknown, "application/vnd.ll.currentoutfitfolder", "currentoutfitfolder"),
|
||||
new TypeMapping(AssetType.OutfitFolder, InventoryType.Unknown, "application/vnd.ll.outfitfolder", "outfitfolder"),
|
||||
new TypeMapping(AssetType.MyOutfitsFolder, InventoryType.Unknown, "application/vnd.ll.myoutfitsfolder", "myoutfitsfolder"),
|
||||
new TypeMapping(AssetType.Mesh, InventoryType.Mesh, "application/vnd.ll.mesh", "llm")
|
||||
};
|
||||
|
||||
private static Dictionary<sbyte, string> asset2Content;
|
||||
private static Dictionary<sbyte, string> asset2Extension;
|
||||
private static Dictionary<InventoryType, string> inventory2Content;
|
||||
private static Dictionary<string, sbyte> content2Asset;
|
||||
private static Dictionary<string, InventoryType> content2Inventory;
|
||||
|
||||
static SLUtil()
|
||||
{
|
||||
asset2Content = new Dictionary<sbyte, string>();
|
||||
asset2Extension = new Dictionary<sbyte, string>();
|
||||
inventory2Content = new Dictionary<InventoryType, string>();
|
||||
content2Asset = new Dictionary<string, sbyte>();
|
||||
content2Inventory = new Dictionary<string, InventoryType>();
|
||||
|
||||
foreach (TypeMapping mapping in MAPPINGS)
|
||||
{
|
||||
sbyte assetType = mapping.AssetTypeCode;
|
||||
if (!asset2Content.ContainsKey(assetType))
|
||||
asset2Content.Add(assetType, mapping.ContentType);
|
||||
if (!asset2Extension.ContainsKey(assetType))
|
||||
asset2Extension.Add(assetType, mapping.Extension);
|
||||
if (!inventory2Content.ContainsKey(mapping.InventoryType))
|
||||
inventory2Content.Add(mapping.InventoryType, mapping.ContentType);
|
||||
if (!content2Asset.ContainsKey(mapping.ContentType))
|
||||
content2Asset.Add(mapping.ContentType, assetType);
|
||||
if (!content2Inventory.ContainsKey(mapping.ContentType))
|
||||
content2Inventory.Add(mapping.ContentType, mapping.InventoryType);
|
||||
|
||||
if (mapping.ContentType2 != null)
|
||||
{
|
||||
if (!content2Asset.ContainsKey(mapping.ContentType2))
|
||||
content2Asset.Add(mapping.ContentType2, assetType);
|
||||
if (!content2Inventory.ContainsKey(mapping.ContentType2))
|
||||
content2Inventory.Add(mapping.ContentType2, mapping.InventoryType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string SLAssetTypeToContentType(int assetType)
|
||||
{
|
||||
switch ((AssetType)assetType)
|
||||
{
|
||||
case AssetType.Texture:
|
||||
return "image/x-j2c";
|
||||
case AssetType.Sound:
|
||||
return "audio/ogg";
|
||||
case AssetType.CallingCard:
|
||||
return "application/vnd.ll.callingcard";
|
||||
case AssetType.Landmark:
|
||||
return "application/vnd.ll.landmark";
|
||||
case AssetType.Clothing:
|
||||
return "application/vnd.ll.clothing";
|
||||
case AssetType.Object:
|
||||
return "application/vnd.ll.primitive";
|
||||
case AssetType.Notecard:
|
||||
return "application/vnd.ll.notecard";
|
||||
case AssetType.Folder:
|
||||
return "application/vnd.ll.folder";
|
||||
case AssetType.RootFolder:
|
||||
return "application/vnd.ll.rootfolder";
|
||||
case AssetType.LSLText:
|
||||
return "application/vnd.ll.lsltext";
|
||||
case AssetType.LSLBytecode:
|
||||
return "application/vnd.ll.lslbyte";
|
||||
case AssetType.TextureTGA:
|
||||
case AssetType.ImageTGA:
|
||||
return "image/tga";
|
||||
case AssetType.Bodypart:
|
||||
return "application/vnd.ll.bodypart";
|
||||
case AssetType.TrashFolder:
|
||||
return "application/vnd.ll.trashfolder";
|
||||
case AssetType.SnapshotFolder:
|
||||
return "application/vnd.ll.snapshotfolder";
|
||||
case AssetType.LostAndFoundFolder:
|
||||
return "application/vnd.ll.lostandfoundfolder";
|
||||
case AssetType.SoundWAV:
|
||||
return "audio/x-wav";
|
||||
case AssetType.ImageJPEG:
|
||||
return "image/jpeg";
|
||||
case AssetType.Animation:
|
||||
return "application/vnd.ll.animation";
|
||||
case AssetType.Gesture:
|
||||
return "application/vnd.ll.gesture";
|
||||
case AssetType.Simstate:
|
||||
return "application/x-metaverse-simstate";
|
||||
case AssetType.FavoriteFolder:
|
||||
return "application/vnd.ll.favoritefolder";
|
||||
case AssetType.Link:
|
||||
return "application/vnd.ll.link";
|
||||
case AssetType.LinkFolder:
|
||||
return "application/vnd.ll.linkfolder";
|
||||
case AssetType.CurrentOutfitFolder:
|
||||
return "application/vnd.ll.currentoutfitfolder";
|
||||
case AssetType.OutfitFolder:
|
||||
return "application/vnd.ll.outfitfolder";
|
||||
case AssetType.MyOutfitsFolder:
|
||||
return "application/vnd.ll.myoutfitsfolder";
|
||||
case AssetType.Unknown:
|
||||
default:
|
||||
return "application/octet-stream";
|
||||
}
|
||||
string contentType;
|
||||
if (!asset2Content.TryGetValue((sbyte)assetType, out contentType))
|
||||
contentType = asset2Content[(sbyte)AssetType.Unknown];
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public static string SLInvTypeToContentType(int invType)
|
||||
{
|
||||
switch ((InventoryType)invType)
|
||||
{
|
||||
case InventoryType.Animation:
|
||||
return "application/vnd.ll.animation";
|
||||
case InventoryType.CallingCard:
|
||||
return "application/vnd.ll.callingcard";
|
||||
case InventoryType.Folder:
|
||||
return "application/vnd.ll.folder";
|
||||
case InventoryType.Gesture:
|
||||
return "application/vnd.ll.gesture";
|
||||
case InventoryType.Landmark:
|
||||
return "application/vnd.ll.landmark";
|
||||
case InventoryType.LSL:
|
||||
return "application/vnd.ll.lsltext";
|
||||
case InventoryType.Notecard:
|
||||
return "application/vnd.ll.notecard";
|
||||
case InventoryType.Attachment:
|
||||
case InventoryType.Object:
|
||||
return "application/vnd.ll.primitive";
|
||||
case InventoryType.Sound:
|
||||
return "audio/ogg";
|
||||
case InventoryType.Snapshot:
|
||||
case InventoryType.Texture:
|
||||
return "image/x-j2c";
|
||||
case InventoryType.Wearable:
|
||||
return "application/vnd.ll.clothing";
|
||||
default:
|
||||
return "application/octet-stream";
|
||||
}
|
||||
string contentType;
|
||||
if (!inventory2Content.TryGetValue((InventoryType)invType, out contentType))
|
||||
contentType = inventory2Content[InventoryType.Unknown];
|
||||
return contentType;
|
||||
}
|
||||
|
||||
public static sbyte ContentTypeToSLAssetType(string contentType)
|
||||
{
|
||||
switch (contentType)
|
||||
{
|
||||
case "image/x-j2c":
|
||||
case "image/jp2":
|
||||
return (sbyte)AssetType.Texture;
|
||||
case "application/ogg":
|
||||
case "audio/ogg":
|
||||
return (sbyte)AssetType.Sound;
|
||||
case "application/vnd.ll.callingcard":
|
||||
case "application/x-metaverse-callingcard":
|
||||
return (sbyte)AssetType.CallingCard;
|
||||
case "application/vnd.ll.landmark":
|
||||
case "application/x-metaverse-landmark":
|
||||
return (sbyte)AssetType.Landmark;
|
||||
case "application/vnd.ll.clothing":
|
||||
case "application/x-metaverse-clothing":
|
||||
return (sbyte)AssetType.Clothing;
|
||||
case "application/vnd.ll.primitive":
|
||||
case "application/x-metaverse-primitive":
|
||||
return (sbyte)AssetType.Object;
|
||||
case "application/vnd.ll.notecard":
|
||||
case "application/x-metaverse-notecard":
|
||||
return (sbyte)AssetType.Notecard;
|
||||
case "application/vnd.ll.folder":
|
||||
return (sbyte)AssetType.Folder;
|
||||
case "application/vnd.ll.rootfolder":
|
||||
return (sbyte)AssetType.RootFolder;
|
||||
case "application/vnd.ll.lsltext":
|
||||
case "application/x-metaverse-lsl":
|
||||
return (sbyte)AssetType.LSLText;
|
||||
case "application/vnd.ll.lslbyte":
|
||||
case "application/x-metaverse-lso":
|
||||
return (sbyte)AssetType.LSLBytecode;
|
||||
case "image/tga":
|
||||
// Note that AssetType.TextureTGA will be converted to AssetType.ImageTGA
|
||||
return (sbyte)AssetType.ImageTGA;
|
||||
case "application/vnd.ll.bodypart":
|
||||
case "application/x-metaverse-bodypart":
|
||||
return (sbyte)AssetType.Bodypart;
|
||||
case "application/vnd.ll.trashfolder":
|
||||
return (sbyte)AssetType.TrashFolder;
|
||||
case "application/vnd.ll.snapshotfolder":
|
||||
return (sbyte)AssetType.SnapshotFolder;
|
||||
case "application/vnd.ll.lostandfoundfolder":
|
||||
return (sbyte)AssetType.LostAndFoundFolder;
|
||||
case "audio/x-wav":
|
||||
return (sbyte)AssetType.SoundWAV;
|
||||
case "image/jpeg":
|
||||
return (sbyte)AssetType.ImageJPEG;
|
||||
case "application/vnd.ll.animation":
|
||||
case "application/x-metaverse-animation":
|
||||
return (sbyte)AssetType.Animation;
|
||||
case "application/vnd.ll.gesture":
|
||||
case "application/x-metaverse-gesture":
|
||||
return (sbyte)AssetType.Gesture;
|
||||
case "application/x-metaverse-simstate":
|
||||
return (sbyte)AssetType.Simstate;
|
||||
case "application/vnd.ll.favoritefolder":
|
||||
return (sbyte)AssetType.FavoriteFolder;
|
||||
case "application/vnd.ll.link":
|
||||
return (sbyte)AssetType.Link;
|
||||
case "application/vnd.ll.linkfolder":
|
||||
return (sbyte)AssetType.LinkFolder;
|
||||
case "application/vnd.ll.currentoutfitfolder":
|
||||
return (sbyte)AssetType.CurrentOutfitFolder;
|
||||
case "application/vnd.ll.outfitfolder":
|
||||
return (sbyte)AssetType.OutfitFolder;
|
||||
case "application/vnd.ll.myoutfitsfolder":
|
||||
return (sbyte)AssetType.MyOutfitsFolder;
|
||||
case "application/octet-stream":
|
||||
default:
|
||||
return (sbyte)AssetType.Unknown;
|
||||
}
|
||||
sbyte assetType;
|
||||
if (!content2Asset.TryGetValue(contentType, out assetType))
|
||||
assetType = (sbyte)AssetType.Unknown;
|
||||
return (sbyte)assetType;
|
||||
}
|
||||
|
||||
public static sbyte ContentTypeToSLInvType(string contentType)
|
||||
{
|
||||
switch (contentType)
|
||||
{
|
||||
case "image/x-j2c":
|
||||
case "image/jp2":
|
||||
case "image/tga":
|
||||
case "image/jpeg":
|
||||
return (sbyte)InventoryType.Texture;
|
||||
case "application/ogg":
|
||||
case "audio/ogg":
|
||||
case "audio/x-wav":
|
||||
return (sbyte)InventoryType.Sound;
|
||||
case "application/vnd.ll.callingcard":
|
||||
case "application/x-metaverse-callingcard":
|
||||
return (sbyte)InventoryType.CallingCard;
|
||||
case "application/vnd.ll.landmark":
|
||||
case "application/x-metaverse-landmark":
|
||||
return (sbyte)InventoryType.Landmark;
|
||||
case "application/vnd.ll.clothing":
|
||||
case "application/x-metaverse-clothing":
|
||||
case "application/vnd.ll.bodypart":
|
||||
case "application/x-metaverse-bodypart":
|
||||
return (sbyte)InventoryType.Wearable;
|
||||
case "application/vnd.ll.primitive":
|
||||
case "application/x-metaverse-primitive":
|
||||
return (sbyte)InventoryType.Object;
|
||||
case "application/vnd.ll.notecard":
|
||||
case "application/x-metaverse-notecard":
|
||||
return (sbyte)InventoryType.Notecard;
|
||||
case "application/vnd.ll.folder":
|
||||
return (sbyte)InventoryType.Folder;
|
||||
case "application/vnd.ll.rootfolder":
|
||||
return (sbyte)InventoryType.RootCategory;
|
||||
case "application/vnd.ll.lsltext":
|
||||
case "application/x-metaverse-lsl":
|
||||
case "application/vnd.ll.lslbyte":
|
||||
case "application/x-metaverse-lso":
|
||||
return (sbyte)InventoryType.LSL;
|
||||
case "application/vnd.ll.trashfolder":
|
||||
case "application/vnd.ll.snapshotfolder":
|
||||
case "application/vnd.ll.lostandfoundfolder":
|
||||
return (sbyte)InventoryType.Folder;
|
||||
case "application/vnd.ll.animation":
|
||||
case "application/x-metaverse-animation":
|
||||
return (sbyte)InventoryType.Animation;
|
||||
case "application/vnd.ll.gesture":
|
||||
case "application/x-metaverse-gesture":
|
||||
return (sbyte)InventoryType.Gesture;
|
||||
case "application/x-metaverse-simstate":
|
||||
return (sbyte)InventoryType.Snapshot;
|
||||
case "application/octet-stream":
|
||||
default:
|
||||
return (sbyte)InventoryType.Unknown;
|
||||
}
|
||||
InventoryType invType;
|
||||
if (!content2Inventory.TryGetValue(contentType, out invType))
|
||||
invType = InventoryType.Unknown;
|
||||
return (sbyte)invType;
|
||||
}
|
||||
|
||||
public static string SLAssetTypeToExtension(int assetType)
|
||||
{
|
||||
string extension;
|
||||
if (!asset2Extension.TryGetValue((sbyte)assetType, out extension))
|
||||
extension = asset2Extension[(sbyte)AssetType.Unknown];
|
||||
return extension;
|
||||
}
|
||||
|
||||
#endregion SL / file extension / content-type conversions
|
||||
|
||||
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="nodeToFill"></param>
|
||||
/// <param name="processors">/param>
|
||||
/// <param name="xtr"></param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
|
||||
{
|
||||
ExecuteReadProcessors(
|
||||
return ExecuteReadProcessors(
|
||||
nodeToFill,
|
||||
processors,
|
||||
xtr,
|
||||
(o, name, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
|
||||
name, e.Message, e.StackTrace));
|
||||
}
|
||||
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="parseExceptionAction">
|
||||
/// Action to take if there is a parsing problem. This will usually just be to log the exception
|
||||
/// </param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill,
|
||||
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
|
||||
XmlTextReader xtr,
|
||||
Action<NodeType, string, Exception> parseExceptionAction)
|
||||
{
|
||||
bool errors = false;
|
||||
|
||||
string nodeName = string.Empty;
|
||||
while (xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errors = true;
|
||||
parseExceptionAction(nodeToFill, nodeName, e);
|
||||
|
||||
if (xtr.NodeType == XmlNodeType.EndElement)
|
||||
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtr.ReadOuterXml(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UUID.TryParse(node.InnerText, out uuid);
|
||||
creator = userService.GetUserAccount(scopeID, uuid);
|
||||
}
|
||||
|
||||
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
|
||||
hasCreatorData = true;
|
||||
|
||||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
|
||||
doc.Save(wr);
|
||||
return wr.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,8 @@ using System.Text;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace OpenSim.Framework.Serialization.External
|
||||
{
|
||||
@@ -187,7 +189,29 @@ namespace OpenSim.Framework.Serialization.External
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
xtr.ReadEndElement();
|
||||
|
||||
if (xtr.IsStartElement("Telehub"))
|
||||
{
|
||||
xtr.ReadStartElement("Telehub");
|
||||
|
||||
while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
switch (xtr.Name)
|
||||
{
|
||||
case "TelehubObject":
|
||||
settings.TelehubObject = UUID.Parse(xtr.ReadElementContentAsString());
|
||||
break;
|
||||
case "SpawnPoint":
|
||||
string str = xtr.ReadElementContentAsString();
|
||||
SpawnPoint sp = SpawnPoint.Parse(str);
|
||||
settings.AddSpawnPoint(sp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xtr.Close();
|
||||
sr.Close();
|
||||
|
||||
@@ -243,7 +267,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtw.WriteElementString("SunPosition", settings.SunPosition.ToString());
|
||||
// Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which
|
||||
// calculates it automatically according to the date and other factors.
|
||||
xtw.WriteEndElement();
|
||||
xtw.WriteEndElement();
|
||||
|
||||
xtw.WriteStartElement("Telehub");
|
||||
if (settings.TelehubObject != UUID.Zero)
|
||||
{
|
||||
xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString());
|
||||
foreach (SpawnPoint sp in settings.SpawnPoints())
|
||||
xtw.WriteElementString("SpawnPoint", sp.ToString());
|
||||
}
|
||||
xtw.WriteEndElement();
|
||||
|
||||
xtw.WriteEndElement();
|
||||
|
||||
|
||||
@@ -78,6 +78,10 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||
<FixedSun>true</FixedSun>
|
||||
<SunPosition>12</SunPosition>
|
||||
</Terrain>
|
||||
<Telehub>
|
||||
<TelehubObject>00000000-0000-0000-0000-111111111111</TelehubObject>
|
||||
<SpawnPoint>1,-2,0.33</SpawnPoint>
|
||||
</Telehub>
|
||||
</RegionSettings>";
|
||||
|
||||
private RegionSettings m_rs;
|
||||
@@ -116,6 +120,8 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||
m_rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080");
|
||||
m_rs.UseEstateSun = true;
|
||||
m_rs.WaterHeight = 23;
|
||||
m_rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111");
|
||||
m_rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -129,6 +135,8 @@ namespace OpenSim.Framework.Serialization.Tests
|
||||
Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2));
|
||||
Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics));
|
||||
Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit));
|
||||
Assert.That(deserRs.TelehubObject, Is.EqualTo(m_rs.TelehubObject));
|
||||
Assert.That(deserRs.SpawnPoints()[0].ToString(), Is.EqualTo(m_rs.SpawnPoints()[0].ToString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,43 +161,43 @@ namespace OpenSim.Framework.Servers
|
||||
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
|
||||
}
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "quit",
|
||||
m_console.Commands.AddCommand("General", false, "quit",
|
||||
"quit",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "shutdown",
|
||||
m_console.Commands.AddCommand("General", false, "shutdown",
|
||||
"shutdown",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "set log level",
|
||||
m_console.Commands.AddCommand("General", false, "set log level",
|
||||
"set log level <level>",
|
||||
"Set the console logging level", HandleLogLevel);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show info",
|
||||
m_console.Commands.AddCommand("General", false, "show info",
|
||||
"show info",
|
||||
"Show general information about the server", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show stats",
|
||||
m_console.Commands.AddCommand("General", false, "show stats",
|
||||
"show stats",
|
||||
"Show statistics", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show threads",
|
||||
m_console.Commands.AddCommand("General", false, "show threads",
|
||||
"show threads",
|
||||
"Show thread status", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show uptime",
|
||||
m_console.Commands.AddCommand("General", false, "show uptime",
|
||||
"show uptime",
|
||||
"Show server uptime", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show version",
|
||||
m_console.Commands.AddCommand("General", false, "show version",
|
||||
"show version",
|
||||
"Show server version", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "threads abort",
|
||||
m_console.Commands.AddCommand("General", false, "threads abort",
|
||||
"threads abort <thread-id>",
|
||||
"Abort a managed thread. Use \"show threads\" to find possible threads.", HandleThreadsAbort);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "threads show",
|
||||
m_console.Commands.AddCommand("General", false, "threads show",
|
||||
"threads show",
|
||||
"Show thread status. Synonym for \"show threads\"",
|
||||
(string module, string[] args) => Notice(GetThreadsReport()));
|
||||
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Servers
|
||||
string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
|
||||
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreadsInfo();
|
||||
|
||||
sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
|
||||
|
||||
@@ -269,15 +269,19 @@ namespace OpenSim.Framework.Servers
|
||||
t.Priority,
|
||||
t.ThreadState);
|
||||
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
|
||||
ThreadPool.GetAvailableThreads(out workers, out ports);
|
||||
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
|
||||
sb.Append("\n");
|
||||
|
||||
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
|
||||
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
|
||||
// For some reason mono 2.6.7 returns an empty threads set! Not going to confuse people by reporting
|
||||
// zero active threads.
|
||||
int totalThreads = Process.GetCurrentProcess().Threads.Count;
|
||||
if (totalThreads > 0)
|
||||
sb.AppendFormat("Total threads active: {0}\n\n", totalThreads);
|
||||
|
||||
sb.Append("Main threadpool (excluding script engine pools)\n");
|
||||
sb.Append(Util.GetThreadPoolReport());
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -308,7 +312,9 @@ namespace OpenSim.Framework.Servers
|
||||
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
|
||||
// the clr version number doesn't match the project version number under Mono.
|
||||
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
|
||||
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
|
||||
m_log.InfoFormat(
|
||||
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
|
||||
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
|
||||
|
||||
StartupSpecific();
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public abstract Hashtable Handle(string path, Hashtable Request);
|
||||
|
||||
protected BaseHTTPHandler(string httpMethod, string path)
|
||||
: base(httpMethod, path)
|
||||
{
|
||||
}
|
||||
protected BaseHTTPHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
|
||||
|
||||
protected BaseHTTPHandler(string httpMethod, string path, string name, string description)
|
||||
: base(httpMethod, path, name, description) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetStreamHandlerKeys()
|
||||
public List<string> GetStreamHandlerKeys()
|
||||
{
|
||||
lock (m_streamHandlers)
|
||||
return new List<string>(m_streamHandlers.Keys);
|
||||
@@ -356,7 +356,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0}{1}", e.Message, e.StackTrace);
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: OnRequest() failed: {0} ", e.Message), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -410,6 +410,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
// string reqnum = "unknown";
|
||||
int tickstart = Environment.TickCount;
|
||||
|
||||
IRequestHandler requestHandler = null;
|
||||
|
||||
try
|
||||
{
|
||||
// OpenSim.Framework.WebUtil.OSHeaderRequestID
|
||||
@@ -438,8 +440,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
//response.KeepAlive = true;
|
||||
response.SendChunked = false;
|
||||
|
||||
IRequestHandler requestHandler;
|
||||
|
||||
string path = request.RawUrl;
|
||||
string handlerKey = GetHandlerKey(request.HttpMethod, path);
|
||||
|
||||
@@ -447,8 +447,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
if (DebugLevel >= 1)
|
||||
m_log.DebugFormat(
|
||||
"[BASE HTTP SERVER]: Found stream handler for {0} {1}",
|
||||
request.HttpMethod, request.Url.PathAndQuery);
|
||||
"[BASE HTTP SERVER]: Found stream handler for {0} {1} {2} {3}",
|
||||
request.HttpMethod, request.Url.PathAndQuery, requestHandler.Name, requestHandler.Description);
|
||||
|
||||
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
|
||||
byte[] buffer = null;
|
||||
@@ -551,11 +551,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}. ", e.Message), e);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -658,15 +658,15 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
//
|
||||
// An alternative may be to turn off all response write exceptions on the HttpListener, but let's go
|
||||
// with the minimum first
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux ", e.Message), e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw ", e);
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw " + e.ToString());
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: HandleRequest() threw {0} ", e.Message), e);
|
||||
SendHTML500(response);
|
||||
}
|
||||
finally
|
||||
@@ -675,8 +675,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
// since its just for reporting, tickdiff limit can be adjusted
|
||||
int tickdiff = Environment.TickCount - tickstart;
|
||||
if (tickdiff > 3000)
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[BASE HTTP SERVER]: slow {0} request for {1} from {2} took {3} ms", requestMethod, uriString, request.RemoteIPEndPoint.ToString(), tickdiff);
|
||||
"[BASE HTTP SERVER]: Slow handling of {0} {1} {2} {3} from {4} took {5}ms",
|
||||
requestMethod,
|
||||
uriString,
|
||||
requestHandler != null ? requestHandler.Name : "",
|
||||
requestHandler != null ? requestHandler.Description : "",
|
||||
request.RemoteIPEndPoint.ToString(),
|
||||
tickdiff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,11 +933,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -962,11 +970,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1077,12 +1085,12 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: LLSD IOException {0}.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD IOException {0} ", e.Message), e);
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: LLSD issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1334,8 +1342,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException f)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat(
|
||||
"[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", f);
|
||||
m_log.Warn(
|
||||
String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", f.Message), f);
|
||||
}
|
||||
}
|
||||
catch(Exception)
|
||||
@@ -1630,11 +1638,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
m_log.Warn("[BASE HTTP SERVER]: XmlRpcRequest issue: " + e.Message);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0} ", e.Message), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1671,7 +1679,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER]: XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1707,7 +1715,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
catch (SocketException e)
|
||||
{
|
||||
// This has to be here to prevent a Linux/Mono crash
|
||||
m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e);
|
||||
m_log.Warn(String.Format("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux. ", e.Message), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1786,7 +1794,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
public void httpServerException(object source, Exception exception)
|
||||
{
|
||||
m_log.ErrorFormat("[BASE HTTP SERVER]: {0} had an exception {1}", source.ToString(), exception.ToString());
|
||||
m_log.Error(String.Format("[BASE HTTP SERVER]: {0} had an exception: {1} ", source.ToString(), exception.Message), exception);
|
||||
/*
|
||||
if (HTTPDRunning)// && NotSocketErrors > 5)
|
||||
{
|
||||
|
||||
@@ -45,8 +45,16 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
private readonly string m_path;
|
||||
|
||||
protected BaseRequestHandler(string httpMethod, string path)
|
||||
public string Name { get; private set; }
|
||||
|
||||
public string Description { get; private set; }
|
||||
|
||||
protected BaseRequestHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
|
||||
|
||||
protected BaseRequestHandler(string httpMethod, string path, string name, string description)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
m_httpMethod = httpMethod;
|
||||
m_path = path;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,9 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
public abstract byte[] Handle(string path, Stream request,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse);
|
||||
|
||||
protected BaseStreamHandler(string httpMethod, string path) : base(httpMethod, path)
|
||||
{
|
||||
}
|
||||
protected BaseStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {}
|
||||
|
||||
protected BaseStreamHandler(string httpMethod, string path, string name, string description)
|
||||
: base(httpMethod, path, name, description) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,6 +36,15 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
private BinaryMethod m_method;
|
||||
|
||||
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
|
||||
: this(httpMethod, path, binaryMethod, null, null) {}
|
||||
|
||||
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod, string name, string description)
|
||||
: base(httpMethod, path, name, description)
|
||||
{
|
||||
m_method = binaryMethod;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
byte[] data = ReadFully(request);
|
||||
@@ -45,12 +54,6 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
return Encoding.UTF8.GetBytes(responseString);
|
||||
}
|
||||
|
||||
public BinaryStreamHandler(string httpMethod, string path, BinaryMethod binaryMethod)
|
||||
: base(httpMethod, path)
|
||||
{
|
||||
m_method = binaryMethod;
|
||||
}
|
||||
|
||||
private static byte[] ReadFully(Stream stream)
|
||||
{
|
||||
byte[] buffer = new byte[1024];
|
||||
@@ -70,4 +73,4 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,25 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
public interface IRequestHandler
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Name for this handler.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
|
||||
/// specified.
|
||||
/// </remarks>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Description for this handler.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Used for diagnostics. The path doesn't always describe what the handler does. Can be null if none
|
||||
/// specified.
|
||||
/// </remarks>
|
||||
string Description { get; }
|
||||
|
||||
// Return response content type
|
||||
string ContentType { get; }
|
||||
|
||||
@@ -58,4 +77,4 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
Hashtable Handle(string path, Hashtable request);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,143 +28,252 @@
|
||||
namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
/// <summary>
|
||||
/// HTTP status codes (almost) as defined by W3C in
|
||||
/// http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
|
||||
/// HTTP status codes (almost) as defined by W3C in http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html and IETF in http://tools.ietf.org/html/rfc6585
|
||||
/// </summary>
|
||||
public enum OSHttpStatusCode: int
|
||||
public enum OSHttpStatusCode : int
|
||||
{
|
||||
// 1xx Informational status codes providing a provisional
|
||||
// response.
|
||||
// 100 Tells client that to keep on going sending its request
|
||||
InfoContinue = 100,
|
||||
// 101 Server understands request, proposes to switch to different
|
||||
// application level protocol
|
||||
InfoSwitchingProtocols = 101,
|
||||
#region 1xx Informational status codes providing a provisional response.
|
||||
|
||||
/// <summary>
|
||||
/// 100 Tells client that to keep on going sending its request
|
||||
/// </summary>
|
||||
InfoContinue = 100,
|
||||
|
||||
// 2xx Success codes
|
||||
// 200 Request successful
|
||||
SuccessOk = 200,
|
||||
// 201 Request successful, new resource created
|
||||
SuccessOkCreated = 201,
|
||||
// 202 Request accepted, processing still on-going
|
||||
SuccessOkAccepted = 202,
|
||||
// 203 Request successful, meta information not authoritative
|
||||
SuccessOkNonAuthoritativeInformation = 203,
|
||||
// 204 Request successful, nothing to return in the body
|
||||
SuccessOkNoContent = 204,
|
||||
// 205 Request successful, reset displayed content
|
||||
SuccessOkResetContent = 205,
|
||||
// 206 Request successful, partial content returned
|
||||
SuccessOkPartialContent = 206,
|
||||
/// <summary>
|
||||
/// 101 Server understands request, proposes to switch to different application level protocol
|
||||
/// </summary>
|
||||
InfoSwitchingProtocols = 101,
|
||||
|
||||
// 3xx Redirect code: user agent needs to go somewhere else
|
||||
// 300 Redirect: different presentation forms available, take
|
||||
// a pick
|
||||
RedirectMultipleChoices = 300,
|
||||
// 301 Redirect: requested resource has moved and now lives
|
||||
// somewhere else
|
||||
RedirectMovedPermanently = 301,
|
||||
// 302 Redirect: Resource temporarily somewhere else, location
|
||||
// might change
|
||||
RedirectFound = 302,
|
||||
// 303 Redirect: See other as result of a POST
|
||||
RedirectSeeOther = 303,
|
||||
// 304 Redirect: Resource still the same as before
|
||||
RedirectNotModified = 304,
|
||||
// 305 Redirect: Resource must be accessed via proxy provided
|
||||
// in location field
|
||||
RedirectUseProxy = 305,
|
||||
// 307 Redirect: Resource temporarily somewhere else, location
|
||||
// might change
|
||||
RedirectMovedTemporarily = 307,
|
||||
#endregion
|
||||
|
||||
// 4xx Client error: the client borked the request
|
||||
// 400 Client error: bad request, server does not grok what
|
||||
// the client wants
|
||||
ClientErrorBadRequest = 400,
|
||||
// 401 Client error: the client is not authorized, response
|
||||
// provides WWW-Authenticate header field with a challenge
|
||||
ClientErrorUnauthorized = 401,
|
||||
// 402 Client error: Payment required (reserved for future use)
|
||||
ClientErrorPaymentRequired = 402,
|
||||
// 403 Client error: Server understood request, will not
|
||||
// deliver, do not try again.
|
||||
ClientErrorForbidden = 403,
|
||||
// 404 Client error: Server cannot find anything matching the
|
||||
// client request.
|
||||
ClientErrorNotFound = 404,
|
||||
// 405 Client error: The method specified by the client in the
|
||||
// request is not allowed for the resource requested
|
||||
ClientErrorMethodNotAllowed = 405,
|
||||
// 406 Client error: Server cannot generate suitable response
|
||||
// for the resource and content characteristics requested by
|
||||
// the client
|
||||
ClientErrorNotAcceptable = 406,
|
||||
// 407 Client error: Similar to 401, Server requests that
|
||||
// client authenticate itself with the proxy first
|
||||
ClientErrorProxyAuthRequired = 407,
|
||||
// 408 Client error: Server got impatient with client and
|
||||
// decided to give up waiting for the client's request to
|
||||
// arrive
|
||||
ClientErrorRequestTimeout = 408,
|
||||
// 409 Client error: Server could not fulfill the request for
|
||||
// a resource as there is a conflict with the current state of
|
||||
// the resource but thinks client can do something about this
|
||||
ClientErrorConflict = 409,
|
||||
// 410 Client error: The resource has moved somewhere else,
|
||||
// but server has no clue where.
|
||||
ClientErrorGone = 410,
|
||||
// 411 Client error: The server is picky again and insists on
|
||||
// having a content-length header field in the request
|
||||
ClientErrorLengthRequired = 411,
|
||||
// 412 Client error: one or more preconditions supplied in the
|
||||
// client's request is false
|
||||
ClientErrorPreconditionFailed = 412,
|
||||
// 413 Client error: For fear of reflux, the server refuses to
|
||||
// swallow that much data.
|
||||
ClientErrorRequestEntityToLarge = 413,
|
||||
// 414 Client error: The server considers the Request-URI to
|
||||
// be indecently long and refuses to even look at it.
|
||||
ClientErrorRequestURITooLong = 414,
|
||||
// 415 Client error: The server has no clue about the media
|
||||
// type requested by the client (contrary to popular belief it
|
||||
// is not a warez server)
|
||||
ClientErrorUnsupportedMediaType = 415,
|
||||
// 416 Client error: The requested range cannot be delivered
|
||||
// by the server.
|
||||
#region 2xx Success codes
|
||||
|
||||
/// <summary>
|
||||
/// 200 Request successful
|
||||
/// </summary>
|
||||
SuccessOk = 200,
|
||||
|
||||
/// <summary>
|
||||
/// 201 Request successful, new resource created
|
||||
/// </summary>
|
||||
SuccessOkCreated = 201,
|
||||
|
||||
/// <summary>
|
||||
/// 202 Request accepted, processing still on-going
|
||||
/// </summary>
|
||||
SuccessOkAccepted = 202,
|
||||
|
||||
/// <summary>
|
||||
/// 203 Request successful, meta information not authoritative
|
||||
/// </summary>
|
||||
SuccessOkNonAuthoritativeInformation = 203,
|
||||
|
||||
/// <summary>
|
||||
/// 204 Request successful, nothing to return in the body
|
||||
/// </summary>
|
||||
SuccessOkNoContent = 204,
|
||||
|
||||
/// <summary>
|
||||
/// 205 Request successful, reset displayed content
|
||||
/// </summary>
|
||||
SuccessOkResetContent = 205,
|
||||
|
||||
/// <summary>
|
||||
/// 206 Request successful, partial content returned
|
||||
/// </summary>
|
||||
SuccessOkPartialContent = 206,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 3xx Redirect code: user agent needs to go somewhere else
|
||||
|
||||
/// <summary>
|
||||
/// 300 Redirect: different presentation forms available, take a pick
|
||||
/// </summary>
|
||||
RedirectMultipleChoices = 300,
|
||||
|
||||
/// <summary>
|
||||
/// 301 Redirect: requested resource has moved and now lives somewhere else
|
||||
/// </summary>
|
||||
RedirectMovedPermanently = 301,
|
||||
|
||||
/// <summary>
|
||||
/// 302 Redirect: Resource temporarily somewhere else, location might change
|
||||
/// </summary>
|
||||
RedirectFound = 302,
|
||||
|
||||
/// <summary>
|
||||
/// 303 Redirect: See other as result of a POST
|
||||
/// </summary>
|
||||
RedirectSeeOther = 303,
|
||||
|
||||
/// <summary>
|
||||
/// 304 Redirect: Resource still the same as before
|
||||
/// </summary>
|
||||
RedirectNotModified = 304,
|
||||
|
||||
/// <summary>
|
||||
/// 305 Redirect: Resource must be accessed via proxy provided in location field
|
||||
/// </summary>
|
||||
RedirectUseProxy = 305,
|
||||
|
||||
/// <summary>
|
||||
/// 307 Redirect: Resource temporarily somewhere else, location might change
|
||||
/// </summary>
|
||||
RedirectMovedTemporarily = 307,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 4xx Client error: the client borked the request
|
||||
|
||||
/// <summary>
|
||||
/// 400 Client error: bad request, server does not grok what the client wants
|
||||
/// </summary>
|
||||
ClientErrorBadRequest = 400,
|
||||
|
||||
/// <summary>
|
||||
/// 401 Client error: the client is not authorized, response provides WWW-Authenticate header field with a challenge
|
||||
/// </summary>
|
||||
ClientErrorUnauthorized = 401,
|
||||
|
||||
/// <summary>
|
||||
/// 402 Client error: Payment required (reserved for future use)
|
||||
/// </summary>
|
||||
ClientErrorPaymentRequired = 402,
|
||||
|
||||
/// <summary>
|
||||
/// 403 Client error: Server understood request, will not deliver, do not try again.
|
||||
ClientErrorForbidden = 403,
|
||||
|
||||
/// <summary>
|
||||
/// 404 Client error: Server cannot find anything matching the client request.
|
||||
/// </summary>
|
||||
ClientErrorNotFound = 404,
|
||||
|
||||
/// <summary>
|
||||
/// 405 Client error: The method specified by the client in the request is not allowed for the resource requested
|
||||
/// </summary>
|
||||
ClientErrorMethodNotAllowed = 405,
|
||||
|
||||
/// <summary>
|
||||
/// 406 Client error: Server cannot generate suitable response for the resource and content characteristics requested by the client
|
||||
/// </summary>
|
||||
ClientErrorNotAcceptable = 406,
|
||||
|
||||
/// <summary>
|
||||
/// 407 Client error: Similar to 401, Server requests that client authenticate itself with the proxy first
|
||||
/// </summary>
|
||||
ClientErrorProxyAuthRequired = 407,
|
||||
|
||||
/// <summary>
|
||||
/// 408 Client error: Server got impatient with client and decided to give up waiting for the client's request to arrive
|
||||
/// </summary>
|
||||
ClientErrorRequestTimeout = 408,
|
||||
|
||||
/// <summary>
|
||||
/// 409 Client error: Server could not fulfill the request for a resource as there is a conflict with the current state of the resource but thinks client can do something about this
|
||||
/// </summary>
|
||||
ClientErrorConflict = 409,
|
||||
|
||||
/// <summary>
|
||||
/// 410 Client error: The resource has moved somewhere else, but server has no clue where.
|
||||
/// </summary>
|
||||
ClientErrorGone = 410,
|
||||
|
||||
/// <summary>
|
||||
/// 411 Client error: The server is picky again and insists on having a content-length header field in the request
|
||||
/// </summary>
|
||||
ClientErrorLengthRequired = 411,
|
||||
|
||||
/// <summary>
|
||||
/// 412 Client error: one or more preconditions supplied in the client's request is false
|
||||
/// </summary>
|
||||
ClientErrorPreconditionFailed = 412,
|
||||
|
||||
/// <summary>
|
||||
/// 413 Client error: For fear of reflux, the server refuses to swallow that much data.
|
||||
/// </summary>
|
||||
ClientErrorRequestEntityToLarge = 413,
|
||||
|
||||
/// <summary>
|
||||
/// 414 Client error: The server considers the Request-URI to be indecently long and refuses to even look at it.
|
||||
/// </summary>
|
||||
ClientErrorRequestURITooLong = 414,
|
||||
|
||||
/// <summary>
|
||||
/// 415 Client error: The server has no clue about the media type requested by the client (contrary to popular belief it is not a warez server)
|
||||
/// </summary>
|
||||
ClientErrorUnsupportedMediaType = 415,
|
||||
|
||||
/// <summary>
|
||||
/// 416 Client error: The requested range cannot be delivered by the server.
|
||||
/// </summary>
|
||||
ClientErrorRequestRangeNotSatisfiable = 416,
|
||||
// 417 Client error: The expectations of the client as
|
||||
// expressed in one or more Expect header fields cannot be met
|
||||
// by the server, the server is awfully sorry about this.
|
||||
ClientErrorExpectationFailed = 417,
|
||||
// 499 Client error: Wildcard error.
|
||||
ClientErrorJoker = 499,
|
||||
|
||||
// 5xx Server errors (rare)
|
||||
// 500 Server error: something really strange and unexpected
|
||||
// happened
|
||||
ServerErrorInternalError = 500,
|
||||
// 501 Server error: The server does not do the functionality
|
||||
// required to carry out the client request. not at
|
||||
// all. certainly not before breakfast. but also not after
|
||||
// breakfast.
|
||||
ServerErrorNotImplemented = 501,
|
||||
// 502 Server error: While acting as a proxy or a gateway, the
|
||||
// server got ditched by the upstream server and as a
|
||||
// consequence regretfully cannot fulfill the client's request
|
||||
ServerErrorBadGateway = 502,
|
||||
// 503 Server error: Due to unforseen circumstances the server
|
||||
// cannot currently deliver the service requested. Retry-After
|
||||
// header might indicate when to try again.
|
||||
ServerErrorServiceUnavailable = 503,
|
||||
// 504 Server error: The server blames the upstream server
|
||||
// for not being able to deliver the service requested and
|
||||
// claims that the upstream server is too slow delivering the
|
||||
// goods.
|
||||
ServerErrorGatewayTimeout = 504,
|
||||
// 505 Server error: The server does not support the HTTP
|
||||
// version conveyed in the client's request.
|
||||
ServerErrorHttpVersionNotSupported = 505,
|
||||
/// <summary>
|
||||
/// 417 Client error: The expectations of the client as expressed in one or more Expect header fields cannot be met by the server, the server is awfully sorry about this.
|
||||
/// </summary>
|
||||
ClientErrorExpectationFailed = 417,
|
||||
|
||||
/// <summary>
|
||||
/// 428 Client error :The 428 status code indicates that the origin server requires the request to be conditional.
|
||||
/// </summary>
|
||||
ClientErrorPreconditionRequired = 428,
|
||||
|
||||
/// <summary>
|
||||
/// 429 Client error: The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting").
|
||||
/// </summary>
|
||||
ClientErrorTooManyRequests = 429,
|
||||
|
||||
/// <summary>
|
||||
/// 431 Client error: The 431 status code indicates that the server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields.
|
||||
/// </summary>
|
||||
ClientErrorRequestHeaderFieldsTooLarge = 431,
|
||||
|
||||
/// <summary>
|
||||
/// 499 Client error: Wildcard error.
|
||||
/// </summary>
|
||||
ClientErrorJoker = 499,
|
||||
|
||||
#endregion
|
||||
|
||||
#region 5xx Server errors (rare)
|
||||
|
||||
/// <summary>
|
||||
/// 500 Server error: something really strange and unexpected happened
|
||||
/// </summary>
|
||||
ServerErrorInternalError = 500,
|
||||
|
||||
/// <summary>
|
||||
/// 501 Server error: The server does not do the functionality required to carry out the client request. not at all. certainly not before breakfast. but also not after breakfast.
|
||||
/// </summary>
|
||||
ServerErrorNotImplemented = 501,
|
||||
|
||||
/// <summary>
|
||||
/// 502 Server error: While acting as a proxy or a gateway, the server got ditched by the upstream server and as a consequence regretfully cannot fulfill the client's request
|
||||
/// </summary>
|
||||
ServerErrorBadGateway = 502,
|
||||
|
||||
/// <summary>
|
||||
/// 503 Server error: Due to unforseen circumstances the server cannot currently deliver the service requested. Retry-After header might indicate when to try again.
|
||||
/// </summary>
|
||||
ServerErrorServiceUnavailable = 503,
|
||||
|
||||
/// <summary>
|
||||
/// 504 Server error: The server blames the upstream server for not being able to deliver the service requested and claims that the upstream server is too slow delivering the goods.
|
||||
/// </summary>
|
||||
ServerErrorGatewayTimeout = 504,
|
||||
|
||||
/// <summary>
|
||||
/// 505 Server error: The server does not support the HTTP version conveyed in the client's request.
|
||||
/// </summary>
|
||||
ServerErrorHttpVersionNotSupported = 505,
|
||||
|
||||
/// <summary>
|
||||
/// 511 Server error: The 511 status code indicates that the client needs to authenticate to gain network access.
|
||||
/// </summary>
|
||||
ServerErrorNetworkAuthenticationRequired = 511,
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
String.Format("PollServiceWorkerThread{0}", i),
|
||||
ThreadPriority.Normal,
|
||||
false,
|
||||
true,
|
||||
int.MaxValue);
|
||||
}
|
||||
|
||||
@@ -73,6 +74,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
"PollServiceWatcherThread",
|
||||
ThreadPriority.Normal,
|
||||
false,
|
||||
true,
|
||||
1000 * 60 * 10);
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
private RestDeserialiseMethod<TRequest, TResponse> m_method;
|
||||
|
||||
public RestDeserialiseHandler(string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method)
|
||||
: base(httpMethod, path)
|
||||
: this(httpMethod, path, method, null, null) {}
|
||||
|
||||
public RestDeserialiseHandler(
|
||||
string httpMethod, string path, RestDeserialiseMethod<TRequest, TResponse> method, string name, string description)
|
||||
: base(httpMethod, path, name, description)
|
||||
{
|
||||
m_method = method;
|
||||
}
|
||||
|
||||
@@ -38,19 +38,25 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
get { return m_dhttpMethod; }
|
||||
}
|
||||
|
||||
public override Hashtable Handle(string path, Hashtable request)
|
||||
{
|
||||
|
||||
string param = GetParam(path);
|
||||
request.Add("param", param);
|
||||
request.Add("path", path);
|
||||
return m_dhttpMethod(request);
|
||||
}
|
||||
|
||||
public RestHTTPHandler(string httpMethod, string path, GenericHTTPMethod dhttpMethod)
|
||||
: base(httpMethod, path)
|
||||
{
|
||||
m_dhttpMethod = dhttpMethod;
|
||||
}
|
||||
|
||||
public RestHTTPHandler(
|
||||
string httpMethod, string path, GenericHTTPMethod dhttpMethod, string name, string description)
|
||||
: base(httpMethod, path, name, description)
|
||||
{
|
||||
m_dhttpMethod = dhttpMethod;
|
||||
}
|
||||
|
||||
public override Hashtable Handle(string path, Hashtable request)
|
||||
{
|
||||
string param = GetParam(path);
|
||||
request.Add("param", param);
|
||||
request.Add("path", path);
|
||||
return m_dhttpMethod(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,15 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
get { return m_restMethod; }
|
||||
}
|
||||
|
||||
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod)
|
||||
: this(httpMethod, path, restMethod, null, null) {}
|
||||
|
||||
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod, string name, string description)
|
||||
: base(httpMethod, path, name, description)
|
||||
{
|
||||
m_restMethod = restMethod;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
Encoding encoding = Encoding.UTF8;
|
||||
@@ -52,10 +61,5 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
return Encoding.UTF8.GetBytes(responseString);
|
||||
}
|
||||
|
||||
public RestStreamHandler(string httpMethod, string path, RestMethod restMethod) : base(httpMethod, path)
|
||||
{
|
||||
m_restMethod = restMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.3";
|
||||
private const string VERSION_NUMBER = "0.7.4";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
@@ -39,7 +39,8 @@ namespace OpenSim
|
||||
RC1,
|
||||
RC2,
|
||||
Release,
|
||||
Post_Fixes
|
||||
Post_Fixes,
|
||||
Extended
|
||||
}
|
||||
|
||||
public static string Version
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
@@ -46,8 +46,12 @@ namespace OpenSim.Framework.Statistics
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(
|
||||
string.Format(
|
||||
"Allocated to OpenSim : {0} MB" + Environment.NewLine,
|
||||
"Allocated to OpenSim objects: {0} MB\n",
|
||||
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
|
||||
sb.Append(
|
||||
string.Format(
|
||||
"Process memory : {0} MB\n",
|
||||
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)));
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -35,6 +37,8 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public class TaskInventoryItem : ICloneable
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// XXX This should really be factored out into some constants class.
|
||||
/// </summary>
|
||||
@@ -331,12 +335,18 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public bool OwnerChanged {
|
||||
get {
|
||||
public bool OwnerChanged
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ownerChanged;
|
||||
}
|
||||
set {
|
||||
set
|
||||
{
|
||||
_ownerChanged = value;
|
||||
// m_log.DebugFormat(
|
||||
// "[TASK INVENTORY ITEM]: Owner changed set {0} for {1} {2} owned by {3}",
|
||||
// _ownerChanged, Name, ItemID, OwnerID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,10 +227,10 @@ namespace OpenSim.Framework.Tests
|
||||
es.AddEstateManager(UUID.Zero);
|
||||
|
||||
es.AddEstateManager(bannedUserId);
|
||||
Assert.IsTrue(es.IsEstateManager(bannedUserId), "bannedUserId should be EstateManager but isn't.");
|
||||
Assert.IsTrue(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserId should be EstateManager but isn't.");
|
||||
|
||||
es.RemoveEstateManager(bannedUserId);
|
||||
Assert.IsFalse(es.IsEstateManager(bannedUserId), "bannedUserID is estateManager but shouldn't be");
|
||||
Assert.IsFalse(es.IsEstateManagerOrOwner(bannedUserId), "bannedUserID is estateManager but shouldn't be");
|
||||
|
||||
Assert.IsFalse(es.HasAccess(bannedUserId), "bannedUserID has access but shouldn't");
|
||||
|
||||
|
||||
@@ -214,16 +214,13 @@ namespace OpenSim.Framework.Tests
|
||||
|
||||
for (int i = 0; i < contenttypes.Length; i++)
|
||||
{
|
||||
if (SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == 18)
|
||||
{
|
||||
Assert.That(contenttypes[i] == "image/tga");
|
||||
}
|
||||
int expected;
|
||||
if (contenttypes[i] == "image/tga")
|
||||
expected = 12; // if we know only the content-type "image/tga", then we assume the asset type is TextureTGA; not ImageTGA
|
||||
else
|
||||
{
|
||||
Assert.That(SLUtil.ContentTypeToSLAssetType(contenttypes[i]) == assettypes[i],
|
||||
"Expecting {0} but got {1}", assettypes[i],
|
||||
SLUtil.ContentTypeToSLAssetType(contenttypes[i]));
|
||||
}
|
||||
expected = assettypes[i];
|
||||
Assert.AreEqual(expected, SLUtil.ContentTypeToSLAssetType(contenttypes[i]),
|
||||
String.Format("Incorrect AssetType mapped from Content-Type {0}", contenttypes[i]));
|
||||
}
|
||||
|
||||
int[] inventorytypes = new int[] {-1,0,1,2,3,6,7,8,9,10,15,17,18,20};
|
||||
@@ -237,7 +234,7 @@ namespace OpenSim.Framework.Tests
|
||||
"application/vnd.ll.primitive",
|
||||
"application/vnd.ll.notecard",
|
||||
"application/vnd.ll.folder",
|
||||
"application/octet-stream",
|
||||
"application/vnd.ll.rootfolder",
|
||||
"application/vnd.ll.lsltext",
|
||||
"image/x-j2c",
|
||||
"application/vnd.ll.primitive",
|
||||
@@ -247,7 +244,8 @@ namespace OpenSim.Framework.Tests
|
||||
|
||||
for (int i=0;i<inventorytypes.Length;i++)
|
||||
{
|
||||
Assert.That(SLUtil.SLInvTypeToContentType(inventorytypes[i]) == invcontenttypes[i], "Expected {0}, Got {1}", invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]));
|
||||
Assert.AreEqual(invcontenttypes[i], SLUtil.SLInvTypeToContentType(inventorytypes[i]),
|
||||
String.Format("Incorrect Content-Type mapped from InventoryType {0}", inventorytypes[i]));
|
||||
}
|
||||
|
||||
invcontenttypes = new string[]
|
||||
@@ -280,7 +278,8 @@ namespace OpenSim.Framework.Tests
|
||||
|
||||
for (int i = 0; i < invtypes.Length; i++)
|
||||
{
|
||||
Assert.That(SLUtil.ContentTypeToSLInvType(invcontenttypes[i]) == invtypes[i], "Expected {0}, Got {1}", invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i]));
|
||||
Assert.AreEqual(invtypes[i], SLUtil.ContentTypeToSLInvType(invcontenttypes[i]),
|
||||
String.Format("Incorrect InventoryType mapped from Content-Type {0}", invcontenttypes[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Security.Cryptography;
|
||||
@@ -80,12 +81,15 @@ namespace OpenSim.Framework
|
||||
|
||||
private static uint nextXferID = 5000;
|
||||
private static Random randomClass = new Random();
|
||||
|
||||
// Get a list of invalid file characters (OS dependent)
|
||||
private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]";
|
||||
private static string regexInvalidPathChars = "[" + new String(Path.GetInvalidPathChars()) + "]";
|
||||
private static object XferLock = new object();
|
||||
/// <summary>Thread pool used for Util.FireAndForget if
|
||||
/// FireAndForgetMethod.SmartThreadPool is used</summary>
|
||||
|
||||
/// <summary>
|
||||
/// Thread pool used for Util.FireAndForget if FireAndForgetMethod.SmartThreadPool is used
|
||||
/// </summary>
|
||||
private static SmartThreadPool m_ThreadPool;
|
||||
|
||||
// Unix-epoch starts at January 1st 1970, 00:00:00 UTC. And all our times in the server are (or at least should be) in UTC.
|
||||
@@ -143,7 +147,6 @@ namespace OpenSim.Framework
|
||||
return lerp(y, lerp(x, a, b), lerp(x, c, d));
|
||||
}
|
||||
|
||||
|
||||
public static Encoding UTF8 = Encoding.UTF8;
|
||||
|
||||
/// <value>
|
||||
@@ -377,6 +380,50 @@ namespace OpenSim.Framework
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is the platform Windows?
|
||||
/// </summary>
|
||||
/// <returns>true if so, false otherwise</returns>
|
||||
public static bool IsWindows()
|
||||
{
|
||||
PlatformID platformId = Environment.OSVersion.Platform;
|
||||
|
||||
return (platformId == PlatformID.Win32NT
|
||||
|| platformId == PlatformID.Win32S
|
||||
|| platformId == PlatformID.Win32Windows
|
||||
|| platformId == PlatformID.WinCE);
|
||||
}
|
||||
|
||||
public static bool LoadArchSpecificWindowsDll(string libraryName)
|
||||
{
|
||||
// We do this so that OpenSimulator on Windows loads the correct native library depending on whether
|
||||
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||
// will find it already loaded later on.
|
||||
//
|
||||
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||
// controlled in config files.
|
||||
string nativeLibraryPath;
|
||||
|
||||
if (Util.Is64BitProcess())
|
||||
nativeLibraryPath = "lib64/" + libraryName;
|
||||
else
|
||||
nativeLibraryPath = "lib32/" + libraryName;
|
||||
|
||||
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsEnvironmentSupported(ref string reason)
|
||||
{
|
||||
// Must have .NET 2.0 (Generics / libsl)
|
||||
@@ -1459,6 +1506,27 @@ namespace OpenSim.Framework
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to trigger an early library load on Windows systems.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Required to get 32-bit and 64-bit processes to automatically use the
|
||||
/// appropriate native library.
|
||||
/// </remarks>
|
||||
/// <param name="dllToLoad"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the current process is 64 bit
|
||||
/// </summary>
|
||||
/// <returns>true if so, false if not</returns>
|
||||
public static bool Is64BitProcess()
|
||||
{
|
||||
return IntPtr.Size == 8;
|
||||
}
|
||||
|
||||
#region FireAndForget Threading Pattern
|
||||
|
||||
/// <summary>
|
||||
@@ -1605,6 +1673,61 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a thread pool report.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetThreadPoolReport()
|
||||
{
|
||||
string threadPoolUsed = null;
|
||||
int maxThreads = 0;
|
||||
int minThreads = 0;
|
||||
int allocatedThreads = 0;
|
||||
int inUseThreads = 0;
|
||||
int waitingCallbacks = 0;
|
||||
int completionPortThreads = 0;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool)
|
||||
{
|
||||
threadPoolUsed = "SmartThreadPool";
|
||||
maxThreads = m_ThreadPool.MaxThreads;
|
||||
minThreads = m_ThreadPool.MinThreads;
|
||||
inUseThreads = m_ThreadPool.InUseThreads;
|
||||
allocatedThreads = m_ThreadPool.ActiveThreads;
|
||||
waitingCallbacks = m_ThreadPool.WaitingCallbacks;
|
||||
}
|
||||
else if (
|
||||
FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem
|
||||
|| FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem)
|
||||
{
|
||||
threadPoolUsed = "BuiltInThreadPool";
|
||||
ThreadPool.GetMaxThreads(out maxThreads, out completionPortThreads);
|
||||
ThreadPool.GetMinThreads(out minThreads, out completionPortThreads);
|
||||
int availableThreads;
|
||||
ThreadPool.GetAvailableThreads(out availableThreads, out completionPortThreads);
|
||||
inUseThreads = maxThreads - availableThreads;
|
||||
allocatedThreads = -1;
|
||||
waitingCallbacks = -1;
|
||||
}
|
||||
|
||||
if (threadPoolUsed != null)
|
||||
{
|
||||
sb.AppendFormat("Thread pool used : {0}\n", threadPoolUsed);
|
||||
sb.AppendFormat("Max threads : {0}\n", maxThreads);
|
||||
sb.AppendFormat("Min threads : {0}\n", minThreads);
|
||||
sb.AppendFormat("Allocated threads : {0}\n", allocatedThreads < 0 ? "not applicable" : allocatedThreads.ToString());
|
||||
sb.AppendFormat("In use threads : {0}\n", inUseThreads);
|
||||
sb.AppendFormat("Work items waiting : {0}\n", waitingCallbacks < 0 ? "not available" : waitingCallbacks.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("Thread pool not used\n");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static object SmartThreadPoolCallback(object o)
|
||||
{
|
||||
object[] array = (object[])o;
|
||||
@@ -1630,6 +1753,20 @@ namespace OpenSim.Framework
|
||||
}
|
||||
const Int32 EnvironmentTickCountMask = 0x3fffffff;
|
||||
|
||||
/// <summary>
|
||||
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
|
||||
/// and negative every 24.9 days. Subtracts the passed value (previously fetched by
|
||||
/// 'EnvironmentTickCount()') and accounts for any wrapping.
|
||||
/// </summary>
|
||||
/// <param name="newValue"></param>
|
||||
/// <param name="prevValue"></param>
|
||||
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
|
||||
public static Int32 EnvironmentTickCountSubtract(Int32 newValue, Int32 prevValue)
|
||||
{
|
||||
Int32 diff = newValue - prevValue;
|
||||
return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Environment.TickCount is an int but it counts all 32 bits so it goes positive
|
||||
/// and negative every 24.9 days. Subtracts the passed value (previously fetched by
|
||||
@@ -1638,8 +1775,7 @@ namespace OpenSim.Framework
|
||||
/// <returns>subtraction of passed prevValue from current Environment.TickCount</returns>
|
||||
public static Int32 EnvironmentTickCountSubtract(Int32 prevValue)
|
||||
{
|
||||
Int32 diff = EnvironmentTickCount() - prevValue;
|
||||
return (diff >= 0) ? diff : (diff + EnvironmentTickCountMask + 1);
|
||||
return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue);
|
||||
}
|
||||
|
||||
// Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount
|
||||
@@ -1804,11 +1940,12 @@ namespace OpenSim.Framework
|
||||
#region Universal User Identifiers
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
/// <param name="value">uuid[;endpoint[;name]]</param>
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="url"></param>
|
||||
/// <param name="firstname"></param>
|
||||
/// <param name="lastname"></param>
|
||||
/// <param name="value">uuid[;endpoint[;first last[;secret]]]</param>
|
||||
/// <param name="uuid">the uuid part</param>
|
||||
/// <param name="url">the endpoint part (e.g. http://foo.com)</param>
|
||||
/// <param name="firstname">the first name part (e.g. Test)</param>
|
||||
/// <param name="lastname">the last name part (e.g User)</param>
|
||||
/// <param name="secret">the secret part</param>
|
||||
public static bool ParseUniversalUserIdentifier(string value, out UUID uuid, out string url, out string firstname, out string lastname, out string secret)
|
||||
{
|
||||
uuid = UUID.Zero; url = string.Empty; firstname = "Unknown"; lastname = "User"; secret = string.Empty;
|
||||
@@ -1837,31 +1974,64 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Produces a universal (HG) system-facing identifier given the information
|
||||
/// </summary>
|
||||
/// <param name="acircuit"></param>
|
||||
/// <returns>uuid[;endpoint[;name]]</returns>
|
||||
/// <returns>uuid[;homeURI[;first last]]</returns>
|
||||
public static string ProduceUserUniversalIdentifier(AgentCircuitData acircuit)
|
||||
{
|
||||
if (acircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||
{
|
||||
string agentsURI = acircuit.ServiceURLs["HomeURI"].ToString();
|
||||
if (!agentsURI.EndsWith("/"))
|
||||
agentsURI += "/";
|
||||
|
||||
// This is ugly, but there's no other way, given that the name is changed
|
||||
// in the agent circuit data for foreigners
|
||||
if (acircuit.lastname.Contains("@"))
|
||||
{
|
||||
string[] parts = acircuit.firstname.Split(new char[] { '.' });
|
||||
if (parts.Length == 2)
|
||||
return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
|
||||
}
|
||||
return acircuit.AgentID.ToString() + ";" + agentsURI + ";" + acircuit.firstname + " " + acircuit.lastname;
|
||||
}
|
||||
return UniversalIdentifier(acircuit.AgentID, acircuit.firstname, acircuit.lastname, acircuit.ServiceURLs["HomeURI"].ToString());
|
||||
else
|
||||
return acircuit.AgentID.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Produces a universal (HG) system-facing identifier given the information
|
||||
/// </summary>
|
||||
/// <param name="id">UUID of the user</param>
|
||||
/// <param name="firstName">first name (e.g Test)</param>
|
||||
/// <param name="lastName">last name (e.g. User)</param>
|
||||
/// <param name="homeURI">homeURI (e.g. http://foo.com)</param>
|
||||
/// <returns>a string of the form uuid[;homeURI[;first last]]</returns>
|
||||
public static string UniversalIdentifier(UUID id, String firstName, String lastName, String homeURI)
|
||||
{
|
||||
string agentsURI = homeURI;
|
||||
if (!agentsURI.EndsWith("/"))
|
||||
agentsURI += "/";
|
||||
|
||||
// This is ugly, but there's no other way, given that the name is changed
|
||||
// in the agent circuit data for foreigners
|
||||
if (lastName.Contains("@"))
|
||||
{
|
||||
string[] parts = firstName.Split(new char[] { '.' });
|
||||
if (parts.Length == 2)
|
||||
return id.ToString() + ";" + agentsURI + ";" + parts[0] + " " + parts[1];
|
||||
}
|
||||
return id.ToString() + ";" + agentsURI + ";" + firstName + " " + lastName;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Produces a universal (HG) user-facing name given the information
|
||||
/// </summary>
|
||||
/// <param name="firstName"></param>
|
||||
/// <param name="lastName"></param>
|
||||
/// <param name="homeURI"></param>
|
||||
/// <returns>string of the form first.last @foo.com or first last</returns>
|
||||
public static string UniversalName(String firstName, String lastName, String homeURI)
|
||||
{
|
||||
Uri uri = null;
|
||||
try
|
||||
{
|
||||
uri = new Uri(homeURI);
|
||||
}
|
||||
catch (UriFormatException)
|
||||
{
|
||||
return firstName + " " + lastName;
|
||||
}
|
||||
return firstName + "." + lastName + " " + "@" + uri.Authority;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,11 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public bool IsTimedOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will this thread trigger the alarm function if it has timed out?
|
||||
/// </summary>
|
||||
public bool AlarmIfTimeout { get; set; }
|
||||
|
||||
public ThreadWatchdogInfo(Thread thread, int timeout)
|
||||
{
|
||||
Thread = thread;
|
||||
@@ -112,12 +117,13 @@ namespace OpenSim.Framework
|
||||
/// <param name="start">The method that will be executed in a new thread</param>
|
||||
/// <param name="name">A name to give to the new thread</param>
|
||||
/// <param name="priority">Priority to run the thread at</param>
|
||||
/// <param name="isBackground">True to run this thread as a background
|
||||
/// thread, otherwise false</param>
|
||||
/// <param name="isBackground">True to run this thread as a background thread, otherwise false</param>
|
||||
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
|
||||
/// <returns>The newly created Thread object</returns>
|
||||
public static Thread StartThread(ThreadStart start, string name, ThreadPriority priority, bool isBackground)
|
||||
public static Thread StartThread(
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout)
|
||||
{
|
||||
return StartThread(start, name, priority, isBackground, WATCHDOG_TIMEOUT_MS);
|
||||
return StartThread(start, name, priority, isBackground, alarmIfTimeout, WATCHDOG_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -128,21 +134,21 @@ namespace OpenSim.Framework
|
||||
/// <param name="priority">Priority to run the thread at</param>
|
||||
/// <param name="isBackground">True to run this thread as a background
|
||||
/// thread, otherwise false</param>
|
||||
/// <param name="timeout">
|
||||
/// Number of milliseconds to wait until we issue a warning about timeout.
|
||||
/// </para>
|
||||
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
|
||||
/// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param>
|
||||
/// <returns>The newly created Thread object</returns>
|
||||
public static Thread StartThread(
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout)
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, int timeout)
|
||||
{
|
||||
Thread thread = new Thread(start);
|
||||
thread.Name = name;
|
||||
thread.Priority = priority;
|
||||
thread.IsBackground = isBackground;
|
||||
|
||||
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout);
|
||||
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout) { AlarmIfTimeout = alarmIfTimeout };
|
||||
|
||||
m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")");
|
||||
m_log.DebugFormat(
|
||||
"[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
|
||||
|
||||
lock (m_threads)
|
||||
m_threads.Add(twi.Thread.ManagedThreadId, twi);
|
||||
@@ -224,19 +230,39 @@ namespace OpenSim.Framework
|
||||
/// Get currently watched threads for diagnostic purposes
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ThreadWatchdogInfo[] GetThreads()
|
||||
public static ThreadWatchdogInfo[] GetThreadsInfo()
|
||||
{
|
||||
lock (m_threads)
|
||||
return m_threads.Values.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the current thread's watchdog info.
|
||||
/// </summary>
|
||||
/// <returns>The watchdog info. null if the thread isn't being monitored.</returns>
|
||||
public static ThreadWatchdogInfo GetCurrentThreadInfo()
|
||||
{
|
||||
lock (m_threads)
|
||||
{
|
||||
if (m_threads.ContainsKey(Thread.CurrentThread.ManagedThreadId))
|
||||
return m_threads[Thread.CurrentThread.ManagedThreadId];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check watched threads. Fire alarm if appropriate.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
WatchdogTimeout callback = OnWatchdogTimeout;
|
||||
|
||||
if (callback != null)
|
||||
{
|
||||
ThreadWatchdogInfo timedOut = null;
|
||||
List<ThreadWatchdogInfo> callbackInfos = null;
|
||||
|
||||
lock (m_threads)
|
||||
{
|
||||
@@ -246,21 +272,31 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
||||
{
|
||||
timedOut = threadInfo;
|
||||
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
||||
break;
|
||||
|
||||
if (callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
||||
{
|
||||
threadInfo.IsTimedOut = true;
|
||||
timedOut = threadInfo;
|
||||
break;
|
||||
|
||||
if (threadInfo.AlarmIfTimeout)
|
||||
{
|
||||
if (callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timedOut != null)
|
||||
callback(timedOut.Thread, timedOut.LastTick);
|
||||
if (callbackInfos != null)
|
||||
foreach (ThreadWatchdogInfo callbackInfo in callbackInfos)
|
||||
callback(callbackInfo.Thread, callbackInfo.LastTick);
|
||||
}
|
||||
|
||||
m_watchdogTimer.Start();
|
||||
|
||||
@@ -53,88 +53,59 @@ namespace OpenSim.Framework
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static int m_requestNumber = 0;
|
||||
|
||||
// this is the header field used to communicate the local request id
|
||||
// used for performance and debugging
|
||||
public const string OSHeaderRequestID = "opensim-request-id";
|
||||
|
||||
// number of milliseconds a call can take before it is considered
|
||||
// a "long" call for warning & debugging purposes
|
||||
public const int LongCallTime = 500;
|
||||
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+json form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+json";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+xml form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+xml";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
/// <summary>
|
||||
/// Request number for diagnostic purposes.
|
||||
/// </summary>
|
||||
public static int RequestNumber = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Make a GET or GET-like request to a web service that returns LLSD
|
||||
/// or JSON data
|
||||
/// this is the header field used to communicate the local request id
|
||||
/// used for performance and debugging
|
||||
/// </summary>
|
||||
public static OSDMap ServiceRequest(string url, string httpVerb)
|
||||
public const string OSHeaderRequestID = "opensim-request-id";
|
||||
|
||||
/// <summary>
|
||||
/// Number of milliseconds a call can take before it is considered
|
||||
/// a "long" call for warning & debugging purposes
|
||||
/// </summary>
|
||||
public const int LongCallTime = 3000;
|
||||
|
||||
/// <summary>
|
||||
/// The maximum length of any data logged because of a long request time.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This is to truncate any really large post data, such as an asset. In theory, the first section should
|
||||
/// give us useful information about the call (which agent it relates to if applicable, etc.).
|
||||
/// </remarks>
|
||||
public const int MaxRequestDiagLength = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary of end points
|
||||
/// </summary>
|
||||
private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
|
||||
|
||||
private static object EndPointLock(string url)
|
||||
{
|
||||
string errorMessage;
|
||||
System.Uri uri = new System.Uri(url);
|
||||
string endpoint = string.Format("{0}:{1}",uri.Host,uri.Port);
|
||||
|
||||
try
|
||||
lock (m_endpointSerializer)
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||
request.Method = httpVerb;
|
||||
object eplock = null;
|
||||
|
||||
using (WebResponse response = request.GetResponse())
|
||||
if (! m_endpointSerializer.TryGetValue(endpoint,out eplock))
|
||||
{
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
{
|
||||
try
|
||||
{
|
||||
string responseStr = responseStream.GetStreamString();
|
||||
OSD responseOSD = OSDParser.Deserialize(responseStr);
|
||||
if (responseOSD.Type == OSDType.Map)
|
||||
return (OSDMap)responseOSD;
|
||||
else
|
||||
errorMessage = "Response format was invalid.";
|
||||
}
|
||||
catch
|
||||
{
|
||||
errorMessage = "Failed to parse the response.";
|
||||
}
|
||||
}
|
||||
eplock = new object();
|
||||
m_endpointSerializer.Add(endpoint,eplock);
|
||||
// m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
|
||||
errorMessage = ex.Message;
|
||||
}
|
||||
|
||||
return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } };
|
||||
return eplock;
|
||||
}
|
||||
}
|
||||
|
||||
#region JSONRequest
|
||||
|
||||
/// <summary>
|
||||
/// PUT JSON-encoded data to a web service that returns LLSD or
|
||||
/// JSON data
|
||||
@@ -166,12 +137,21 @@ namespace OpenSim.Framework
|
||||
|
||||
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
|
||||
{
|
||||
int reqnum = m_requestNumber++;
|
||||
lock (EndPointLock(url))
|
||||
{
|
||||
return ServiceOSDRequestWorker(url,data,method,timeout,compressed);
|
||||
}
|
||||
}
|
||||
|
||||
private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
|
||||
{
|
||||
int reqnum = RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
string errorMessage = "unknown error";
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
string strBuffer = null;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -186,7 +166,7 @@ namespace OpenSim.Framework
|
||||
// If there is some input, write it into the request
|
||||
if (data != null)
|
||||
{
|
||||
string strBuffer = OSDParser.SerializeJsonString(data);
|
||||
strBuffer = OSDParser.SerializeJsonString(data);
|
||||
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer);
|
||||
|
||||
if (compressed)
|
||||
@@ -246,14 +226,23 @@ namespace OpenSim.Framework
|
||||
}
|
||||
finally
|
||||
{
|
||||
// This just dumps a warning for any operation that takes more than 100 ms
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > LongCallTime)
|
||||
m_log.DebugFormat("[WEB UTIL]: osd request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
|
||||
reqnum,url,method,tickdiff,tickdata);
|
||||
m_log.InfoFormat(
|
||||
"[OSD REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
method,
|
||||
url,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
strBuffer != null
|
||||
? (strBuffer.Length > MaxRequestDiagLength ? strBuffer.Remove(MaxRequestDiagLength) : strBuffer)
|
||||
: "");
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
m_log.DebugFormat(
|
||||
"[WEB UTIL]: <{0}> osd request for {1}, method {2} FAILED: {3}", reqnum, url, method, errorMessage);
|
||||
|
||||
return ErrorResponseMap(errorMessage);
|
||||
}
|
||||
|
||||
@@ -303,6 +292,10 @@ namespace OpenSim.Framework
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion JSONRequest
|
||||
|
||||
#region FormRequest
|
||||
|
||||
/// <summary>
|
||||
/// POST URL-encoded form data to a web service that returns LLSD or
|
||||
/// JSON data
|
||||
@@ -314,17 +307,25 @@ namespace OpenSim.Framework
|
||||
|
||||
public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
|
||||
{
|
||||
int reqnum = m_requestNumber++;
|
||||
lock (EndPointLock(url))
|
||||
{
|
||||
return ServiceFormRequestWorker(url,data,timeout);
|
||||
}
|
||||
}
|
||||
|
||||
private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
|
||||
{
|
||||
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);
|
||||
|
||||
string errorMessage = "unknown error";
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
string queryString = null;
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||
request.Method = "POST";
|
||||
request.Timeout = timeout;
|
||||
@@ -335,7 +336,7 @@ namespace OpenSim.Framework
|
||||
|
||||
if (data != null)
|
||||
{
|
||||
string queryString = BuildQueryString(data);
|
||||
queryString = BuildQueryString(data);
|
||||
byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString);
|
||||
|
||||
request.ContentLength = buffer.Length;
|
||||
@@ -378,11 +379,20 @@ namespace OpenSim.Framework
|
||||
{
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > LongCallTime)
|
||||
m_log.InfoFormat("[WEB UTIL]: form request <{0}> (URI:{1}, METHOD:{2}) took {3}ms overall, {4}ms writing",
|
||||
reqnum,url,method,tickdiff,tickdata);
|
||||
m_log.InfoFormat(
|
||||
"[SERVICE FORM]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
method,
|
||||
url,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
queryString != null
|
||||
? (queryString.Length > MaxRequestDiagLength) ? queryString.Remove(MaxRequestDiagLength) : queryString
|
||||
: "");
|
||||
}
|
||||
|
||||
m_log.WarnFormat("[WEB UTIL]: <{0}> form request failed: {1}",reqnum,errorMessage);
|
||||
m_log.WarnFormat("[SERVICE FORM]: <{0}> form request to {1} failed: {2}", reqnum, url, errorMessage);
|
||||
|
||||
return ErrorResponseMap(errorMessage);
|
||||
}
|
||||
|
||||
@@ -397,6 +407,8 @@ namespace OpenSim.Framework
|
||||
result["Message"] = OSD.FromString("Service request failed: " + msg);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion FormRequest
|
||||
|
||||
#region Uri
|
||||
|
||||
@@ -533,8 +545,13 @@ namespace OpenSim.Framework
|
||||
/// <remarks>
|
||||
/// Copying begins at the streams' current positions. The positions are
|
||||
/// NOT reset after copying is complete.
|
||||
/// NOTE!! .NET 4.0 adds the method 'Stream.CopyTo(stream, bufferSize)'.
|
||||
/// This function could be replaced with that method once we move
|
||||
/// totally to .NET 4.0. For versions before, this routine exists.
|
||||
/// This routine used to be named 'CopyTo' but the int parameter has
|
||||
/// a different meaning so this method was renamed to avoid any confusion.
|
||||
/// </remarks>
|
||||
public static int CopyTo(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
|
||||
public static int CopyStream(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
|
||||
{
|
||||
byte[] buffer = new byte[4096];
|
||||
int readBytes;
|
||||
@@ -655,8 +672,6 @@ namespace OpenSim.Framework
|
||||
|
||||
return new string[0];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static class AsynchronousRestObjectRequester
|
||||
@@ -679,6 +694,12 @@ namespace OpenSim.Framework
|
||||
public static void MakeRequest<TRequest, TResponse>(string verb,
|
||||
string requestUrl, TRequest obj, Action<TResponse> action)
|
||||
{
|
||||
int reqnum = WebUtil.RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
|
||||
// m_log.DebugFormat("[ASYNC REQUEST]: Starting {0} {1}", verb, requestUrl);
|
||||
|
||||
Type type = typeof(TRequest);
|
||||
@@ -689,12 +710,13 @@ namespace OpenSim.Framework
|
||||
XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
|
||||
|
||||
request.Method = verb;
|
||||
MemoryStream buffer = null;
|
||||
|
||||
if (verb == "POST")
|
||||
{
|
||||
request.ContentType = "text/xml";
|
||||
|
||||
MemoryStream buffer = new MemoryStream();
|
||||
buffer = new MemoryStream();
|
||||
|
||||
XmlWriterSettings settings = new XmlWriterSettings();
|
||||
settings.Encoding = Encoding.UTF8;
|
||||
@@ -716,6 +738,9 @@ namespace OpenSim.Framework
|
||||
requestStream.Write(buffer.ToArray(), 0, length);
|
||||
requestStream.Close();
|
||||
|
||||
// capture how much time was spent writing
|
||||
tickdata = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
|
||||
request.BeginGetResponse(delegate(IAsyncResult ar)
|
||||
{
|
||||
response = request.EndGetResponse(ar);
|
||||
@@ -741,83 +766,108 @@ namespace OpenSim.Framework
|
||||
|
||||
}, null);
|
||||
}, null);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
request.BeginGetResponse(delegate(IAsyncResult res2)
|
||||
else
|
||||
{
|
||||
try
|
||||
request.BeginGetResponse(delegate(IAsyncResult res2)
|
||||
{
|
||||
// If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
|
||||
// documented in MSDN
|
||||
response = request.EndGetResponse(res2);
|
||||
|
||||
Stream respStream = null;
|
||||
try
|
||||
{
|
||||
respStream = response.GetResponseStream();
|
||||
deserial = (TResponse)deserializer.Deserialize(respStream);
|
||||
}
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
respStream.Close();
|
||||
response.Close();
|
||||
}
|
||||
}
|
||||
catch (WebException e)
|
||||
{
|
||||
if (e.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
if (e.Response is HttpWebResponse)
|
||||
// If the server returns a 404, this appears to trigger a System.Net.WebException even though that isn't
|
||||
// documented in MSDN
|
||||
response = request.EndGetResponse(res2);
|
||||
|
||||
Stream respStream = null;
|
||||
try
|
||||
{
|
||||
HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
|
||||
|
||||
if (httpResponse.StatusCode != HttpStatusCode.NotFound)
|
||||
{
|
||||
// We don't appear to be handling any other status codes, so log these feailures to that
|
||||
// people don't spend unnecessary hours hunting phantom bugs.
|
||||
m_log.DebugFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
|
||||
verb, requestUrl, httpResponse.StatusCode);
|
||||
}
|
||||
respStream = response.GetResponseStream();
|
||||
deserial = (TResponse)deserializer.Deserialize(respStream);
|
||||
}
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
}
|
||||
finally
|
||||
{
|
||||
respStream.Close();
|
||||
response.Close();
|
||||
}
|
||||
}
|
||||
else
|
||||
catch (WebException e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}", verb, requestUrl, e.Status, e.Message);
|
||||
if (e.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
if (e.Response is HttpWebResponse)
|
||||
{
|
||||
HttpWebResponse httpResponse = (HttpWebResponse)e.Response;
|
||||
|
||||
if (httpResponse.StatusCode != HttpStatusCode.NotFound)
|
||||
{
|
||||
// We don't appear to be handling any other status codes, so log these feailures to that
|
||||
// people don't spend unnecessary hours hunting phantom bugs.
|
||||
m_log.DebugFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} failed with unexpected status code {2}",
|
||||
verb, requestUrl, httpResponse.StatusCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} failed with status {2} and message {3}",
|
||||
verb, requestUrl, e.Status, e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} failed with exception {2}{3}",
|
||||
verb, requestUrl, e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
action(deserial);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}{3}",
|
||||
verb, requestUrl, e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
}, null);
|
||||
}
|
||||
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > WebUtil.LongCallTime)
|
||||
{
|
||||
string originalRequest = null;
|
||||
|
||||
if (buffer != null)
|
||||
{
|
||||
m_log.ErrorFormat("[ASYNC REQUEST]: Request {0} {1} failed with exception {2}", verb, requestUrl, e);
|
||||
originalRequest = Encoding.UTF8.GetString(buffer.ToArray());
|
||||
|
||||
if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
|
||||
originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[ASYNC REQUEST]: Received {0}", deserial.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
action(deserial);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e);
|
||||
}
|
||||
|
||||
}, null);
|
||||
m_log.InfoFormat(
|
||||
"[ASYNC REQUEST]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
originalRequest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class SynchronousRestFormsRequester
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Perform a synchronous REST request.
|
||||
@@ -831,6 +881,12 @@ namespace OpenSim.Framework
|
||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||
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);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
string respstring = String.Empty;
|
||||
@@ -859,12 +915,16 @@ namespace OpenSim.Framework
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
|
||||
m_log.DebugFormat(
|
||||
"[FORMS]: exception occured {0} {1}: {2}{3}", verb, requestUrl, e.Message, e.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (requestStream != null)
|
||||
requestStream.Close();
|
||||
|
||||
// capture how much time was spent writing
|
||||
tickdata = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -885,7 +945,9 @@ namespace OpenSim.Framework
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
|
||||
m_log.DebugFormat(
|
||||
"[FORMS]: Exception occured on receiving {0} {1}: {2}{3}",
|
||||
verb, requestUrl, e.Message, e.StackTrace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -898,9 +960,21 @@ namespace OpenSim.Framework
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
// This is what happens when there is invalid XML
|
||||
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
|
||||
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving {0} {1}", verb, requestUrl);
|
||||
}
|
||||
}
|
||||
|
||||
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}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
obj.Length > WebUtil.MaxRequestDiagLength ? obj.Remove(WebUtil.MaxRequestDiagLength) : obj);
|
||||
|
||||
return respstring;
|
||||
}
|
||||
}
|
||||
@@ -923,17 +997,24 @@ namespace OpenSim.Framework
|
||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
|
||||
{
|
||||
int reqnum = WebUtil.RequestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
|
||||
int tickstart = Util.EnvironmentTickCount();
|
||||
int tickdata = 0;
|
||||
|
||||
Type type = typeof(TRequest);
|
||||
TResponse deserial = default(TResponse);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
MemoryStream buffer = null;
|
||||
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
{
|
||||
request.ContentType = "text/xml";
|
||||
|
||||
MemoryStream buffer = new MemoryStream();
|
||||
buffer = new MemoryStream();
|
||||
|
||||
XmlWriterSettings settings = new XmlWriterSettings();
|
||||
settings.Encoding = Encoding.UTF8;
|
||||
@@ -956,13 +1037,19 @@ namespace OpenSim.Framework
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[SynchronousRestObjectRequester]: exception in sending data to {0}: {1}", requestUrl, e);
|
||||
m_log.DebugFormat(
|
||||
"[SynchronousRestObjectRequester]: Exception in making request {0} {1}: {2}{3}",
|
||||
verb, requestUrl, e.Message, e.StackTrace);
|
||||
|
||||
return deserial;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (requestStream != null)
|
||||
requestStream.Close();
|
||||
|
||||
// capture how much time was spent writing
|
||||
tickdata = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -978,7 +1065,11 @@ namespace OpenSim.Framework
|
||||
respStream.Close();
|
||||
}
|
||||
else
|
||||
m_log.DebugFormat("[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}", requestUrl, verb);
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SynchronousRestObjectRequester]: Oops! no content found in response stream from {0} {1}",
|
||||
verb, requestUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException e)
|
||||
@@ -989,20 +1080,47 @@ namespace OpenSim.Framework
|
||||
return deserial;
|
||||
else
|
||||
m_log.ErrorFormat(
|
||||
"[SynchronousRestObjectRequester]: WebException {0} {1} {2} {3}",
|
||||
requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
|
||||
"[SynchronousRestObjectRequester]: WebException for {0} {1} {2}: {3} {4}",
|
||||
verb, requestUrl, typeof(TResponse).ToString(), e.Message, e.StackTrace);
|
||||
}
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
// This is what happens when there is invalid XML
|
||||
m_log.DebugFormat("[SynchronousRestObjectRequester]: Invalid XML {0} {1}", requestUrl, typeof(TResponse).ToString());
|
||||
m_log.DebugFormat(
|
||||
"[SynchronousRestObjectRequester]: Invalid XML from {0} {1} {2}",
|
||||
verb, requestUrl, typeof(TResponse).ToString());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[SynchronousRestObjectRequester]: Exception on response from {0} {1}", requestUrl, e);
|
||||
m_log.DebugFormat(
|
||||
"[SynchronousRestObjectRequester]: Exception on response from {0} {1}: {2}{3}",
|
||||
verb, requestUrl, e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
int tickdiff = Util.EnvironmentTickCountSubtract(tickstart);
|
||||
if (tickdiff > WebUtil.LongCallTime)
|
||||
{
|
||||
string originalRequest = null;
|
||||
|
||||
if (buffer != null)
|
||||
{
|
||||
originalRequest = Encoding.UTF8.GetString(buffer.ToArray());
|
||||
|
||||
if (originalRequest.Length > WebUtil.MaxRequestDiagLength)
|
||||
originalRequest = originalRequest.Remove(WebUtil.MaxRequestDiagLength);
|
||||
}
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[SynchronousRestObjectRequester]: Slow request to <{0}> {1} {2} took {3}ms, {4}ms writing, {5}",
|
||||
reqnum,
|
||||
verb,
|
||||
requestUrl,
|
||||
tickdiff,
|
||||
tickdata,
|
||||
originalRequest);
|
||||
}
|
||||
|
||||
return deserial;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -138,7 +139,7 @@ namespace OpenSim
|
||||
m_log.Info("====================================================================");
|
||||
m_log.Info("========================= STARTING OPENSIM =========================");
|
||||
m_log.Info("====================================================================");
|
||||
|
||||
|
||||
//m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString());
|
||||
// http://msdn.microsoft.com/en-us/library/bb384202.aspx
|
||||
//GCSettings.LatencyMode = GCLatencyMode.Batch;
|
||||
@@ -225,12 +226,12 @@ namespace OpenSim
|
||||
/// </summary>
|
||||
private void RegisterConsoleCommands()
|
||||
{
|
||||
m_console.Commands.AddCommand("region", false, "force update",
|
||||
m_console.Commands.AddCommand("Objects", false, "force update",
|
||||
"force update",
|
||||
"Force the update of all objects on clients",
|
||||
HandleForceUpdate);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug packet",
|
||||
m_console.Commands.AddCommand("Comms", false, "debug packet",
|
||||
"debug packet <level> [<avatar-first-name> <avatar-last-name>]",
|
||||
"Turn on packet debugging",
|
||||
"If level > 255 then all incoming and outgoing packets are logged.\n"
|
||||
@@ -242,7 +243,7 @@ namespace OpenSim
|
||||
+ "If an avatar name is given then only packets from that avatar are logged",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug http",
|
||||
m_console.Commands.AddCommand("Comms", false, "debug http",
|
||||
"debug http <level>",
|
||||
"Turn on inbound http request debugging for everything except the event queue (see debug eq).",
|
||||
"If level >= 2 then the handler used to service the request is logged.\n"
|
||||
@@ -250,37 +251,37 @@ namespace OpenSim
|
||||
+ "If level <= 0 then no extra http logging is done.\n",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
|
||||
m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug scene",
|
||||
m_console.Commands.AddCommand("Regions", false, "debug scene",
|
||||
"debug scene <scripting> <collisions> <physics>",
|
||||
"Turn on scene debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "change region",
|
||||
m_console.Commands.AddCommand("General", false, "change region",
|
||||
"change region <region name>",
|
||||
"Change current console region", ChangeSelectedRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save xml",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save xml",
|
||||
"save xml",
|
||||
"Save a region's data in XML format", SaveXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save xml2",
|
||||
"save xml2",
|
||||
"Save a region's data in XML2 format", SaveXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load xml",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load xml",
|
||||
"load xml [-newIDs [<x> <y> <z>]]",
|
||||
"Load a region's data from XML format", LoadXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load xml2",
|
||||
"load xml2",
|
||||
"Load a region's data from XML2 format", LoadXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save prims xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save prims xml2",
|
||||
"save prims xml2 [<prim name> <file name>]",
|
||||
"Save named prim to XML2", SavePrimsXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load oar",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load oar",
|
||||
"load oar [--merge] [--skip-assets] [<OAR path>]",
|
||||
"Load a region's data from an OAR archive.",
|
||||
"--merge will merge the OAR with the existing scene." + Environment.NewLine
|
||||
@@ -289,7 +290,7 @@ namespace OpenSim
|
||||
+ " If this is not given then the command looks for an OAR named region.oar in the current directory.",
|
||||
LoadOar);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save oar",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save oar",
|
||||
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
|
||||
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
|
||||
"Save a region's data to an OAR archive.",
|
||||
@@ -306,54 +307,54 @@ namespace OpenSim
|
||||
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
||||
SaveOar);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "edit scale",
|
||||
m_console.Commands.AddCommand("Objects", false, "edit scale",
|
||||
"edit scale <name> <x> <y> <z>",
|
||||
"Change the scale of a named prim", HandleEditScale);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "kick user",
|
||||
m_console.Commands.AddCommand("Users", false, "kick user",
|
||||
"kick user <first> <last> [message]",
|
||||
"Kick a user off the simulator", KickUserCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show users",
|
||||
m_console.Commands.AddCommand("Users", false, "show users",
|
||||
"show users [full]",
|
||||
"Show user data for users currently on the region",
|
||||
"Without the 'full' option, only users actually on the region are shown."
|
||||
+ " With the 'full' option child agents of users in neighbouring regions are also shown.",
|
||||
HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show connections",
|
||||
m_console.Commands.AddCommand("Comms", false, "show connections",
|
||||
"show connections",
|
||||
"Show connection data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show circuits",
|
||||
m_console.Commands.AddCommand("Comms", false, "show circuits",
|
||||
"show circuits",
|
||||
"Show agent circuit data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show http-handlers",
|
||||
m_console.Commands.AddCommand("Comms", false, "show http-handlers",
|
||||
"show http-handlers",
|
||||
"Show all registered http handlers", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show pending-objects",
|
||||
m_console.Commands.AddCommand("Comms", false, "show pending-objects",
|
||||
"show pending-objects",
|
||||
"Show # of objects on the pending queues of all scene viewers", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show modules",
|
||||
m_console.Commands.AddCommand("General", false, "show modules",
|
||||
"show modules",
|
||||
"Show module data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show regions",
|
||||
m_console.Commands.AddCommand("Regions", false, "show regions",
|
||||
"show regions",
|
||||
"Show region data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show ratings",
|
||||
m_console.Commands.AddCommand("Regions", false, "show ratings",
|
||||
"show ratings",
|
||||
"Show rating data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "backup",
|
||||
m_console.Commands.AddCommand("Objects", false, "backup",
|
||||
"backup",
|
||||
"Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "create region",
|
||||
m_console.Commands.AddCommand("Regions", false, "create region",
|
||||
"create region [\"region name\"] <region_file.ini>",
|
||||
"Create a new region.",
|
||||
"The settings for \"region name\" are read from <region_file.ini>. Paths specified with <region_file.ini> are relative to your Regions directory, unless an absolute path is given."
|
||||
@@ -362,62 +363,57 @@ namespace OpenSim
|
||||
+ "If <region_file.ini> does not exist, it will be created.",
|
||||
HandleCreateRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "restart",
|
||||
m_console.Commands.AddCommand("Regions", false, "restart",
|
||||
"restart",
|
||||
"Restart all sims in this instance", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config set",
|
||||
m_console.Commands.AddCommand("General", false, "config set",
|
||||
"config set <section> <key> <value>",
|
||||
"Set a config option. In most cases this is not useful since changed parameters are not dynamically reloaded. Neither do changed parameters persist - you will have to change a config file manually and restart.", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config get",
|
||||
m_console.Commands.AddCommand("General", false, "config get",
|
||||
"config get [<section>] [<key>]",
|
||||
"Synonym for config show",
|
||||
HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config show",
|
||||
m_console.Commands.AddCommand("General", false, "config show",
|
||||
"config show [<section>] [<key>]",
|
||||
"Show config information",
|
||||
"If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
|
||||
+ "If a section is given but not a field, then all fields in that section are printed.",
|
||||
HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config save",
|
||||
m_console.Commands.AddCommand("General", false, "config save",
|
||||
"config save <path>",
|
||||
"Save current configuration to a file at the given path", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "command-script",
|
||||
m_console.Commands.AddCommand("General", false, "command-script",
|
||||
"command-script <script>",
|
||||
"Run a command script from file", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "remove-region",
|
||||
m_console.Commands.AddCommand("Regions", false, "remove-region",
|
||||
"remove-region <name>",
|
||||
"Remove a region from this simulator", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "delete-region",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete-region",
|
||||
"delete-region <name>",
|
||||
"Delete a region from disk", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules list",
|
||||
m_console.Commands.AddCommand("General", false, "modules list",
|
||||
"modules list",
|
||||
"List modules", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules load",
|
||||
m_console.Commands.AddCommand("General", false, "modules load",
|
||||
"modules load <name>",
|
||||
"Load a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules unload",
|
||||
m_console.Commands.AddCommand("General", false, "modules unload",
|
||||
"modules unload <name>",
|
||||
"Unload a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
|
||||
"Add-InventoryHost <host>",
|
||||
String.Empty, RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "kill uuid",
|
||||
m_console.Commands.AddCommand("Objects", false, "kill uuid",
|
||||
"kill uuid <UUID>",
|
||||
"Kill an object by UUID", KillUUID);
|
||||
|
||||
}
|
||||
|
||||
public override void ShutdownSpecific()
|
||||
@@ -508,7 +504,11 @@ namespace OpenSim
|
||||
string currentCommand;
|
||||
while ((currentCommand = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (currentCommand != String.Empty)
|
||||
currentCommand = currentCommand.Trim();
|
||||
if (!(currentCommand == ""
|
||||
|| currentCommand.StartsWith(";")
|
||||
|| currentCommand.StartsWith("//")
|
||||
|| currentCommand.StartsWith("#")))
|
||||
{
|
||||
m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
|
||||
m_console.RunCommand(currentCommand);
|
||||
@@ -619,10 +619,11 @@ namespace OpenSim
|
||||
return;
|
||||
}
|
||||
|
||||
PopulateRegionEstateInfo(regInfo);
|
||||
bool changed = PopulateRegionEstateInfo(regInfo);
|
||||
IScene scene;
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
regInfo.EstateSettings.Save();
|
||||
if (changed)
|
||||
regInfo.EstateSettings.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -829,14 +830,6 @@ namespace OpenSim
|
||||
case "restart":
|
||||
m_sceneManager.RestartCurrentScene();
|
||||
break;
|
||||
|
||||
case "Add-InventoryHost":
|
||||
if (cmdparams.Length > 0)
|
||||
{
|
||||
MainConsole.Instance.Output("Not implemented.");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -928,7 +921,7 @@ namespace OpenSim
|
||||
break;
|
||||
|
||||
case "scene":
|
||||
if (args.Length == 5)
|
||||
if (args.Length == 4)
|
||||
{
|
||||
if (m_sceneManager.CurrentScene == null)
|
||||
{
|
||||
@@ -936,39 +929,21 @@ namespace OpenSim
|
||||
}
|
||||
else
|
||||
{
|
||||
bool scriptingOn = !Convert.ToBoolean(args[2]);
|
||||
bool collisionsOn = !Convert.ToBoolean(args[3]);
|
||||
bool physicsOn = !Convert.ToBoolean(args[4]);
|
||||
m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn);
|
||||
string key = args[2];
|
||||
string value = args[3];
|
||||
m_sceneManager.CurrentScene.SetSceneCoreDebug(
|
||||
new Dictionary<string, string>() { { key, value } });
|
||||
|
||||
MainConsole.Instance.Output(
|
||||
String.Format(
|
||||
"Set debug scene scripting = {0}, collisions = {1}, physics = {2}",
|
||||
!scriptingOn, !collisionsOn, !physicsOn));
|
||||
MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MainConsole.Instance.Output("Usage: debug scene <scripting> <collisions> <physics> (where inside <> is true/false)");
|
||||
MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "teleport":
|
||||
foreach(Scene s in m_sceneManager.Scenes)
|
||||
{
|
||||
if (s.DEBUG)
|
||||
{
|
||||
s.DEBUG = false;
|
||||
MainConsole.Instance.Output("Teleport debugging is disabled!");
|
||||
}
|
||||
else{
|
||||
s.DEBUG = true;
|
||||
MainConsole.Instance.Output("Teleport debugging is enabled!");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
MainConsole.Instance.Output("Unknown debug command");
|
||||
break;
|
||||
@@ -996,8 +971,7 @@ namespace OpenSim
|
||||
if (showParams.Length > 1 && showParams[1] == "full")
|
||||
{
|
||||
agents = m_sceneManager.GetCurrentScenePresences();
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
agents = m_sceneManager.GetCurrentSceneAvatars();
|
||||
}
|
||||
@@ -1006,7 +980,8 @@ namespace OpenSim
|
||||
|
||||
MainConsole.Instance.Output(
|
||||
String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname",
|
||||
"Agent ID", "Root/Child", "Region", "Position"));
|
||||
"Agent ID", "Root/Child", "Region", "Position")
|
||||
);
|
||||
|
||||
foreach (ScenePresence presence in agents)
|
||||
{
|
||||
@@ -1016,8 +991,7 @@ namespace OpenSim
|
||||
if (regionInfo == null)
|
||||
{
|
||||
regionName = "Unresolvable";
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
regionName = regionInfo.RegionName;
|
||||
}
|
||||
@@ -1030,7 +1004,8 @@ namespace OpenSim
|
||||
presence.UUID,
|
||||
presence.IsChildAgent ? "Child" : "Root",
|
||||
regionName,
|
||||
presence.AbsolutePosition.ToString()));
|
||||
presence.AbsolutePosition.ToString())
|
||||
);
|
||||
}
|
||||
|
||||
MainConsole.Instance.Output(String.Empty);
|
||||
@@ -1039,16 +1014,20 @@ namespace OpenSim
|
||||
case "connections":
|
||||
System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n");
|
||||
m_sceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
scene.ForEachClient(
|
||||
delegate(IClientAPI client)
|
||||
{
|
||||
connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n",
|
||||
scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode);
|
||||
}
|
||||
delegate(Scene scene) {
|
||||
scene.ForEachClient(
|
||||
delegate(IClientAPI client) {
|
||||
connections.AppendFormat(
|
||||
"{0}: {1} ({2}) from {3} on circuit {4}\n",
|
||||
scene.RegionInfo.RegionName,
|
||||
client.Name,
|
||||
client.AgentId,
|
||||
client.RemoteEndPoint,
|
||||
client.CircuitCode
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
MainConsole.Instance.Output(connections.ToString());
|
||||
@@ -1057,13 +1036,17 @@ namespace OpenSim
|
||||
case "circuits":
|
||||
System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n");
|
||||
m_sceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
//this.HttpServer.
|
||||
acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
|
||||
foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values)
|
||||
acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root"));
|
||||
}
|
||||
delegate(Scene scene) {
|
||||
//this.HttpServer.
|
||||
acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
|
||||
foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values)
|
||||
acd.AppendFormat(
|
||||
"\t{0} {1} ({2})\n",
|
||||
aCircuit.firstname,
|
||||
aCircuit.lastname,
|
||||
(aCircuit.child ? "Child" : "Root")
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
MainConsole.Instance.Output(acd.ToString());
|
||||
@@ -1104,17 +1087,29 @@ namespace OpenSim
|
||||
}
|
||||
|
||||
m_sceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
delegate(Scene scene) {
|
||||
m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:");
|
||||
foreach (IRegionModule module in scene.Modules.Values)
|
||||
{
|
||||
m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:");
|
||||
foreach (IRegionModule module in scene.Modules.Values)
|
||||
if (!module.IsSharedModule)
|
||||
{
|
||||
if (!module.IsSharedModule)
|
||||
{
|
||||
m_log.Error("Region Module: " + module.Name);
|
||||
}
|
||||
m_log.Error("Region Module: " + module.Name);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
m_sceneManager.ForEachScene(
|
||||
delegate(Scene scene) {
|
||||
MainConsole.Instance.Output("Loaded new region modules in" + scene.RegionInfo.RegionName + " are:");
|
||||
foreach (IRegionModuleBase module in scene.RegionModules.Values)
|
||||
{
|
||||
Type type = module.GetType().GetInterface("ISharedRegionModule");
|
||||
string module_type = type != null ? "Shared" : "Non-Shared";
|
||||
MainConsole.Instance.OutputFormat("New Region Module ({0}): {1}", module_type, module.Name);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
MainConsole.Instance.Output("");
|
||||
break;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -67,6 +68,9 @@ namespace OpenSim
|
||||
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
|
||||
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
|
||||
|
||||
// OpenSim.ini Section name for ESTATES Settings
|
||||
public const string ESTATE_SECTION_NAME = "Estates";
|
||||
|
||||
protected string proxyUrl;
|
||||
protected int proxyOffset = 0;
|
||||
|
||||
@@ -242,15 +246,18 @@ namespace OpenSim
|
||||
|
||||
foreach (string topic in topics)
|
||||
{
|
||||
m_console.Commands.AddCommand("plugin", false, "help " + topic,
|
||||
"help " + topic,
|
||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||
|
||||
// This is a hack to allow the user to enter the help command in upper or lowercase. This will go
|
||||
// away at some point.
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + topic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
|
||||
m_console.Commands.AddCommand("plugin", false, topic,
|
||||
topic,
|
||||
"Execute subcommand for plugin '" + topic + "'",
|
||||
null);
|
||||
|
||||
ICommander commander = null;
|
||||
|
||||
@@ -267,7 +274,7 @@ namespace OpenSim
|
||||
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
m_console.Commands.AddCommand(topic, false,
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
@@ -286,7 +293,7 @@ namespace OpenSim
|
||||
// Only safe for the interactive console, since it won't
|
||||
// let us come here unless both scene and commander exist
|
||||
//
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1].ToLower());
|
||||
if (moduleCommander != null)
|
||||
m_console.Output(moduleCommander.Help);
|
||||
}
|
||||
@@ -381,7 +388,7 @@ namespace OpenSim
|
||||
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
|
||||
|
||||
// TODO : Try setting resource for region xstats here on scene
|
||||
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
|
||||
MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));
|
||||
|
||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
@@ -424,7 +431,7 @@ namespace OpenSim
|
||||
|
||||
mscene = scene;
|
||||
|
||||
scene.StartTimer();
|
||||
scene.Start();
|
||||
|
||||
scene.StartScripts();
|
||||
|
||||
@@ -443,12 +450,42 @@ namespace OpenSim
|
||||
{
|
||||
RegionInfo regionInfo = scene.RegionInfo;
|
||||
|
||||
string estateOwnerFirstName = null;
|
||||
string estateOwnerLastName = null;
|
||||
string estateOwnerEMail = null;
|
||||
string estateOwnerPassword = null;
|
||||
string rawEstateOwnerUuid = null;
|
||||
|
||||
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
|
||||
{
|
||||
string defaultEstateOwnerName
|
||||
= m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
|
||||
string[] ownerNames = defaultEstateOwnerName.Split(' ');
|
||||
|
||||
if (ownerNames.Length >= 2)
|
||||
{
|
||||
estateOwnerFirstName = ownerNames[0];
|
||||
estateOwnerLastName = ownerNames[1];
|
||||
}
|
||||
|
||||
// Info to be used only on Standalone Mode
|
||||
rawEstateOwnerUuid = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null);
|
||||
estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null);
|
||||
estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null);
|
||||
}
|
||||
|
||||
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
|
||||
List<char> excluded = new List<char>(new char[1]{' '});
|
||||
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
|
||||
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
|
||||
|
||||
UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
|
||||
|
||||
if (estateOwnerFirstName == null || estateOwnerLastName == null)
|
||||
{
|
||||
estateOwnerFirstName = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
|
||||
estateOwnerLastName = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
|
||||
}
|
||||
|
||||
UserAccount account
|
||||
= scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, estateOwnerFirstName, estateOwnerLastName);
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
@@ -467,23 +504,35 @@ namespace OpenSim
|
||||
|
||||
if (scene.UserAccountService is UserAccountService)
|
||||
{
|
||||
string password = MainConsole.Instance.PasswdPrompt("Password");
|
||||
string email = MainConsole.Instance.CmdPrompt("Email", "");
|
||||
if (estateOwnerPassword == null)
|
||||
estateOwnerPassword = MainConsole.Instance.PasswdPrompt("Password");
|
||||
|
||||
string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
|
||||
if (estateOwnerEMail == null)
|
||||
estateOwnerEMail = MainConsole.Instance.CmdPrompt("Email");
|
||||
|
||||
if (rawEstateOwnerUuid == null)
|
||||
rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
|
||||
|
||||
UUID principalId = UUID.Zero;
|
||||
if (!UUID.TryParse(rawPrincipalId, out principalId))
|
||||
UUID estateOwnerUuid = UUID.Zero;
|
||||
if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
|
||||
{
|
||||
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId);
|
||||
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawEstateOwnerUuid);
|
||||
return;
|
||||
}
|
||||
|
||||
// If we've been given a zero uuid then this signals that we should use a random user id
|
||||
if (estateOwnerUuid == UUID.Zero)
|
||||
estateOwnerUuid = UUID.Random();
|
||||
|
||||
account
|
||||
= ((UserAccountService)scene.UserAccountService).CreateUser(
|
||||
regionInfo.ScopeID, principalId, first, last, password, email);
|
||||
regionInfo.ScopeID,
|
||||
estateOwnerUuid,
|
||||
estateOwnerFirstName,
|
||||
estateOwnerLastName,
|
||||
estateOwnerPassword,
|
||||
estateOwnerEMail);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
if (account == null)
|
||||
@@ -724,6 +773,9 @@ namespace OpenSim
|
||||
return Util.UTF8.GetBytes("OK");
|
||||
}
|
||||
|
||||
public string Name { get { return "SimStatus"; } }
|
||||
public string Description { get { return "Simulator Status"; } }
|
||||
|
||||
public string ContentType
|
||||
{
|
||||
get { return "text/plain"; }
|
||||
@@ -748,6 +800,9 @@ namespace OpenSim
|
||||
{
|
||||
OpenSimBase m_opensim;
|
||||
string osXStatsURI = String.Empty;
|
||||
|
||||
public string Name { get { return "XSimStatus"; } }
|
||||
public string Description { get { return "Simulator XStatus"; } }
|
||||
|
||||
public XSimStatusHandler(OpenSimBase sim)
|
||||
{
|
||||
@@ -788,6 +843,9 @@ namespace OpenSim
|
||||
{
|
||||
OpenSimBase m_opensim;
|
||||
string osUXStatsURI = String.Empty;
|
||||
|
||||
public string Name { get { return "UXSimStatus"; } }
|
||||
public string Description { get { return "Simulator UXStatus"; } }
|
||||
|
||||
public UXSimStatusHandler(OpenSimBase sim)
|
||||
{
|
||||
@@ -883,15 +941,21 @@ namespace OpenSim
|
||||
/// This method doesn't allow an estate to be created with the same name as existing estates.
|
||||
/// </remarks>
|
||||
/// <param name="regInfo"></param>
|
||||
/// <param name="existingName">A list of estate names that already exist.</param>
|
||||
/// <param name="estatesByName">A list of estate names that already exist.</param>
|
||||
/// <param name="estateName">Estate name to create if already known</param>
|
||||
/// <returns>true if the estate was created, false otherwise</returns>
|
||||
public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
|
||||
public bool CreateEstate(RegionInfo regInfo, Dictionary<string, EstateSettings> estatesByName, string estateName)
|
||||
{
|
||||
// Create a new estate
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
|
||||
string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
|
||||
if (existingNames.Contains(newName))
|
||||
string newName;
|
||||
if (estateName != null && estateName != "")
|
||||
newName = estateName;
|
||||
else
|
||||
newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
|
||||
if (estatesByName.ContainsKey(newName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
|
||||
return false;
|
||||
@@ -913,75 +977,113 @@ namespace OpenSim
|
||||
/// Load the estate information for the provided RegionInfo object.
|
||||
/// </summary>
|
||||
/// <param name="regInfo"></param>
|
||||
public void PopulateRegionEstateInfo(RegionInfo regInfo)
|
||||
public bool PopulateRegionEstateInfo(RegionInfo regInfo)
|
||||
{
|
||||
if (EstateDataService != null)
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
|
||||
|
||||
if (regInfo.EstateSettings.EstateID == 0) // No record at all
|
||||
if (regInfo.EstateSettings.EstateID != 0)
|
||||
return false; // estate info in the database did not change
|
||||
|
||||
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
|
||||
|
||||
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
||||
Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>();
|
||||
|
||||
foreach (EstateSettings estate in estates)
|
||||
estatesByName[estate.EstateName] = estate;
|
||||
|
||||
string defaultEstateName = null;
|
||||
|
||||
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
|
||||
{
|
||||
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
|
||||
|
||||
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
||||
List<string> estateNames = new List<string>();
|
||||
foreach (EstateSettings estate in estates)
|
||||
estateNames.Add(estate.EstateName);
|
||||
|
||||
while (true)
|
||||
defaultEstateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null);
|
||||
|
||||
if (defaultEstateName != null)
|
||||
{
|
||||
if (estates.Count == 0)
|
||||
{
|
||||
m_log.Info("[ESTATE] No existing estates found. You must create a new one.");
|
||||
|
||||
if (CreateEstate(regInfo, estateNames))
|
||||
break;
|
||||
EstateSettings defaultEstate;
|
||||
bool defaultEstateJoined = false;
|
||||
|
||||
if (estatesByName.ContainsKey(defaultEstateName))
|
||||
{
|
||||
defaultEstate = estatesByName[defaultEstateName];
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, (int)defaultEstate.EstateID))
|
||||
defaultEstateJoined = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CreateEstate(regInfo, estatesByName, defaultEstateName))
|
||||
defaultEstateJoined = true;
|
||||
}
|
||||
|
||||
if (defaultEstateJoined)
|
||||
return true; // need to update the database
|
||||
else
|
||||
m_log.ErrorFormat(
|
||||
"[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have no default estate or creation of the default estate failed then ask the user.
|
||||
while (true)
|
||||
{
|
||||
if (estates.Count == 0)
|
||||
{
|
||||
m_log.Info("[ESTATE]: No existing estates found. You must create a new one.");
|
||||
|
||||
if (CreateEstate(regInfo, estatesByName, null))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
|
||||
"yes",
|
||||
new List<string>() { "yes", "no" });
|
||||
|
||||
if (response == "no")
|
||||
{
|
||||
if (CreateEstate(regInfo, estatesByName, null))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string response
|
||||
string[] estateNames = estatesByName.Keys.ToArray();
|
||||
response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
|
||||
"yes",
|
||||
new List<string>() { "yes", "no" });
|
||||
|
||||
if (response == "no")
|
||||
"Name of estate to join. Existing estate names are ({0})",
|
||||
string.Join(", ", estateNames)),
|
||||
estateNames[0]);
|
||||
|
||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
if (CreateEstate(regInfo, estateNames))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
|
||||
estateNames[0]);
|
||||
|
||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true; // need to update the database
|
||||
}
|
||||
}
|
||||
|
||||
public class OpenSimConfigSource
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
private IAssetService m_assetService;
|
||||
private bool m_dumpAssetsToFile = false;
|
||||
private string m_regionName;
|
||||
private int m_levelUpload = 0;
|
||||
|
||||
public BunchOfCaps(Scene scene, Caps caps)
|
||||
{
|
||||
@@ -121,7 +122,10 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
IConfig sconfig = config.Configs["Startup"];
|
||||
if (sconfig != null)
|
||||
{
|
||||
m_persistBakedTextures = sconfig.GetBoolean("PersistBakedTextures", m_persistBakedTextures);
|
||||
m_levelUpload = sconfig.GetInt("LevelUpload", 0);
|
||||
}
|
||||
}
|
||||
|
||||
m_assetService = m_Scene.AssetService;
|
||||
@@ -151,7 +155,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
try
|
||||
{
|
||||
// the root of all evil
|
||||
m_HostCapsObj.RegisterHandler("SEED", new RestStreamHandler("POST", capsBase + m_requestPath, SeedCapRequest));
|
||||
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);
|
||||
|
||||
@@ -159,7 +165,10 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
// new LLSDStreamhandler<OSDMapRequest, OSDMapLayerResponse>("POST",
|
||||
// capsBase + m_mapLayerPath,
|
||||
// GetMapLayer);
|
||||
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
|
||||
IRequestHandler req
|
||||
= new RestStreamHandler(
|
||||
"POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory, "UpdateScript", null);
|
||||
|
||||
m_HostCapsObj.RegisterHandler("UpdateScriptTaskInventory", req);
|
||||
m_HostCapsObj.RegisterHandler("UpdateScriptTask", req);
|
||||
}
|
||||
@@ -174,14 +183,27 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
try
|
||||
{
|
||||
// I don't think this one works...
|
||||
m_HostCapsObj.RegisterHandler("NewFileAgentInventory", new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST",
|
||||
capsBase + m_newInventory,
|
||||
NewAgentInventoryRequest));
|
||||
IRequestHandler req = new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory);
|
||||
m_HostCapsObj.RegisterHandler(
|
||||
"NewFileAgentInventory",
|
||||
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>(
|
||||
"POST",
|
||||
capsBase + m_newInventory,
|
||||
NewAgentInventoryRequest,
|
||||
"NewFileAgentInventory",
|
||||
null));
|
||||
|
||||
IRequestHandler req
|
||||
= new RestStreamHandler(
|
||||
"POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory, "Update*", null);
|
||||
|
||||
m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req);
|
||||
m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req);
|
||||
m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req);
|
||||
m_HostCapsObj.RegisterHandler("CopyInventoryFromNotecard", new RestStreamHandler("POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard));
|
||||
|
||||
m_HostCapsObj.RegisterHandler(
|
||||
"CopyInventoryFromNotecard",
|
||||
new RestStreamHandler(
|
||||
"POST", capsBase + m_copyFromNotecardPath, CopyInventoryFromNotecard, "CopyInventoryFromNotecard", null));
|
||||
|
||||
// As of RC 1.22.9 of the Linden client this is
|
||||
// supported
|
||||
@@ -231,7 +253,10 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
|
||||
{
|
||||
m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
|
||||
m_log.DebugFormat(
|
||||
"[CAPS]: Unauthorized CAPS client {0} from {1}",
|
||||
m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
@@ -262,7 +287,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
try
|
||||
{
|
||||
m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
|
||||
// m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
|
||||
//m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
|
||||
|
||||
Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
|
||||
@@ -282,7 +307,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
m_dumpAssetsToFile);
|
||||
uploader.OnUpLoad += TaskScriptUpdated;
|
||||
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler(
|
||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "TaskInventoryScriptUpdater", null));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
@@ -357,21 +384,37 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
llsdRequest.asset_type == "animation" ||
|
||||
llsdRequest.asset_type == "sound")
|
||||
{
|
||||
ScenePresence avatar = null;
|
||||
IClientAPI client = null;
|
||||
IScene scene = null;
|
||||
if (GetClient != null)
|
||||
{
|
||||
client = GetClient(m_HostCapsObj.AgentID);
|
||||
scene = client.Scene;
|
||||
m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar);
|
||||
|
||||
IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>();
|
||||
// check user level
|
||||
if (avatar != null)
|
||||
{
|
||||
client = avatar.ControllingClient;
|
||||
|
||||
if (avatar.UserLevel < m_levelUpload)
|
||||
{
|
||||
if (client != null)
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
|
||||
|
||||
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
|
||||
errorResponse.uploader = "";
|
||||
errorResponse.state = "error";
|
||||
return errorResponse;
|
||||
}
|
||||
}
|
||||
|
||||
// check funds
|
||||
if (client != null)
|
||||
{
|
||||
IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>();
|
||||
|
||||
if (mm != null)
|
||||
{
|
||||
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
|
||||
{
|
||||
if (client != null)
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
||||
|
||||
LLSDAssetUploadResponse errorResponse = new LLSDAssetUploadResponse();
|
||||
errorResponse.uploader = "";
|
||||
@@ -393,8 +436,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
AssetUploader uploader =
|
||||
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
|
||||
llsdRequest.asset_type, capsBase + uploaderPath, m_HostCapsObj.HttpListener, m_dumpAssetsToFile);
|
||||
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
new BinaryStreamHandler(
|
||||
"POST",
|
||||
capsBase + uploaderPath,
|
||||
uploader.uploaderCaps,
|
||||
"NewAgentInventoryRequest",
|
||||
m_HostCapsObj.AgentID.ToString()));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
@@ -710,7 +759,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
uploader.OnUpLoad += ItemUpdated;
|
||||
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
new BinaryStreamHandler(
|
||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "NoteCardAgentInventory", null));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
@@ -761,7 +811,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(objectID);
|
||||
if (part != null)
|
||||
{
|
||||
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
|
||||
// TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(notecardID);
|
||||
if (!m_Scene.Permissions.CanCopyObjectInventory(notecardID, objectID, m_HostCapsObj.AgentID))
|
||||
{
|
||||
return LLSDHelpers.SerialiseLLSDReply(response);
|
||||
|
||||
@@ -106,13 +106,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"event queue",
|
||||
"Comms",
|
||||
false,
|
||||
"debug eq",
|
||||
"debug eq [0|1]",
|
||||
"Turn on event queue debugging",
|
||||
"debug eq 1 will turn on event queue debugging. This will log all outgoing event queue messages to clients.\n"
|
||||
+ "debug eq 0 will turn off event queue debugging.",
|
||||
"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
|
||||
@@ -235,19 +236,19 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
// ClientClosed(client.AgentId);
|
||||
// }
|
||||
|
||||
private void ClientClosed(UUID AgentID, Scene scene)
|
||||
private void ClientClosed(UUID agentID, Scene scene)
|
||||
{
|
||||
// m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", AgentID, m_scene.RegionInfo.RegionName);
|
||||
// m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName);
|
||||
|
||||
int count = 0;
|
||||
while (queues.ContainsKey(AgentID) && queues[AgentID].Count > 0 && count++ < 5)
|
||||
while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5)
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
lock (queues)
|
||||
{
|
||||
queues.Remove(AgentID);
|
||||
queues.Remove(agentID);
|
||||
}
|
||||
|
||||
List<UUID> removeitems = new List<UUID>();
|
||||
@@ -256,7 +257,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys)
|
||||
{
|
||||
// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID);
|
||||
if (ky == AgentID)
|
||||
if (ky == agentID)
|
||||
{
|
||||
removeitems.Add(ky);
|
||||
}
|
||||
@@ -267,7 +268,12 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky];
|
||||
m_AvatarQueueUUIDMapping.Remove(ky);
|
||||
|
||||
MainServer.Instance.RemovePollServiceHTTPHandler("","/CAPS/EQG/" + eventQueueGetUuid.ToString() + "/");
|
||||
string eqgPath = GenerateEqgCapPath(eventQueueGetUuid);
|
||||
MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}",
|
||||
// eqgPath, agentID, m_scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,7 +287,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
searchval = m_QueueUUIDAvatarMapping[ky];
|
||||
|
||||
if (searchval == AgentID)
|
||||
if (searchval == agentID)
|
||||
{
|
||||
removeitems.Add(ky);
|
||||
}
|
||||
@@ -305,6 +311,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate an Event Queue Get handler path for the given eqg uuid.
|
||||
/// </summary>
|
||||
/// <param name='eqgUuid'></param>
|
||||
private string GenerateEqgCapPath(UUID eqgUuid)
|
||||
{
|
||||
return string.Format("/CAPS/EQG/{0}/", eqgUuid);
|
||||
}
|
||||
|
||||
public void OnRegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
// Register an event queue for the client
|
||||
@@ -316,8 +331,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
// Let's instantiate a Queue for this agent right now
|
||||
TryGetQueue(agentID);
|
||||
|
||||
string capsBase = "/CAPS/EQG/";
|
||||
UUID EventQueueGetUUID = UUID.Zero;
|
||||
UUID eventQueueGetUUID;
|
||||
|
||||
lock (m_AvatarQueueUUIDMapping)
|
||||
{
|
||||
@@ -325,44 +339,50 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
if (m_AvatarQueueUUIDMapping.ContainsKey(agentID))
|
||||
{
|
||||
//m_log.DebugFormat("[EVENTQUEUE]: Found Existing UUID!");
|
||||
EventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
|
||||
eventQueueGetUUID = m_AvatarQueueUUIDMapping[agentID];
|
||||
}
|
||||
else
|
||||
{
|
||||
EventQueueGetUUID = UUID.Random();
|
||||
eventQueueGetUUID = UUID.Random();
|
||||
//m_log.DebugFormat("[EVENTQUEUE]: Using random UUID!");
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_QueueUUIDAvatarMapping)
|
||||
{
|
||||
if (!m_QueueUUIDAvatarMapping.ContainsKey(EventQueueGetUUID))
|
||||
m_QueueUUIDAvatarMapping.Add(EventQueueGetUUID, agentID);
|
||||
if (!m_QueueUUIDAvatarMapping.ContainsKey(eventQueueGetUUID))
|
||||
m_QueueUUIDAvatarMapping.Add(eventQueueGetUUID, agentID);
|
||||
}
|
||||
|
||||
lock (m_AvatarQueueUUIDMapping)
|
||||
{
|
||||
if (!m_AvatarQueueUUIDMapping.ContainsKey(agentID))
|
||||
m_AvatarQueueUUIDMapping.Add(agentID, EventQueueGetUUID);
|
||||
m_AvatarQueueUUIDMapping.Add(agentID, eventQueueGetUUID);
|
||||
}
|
||||
|
||||
string eventQueueGetPath = GenerateEqgCapPath(eventQueueGetUUID);
|
||||
|
||||
// Register this as a caps handler
|
||||
// FIXME: Confusingly, we need to register separate as a capability so that the client is told about
|
||||
// EventQueueGet when it receive capability information, but then we replace the rest handler immediately
|
||||
// afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but
|
||||
// really it should be possible to directly register the poll handler as a capability.
|
||||
caps.RegisterHandler("EventQueueGet",
|
||||
new RestHTTPHandler("POST", capsBase + EventQueueGetUUID.ToString() + "/", null));
|
||||
caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null));
|
||||
// delegate(Hashtable m_dhttpMethod)
|
||||
// {
|
||||
// return ProcessQueue(m_dhttpMethod, agentID, caps);
|
||||
// }));
|
||||
|
||||
// This will persist this beyond the expiry of the caps handlers
|
||||
// TODO: Add EventQueueGet name/description for diagnostics
|
||||
MainServer.Instance.AddPollServiceHTTPHandler(
|
||||
capsBase + EventQueueGetUUID.ToString() + "/",
|
||||
eventQueueGetPath,
|
||||
new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, agentID));
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[EVENT QUEUE GET MODULE]: Registered EQG handler {0} for {1} in {2}",
|
||||
// eventQueueGetPath, agentID, m_scene.RegionInfo.RegionName);
|
||||
|
||||
Random rnd = new Random(Environment.TickCount);
|
||||
lock (m_ids)
|
||||
{
|
||||
@@ -384,9 +404,25 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs a debug line for an outbound event queue message if appropriate.
|
||||
/// </summary>
|
||||
/// <param name='element'>Element containing message</param>
|
||||
private void LogOutboundDebugMessage(OSD element, UUID agentId)
|
||||
{
|
||||
if (element is OSDMap)
|
||||
{
|
||||
OSDMap ev = (OSDMap)element;
|
||||
m_log.DebugFormat(
|
||||
"Eq OUT {0,-30} to {1,-20} {2,-20}",
|
||||
ev["message"], m_scene.GetScenePresence(agentId).Name, m_scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
public Hashtable GetEvents(UUID requestID, UUID pAgentId, string request)
|
||||
{
|
||||
// m_log.DebugFormat("[EVENT QUEUE GET MODULE]: Invoked GetEvents() for {0}", pAgentId);
|
||||
if (DebugLevel >= 2)
|
||||
m_log.DebugFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName);
|
||||
|
||||
Queue<OSD> queue = TryGetQueue(pAgentId);
|
||||
OSD element;
|
||||
@@ -410,13 +446,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DebugLevel > 0 && element is OSDMap)
|
||||
{
|
||||
OSDMap ev = (OSDMap)element;
|
||||
m_log.DebugFormat(
|
||||
"[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}",
|
||||
ev["message"], m_scene.GetScenePresence(pAgentId).Name);
|
||||
}
|
||||
if (DebugLevel > 0)
|
||||
LogOutboundDebugMessage(element, pAgentId);
|
||||
|
||||
array.Add(element);
|
||||
|
||||
@@ -426,13 +457,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
element = queue.Dequeue();
|
||||
|
||||
if (DebugLevel > 0 && element is OSDMap)
|
||||
{
|
||||
OSDMap ev = (OSDMap)element;
|
||||
m_log.DebugFormat(
|
||||
"[EVENT QUEUE GET MODULE]: Eq OUT {0} to {1}",
|
||||
ev["message"], m_scene.GetScenePresence(pAgentId).Name);
|
||||
}
|
||||
if (DebugLevel > 0)
|
||||
LogOutboundDebugMessage(element, pAgentId);
|
||||
|
||||
array.Add(element);
|
||||
thisID++;
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.ClientStack.Linden.Tests
|
||||
CapabilitiesModule capsModule = new CapabilitiesModule();
|
||||
EventQueueGetModule eqgModule = new EventQueueGetModule();
|
||||
|
||||
m_scene = SceneHelpers.SetupScene();
|
||||
m_scene = new SceneHelpers().SetupScene();
|
||||
SceneHelpers.SetupSceneModules(m_scene, config, capsModule, eqgModule);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,8 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
capUrl = "/CAPS/" + UUID.Random();
|
||||
|
||||
IRequestHandler reqHandler
|
||||
= new RestStreamHandler("POST", capUrl, m_fetchHandler.FetchInventoryRequest);
|
||||
= new RestStreamHandler(
|
||||
"POST", capUrl, m_fetchHandler.FetchInventoryRequest, capName, agentID.ToString());
|
||||
|
||||
caps.RegisterHandler(capName, reqHandler);
|
||||
}
|
||||
|
||||
@@ -120,11 +120,13 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||
GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
|
||||
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
|
||||
delegate(Hashtable m_dhttpMethod)
|
||||
{
|
||||
return gmeshHandler.ProcessGetMesh(m_dhttpMethod, UUID.Zero, null);
|
||||
});
|
||||
IRequestHandler reqHandler
|
||||
= new RestHTTPHandler(
|
||||
"GET",
|
||||
"/CAPS/" + UUID.Random(),
|
||||
httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
|
||||
"GetMesh",
|
||||
agentID.ToString());
|
||||
|
||||
caps.RegisterHandler("GetMesh", reqHandler);
|
||||
}
|
||||
|
||||
@@ -130,7 +130,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
if (m_URL == "localhost")
|
||||
{
|
||||
// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
|
||||
caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
|
||||
caps.RegisterHandler(
|
||||
"GetTexture",
|
||||
new GetTextureHandler("/CAPS/" + capID + "/", m_assetService, "GetTexture", agentID.ToString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -117,7 +117,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
public void RegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag);
|
||||
IRequestHandler reqHandler
|
||||
= new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), MeshUploadFlag, "MeshUploadFlag", agentID.ToString());
|
||||
|
||||
caps.RegisterHandler("MeshUploadFlag", reqHandler);
|
||||
m_agentID = agentID;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
// private IAssetService m_assetService;
|
||||
private bool m_dumpAssetsToFile = false;
|
||||
private bool m_enabled = true;
|
||||
private int m_levelUpload = 0;
|
||||
|
||||
#region IRegionModuleBase Members
|
||||
|
||||
@@ -72,6 +73,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
return;
|
||||
|
||||
m_enabled = meshConfig.GetBoolean("AllowMeshUpload", true);
|
||||
m_levelUpload = meshConfig.GetInt("LevelUpload", 0);
|
||||
}
|
||||
|
||||
public void AddRegion(Scene pScene)
|
||||
@@ -113,51 +115,66 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
UUID capID = UUID.Random();
|
||||
|
||||
// m_log.Debug("[NEW FILE AGENT INVENTORY VARIABLE PRICE]: /CAPS/" + capID);
|
||||
caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
|
||||
|
||||
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>("POST",
|
||||
"/CAPS/" + capID.ToString(),
|
||||
delegate(LLSDAssetUploadRequest req)
|
||||
{
|
||||
return NewAgentInventoryRequest(req,agentID);
|
||||
}));
|
||||
|
||||
caps.RegisterHandler(
|
||||
"NewFileAgentInventoryVariablePrice",
|
||||
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDNewFileAngentInventoryVariablePriceReplyResponse>(
|
||||
"POST",
|
||||
"/CAPS/" + capID.ToString(),
|
||||
req => NewAgentInventoryRequest(req, agentID),
|
||||
"NewFileAgentInventoryVariablePrice",
|
||||
agentID.ToString()));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public LLSDNewFileAngentInventoryVariablePriceReplyResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest, UUID agentID)
|
||||
{
|
||||
|
||||
//TODO: The Mesh uploader uploads many types of content. If you're going to implement a Money based limit
|
||||
// You need to be aware of this and
|
||||
|
||||
// you need to be aware of this
|
||||
|
||||
//if (llsdRequest.asset_type == "texture" ||
|
||||
// llsdRequest.asset_type == "animation" ||
|
||||
// llsdRequest.asset_type == "sound")
|
||||
// {
|
||||
IClientAPI client = null;
|
||||
// check user level
|
||||
|
||||
|
||||
IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
|
||||
|
||||
if (mm != null)
|
||||
ScenePresence avatar = null;
|
||||
IClientAPI client = null;
|
||||
m_scene.TryGetScenePresence(agentID, out avatar);
|
||||
|
||||
if (avatar != null)
|
||||
{
|
||||
client = avatar.ControllingClient;
|
||||
|
||||
if (avatar.UserLevel < m_levelUpload)
|
||||
{
|
||||
if (m_scene.TryGetClient(agentID, out client))
|
||||
{
|
||||
if (!mm.UploadCovered(client.AgentId, mm.UploadCharge))
|
||||
{
|
||||
if (client != null)
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
||||
if (client != null)
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient permissions.", false);
|
||||
|
||||
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
|
||||
errorResponse.rsvp = "";
|
||||
errorResponse.state = "error";
|
||||
return errorResponse;
|
||||
}
|
||||
}
|
||||
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
|
||||
errorResponse.rsvp = "";
|
||||
errorResponse.state = "error";
|
||||
return errorResponse;
|
||||
}
|
||||
}
|
||||
|
||||
// check funds
|
||||
IMoneyModule mm = m_scene.RequestModuleInterface<IMoneyModule>();
|
||||
|
||||
if (mm != null)
|
||||
{
|
||||
if (!mm.UploadCovered(agentID, mm.UploadCharge))
|
||||
{
|
||||
if (client != null)
|
||||
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
|
||||
|
||||
LLSDNewFileAngentInventoryVariablePriceReplyResponse errorResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
|
||||
errorResponse.rsvp = "";
|
||||
errorResponse.state = "error";
|
||||
return errorResponse;
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
|
||||
string assetName = llsdRequest.name;
|
||||
@@ -171,8 +188,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
AssetUploader uploader =
|
||||
new AssetUploader(assetName, assetDes, newAsset, newInvItem, parentFolder, llsdRequest.inventory_type,
|
||||
llsdRequest.asset_type, capsBase + uploaderPath, MainServer.Instance, m_dumpAssetsToFile);
|
||||
|
||||
MainServer.Instance.AddStreamHandler(
|
||||
new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps));
|
||||
new BinaryStreamHandler(
|
||||
"POST",
|
||||
capsBase + uploaderPath,
|
||||
uploader.uploaderCaps,
|
||||
"NewFileAgentInventoryVariablePrice",
|
||||
agentID.ToString()));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
@@ -181,10 +204,9 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
string uploaderURL = protocol + m_scene.RegionInfo.ExternalHostName + ":" + MainServer.Instance.Port.ToString() + capsBase +
|
||||
uploaderPath;
|
||||
|
||||
|
||||
|
||||
LLSDNewFileAngentInventoryVariablePriceReplyResponse uploadResponse = new LLSDNewFileAngentInventoryVariablePriceReplyResponse();
|
||||
|
||||
|
||||
uploadResponse.rsvp = uploaderURL;
|
||||
uploadResponse.state = "upload";
|
||||
@@ -202,6 +224,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
pinventoryItem, pparentFolder, pdata, pinventoryType,
|
||||
passetType,agentID);
|
||||
};
|
||||
|
||||
return uploadResponse;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,12 +66,14 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
// m_log.InfoFormat("[OBJECTADD]: {0}", "/CAPS/OA/" + capuuid + "/");
|
||||
|
||||
caps.RegisterHandler("ObjectAdd",
|
||||
new RestHTTPHandler("POST", "/CAPS/OA/" + capuuid + "/",
|
||||
delegate(Hashtable m_dhttpMethod)
|
||||
{
|
||||
return ProcessAdd(m_dhttpMethod, agentID, caps);
|
||||
}));
|
||||
caps.RegisterHandler(
|
||||
"ObjectAdd",
|
||||
new RestHTTPHandler(
|
||||
"POST",
|
||||
"/CAPS/OA/" + capuuid + "/",
|
||||
httpMethod => ProcessAdd(httpMethod, agentID, caps),
|
||||
"ObjectAdd",
|
||||
agentID.ToString()));;
|
||||
}
|
||||
|
||||
public Hashtable ProcessAdd(Hashtable request, UUID AgentId, Caps cap)
|
||||
|
||||
@@ -106,12 +106,15 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
UUID capID = UUID.Random();
|
||||
|
||||
// m_log.Debug("[UPLOAD OBJECT ASSET MODULE]: /CAPS/" + capID);
|
||||
caps.RegisterHandler("UploadObjectAsset",
|
||||
new RestHTTPHandler("POST", "/CAPS/OA/" + capID + "/",
|
||||
delegate(Hashtable m_dhttpMethod)
|
||||
{
|
||||
return ProcessAdd(m_dhttpMethod, agentID, caps);
|
||||
}));
|
||||
caps.RegisterHandler(
|
||||
"UploadObjectAsset",
|
||||
new RestHTTPHandler(
|
||||
"POST",
|
||||
"/CAPS/OA/" + capID + "/",
|
||||
httpMethod => ProcessAdd(httpMethod, agentID, caps),
|
||||
"UploadObjectAsset",
|
||||
agentID.ToString()));
|
||||
|
||||
/*
|
||||
caps.RegisterHandler("NewFileAgentInventoryVariablePrice",
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user