Compare commits
1166 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a47fb93b74 | ||
|
|
6557d5f359 | ||
|
|
3caea83e9a | ||
|
|
4a54b3318b | ||
|
|
571becefb6 | ||
|
|
506192e466 | ||
|
|
54d1d6d917 | ||
|
|
87f30709a2 | ||
|
|
22ff06ba17 | ||
|
|
7e9a3019ac | ||
|
|
8d7b181b58 | ||
|
|
5f8a0f3d1f | ||
|
|
83a427a8f9 | ||
|
|
1cf8eb8a90 | ||
|
|
164007dd00 | ||
|
|
f3e4000a55 | ||
|
|
47f0468995 | ||
|
|
095e3aae67 | ||
|
|
3bc9c1adb4 | ||
|
|
2e5ae1b013 | ||
|
|
80d3998001 | ||
|
|
0049ec16f5 | ||
|
|
c4eb430ad2 | ||
|
|
d4d45c3acb | ||
|
|
4f15b8d4e6 | ||
|
|
c2ac5dc358 | ||
|
|
7a9c57a81e | ||
|
|
0f152bfe8c | ||
|
|
b2aeea66e3 | ||
|
|
9462a1861b | ||
|
|
aace455249 | ||
|
|
b68f701c00 | ||
|
|
fa64f2e56e | ||
|
|
ee85a530f6 | ||
|
|
d206721e2f | ||
|
|
dfe11566f4 | ||
|
|
ccfbce3176 | ||
|
|
09ea73f7cc | ||
|
|
15da52d73a | ||
|
|
df0787f5cf | ||
|
|
8a97d58f09 | ||
|
|
5a3cd9f1d0 | ||
|
|
4db60a5a40 | ||
|
|
7844872067 | ||
|
|
ddd3c6824a | ||
|
|
f985775962 | ||
|
|
654814d563 | ||
|
|
6bac92db80 | ||
|
|
53d64f755a | ||
|
|
893915ce0b | ||
|
|
82e534a029 | ||
|
|
b8924167e0 | ||
|
|
c2bd6ccdb8 | ||
|
|
5f8ab9f018 | ||
|
|
636ca6218d | ||
|
|
c285f87702 | ||
|
|
d5d0e81df2 | ||
|
|
e9ec187746 | ||
|
|
797e461ef9 | ||
|
|
26f12f479f | ||
|
|
69c1e0b2f7 | ||
|
|
840b75ca9b | ||
|
|
9331898c32 | ||
|
|
b800a299aa | ||
|
|
dbd1a68b58 | ||
|
|
3231602b88 | ||
|
|
bd4e3b0aaf | ||
|
|
e2b08bac6d | ||
|
|
13129f1a8d | ||
|
|
e6a8d2872c | ||
|
|
a51a545cb9 | ||
|
|
05dbe4f2c4 | ||
|
|
3113cc9129 | ||
|
|
ac370cf57b | ||
|
|
cf78f3fae3 | ||
|
|
dd7f9ed7bf | ||
|
|
61137eac22 | ||
|
|
2f0a3391ee | ||
|
|
5f266fd571 | ||
|
|
d0c707209a | ||
|
|
9a78281f82 | ||
|
|
7f74dc1b14 | ||
|
|
9fa915bdef | ||
|
|
c3ddf46188 | ||
|
|
301a926015 | ||
|
|
28c4dd7931 | ||
|
|
fa7da00cc3 | ||
|
|
12ebed8bab | ||
|
|
fc33d569cd | ||
|
|
8853c21763 | ||
|
|
e0a02d6ca3 | ||
|
|
ce3594f7f2 | ||
|
|
78a6e5489b | ||
|
|
bb7a755cba | ||
|
|
46e5c8e919 | ||
|
|
e6d0fb0b0e | ||
|
|
efc555ca22 | ||
|
|
455a2ba7de | ||
|
|
537905d81b | ||
|
|
bb1e35fbd9 | ||
|
|
3eb68c319e | ||
|
|
0806d03780 | ||
|
|
cb79e228e4 | ||
|
|
2804c97a39 | ||
|
|
c2971a6398 | ||
|
|
231feab57f | ||
|
|
ff49a21eca | ||
|
|
52dd547863 | ||
|
|
ba0afa53d3 | ||
|
|
2db0ac74c7 | ||
|
|
42f76773a1 | ||
|
|
ca50f6a82c | ||
|
|
1a47ec082e | ||
|
|
b7586806cd | ||
|
|
d8149373c1 | ||
|
|
e55e93c994 | ||
|
|
da6816c805 | ||
|
|
c19ac997b1 | ||
|
|
7bbc486c62 | ||
|
|
6ba7ee6b2e | ||
|
|
90f9b7b7c4 | ||
|
|
50b03d08a8 | ||
|
|
48988bf4e9 | ||
|
|
b4fe6da4eb | ||
|
|
5910be236f | ||
|
|
662976b602 | ||
|
|
fd56fd2ce8 | ||
|
|
b40c91777c | ||
|
|
9f7f266f58 | ||
|
|
7ad1b60eca | ||
|
|
521e2c8355 | ||
|
|
ac7a4a7d38 | ||
|
|
9522881404 | ||
|
|
3d75e9addd | ||
|
|
841c84831f | ||
|
|
5b2aa02fd9 | ||
|
|
41051b3cc6 | ||
|
|
296cf04ce6 | ||
|
|
34e8bf45b6 | ||
|
|
9f17ae580d | ||
|
|
aecac9bba9 | ||
|
|
6f689f591a | ||
|
|
0080f28f1d | ||
|
|
4fbdcb95a0 | ||
|
|
83b16612ce | ||
|
|
1c1f308052 | ||
|
|
33bd4fe789 | ||
|
|
41847e8fdf | ||
|
|
9feef34a81 | ||
|
|
12f9b1df8c | ||
|
|
7229bc4fbd | ||
|
|
9cf8795ecf | ||
|
|
3a760ad12b | ||
|
|
bdd4dcf69b | ||
|
|
a6382deec5 | ||
|
|
9f7aa7deef | ||
|
|
e32855d080 | ||
|
|
7df4383235 | ||
|
|
87a1e00f05 | ||
|
|
251f2444d0 | ||
|
|
1e4e978f7f | ||
|
|
a0c87b5af6 | ||
|
|
512ded6eb5 | ||
|
|
d50a072336 | ||
|
|
ec89dc99b7 | ||
|
|
58b1ee8e2c | ||
|
|
571693d7b6 | ||
|
|
77eb8ade8c | ||
|
|
1f74f013b2 | ||
|
|
7f7bbbb84a | ||
|
|
18beb796bc | ||
|
|
540a1912ce | ||
|
|
356b1ef1d9 | ||
|
|
e27f59cf42 | ||
|
|
2f41bc4ca7 | ||
|
|
1212cb0c74 | ||
|
|
cc290abf7a | ||
|
|
d299f8b55c | ||
|
|
ec305a4825 | ||
|
|
656e64b3ed | ||
|
|
8e51ca3a7b | ||
|
|
5e1aab92f5 | ||
|
|
6a1ce17cdb | ||
|
|
d264f0d301 | ||
|
|
5e5260ad1b | ||
|
|
319007783c | ||
|
|
7a1b1dd419 | ||
|
|
342c64b7ac | ||
|
|
50cc22c9e6 | ||
|
|
8ab4b277c1 | ||
|
|
2684ca0838 | ||
|
|
3284356bba | ||
|
|
cfaefad754 | ||
|
|
c719e016ed | ||
|
|
8886afd319 | ||
|
|
f4f9a2cb45 | ||
|
|
06adbc1324 | ||
|
|
f2e343d530 | ||
|
|
00a23eea0e | ||
|
|
b9c20fbaa7 | ||
|
|
e4c2b44e5c | ||
|
|
e593607171 | ||
|
|
5cbc4e2a5f | ||
|
|
4e0d6e8e41 | ||
|
|
457160afc3 | ||
|
|
24c73aa8b2 | ||
|
|
16814dd8f1 | ||
|
|
5ea979d515 | ||
|
|
eea5d8368a | ||
|
|
713c666827 | ||
|
|
0f40ec5c65 | ||
|
|
db015963a9 | ||
|
|
09fba16094 | ||
|
|
2232e6f273 | ||
|
|
aca10cb027 | ||
|
|
b973fe5297 | ||
|
|
35d6181b78 | ||
|
|
4cf5ef3cd4 | ||
|
|
79bfa275da | ||
|
|
8ee31d97a8 | ||
|
|
47818a2db3 | ||
|
|
4b47008d30 | ||
|
|
fc8d2be632 | ||
|
|
252e159340 | ||
|
|
1096f43f0d | ||
|
|
dc1baf8025 | ||
|
|
1bcb2e788f | ||
|
|
c13045b25e | ||
|
|
314d1171ef | ||
|
|
ef5b628191 | ||
|
|
7296286267 | ||
|
|
4e324ae3cb | ||
|
|
512a13dbe7 | ||
|
|
5a05de0eec | ||
|
|
483fc88b07 | ||
|
|
b9e12ed3b7 | ||
|
|
1bfec00a88 | ||
|
|
8a1640f0a1 | ||
|
|
46412f4931 | ||
|
|
5c368c8d38 | ||
|
|
0ca771c185 | ||
|
|
98b2d3a7f2 | ||
|
|
32ddeab5e3 | ||
|
|
071edaff49 | ||
|
|
a0a25bb8ca | ||
|
|
8613336674 | ||
|
|
3ffdadef70 | ||
|
|
839b08c32b | ||
|
|
f8ff98577e | ||
|
|
f7c4be1fa1 | ||
|
|
c448151f6b | ||
|
|
4708083434 | ||
|
|
b1790ba56e | ||
|
|
187ccd72f0 | ||
|
|
cc8864b0e3 | ||
|
|
47838e5fb3 | ||
|
|
1ab631f015 | ||
|
|
a1074cad5c | ||
|
|
77705145a0 | ||
|
|
1a8a11140c | ||
|
|
fdc59ee802 | ||
|
|
0344395776 | ||
|
|
7c673c79d4 | ||
|
|
fb2deb0d45 | ||
|
|
810840b862 | ||
|
|
ca8b1e488c | ||
|
|
e74809ff4c | ||
|
|
f2d7f3e731 | ||
|
|
a32b0ce0ae | ||
|
|
042eb80a62 | ||
|
|
b43a731beb | ||
|
|
df9521caf3 | ||
|
|
7aac4d650f | ||
|
|
24577876be | ||
|
|
ac581b532e | ||
|
|
fa393cb13a | ||
|
|
d00a954d35 | ||
|
|
a5a60df687 | ||
|
|
af60b8ac16 | ||
|
|
1582e05ac7 | ||
|
|
48c52d6e48 | ||
|
|
fb14390fb0 | ||
|
|
9fba4b66bb | ||
|
|
5e8c3f8325 | ||
|
|
7fead01786 | ||
|
|
d0a22fb359 | ||
|
|
24b9a2885f | ||
|
|
c2e5d1d203 | ||
|
|
383ee0d647 | ||
|
|
d98d5ee6be | ||
|
|
1ead2ed5ee | ||
|
|
912bfba20c | ||
|
|
eb5c508f8b | ||
|
|
f0bad66d41 | ||
|
|
0f9eebdfb1 | ||
|
|
bef6fa37b9 | ||
|
|
32ccc19a62 | ||
|
|
f20dc512e8 | ||
|
|
1f052520ae | ||
|
|
680e801bf2 | ||
|
|
603b3a1606 | ||
|
|
b0795bcfef | ||
|
|
52f49b2a78 | ||
|
|
ca2a4bbded | ||
|
|
321e1148da | ||
|
|
6cb50c49b5 | ||
|
|
1cde77293e | ||
|
|
a1f2be5e69 | ||
|
|
f9b5f23383 | ||
|
|
12dd97c9f8 | ||
|
|
0794c6a941 | ||
|
|
aa54e8d95e | ||
|
|
b771965f28 | ||
|
|
acb1590cf0 | ||
|
|
d2b3d45d76 | ||
|
|
50ac61e17f | ||
|
|
19ab4c9508 | ||
|
|
8d3a73d126 | ||
|
|
a6048518b7 | ||
|
|
4c5788c4c0 | ||
|
|
68e4b1115a | ||
|
|
71f2cec1bd | ||
|
|
4900d39b7d | ||
|
|
478d835392 | ||
|
|
7bac069976 | ||
|
|
cabbd187e7 | ||
|
|
97f8175090 | ||
|
|
413b0525db | ||
|
|
19debab060 | ||
|
|
b017d985ab | ||
|
|
b58a47c373 | ||
|
|
00cc42a607 | ||
|
|
bcb3b57f8d | ||
|
|
4f80d75bf3 | ||
|
|
047a4764f2 | ||
|
|
e69efdd4ce | ||
|
|
8fd3f6cf7f | ||
|
|
c554de7501 | ||
|
|
fa11ac8c85 | ||
|
|
7477d7a036 | ||
|
|
a783f048a3 | ||
|
|
f9f776e407 | ||
|
|
330343505c | ||
|
|
26387252f5 | ||
|
|
e941da205b | ||
|
|
03da22378e | ||
|
|
0d4086e602 | ||
|
|
52e2360e91 | ||
|
|
5559422d32 | ||
|
|
c48be64d9a | ||
|
|
3ce335c6f8 | ||
|
|
a636af13e7 | ||
|
|
696c2c429b | ||
|
|
42613ec536 | ||
|
|
5da272d042 | ||
|
|
23d1f0978e | ||
|
|
a390541e1c | ||
|
|
0a004f8c44 | ||
|
|
c5c6627adb | ||
|
|
d7fe9f7b44 | ||
|
|
7368992ee9 | ||
|
|
d8f9b98c4a | ||
|
|
8bdbcda2b7 | ||
|
|
05520d676c | ||
|
|
0eda6714f3 | ||
|
|
85fd2def9c | ||
|
|
8689cdd4dc | ||
|
|
663e25fd3a | ||
|
|
0871d20adb | ||
|
|
cb3b124df9 | ||
|
|
4a33210771 | ||
|
|
a48c493210 | ||
|
|
463fbb4990 | ||
|
|
c8f09f7fcb | ||
|
|
cd9506e842 | ||
|
|
6076eb5558 | ||
|
|
f1c51c8bb4 | ||
|
|
b38d69287a | ||
|
|
0020dbee23 | ||
|
|
5ff9db7388 | ||
|
|
d57bfec702 | ||
|
|
757929012e | ||
|
|
164719119b | ||
|
|
e12993ed22 | ||
|
|
d9ae837063 | ||
|
|
e3cea888fb | ||
|
|
ae99c1393d | ||
|
|
2221517935 | ||
|
|
1d1da5069c | ||
|
|
6e3c79f31e | ||
|
|
f04d51378f | ||
|
|
e3184753a6 | ||
|
|
d2d1c63b17 | ||
|
|
ecfea5fa69 | ||
|
|
8f2986bc6a | ||
|
|
16e90809a9 | ||
|
|
d2d56494b2 | ||
|
|
763dc8bb76 | ||
|
|
b860c8021e | ||
|
|
d5f497478a | ||
|
|
5f94b98cb2 | ||
|
|
dd2d9a68a7 | ||
|
|
3302e8ddc4 | ||
|
|
f9280374d2 | ||
|
|
7a9e246ccd | ||
|
|
7871dd606e | ||
|
|
516ec4acd0 | ||
|
|
83aec1ec94 | ||
|
|
7ebabf185e | ||
|
|
ce8b9b4181 | ||
|
|
fb89d0ff4e | ||
|
|
d4022becc3 | ||
|
|
f63a4c8f2f | ||
|
|
c72c84b455 | ||
|
|
4ccc141764 | ||
|
|
c0b8cbd85b | ||
|
|
dcf7973c9b | ||
|
|
686837d9ed | ||
|
|
fd66ee57f3 | ||
|
|
191bee2ed0 | ||
|
|
54da64acac | ||
|
|
c263fc54ac | ||
|
|
c088397ec7 | ||
|
|
fabe2206db | ||
|
|
17412389f3 | ||
|
|
ef6565470f | ||
|
|
d52fb4d2e9 | ||
|
|
22371ac527 | ||
|
|
c41d418380 | ||
|
|
859e3252be | ||
|
|
d1040c9ff9 | ||
|
|
e06b7ee368 | ||
|
|
85f454e3ae | ||
|
|
9bf6179d24 | ||
|
|
236c0f8e8b | ||
|
|
2e5f200b3b | ||
|
|
3f91805afb | ||
|
|
8d2b4b7b48 | ||
|
|
0dd2496a56 | ||
|
|
50d56c54a3 | ||
|
|
ddfff55cc7 | ||
|
|
0b74662ce2 | ||
|
|
d665f0ae66 | ||
|
|
bebbe407ee | ||
|
|
0c445239a6 | ||
|
|
d1f94b5d58 | ||
|
|
cbb3a8ab94 | ||
|
|
af13c80d68 | ||
|
|
c5891c14c7 | ||
|
|
7270cd0ade | ||
|
|
8c2e1c6c29 | ||
|
|
8c26c8bbc6 | ||
|
|
84227fd558 | ||
|
|
7ab103c96f | ||
|
|
eacf3d9221 | ||
|
|
89c1c5c35a | ||
|
|
31cbd6d113 | ||
|
|
5f4105d48c | ||
|
|
7f0f11304f | ||
|
|
922e874653 | ||
|
|
cea856cfc2 | ||
|
|
cecd660388 | ||
|
|
8aa5f30082 | ||
|
|
05b35eb57c | ||
|
|
5f400a50be | ||
|
|
faaef1b498 | ||
|
|
6e7f1a3ac1 | ||
|
|
90c5555d6d | ||
|
|
e947d04038 | ||
|
|
be5dd04150 | ||
|
|
8849b9af8b | ||
|
|
c616335019 | ||
|
|
5b68343361 | ||
|
|
7665013ad8 | ||
|
|
f3e902092a | ||
|
|
14ab22dcd4 | ||
|
|
3368e3853a | ||
|
|
8a45191aa9 | ||
|
|
baa20a10c3 | ||
|
|
edcfaf60c9 | ||
|
|
4cd5e64231 | ||
|
|
e4739523d3 | ||
|
|
fe2b044d38 | ||
|
|
39ae1def85 | ||
|
|
2b49cb9227 | ||
|
|
3d495b709e | ||
|
|
86a82e6ecb | ||
|
|
721d8a7298 | ||
|
|
233c872d24 | ||
|
|
c87e6a289c | ||
|
|
beb5259cd1 | ||
|
|
a7c4cb95aa | ||
|
|
120c9a4ebb | ||
|
|
ec73074aac | ||
|
|
60c15d7c28 | ||
|
|
68281b356c | ||
|
|
071d601dcb | ||
|
|
b38a22506b | ||
|
|
38384cc79c | ||
|
|
4851706d35 | ||
|
|
1cb7695fb0 | ||
|
|
3d5d44279b | ||
|
|
2312504b04 | ||
|
|
d5cbe4cb75 | ||
|
|
3940a4dbc7 | ||
|
|
46a531d865 | ||
|
|
9012084d11 | ||
|
|
8dc7c0849e | ||
|
|
3cd717d929 | ||
|
|
6f4d4543b9 | ||
|
|
06fa038875 | ||
|
|
a5a1df68c2 | ||
|
|
3e908023b2 | ||
|
|
7807d11807 | ||
|
|
827d9be48f | ||
|
|
4fa1d4896c | ||
|
|
a817f6b48c | ||
|
|
d570cffa39 | ||
|
|
2cced72d70 | ||
|
|
9c553cd254 | ||
|
|
ba38c697e8 | ||
|
|
19f18c8a1b | ||
|
|
ef0ac7c403 | ||
|
|
9f00f141fe | ||
|
|
592ff1288d | ||
|
|
c97e9f8621 | ||
|
|
3bcee57e3e | ||
|
|
c3e806a2ea | ||
|
|
49272657d7 | ||
|
|
8f0adfbfb2 | ||
|
|
d188ed8ed8 | ||
|
|
ed5dac7e82 | ||
|
|
bd19cf739a | ||
|
|
acab2a159d | ||
|
|
70d3b9aeca | ||
|
|
5b6485481b | ||
|
|
6c6c7b0927 | ||
|
|
d3d63fe553 | ||
|
|
06fd49bda9 | ||
|
|
6274317e63 | ||
|
|
f64d1cb396 | ||
|
|
30397b6fbc | ||
|
|
96e649189f | ||
|
|
8daa149c36 | ||
|
|
3ef70b55e9 | ||
|
|
e0d533dc4e | ||
|
|
dc9e9931eb | ||
|
|
94ece2789d | ||
|
|
3101d53064 | ||
|
|
afff74a835 | ||
|
|
8a0ec60c8f | ||
|
|
f186882c0f | ||
|
|
cbca58401a | ||
|
|
2cc1f14b0c | ||
|
|
b012e963d7 | ||
|
|
6c37a02c0f | ||
|
|
9d03271265 | ||
|
|
e94cf3d9b7 | ||
|
|
e93853623b | ||
|
|
ce6fbd9680 | ||
|
|
317ac50a97 | ||
|
|
5c02fb435d | ||
|
|
962dade155 | ||
|
|
3428196631 | ||
|
|
3ea4e5ccbe | ||
|
|
53905cf919 | ||
|
|
ab023c6a29 | ||
|
|
9fd45406be | ||
|
|
973537f819 | ||
|
|
9d251b1dc5 | ||
|
|
fc715a092c | ||
|
|
33d05ef554 | ||
|
|
a1416612a9 | ||
|
|
13a0b65a80 | ||
|
|
797767da57 | ||
|
|
95c763201f | ||
|
|
76b59b8df7 | ||
|
|
04b60aa490 | ||
|
|
49d7d8534c | ||
|
|
6d8da699b2 | ||
|
|
891214c65b | ||
|
|
cea7905602 | ||
|
|
958c6c6fde | ||
|
|
33c092781e | ||
|
|
d1c8b083b8 | ||
|
|
8b3042f24f | ||
|
|
7e22be3441 | ||
|
|
b9c40320f1 | ||
|
|
117fd629d6 | ||
|
|
0b75f759b4 | ||
|
|
ef1496ca2d | ||
|
|
704da8c823 | ||
|
|
fdf648bcf3 | ||
|
|
9b30f44672 | ||
|
|
1532dbca0a | ||
|
|
f9b4f5f594 | ||
|
|
5fda89fdb5 | ||
|
|
093cc047cd | ||
|
|
62763cc0fb | ||
|
|
d520360cb8 | ||
|
|
3058761806 | ||
|
|
520b0e131c | ||
|
|
3d319d6c3f | ||
|
|
f59e272643 | ||
|
|
5e4bee0f34 | ||
|
|
4950ee5f3b | ||
|
|
d2342319da | ||
|
|
63531b1df5 | ||
|
|
3ea11fe2e6 | ||
|
|
03a48f87e4 | ||
|
|
e337c9130f | ||
|
|
57a60282f5 | ||
|
|
0ece71f8d1 | ||
|
|
3c3ad08868 | ||
|
|
ae0a7e2c37 | ||
|
|
508bfa1de8 | ||
|
|
6a2e0c707c | ||
|
|
836728e5de | ||
|
|
4e34770aba | ||
|
|
1cfebca48d | ||
|
|
9318674cdb | ||
|
|
77ef0053f2 | ||
|
|
8a084cb7e1 | ||
|
|
de8f9e201f | ||
|
|
b1224c3540 | ||
|
|
aa2f5bdd77 | ||
|
|
be71a2e5bc | ||
|
|
ef93ac4452 | ||
|
|
10ef80cf15 | ||
|
|
97d83c87ec | ||
|
|
8d5cec5e0d | ||
|
|
b3cf5ccf6d | ||
|
|
1dce243661 | ||
|
|
30d3ea3d4b | ||
|
|
6b2d2413f7 | ||
|
|
20ea823c19 | ||
|
|
7d75dc1294 | ||
|
|
54209907f3 | ||
|
|
6e2cc98eac | ||
|
|
4921d5ac2d | ||
|
|
d2dfbbe339 | ||
|
|
74d62901c8 | ||
|
|
fad5158ab4 | ||
|
|
e962c44749 | ||
|
|
c5878b6610 | ||
|
|
dda7185b43 | ||
|
|
293f775fa5 | ||
|
|
655f02b695 | ||
|
|
70aa965c26 | ||
|
|
d8962ef415 | ||
|
|
90c814a7ca | ||
|
|
6668c789d3 | ||
|
|
c900134f91 | ||
|
|
f8e2d25739 | ||
|
|
28c5759456 | ||
|
|
16d8602d3c | ||
|
|
6c4c72546c | ||
|
|
eca15cfbf2 | ||
|
|
bf233ea0dc | ||
|
|
f57f2370f1 | ||
|
|
70f7790413 | ||
|
|
9d4913224f | ||
|
|
d4b4cbf5a5 | ||
|
|
6c1665bf46 | ||
|
|
bbb4d6e4c9 | ||
|
|
890f3cc54c | ||
|
|
59a5367433 | ||
|
|
84e30bee6d | ||
|
|
31439293cc | ||
|
|
e3dac1292e | ||
|
|
3a5d379db8 | ||
|
|
2f409116db | ||
|
|
e7bf6afd3a | ||
|
|
542e6b8af4 | ||
|
|
ea5bcc7b88 | ||
|
|
9ea42fdfab | ||
|
|
7d6680b38a | ||
|
|
66b4309f34 | ||
|
|
ba49319c07 | ||
|
|
ac5373427f | ||
|
|
9e3b5a5587 | ||
|
|
f90d81a864 | ||
|
|
97501495eb | ||
|
|
00737f1c13 | ||
|
|
72b96e8121 | ||
|
|
a9dad99432 | ||
|
|
297bcb5c3d | ||
|
|
c0cb66e602 | ||
|
|
ccbcf421e7 | ||
|
|
344f209565 | ||
|
|
af5eeab7cf | ||
|
|
a92780fe5f | ||
|
|
d28da5e5ce | ||
|
|
b6674c9b76 | ||
|
|
ddd072b3fb | ||
|
|
147c2d6f80 | ||
|
|
5532341bf9 | ||
|
|
6933b48a7e | ||
|
|
f77f9ecd8f | ||
|
|
fc76b5f589 | ||
|
|
71a95900fd | ||
|
|
ba36c62caa | ||
|
|
55f124745f | ||
|
|
1c3790a70d | ||
|
|
bb0806c61e | ||
|
|
1c040d8c1e | ||
|
|
ed1cfb5245 | ||
|
|
91b1d17e5b | ||
|
|
ae7c30a0f3 | ||
|
|
eb5a95d26b | ||
|
|
c25c40a3f9 | ||
|
|
6bc7e3429f | ||
|
|
8f838c722d | ||
|
|
a003c36de5 | ||
|
|
d8bf370fd6 | ||
|
|
a723225179 | ||
|
|
b94cace547 | ||
|
|
9079ad5ceb | ||
|
|
fd37a21b59 | ||
|
|
7705012ee7 | ||
|
|
98bd3e1f34 | ||
|
|
40e05f4109 | ||
|
|
14a86de115 | ||
|
|
5814d16b58 | ||
|
|
3cda854ef3 | ||
|
|
ab716125d7 | ||
|
|
2e94c75729 | ||
|
|
2fe669448f | ||
|
|
fada4cb6c4 | ||
|
|
6a3e1734e6 | ||
|
|
4e0d62547d | ||
|
|
420dd78fb7 | ||
|
|
14fcc2510e | ||
|
|
bc7d84b75c | ||
|
|
add7abc1de | ||
|
|
b309781f2d | ||
|
|
69d0201d4c | ||
|
|
11971fb302 | ||
|
|
02dea4ce58 | ||
|
|
7e0d5b8665 | ||
|
|
2d9a20529d | ||
|
|
733a07e061 | ||
|
|
65775b87e5 | ||
|
|
e0f9b1a699 | ||
|
|
91cfce3758 | ||
|
|
8a69070b51 | ||
|
|
6fdd5bfe2d | ||
|
|
608bb0dfef | ||
|
|
efc3241541 | ||
|
|
49efec2ef1 | ||
|
|
07e0732a10 | ||
|
|
9ca79df802 | ||
|
|
585259ef08 | ||
|
|
97bbce92a8 | ||
|
|
ce86d39c70 | ||
|
|
4f93d30790 | ||
|
|
da849aea78 | ||
|
|
dbce360566 | ||
|
|
c86259c671 | ||
|
|
deaa79ca9e | ||
|
|
87e0c17707 | ||
|
|
80bf3934af | ||
|
|
8ec6e42e34 | ||
|
|
4df87631ed | ||
|
|
9c8d7d34b3 | ||
|
|
8766401777 | ||
|
|
9f8acbfe3e | ||
|
|
175f3f992a | ||
|
|
0fa57cac3f | ||
|
|
5f6e9e6ab9 | ||
|
|
7ad36d3d75 | ||
|
|
881fcb7def | ||
|
|
7ae55f6248 | ||
|
|
0a9c98e7c4 | ||
|
|
9bc5098dd8 | ||
|
|
3e30de7430 | ||
|
|
486ab82c02 | ||
|
|
10750421a3 | ||
|
|
9500ba2ff5 | ||
|
|
13960b3b86 | ||
|
|
7dc5ebc929 | ||
|
|
8b70477556 | ||
|
|
04845c1898 | ||
|
|
9c79fd6308 | ||
|
|
f3c21524be | ||
|
|
08ebcdb0b8 | ||
|
|
f06772a088 | ||
|
|
5c23b4aa56 | ||
|
|
8a32ee7dd2 | ||
|
|
89a003c6fc | ||
|
|
bbffe16f13 | ||
|
|
06661708b4 | ||
|
|
81ff5eaba0 | ||
|
|
899d521ab4 | ||
|
|
27b3f23ff3 | ||
|
|
71f42f185a | ||
|
|
56f60a04d9 | ||
|
|
85646b157c | ||
|
|
31e0704c8d | ||
|
|
7eda9364fd | ||
|
|
780630d7c0 | ||
|
|
af778f09d5 | ||
|
|
de63b60748 | ||
|
|
80024c023a | ||
|
|
d2e4f2d376 | ||
|
|
1667a29c88 | ||
|
|
efa7873ae1 | ||
|
|
65079b1106 | ||
|
|
98cb4f74b2 | ||
|
|
f8d49e0a30 | ||
|
|
72d380acf0 | ||
|
|
68a4f897b4 | ||
|
|
43acd99bb3 | ||
|
|
b7457a0a5d | ||
|
|
c77444a821 | ||
|
|
ccc56e6dd4 | ||
|
|
1636f535ba | ||
|
|
fac55bc78b | ||
|
|
4433f53f72 | ||
|
|
9920e219dd | ||
|
|
a1c4585a39 | ||
|
|
9b6e89457c | ||
|
|
7ecd9b3f1a | ||
|
|
c6ba50b7e2 | ||
|
|
0b2b2daf23 | ||
|
|
58dac970af | ||
|
|
c4eaf195b5 | ||
|
|
d975bd8e5c | ||
|
|
7701ea2798 | ||
|
|
54cedfe432 | ||
|
|
94a46867ed | ||
|
|
c4c4c3696e | ||
|
|
0f3314c04c | ||
|
|
d834a2c3da | ||
|
|
e80e04c5fd | ||
|
|
309f440fc0 | ||
|
|
db5ea850f6 | ||
|
|
20e3de1f0a | ||
|
|
335c1b4420 | ||
|
|
a97a887ea4 | ||
|
|
e40acda6c8 | ||
|
|
e7be131b89 | ||
|
|
fd4a059e9b | ||
|
|
2f454843d8 | ||
|
|
a573b5767b | ||
|
|
5c04d768a6 | ||
|
|
4bf1598930 | ||
|
|
07b4889eab | ||
|
|
7a3bb266eb | ||
|
|
f34cc6b469 | ||
|
|
9b9e2a8c71 | ||
|
|
2fbbc13c71 | ||
|
|
35bf75a77a | ||
|
|
ba31b31ed0 | ||
|
|
fe034dc3e4 | ||
|
|
f505c1d0a4 | ||
|
|
04a68db195 | ||
|
|
e2a521742a | ||
|
|
956225f0e1 | ||
|
|
4fefd05839 | ||
|
|
7d917e7c5c | ||
|
|
5693870fe2 | ||
|
|
18ed68cd31 | ||
|
|
4d712ddaae | ||
|
|
dd544f811a | ||
|
|
e0b287961f | ||
|
|
0f5fb6f190 | ||
|
|
add47befac | ||
|
|
0e36994fe7 | ||
|
|
3ea72eeabb | ||
|
|
4c2a51b1b5 | ||
|
|
46d990419b | ||
|
|
69b5ddceda | ||
|
|
1a2cbbc8c1 | ||
|
|
f35eb8819c | ||
|
|
6df969894c | ||
|
|
e442c2a3f9 | ||
|
|
37815f3402 | ||
|
|
a1cd3b5b88 | ||
|
|
d3f33acc1a | ||
|
|
898fa637c3 | ||
|
|
8cbd0d3b5f | ||
|
|
8198062610 | ||
|
|
80e4068b3e | ||
|
|
1379ae4310 | ||
|
|
7bd48d383d | ||
|
|
f6f6ef1532 | ||
|
|
689514a40a | ||
|
|
40873504dc | ||
|
|
fce9e499e4 | ||
|
|
80b5a95bb8 | ||
|
|
06e351f1ef | ||
|
|
4423630f1e | ||
|
|
5caae0293a | ||
|
|
49baf090cd | ||
|
|
c8c608acc8 | ||
|
|
3d053b194a | ||
|
|
8180c72cbc | ||
|
|
2fdd535302 | ||
|
|
1f7a0cf892 | ||
|
|
83929c69e3 | ||
|
|
87590491b5 | ||
|
|
107a0a4905 | ||
|
|
62dd83f473 | ||
|
|
84b0a23e19 | ||
|
|
7ec1a3fcad | ||
|
|
028a87fe37 | ||
|
|
01c4bb4a5e | ||
|
|
2f0011c605 | ||
|
|
393a782858 | ||
|
|
7f61de8f57 | ||
|
|
e99341d7df | ||
|
|
efd4810851 | ||
|
|
92a8d7ce6c | ||
|
|
d6eff8ebcf | ||
|
|
af2d20c5fa | ||
|
|
47a9e48f46 | ||
|
|
94c417c90c | ||
|
|
ce3e265575 | ||
|
|
b2fefe3e3f | ||
|
|
2084e08ad7 | ||
|
|
9568718add | ||
|
|
6a70349512 | ||
|
|
0ad8046582 | ||
|
|
ad38450f9c | ||
|
|
c8f3bb56ff | ||
|
|
59851ceee6 | ||
|
|
044979066c | ||
|
|
776d62b9c6 | ||
|
|
ae9362636e | ||
|
|
48134af616 | ||
|
|
fc1ac25935 | ||
|
|
0f1a3f8ed2 | ||
|
|
8c20610293 | ||
|
|
d5ed92cf38 | ||
|
|
6478617c93 | ||
|
|
0c5850237e | ||
|
|
9e37d24624 | ||
|
|
44c86cedcf | ||
|
|
cfca9e1e81 | ||
|
|
5b9ca6e35f | ||
|
|
862caa72a8 | ||
|
|
2d9b69c186 | ||
|
|
e9c9a74e0a | ||
|
|
b80ea00265 | ||
|
|
d2e17f4ffb | ||
|
|
1abb70cc73 | ||
|
|
946e06eb58 | ||
|
|
66692f90e3 | ||
|
|
a964431c21 | ||
|
|
496a8a4f7c | ||
|
|
24056dc98b | ||
|
|
6772c9d2b6 | ||
|
|
e3dbd79543 | ||
|
|
d9c48e70a9 | ||
|
|
51bb311565 | ||
|
|
f4e30664e6 | ||
|
|
44d523518a | ||
|
|
8c39392eaa | ||
|
|
884410501e | ||
|
|
a87d7a1296 | ||
|
|
f0152790cf | ||
|
|
8452c0869d | ||
|
|
20e748205e | ||
|
|
649d45a2d4 | ||
|
|
0ae861d7d7 | ||
|
|
511481e8d9 | ||
|
|
1676e70dfe | ||
|
|
46b5fe5acd | ||
|
|
089f5403a7 | ||
|
|
1597e33549 | ||
|
|
121c6b4835 | ||
|
|
a764eb5dc7 | ||
|
|
d22bdb5095 | ||
|
|
a2aadb78a9 | ||
|
|
71adb37fa8 | ||
|
|
6591f8a592 | ||
|
|
3724a38ab4 | ||
|
|
54e6c26def | ||
|
|
0907d5d69e | ||
|
|
53d3f46add | ||
|
|
d657b76dba | ||
|
|
253e2ed699 | ||
|
|
1121919b57 | ||
|
|
61ce884336 | ||
|
|
71fdc24f5c | ||
|
|
aa51b83fdc | ||
|
|
b321c0a932 | ||
|
|
3f901d313b | ||
|
|
67cfe34e67 | ||
|
|
643cc7a0ee | ||
|
|
b3cb99036c | ||
|
|
9602227eb6 | ||
|
|
5e103f2b2e | ||
|
|
d49d44923d | ||
|
|
cbe0841bc9 | ||
|
|
596af3f600 | ||
|
|
8f0d6d6b5c | ||
|
|
a08360e3cd | ||
|
|
06f639b8f3 | ||
|
|
ba3dfe4121 | ||
|
|
67cfac0cf1 | ||
|
|
8ad8bd6282 | ||
|
|
045a44b1af | ||
|
|
d321d23afe | ||
|
|
e3f60ce06f | ||
|
|
4b96a78039 | ||
|
|
19a5e606b3 | ||
|
|
a18f4964cf | ||
|
|
f5c310d9d4 | ||
|
|
a6c93ce875 | ||
|
|
1b8f91a0db | ||
|
|
7371c7662a | ||
|
|
f3a4860635 | ||
|
|
43c303e27a | ||
|
|
e51be5f4a7 | ||
|
|
59f683066a | ||
|
|
b19e564317 | ||
|
|
e881f35fbb | ||
|
|
59a841d69c | ||
|
|
e7439efc74 | ||
|
|
0054afd39b | ||
|
|
7f699fca9a | ||
|
|
e5e951d92c | ||
|
|
5a653ef96f | ||
|
|
165f193f78 | ||
|
|
6eecbc95e4 | ||
|
|
a9f4d7a29c | ||
|
|
c54e0953d0 | ||
|
|
b575bf2524 | ||
|
|
30f59370d3 | ||
|
|
73491cceed | ||
|
|
28c7bb99bf | ||
|
|
551727cd19 | ||
|
|
bde26a8282 | ||
|
|
11c4a2cfd0 | ||
|
|
93b930b937 | ||
|
|
b53b871669 | ||
|
|
0a29842caf | ||
|
|
49fbe0ddb4 | ||
|
|
46fea74726 | ||
|
|
69b551c516 | ||
|
|
fa0621b486 | ||
|
|
84a1a0a729 | ||
|
|
b891291135 | ||
|
|
d8d6e8a304 | ||
|
|
e3c1466047 | ||
|
|
df30b1c832 | ||
|
|
3d3e0ea4f3 | ||
|
|
c7a457f9ee | ||
|
|
31bf25d05e | ||
|
|
eecaa3d9dd | ||
|
|
e38e8ae987 | ||
|
|
6dbe25360e | ||
|
|
6483470ec5 | ||
|
|
83fad75e22 | ||
|
|
7cd44c1a81 | ||
|
|
f8b6bc8d11 | ||
|
|
0020afaf67 | ||
|
|
b8b4517211 | ||
|
|
824d7190c2 | ||
|
|
30d64444a0 | ||
|
|
9904700dfd | ||
|
|
49dbae65c9 | ||
|
|
b056c243e4 | ||
|
|
c00158b238 | ||
|
|
794419852b | ||
|
|
fbafd22124 | ||
|
|
b9cd66d510 | ||
|
|
b310efc50f | ||
|
|
0fdf883cbd | ||
|
|
1382dc976c | ||
|
|
54e4dcf454 | ||
|
|
f6b1344722 | ||
|
|
5ffd59e7b8 | ||
|
|
0889b5aef1 | ||
|
|
59ca92b10b | ||
|
|
956f337046 | ||
|
|
a6a6bf007a | ||
|
|
2e9890bbe6 | ||
|
|
f2427a7320 | ||
|
|
2a6dbd068e | ||
|
|
d092977f4a | ||
|
|
e3f229225c | ||
|
|
ee9d46c825 | ||
|
|
dbd8c400ce | ||
|
|
29a740ec8c | ||
|
|
c2d3afdeee | ||
|
|
9155c9ee37 | ||
|
|
0d1d437bd3 | ||
|
|
b15f20520f | ||
|
|
172e2f4e76 | ||
|
|
23cd1b1954 | ||
|
|
cade14c58c | ||
|
|
1e222d52e6 | ||
|
|
f9ae9afaac | ||
|
|
09bbfc1d56 | ||
|
|
79511ecce2 | ||
|
|
2fe75a62be | ||
|
|
da414fd509 | ||
|
|
f2891e7738 | ||
|
|
fbefa8273b | ||
|
|
ceccfe02d0 | ||
|
|
129de26032 | ||
|
|
43a6fa1d01 | ||
|
|
cc8246206d | ||
|
|
551696bb45 | ||
|
|
ded16d3529 | ||
|
|
2e6dce434f | ||
|
|
9888f95068 | ||
|
|
8bbb88ea4e | ||
|
|
69d83e1548 | ||
|
|
d3e7a52933 | ||
|
|
aa695e92f7 | ||
|
|
0ddd1ce0b7 | ||
|
|
cc18ab12f8 | ||
|
|
2c3f6aaa87 | ||
|
|
5dedacca3c | ||
|
|
ad2f0a1290 | ||
|
|
bd3b9f79c2 | ||
|
|
ed148eba32 | ||
|
|
06f41bb017 | ||
|
|
a27d33cb63 | ||
|
|
22c325aa5a | ||
|
|
ac2fcbe224 | ||
|
|
63b6b9cdce | ||
|
|
de55110247 | ||
|
|
b9d22aa821 | ||
|
|
de927adf27 | ||
|
|
79395bc7db | ||
|
|
c81f37cf82 | ||
|
|
25b4160434 | ||
|
|
32c464ad1f | ||
|
|
d5aceb6d95 | ||
|
|
81f7e9b462 | ||
|
|
8383bde768 | ||
|
|
d114713694 | ||
|
|
cad2bf5b08 | ||
|
|
247c66b3fe | ||
|
|
73c2162ff6 | ||
|
|
889ce36afa | ||
|
|
c3d4b66953 | ||
|
|
234b29cf66 | ||
|
|
31827b0286 | ||
|
|
df121a7cd0 | ||
|
|
03df03b269 | ||
|
|
f1522e6204 | ||
|
|
87bce90086 | ||
|
|
4a29a7f92c | ||
|
|
0149265ee8 | ||
|
|
0844e5951c | ||
|
|
251d1b8fbb | ||
|
|
7f0f5060ec | ||
|
|
d179f2cce9 | ||
|
|
5d0778014d | ||
|
|
4c10826caa | ||
|
|
873c9098d8 | ||
|
|
6ce5080049 | ||
|
|
b9546d12f2 | ||
|
|
a49c524c9e | ||
|
|
b7f1fc116e | ||
|
|
28aa8010b2 | ||
|
|
c09eb00031 | ||
|
|
1113b3b6eb | ||
|
|
a81a16f22f | ||
|
|
8428b25939 |
28
.gitignore
vendored
28
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
.project
|
||||
.settings
|
||||
.gitignore
|
||||
*.csproj
|
||||
*.csproj.user
|
||||
*.build
|
||||
@@ -10,6 +11,7 @@
|
||||
*.pidb
|
||||
*.dll.build
|
||||
*.dll
|
||||
*.log
|
||||
*.VisualState.xml
|
||||
*/*/obj
|
||||
*/*/*/obj
|
||||
@@ -23,17 +25,13 @@
|
||||
*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/*/bin
|
||||
addon-modules/
|
||||
bin/Debug/*.dll
|
||||
bin/*.dll.mdb
|
||||
bin/*.db
|
||||
bin/*.db-journal
|
||||
bin/addin-db-*
|
||||
bin/*.dll
|
||||
bin/OpenSim.vshost.exe.config
|
||||
bin/OpenSim.32BitLaunch.vshost.exe.config
|
||||
bin/OpenSim.32BitLaunch.log
|
||||
UpgradeLog.XML
|
||||
_UpgradeReport_Files/
|
||||
bin/ScriptEngines/*-*-*-*-*
|
||||
bin/ScriptEngines/*.dll
|
||||
bin/ScriptEngines/*/*.dll
|
||||
@@ -46,8 +44,6 @@ bin/Physics*
|
||||
bin/Terrain*
|
||||
bin/Regions/*
|
||||
bin/UserAssets
|
||||
bin/assetcache
|
||||
bin/maptiles
|
||||
bin/estate_settings.xml
|
||||
bin/config-include/CenomeCache.ini
|
||||
bin/config-include/FlotsamCache.ini
|
||||
@@ -77,20 +73,4 @@ TAGS
|
||||
Makefile.local
|
||||
bin/.version
|
||||
compile.bat
|
||||
addon-modules
|
||||
OpenSim/Data/Tests/test-results/
|
||||
OpenSim/Framework/Serialization/Tests/test-results/
|
||||
OpenSim/Framework/Servers/Tests/test-results/
|
||||
OpenSim/Framework/Tests/test-results/
|
||||
OpenSim/Region/ClientStack/Linden/Caps/test-results/
|
||||
OpenSim/Region/ClientStack/Linden/UDP/Tests/test-results/
|
||||
OpenSim/Region/CoreModules/test-results/
|
||||
OpenSim/Region/Framework/test-results/
|
||||
OpenSim/Region/OptionalModules/test-results/
|
||||
OpenSim/Region/Physics/BulletDotNETPlugin/
|
||||
OpenSim/Region/Physics/Manager/test-results/
|
||||
OpenSim/Region/Physics/OdePlugin/Tests/test-results/
|
||||
OpenSim/Region/ScriptEngine/test-results/
|
||||
OpenSim/Tests/Common/test-results/
|
||||
OpenSim/Tests/test-results/
|
||||
test-results/
|
||||
|
||||
|
||||
@@ -2,37 +2,12 @@
|
||||
<!-- please leave the top comment for us emacs folks -->
|
||||
<property name="nunitcmd" value="nunit-console" />
|
||||
|
||||
<!-- 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 -->
|
||||
<property name="distbindir" value="distbin" />
|
||||
<target name="distbin">
|
||||
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
|
||||
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
|
||||
<delete dir="${distbindir}"/>
|
||||
<copy todir="${distbindir}">
|
||||
<fileset>
|
||||
@@ -62,8 +37,52 @@
|
||||
<include name=".hgignore"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
|
||||
</target>
|
||||
|
||||
<!-- I don't think these targets are being actively used. But just in case, we'll just comment them out for now - justincc -->
|
||||
<!--
|
||||
<property name="projectdir" value="opensim-0.6.9" />
|
||||
<target name="dist" depends="distdir">
|
||||
<zip zipfile="${projectdir}.zip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</zip>
|
||||
<tar destfile="${projectdir}.tar.gz" compression="GZip">
|
||||
<fileset basedir=".">
|
||||
<include name="${projectdir}/**" />
|
||||
</fileset>
|
||||
</tar>
|
||||
</target>
|
||||
|
||||
<target name="distdir">
|
||||
<delete dir="${projectdir}" />
|
||||
<copy todir="${projectdir}">
|
||||
<fileset basedir=".">
|
||||
<include name="ThirdPartyLicenses/**" />
|
||||
<include name="CONTRIBUTORS.txt" />
|
||||
<include name="README" />
|
||||
<include name="OpenSim/**/*.cs" />
|
||||
<include name="**/*.build" />
|
||||
<include name="**/*.csproj" />
|
||||
<include name="**/*.csproj.user" />
|
||||
<include name="**/*.sln" />
|
||||
<include name="bin/*.dll" />
|
||||
<include name="bin/*.so" />
|
||||
<include name="bin/*.config" />
|
||||
<include name="bin/assets/**" />
|
||||
<include name="bin/data/**" />
|
||||
<include name="bin/OpenSim*xml" />
|
||||
<include name="bin/OpenSim.ini" />
|
||||
<include name="bin/defaultstripe.png" />
|
||||
<exclude name="bin/OpenSim.*dll" />
|
||||
</fileset>
|
||||
</copy>
|
||||
<touch file="${projectdir}/bin/startup_commands.txt" />
|
||||
</target>
|
||||
-->
|
||||
|
||||
<target name="test" depends="build, find-nunit">
|
||||
<setenv name="MONO_THREADS_PER_CPU" value="100" />
|
||||
|
||||
@@ -92,15 +111,12 @@
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.serialization.tests)==0}" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindencaps.tests">
|
||||
<arg value="./bin/OpenSim.Region.ClientStack.LindenCaps.Tests.dll" />
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindencaps.tests)==0}" />
|
||||
|
||||
<!--
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
|
||||
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" />
|
||||
-->
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.scriptengine.tests">
|
||||
<arg value="./bin/OpenSim.Region.ScriptEngine.Tests.dll" />
|
||||
@@ -112,11 +128,6 @@
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.optionalmodules.tests">
|
||||
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.region.framework.tests">
|
||||
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
|
||||
</exec>
|
||||
@@ -127,34 +138,106 @@
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.capabilities.handlers.tests">
|
||||
<arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" />
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
|
||||
|
||||
<delete dir="%temp%"/>
|
||||
|
||||
</target>
|
||||
|
||||
<target name="test-stress" depends="build, find-nunit">
|
||||
<setenv name="MONO_THREADS_PER_CPU" value="100" />
|
||||
<target name="test-cov" depends="build">
|
||||
<!-- Code Coverage Test. Prototype, only works with mono 1.2. Instructions in http://opensimulator.org/wiki/Automated_Testing -->
|
||||
<mkdir dir="cov" failonerror="false" />
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Framework.Servers.cov,+[OpenSim.Framework.Servers]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Framework.Servers.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Framework.Servers" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Framework.Servers ./cov/OpenSim.Framework.Servers.cov" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.stress">
|
||||
<arg value="./bin/OpenSim.Tests.Stress.dll" />
|
||||
</exec>
|
||||
<!--
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.ClientStack.LindenUDP.cov,+[OpenSim.Region.ClientStack.LindenUDP]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Region.ClientStack.LindenUDP" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Region.ClientStack.LindenUDP ./cov/OpenSim.Region.ClientStack.LindenUDP.cov" />
|
||||
</exec>
|
||||
-->
|
||||
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.ScriptEngine.Shared.cov,+[OpenSim.Region.ScriptEngine.Shared]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Region.ScriptEngine.Shared.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Region.ScriptEngine.Shared" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Region.ScriptEngine.Shared ./cov/OpenSim.Region.ScriptEngine.Shared.cov" />
|
||||
</exec>
|
||||
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools.cov,+[OpenSim.Region.ScriptEngine.Shared.CodeTools]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools ./cov/OpenSim.Region.ScriptEngine.Shared.CodeTools.cov" />
|
||||
</exec>
|
||||
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.CoreModules.cov,+[OpenSim.Region.CoreModules]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Region.CoreModules.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Region.CoreModules" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Region.CoreModules ./cov/OpenSim.Region.CoreModules.cov" />
|
||||
</exec>
|
||||
|
||||
<fail message="Failures reported in stress tests." unless="${int::parse(testresult.opensim.tests.stress)==0}" />
|
||||
<delete dir="%temp%"/>
|
||||
</target>
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Region.Framework.cov,+[OpenSim.Region.Framework]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Region.Framework" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Region.Framework ./cov/OpenSim.Region.Framework.cov" />
|
||||
</exec>
|
||||
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Data.SQLite.cov,+[OpenSim.Data.SQLite]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Data.SQLite.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Data.SQLite" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Data.SQLite ./cov/OpenSim.Data.SQLite.cov" />
|
||||
</exec>
|
||||
|
||||
<exec program="mono">
|
||||
<arg value="--debug" />
|
||||
<arg value="--profile=monocov:outfile=./cov/OpenSim.Data.MySQL.cov,+[OpenSim.Data.MySQL.Tests]" />
|
||||
<arg value="/usr/lib/nunit/nunit-console.exe" />
|
||||
<arg value="./bin/OpenSim.Data.MySQL.Tests.dll" />
|
||||
</exec>
|
||||
<delete dir="./cov/OpenSim.Data.MySQL" />
|
||||
<exec program="monocov">
|
||||
<arg value="--export-html=./cov/OpenSim.Data.MySQL ./cov/OpenSim.Data.MySQL.cov" />
|
||||
</exec>
|
||||
|
||||
<target name="test-perf" depends="build, find-nunit">
|
||||
<setenv name="MONO_THREADS_PER_CPU" value="100" />
|
||||
<delete file="C:\NUnitPrimaryTrace.txt" failonerror="false" />
|
||||
<delete file="TestResult.xml" failonerror="false" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests.performance">
|
||||
<arg value="./bin/OpenSim.Tests.Performance.dll" />
|
||||
</exec>
|
||||
|
||||
<fail message="Failures reported in performance tests." unless="${int::parse(testresult.opensim.tests.performance)==0}" />
|
||||
<delete dir="%temp%"/>
|
||||
</target>
|
||||
|
||||
<target name="find-nunit">
|
||||
@@ -167,12 +250,15 @@
|
||||
if="${int::parse(hasnunit2)==0}" />
|
||||
<property name="nunitcmd" value="nunit-console"
|
||||
if="${int::parse(hasnunit2)==1}" />
|
||||
|
||||
</target>
|
||||
|
||||
<!-- this is used for panda test execution -->
|
||||
<!-- work in progress -->
|
||||
|
||||
<target name="test-xml" depends="build, find-nunit">
|
||||
|
||||
|
||||
<mkdir dir="test-results" failonerror="false" />
|
||||
<!-- Unit Test Assembly -->
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.tests">
|
||||
@@ -195,15 +281,12 @@
|
||||
<arg value="-xml=test-results/OpenSim.Framework.Servers.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.clientstack.lindencaps.tests">
|
||||
<arg value="./bin/OpenSim.Region.ClientStack.LindenCaps.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Region.ClientStack.LindenCaps.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<!--
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.clientstack.lindenudp.tests">
|
||||
<arg value="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Region.ClientStack.LindenUDP.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
-->
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.scriptengine.tests">
|
||||
<arg value="./bin/OpenSim.Region.ScriptEngine.Tests.dll" />
|
||||
@@ -215,11 +298,6 @@
|
||||
<arg value="-xml=test-results/OpenSim.Region.CoreModules.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.optionalmodules.tests">
|
||||
<arg value="./bin/OpenSim.Region.OptionalModules.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Region.OptionalModules.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.region.framework.tests">
|
||||
<arg value="./bin/OpenSim.Region.Framework.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Region.Framework.Tests.dll-Results.xml" />
|
||||
@@ -230,22 +308,43 @@
|
||||
<arg value="-xml=test-results/OpenSim.Data.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.capabilities.handlers.tests">
|
||||
<arg value="./bin/OpenSim.Capabilities.Handlers.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Capabilities.Handlers.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.framework.servers.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" />
|
||||
<!-- <fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.clientstack.lindenudp.tests)==0}" /> -->
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.scriptengine.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.coremodules.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.optionalmodules.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.region.framework.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.data.tests)==0}" />
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.capabilities.handlers.tests)==0}" />
|
||||
|
||||
</target>
|
||||
<!-- <exec program="nunit-console.exe" failonerror="false" resultproperty="testresult.acceptancetestassembly"> -->
|
||||
<!-- <arg value="AcceptanceTestAssembly.dll" /> -->
|
||||
<!-- <arg value="/xml=AcceptanceTestAssembly-Results.xml" /> -->
|
||||
<!-- </exec> -->
|
||||
|
||||
<!-- <fail message="Failures reported in unit tests." unless="${int::parse(testresult.unittestassembly)==0}" /> -->
|
||||
<!-- <fail message="Failures reported in acceptance tests." unless="${int::parse(testresult.acceptancetestassembly)==0}" /> -->
|
||||
<!-- </target> -->
|
||||
|
||||
|
||||
|
||||
<!-- <nunit2 failonerror="true" verbose="true"> -->
|
||||
<!-- <formatter type="Xml" usefile="true" extension=".xml" outputdir="./test-results" /> -->
|
||||
<!-- <test> -->
|
||||
<!-- <assemblies> -->
|
||||
<!-- <include name="./bin/OpenSim.Framework.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Framework.Servers.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Region.ClientStack.LindenUDP.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Region.ScriptEngine.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Region.CoreModules.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Region.Framework.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Data.SQLite.Tests.dll" /> -->
|
||||
<!-- <include name="./bin/OpenSim.Data.MySQL.Tests.dll" /> -->
|
||||
<!-- </assemblies> -->
|
||||
<!-- </test> -->
|
||||
<!-- </nunit2> -->
|
||||
<!-- </target> -->
|
||||
|
||||
<target name="doxygen">
|
||||
<exec program="doxygen" workingdir="doc" commandline="doxygen.conf" />
|
||||
|
||||
13
BUILDING.txt
13
BUILDING.txt
@@ -12,27 +12,18 @@ Steps:
|
||||
=== Building on Linux ===
|
||||
|
||||
Prereqs:
|
||||
* Mono >= 2.4.3
|
||||
* Mono >= 2.4.2
|
||||
* Nant >= 0.85
|
||||
* On some Linux distributions you may need to install additional packages.
|
||||
See http://opensimulator.org/wiki/Dependencies for more information.
|
||||
|
||||
* May also use xbuild (included in mono distributions)
|
||||
* May use Monodevelop, a cross-platform IDE
|
||||
|
||||
From the distribution type:
|
||||
* ./runprebuild.sh
|
||||
* nant (or xbuild)
|
||||
* nant
|
||||
* cd bin
|
||||
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
|
||||
* run mono OpenSim.exe
|
||||
|
||||
=== Using Monodevelop ===
|
||||
|
||||
From the distribution type:
|
||||
* ./runprebuild.sh
|
||||
* type monodevelop OpenSim.sln
|
||||
|
||||
=== References ===
|
||||
|
||||
Helpful resources:
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
<<<>>>>The following people have contributed to OpenSim (Thank you
|
||||
The following people have contributed to OpenSim (Thank you
|
||||
for your effort!)
|
||||
|
||||
Add your name in here if you have committed to OpenSim
|
||||
|
||||
= Current OpenSim Developers (in very rough order of appearance) =
|
||||
These folks represent the current core team for OpenSim, and are the
|
||||
people that make the day to day of OpenSim happen.
|
||||
|
||||
* justincc (OSVW Consulting, justincc.org)
|
||||
* chi11ken (Genkii)
|
||||
* dahlia
|
||||
* Melanie Thielker
|
||||
* Diva (Crista Lopes, University of California, Irvine)
|
||||
* Dan Lake (Intel)
|
||||
* Marck
|
||||
* Mic Bowman (Intel)
|
||||
* BlueWall (James Hughes)
|
||||
* Nebadon Izumi (Michael Cerquoni, OSgrid)
|
||||
* Snoopy Pfeffer
|
||||
* Richard Adams (Intel)
|
||||
|
||||
= Core Developers Following the White Rabbit =
|
||||
Core developers who have temporarily (we hope) gone chasing the white rabbit.
|
||||
They are in all similar to the active core developers, except that they haven't
|
||||
been that active lately, so their voting rights are awaiting their come back.
|
||||
|
||||
* MW (Tribal Media AB)
|
||||
* Adam Frisby (DeepThink Pty Ltd)
|
||||
* MingChen (DeepThink Pty Ltd)
|
||||
* lbsa71 (Tribal Media AB)
|
||||
* Sean Dague / sdague (IBM)
|
||||
* Tedd
|
||||
* justincc
|
||||
* Teravus (w3z)
|
||||
* Johan Berntsson (3Di)
|
||||
* Ckrinke (Charles Krinke)
|
||||
* chi11ken (Genkii)
|
||||
* adjohn (Genkii)
|
||||
* Dr Scofield aka Dirk Husemann (IBM Research - Zurich)
|
||||
* dahlia
|
||||
* mikem (3Di)
|
||||
* Melanie Thielker
|
||||
* Homer_Horwitz
|
||||
* idb (Ian Brown)
|
||||
* Diva (Crista Lopes, University of California, Irvine)
|
||||
* nlin (3Di)
|
||||
* Arthur Rodrigo S Valadares (IBM)
|
||||
* John Hurliman
|
||||
|
||||
|
||||
= Past Open Sim Developers =
|
||||
These folks are alumns of the OpenSim core group, but are now
|
||||
@@ -49,12 +44,6 @@ where we are today.
|
||||
* Dalien
|
||||
* Darok
|
||||
* Alondria
|
||||
* Sean Dague / sdague (IBM)
|
||||
* Tedd
|
||||
* MingChen (DeepThink Pty Ltd)
|
||||
* adjohn (Genkii)
|
||||
* idb (Ian Brown)
|
||||
* Johan Berntsson (3Di)
|
||||
|
||||
|
||||
= Additional OpenSim Contributors =
|
||||
@@ -71,7 +60,6 @@ what it is today.
|
||||
* CharlieO
|
||||
* ChrisDown
|
||||
* Chris Yeoh (IBM)
|
||||
* controlbreak
|
||||
* coyled
|
||||
* Daedius
|
||||
* Dong Jun Lan (IBM)
|
||||
@@ -81,18 +69,12 @@ what it is today.
|
||||
* dmiles (Daxtron Labs)
|
||||
* dslake (Intel)
|
||||
* FredoChaplin
|
||||
* Garmin Kawaguichi
|
||||
* Gerhard
|
||||
* Godfrey
|
||||
* Grumly57
|
||||
* GuduleLapointe
|
||||
* Ewe Loon
|
||||
* Fernando Oliveira
|
||||
* Fly-Man
|
||||
* Flyte Xevious
|
||||
* Garmin Kawaguichi
|
||||
* Gryc Ueusp
|
||||
* Hiro Lecker
|
||||
* Imaze Rhiano
|
||||
* Intimidated
|
||||
* Jeremy Bongio (IBM)
|
||||
@@ -110,8 +92,6 @@ what it is today.
|
||||
* lulurun
|
||||
* M.Igarashi
|
||||
* maimedleech
|
||||
* Mana Janus
|
||||
* MarcelEdward
|
||||
* Mic Bowman
|
||||
* Michelle Argus
|
||||
* Michael Cortez (The Flotsam Project, http://osflotsam.org/)
|
||||
@@ -122,15 +102,10 @@ what it is today.
|
||||
* Misterblue (Intel)
|
||||
* Mircea Kitsune
|
||||
* mpallari
|
||||
* MrMonkE
|
||||
* Nebadon Izumi (Michael Cerquoni - http://OSgrid.org)
|
||||
* Neil Canham
|
||||
* nornalbion
|
||||
* Omar Vera Ustariz (IBM)
|
||||
* openlifegrid.com
|
||||
* Oren Hurvitz (Kitely)
|
||||
* otakup0pe
|
||||
* Pixel Tomsen
|
||||
* ralphos
|
||||
* RemedyTomm
|
||||
* Revolution
|
||||
@@ -141,15 +116,9 @@ what it is today.
|
||||
* Ruud Lathorp
|
||||
* SachaMagne
|
||||
* Salahzar Stenvaag
|
||||
* satguru p srivastava
|
||||
* sempuki
|
||||
* SignpostMarv
|
||||
* SpotOn3D
|
||||
* Stefan_Boom / stoehr
|
||||
* Snoopy
|
||||
* Strawberry Fride
|
||||
* Talun
|
||||
* TechplexEngineer (Blake Bourque)
|
||||
* TBG Renfold
|
||||
* tglion
|
||||
* tlaukkan/Tommil (Tommi S. E. Laukkanen, Bubble Cloud)
|
||||
* tyre
|
||||
@@ -208,4 +177,3 @@ In addition, we would like to thank:
|
||||
* The Mono Project
|
||||
* The NANT Developers
|
||||
* Microsoft (.NET, MSSQL-Adapters)
|
||||
*x
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.RegionLoader.Filesystem;
|
||||
using OpenSim.Framework.RegionLoader.Web;
|
||||
@@ -69,7 +68,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
public void Initialise()
|
||||
{
|
||||
m_log.Error("[LOAD REGIONS PLUGIN]: " + Name + " cannot be default-initialized!");
|
||||
m_log.Error("[LOADREGIONS]: " + Name + " cannot be default-initialized!");
|
||||
throw new PluginNotInitialisedException(Name);
|
||||
}
|
||||
|
||||
@@ -86,47 +85,46 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
IRegionLoader regionLoader;
|
||||
if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
|
||||
{
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from filesystem");
|
||||
m_log.Info("[LOADREGIONS]: Loading region configurations from filesystem");
|
||||
regionLoader = new RegionLoaderFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Loading region configurations from web");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations from web");
|
||||
regionLoader = new RegionLoaderWebServer();
|
||||
}
|
||||
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations...");
|
||||
|
||||
regionLoader.SetIniConfigSource(m_openSim.ConfigSource.Source);
|
||||
RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
|
||||
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Loading specific shared modules...");
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: DynamicTextureModule...");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: Loading specific shared modules...");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: DynamicTextureModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new DynamicTextureModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: LoadImageURLModule...");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: LoadImageURLModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new LoadImageURLModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: XMLRPCModule...");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: XMLRPCModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new XMLRPCModule());
|
||||
// m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
|
||||
// m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
|
||||
m_log.Info("[LOAD REGIONS PLUGIN]: Done.");
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: AssetTransactionModule...");
|
||||
m_openSim.ModuleLoader.LoadDefaultSharedModule(new AssetTransactionModule());
|
||||
m_log.Info("[LOADREGIONSPLUGIN]: Done.");
|
||||
|
||||
if (!CheckRegionsForSanity(regionsToLoad))
|
||||
{
|
||||
m_log.Error("[LOAD REGIONS PLUGIN]: Halting startup due to conflicts in region configurations");
|
||||
m_log.Error("[LOADREGIONS]: Halting startup due to conflicts in region configurations");
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < regionsToLoad.Length; i++)
|
||||
{
|
||||
IScene scene;
|
||||
m_log.Debug("[LOAD REGIONS PLUGIN]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
|
||||
m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
|
||||
Thread.CurrentThread.ManagedThreadId.ToString() +
|
||||
")");
|
||||
|
||||
bool changed = m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||
m_openSim.PopulateRegionEstateInfo(regionsToLoad[i]);
|
||||
m_openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
||||
if (changed)
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
if (scene != null)
|
||||
{
|
||||
m_newRegionCreatedHandler = OnNewRegionCreated;
|
||||
@@ -154,20 +152,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
/// <returns>True if we're sane, false if we're insane</returns>
|
||||
private bool CheckRegionsForSanity(RegionInfo[] regions)
|
||||
{
|
||||
if (regions.Length == 0)
|
||||
if (regions.Length <= 1)
|
||||
return true;
|
||||
|
||||
foreach (RegionInfo region in regions)
|
||||
{
|
||||
if (region.RegionID == UUID.Zero)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[LOAD REGIONS PLUGIN]: Region {0} has invalid UUID {1}",
|
||||
region.RegionName, region.RegionID);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < regions.Length - 1; i++)
|
||||
{
|
||||
for (int j = i + 1; j < regions.Length; j++)
|
||||
@@ -175,7 +162,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
if (regions[i].RegionID == regions[j].RegionID)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same UUID {2}",
|
||||
"[LOADREGIONS]: Regions {0} and {1} have the same UUID {2}",
|
||||
regions[i].RegionName, regions[j].RegionName, regions[i].RegionID);
|
||||
return false;
|
||||
}
|
||||
@@ -183,14 +170,14 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
regions[i].RegionLocX == regions[j].RegionLocX && regions[i].RegionLocY == regions[j].RegionLocY)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same grid location ({2}, {3})",
|
||||
"[LOADREGIONS]: Regions {0} and {1} have the same grid location ({2}, {3})",
|
||||
regions[i].RegionName, regions[j].RegionName, regions[i].RegionLocX, regions[i].RegionLocY);
|
||||
return false;
|
||||
}
|
||||
else if (regions[i].InternalEndPoint.Port == regions[j].InternalEndPoint.Port)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[LOAD REGIONS PLUGIN]: Regions {0} and {1} have the same internal IP port {2}",
|
||||
"[LOADREGIONS]: Regions {0} and {1} have the same internal IP port {2}",
|
||||
regions[i].RegionName, regions[j].RegionName, regions[i].InternalEndPoint.Port);
|
||||
return false;
|
||||
}
|
||||
@@ -199,5 +186,35 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void LoadRegionFromConfig(OpenSimBase openSim, ulong regionhandle)
|
||||
{
|
||||
m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
|
||||
|
||||
IRegionLoader regionLoader;
|
||||
if (openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
|
||||
{
|
||||
m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
|
||||
regionLoader = new RegionLoaderFileSystem();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[LOADREGIONS]: Loading Region Info from web");
|
||||
regionLoader = new RegionLoaderWebServer();
|
||||
}
|
||||
|
||||
regionLoader.SetIniConfigSource(openSim.ConfigSource.Source);
|
||||
RegionInfo[] regionsToLoad = regionLoader.LoadRegions();
|
||||
for (int i = 0; i < regionsToLoad.Length; i++)
|
||||
{
|
||||
if (regionhandle == regionsToLoad[i].RegionHandle)
|
||||
{
|
||||
IScene scene;
|
||||
m_log.Debug("[LOADREGIONS]: Creating Region: " + regionsToLoad[i].RegionName + " (ThreadID: " +
|
||||
Thread.CurrentThread.ManagedThreadId.ToString() + ")");
|
||||
openSim.CreateRegion(regionsToLoad[i], true, out scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
new List<ISharedRegionModule>();
|
||||
|
||||
#region IApplicationPlugin implementation
|
||||
|
||||
|
||||
public void Initialise (OpenSimBase openSim)
|
||||
{
|
||||
m_openSim = openSim;
|
||||
@@ -91,24 +91,66 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
{
|
||||
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
// Get the config string
|
||||
string moduleString =
|
||||
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
|
||||
|
||||
// We have a selector
|
||||
if (moduleString != String.Empty)
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_sharedModules.Add(node);
|
||||
// Allow disabling modules even if they don't have
|
||||
// support for it
|
||||
if (moduleString == "disabled")
|
||||
continue;
|
||||
|
||||
// Split off port, if present
|
||||
string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
|
||||
// Format is [port/][class]
|
||||
string className = moduleParts[0];
|
||||
if (moduleParts.Length > 1)
|
||||
className = moduleParts[1];
|
||||
|
||||
// Match the class name if given
|
||||
if (className != String.Empty &&
|
||||
node.Type.ToString() != className)
|
||||
continue;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_sharedModules.Add(node);
|
||||
}
|
||||
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
// Get the config string
|
||||
string moduleString =
|
||||
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
|
||||
|
||||
// We have a selector
|
||||
if (moduleString != String.Empty)
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_nonSharedModules.Add(node);
|
||||
// Allow disabling modules even if they don't have
|
||||
// support for it
|
||||
if (moduleString == "disabled")
|
||||
continue;
|
||||
|
||||
// Split off port, if present
|
||||
string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
|
||||
// Format is [port/][class]
|
||||
string className = moduleParts[0];
|
||||
if (moduleParts.Length > 1)
|
||||
className = moduleParts[1];
|
||||
|
||||
// Match the class name if given
|
||||
if (className != String.Empty &&
|
||||
node.Type.ToString() != className)
|
||||
continue;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_nonSharedModules.Add(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
|
||||
}
|
||||
}
|
||||
|
||||
// Load and init the module. We try a constructor with a port
|
||||
@@ -155,6 +197,8 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
m_sharedInstances.Add(module);
|
||||
module.Initialise(m_openSim.ConfigSource.Source);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void PostInitialise ()
|
||||
@@ -166,6 +210,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
{
|
||||
module.PostInitialise();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -199,6 +244,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
@@ -216,42 +262,6 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
}
|
||||
|
||||
#region IRegionModulesController implementation
|
||||
|
||||
/// <summary>
|
||||
/// Check that the given module is no disabled in the [Modules] section of the config files.
|
||||
/// </summary>
|
||||
/// <param name="node"></param>
|
||||
/// <param name="modulesConfig">The config section</param>
|
||||
/// <returns>true if the module is enabled, false if it is disabled</returns>
|
||||
protected bool CheckModuleEnabled(TypeExtensionNode node, IConfig modulesConfig)
|
||||
{
|
||||
// Get the config string
|
||||
string moduleString =
|
||||
modulesConfig.GetString("Setup_" + node.Id, String.Empty);
|
||||
|
||||
// We have a selector
|
||||
if (moduleString != String.Empty)
|
||||
{
|
||||
// Allow disabling modules even if they don't have
|
||||
// support for it
|
||||
if (moduleString == "disabled")
|
||||
return false;
|
||||
|
||||
// Split off port, if present
|
||||
string[] moduleParts = moduleString.Split(new char[] { '/' }, 2);
|
||||
// Format is [port/][class]
|
||||
string className = moduleParts[0];
|
||||
if (moduleParts.Length > 1)
|
||||
className = moduleParts[1];
|
||||
|
||||
// Match the class name if given
|
||||
if (className != String.Empty &&
|
||||
node.Type.ToString() != className)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// The root of all evil.
|
||||
// This is where we handle adding the modules to scenes when they
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,7 +44,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
// private static readonly int PARM_PATH = 1;
|
||||
|
||||
// private bool enabled = false;
|
||||
private bool enabled = false;
|
||||
private string qPrefix = "appearance";
|
||||
|
||||
/// <summary>
|
||||
@@ -74,7 +74,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
// Activate if everything went OK
|
||||
|
||||
// enabled = true;
|
||||
enabled = true;
|
||||
|
||||
Rest.Log.InfoFormat("{0} User appearance services initialization complete", MsgId);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
public void Close()
|
||||
{
|
||||
// enabled = false;
|
||||
enabled = false;
|
||||
Rest.Log.InfoFormat("{0} User appearance services closing down", MsgId);
|
||||
}
|
||||
|
||||
@@ -488,11 +488,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
rdata.userAppearance.AvatarHeight = (float) Convert.ToDouble(xml.Value);
|
||||
indata = true;
|
||||
}
|
||||
// if (xml.MoveToAttribute("Owner"))
|
||||
// {
|
||||
// rdata.userAppearance.Owner = (UUID)xml.Value;
|
||||
// indata = true;
|
||||
// }
|
||||
if (xml.MoveToAttribute("Owner"))
|
||||
{
|
||||
rdata.userAppearance.Owner = (UUID)xml.Value;
|
||||
indata = true;
|
||||
}
|
||||
if (xml.MoveToAttribute("Serial"))
|
||||
{
|
||||
rdata.userAppearance.Serial = Convert.ToInt32(xml.Value);
|
||||
@@ -747,8 +747,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
rdata.writer.WriteStartElement("Appearance");
|
||||
|
||||
rdata.writer.WriteAttributeString("Height", rdata.userAppearance.AvatarHeight.ToString());
|
||||
// if (rdata.userAppearance.Owner != UUID.Zero)
|
||||
// rdata.writer.WriteAttributeString("Owner", rdata.userAppearance.Owner.ToString());
|
||||
if (rdata.userAppearance.Owner != UUID.Zero)
|
||||
rdata.writer.WriteAttributeString("Owner", rdata.userAppearance.Owner.ToString());
|
||||
rdata.writer.WriteAttributeString("Serial", rdata.userAppearance.Serial.ToString());
|
||||
|
||||
/*
|
||||
|
||||
@@ -539,6 +539,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
/// path has not already been registered, the method is added to the active
|
||||
/// handler table.
|
||||
/// </summary>
|
||||
|
||||
public void AddStreamHandler(string httpMethod, string path, RestMethod method)
|
||||
{
|
||||
if (!IsEnabled)
|
||||
|
||||
@@ -46,12 +46,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
public class RestInventoryServices : IRest
|
||||
{
|
||||
// private static readonly int PARM_USERID = 0;
|
||||
// private static readonly int PARM_PATH = 1;
|
||||
private static readonly int PARM_PATH = 1;
|
||||
|
||||
// private bool enabled = false;
|
||||
private string qPrefix = "inventory";
|
||||
|
||||
// private static readonly string PRIVATE_ROOT_NAME = "My Inventory";
|
||||
private static readonly string PRIVATE_ROOT_NAME = "My Inventory";
|
||||
|
||||
/// <summary>
|
||||
/// The constructor makes sure that the service prefix is absolute
|
||||
@@ -2129,17 +2129,17 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
}
|
||||
catch (DllNotFoundException)
|
||||
{
|
||||
Rest.Log.ErrorFormat("OpenJpeg is not installed correctly on this system. Asset Data is empty for {0}", ic.Item.Name);
|
||||
Rest.Log.ErrorFormat("OpenJpeg is not installed correctly on this system. Asset Data is emtpy for {0}", ic.Item.Name);
|
||||
ic.Asset.Data = new Byte[0];
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is empty for {0}", ic.Item.Name);
|
||||
Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", ic.Item.Name);
|
||||
ic.Asset.Data = new Byte[0];
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is empty for {0}", ic.Item.Name);
|
||||
Rest.Log.ErrorFormat("OpenJpeg was unable to encode this. Asset Data is emtpy for {0}", ic.Item.Name);
|
||||
ic.Asset.Data = new Byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||
|
||||
Rest.main.SceneManager.ForEachScene(delegate(Scene s)
|
||||
{
|
||||
s.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
s.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
if (sp.Firstname == names[0] && sp.Lastname == names[1])
|
||||
{
|
||||
@@ -168,8 +168,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
|
||||
float x = Convert.ToSingle(rdata.Parameters[PARM_MOVE_X]);
|
||||
float y = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Y]);
|
||||
float z = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Z]);
|
||||
Vector3 vector = new Vector3(x, y, z);
|
||||
presence.MoveToTarget(vector, false, false);
|
||||
Vector3 vector = new Vector3(x,y,z);
|
||||
presence.DoAutoPilot(0,vector,presence.ControllingClient);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
{
|
||||
#region GET methods
|
||||
public string GetHandler(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
@@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
}
|
||||
}
|
||||
|
||||
public string GetHandlerRegions(IOSHttpResponse httpResponse)
|
||||
public string GetHandlerRegions(OSHttpResponse httpResponse)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
return rxw.ToString();
|
||||
}
|
||||
|
||||
public string GetHandlerRegion(IOSHttpResponse httpResponse, string param)
|
||||
public string GetHandlerRegion(OSHttpResponse httpResponse, string param)
|
||||
{
|
||||
// be resilient and don't get confused by a terminating '/'
|
||||
param = param.TrimEnd(new char[]{'/'});
|
||||
@@ -180,7 +180,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
}
|
||||
#endregion GET methods
|
||||
|
||||
protected string RegionTerrain(IOSHttpResponse httpResponse, Scene scene)
|
||||
protected string RegionTerrain(OSHttpResponse httpResponse, Scene scene)
|
||||
{
|
||||
httpResponse.SendChunked = true;
|
||||
httpResponse.ContentType = "text/xml";
|
||||
@@ -190,7 +190,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
// "GET", "terrain not implemented");
|
||||
}
|
||||
|
||||
protected string RegionStats(IOSHttpResponse httpResponse, Scene scene)
|
||||
protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
|
||||
{
|
||||
int users = scene.GetRootAgentCount();
|
||||
int objects = scene.Entities.Count - users;
|
||||
@@ -213,7 +213,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
return rxw.ToString();
|
||||
}
|
||||
|
||||
protected string RegionPrims(IOSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max)
|
||||
protected string RegionPrims(OSHttpResponse httpResponse, Scene scene, Vector3 min, Vector3 max)
|
||||
{
|
||||
httpResponse.SendChunked = true;
|
||||
httpResponse.ContentType = "text/xml";
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
{
|
||||
#region GET methods
|
||||
public string GetRegionInfoHandler(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
@@ -64,7 +64,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
}
|
||||
}
|
||||
|
||||
public string GetRegionInfoHandlerRegions(IOSHttpResponse httpResponse)
|
||||
public string GetRegionInfoHandlerRegions(OSHttpResponse httpResponse)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
#region POST methods
|
||||
|
||||
public string PostHandler(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||
{
|
||||
// foreach (string h in httpRequest.Headers.AllKeys)
|
||||
// foreach (string v in httpRequest.Headers.GetValues(h))
|
||||
@@ -92,7 +92,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
}
|
||||
}
|
||||
|
||||
public string CreateRegion(IOSHttpRequest request, IOSHttpResponse response)
|
||||
public string CreateRegion(OSHttpRequest request, OSHttpResponse response)
|
||||
{
|
||||
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
|
||||
return rxw.ToString();
|
||||
}
|
||||
|
||||
public string LoadPrims(string requestBody, IOSHttpRequest request, IOSHttpResponse response, Scene scene)
|
||||
public string LoadPrims(string requestBody, OSHttpRequest request, OSHttpResponse response, Scene scene)
|
||||
{
|
||||
IRegionSerialiserModule serialiser = scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
if (serialiser != null)
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
/// </summary>
|
||||
/// <param name="request">HTTP request header</param>
|
||||
/// <returns>true when the HTTP request came from god.</returns>
|
||||
protected bool IsGod(IOSHttpRequest request)
|
||||
protected bool IsGod(OSHttpRequest request)
|
||||
{
|
||||
string[] keys = request.Headers.GetValues("X-OpenSim-Godkey");
|
||||
if (null == keys) return false;
|
||||
@@ -342,7 +342,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
/// HTTP header is indeed the password on file for the avatar
|
||||
/// specified by the UUID
|
||||
/// </summary>
|
||||
protected bool IsVerifiedUser(IOSHttpRequest request, UUID uuid)
|
||||
protected bool IsVerifiedUser(OSHttpRequest request, UUID uuid)
|
||||
{
|
||||
// XXX under construction
|
||||
return false;
|
||||
@@ -377,7 +377,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
/// <param name="message">failure message</param>
|
||||
/// <remarks>This should probably set a return code as
|
||||
/// well. (?)</remarks>
|
||||
protected string Failure(IOSHttpResponse response, OSHttpStatusCode status,
|
||||
protected string Failure(OSHttpResponse response, OSHttpStatusCode status,
|
||||
string method, string format, params string[] msg)
|
||||
{
|
||||
string m = String.Format(format, msg);
|
||||
@@ -396,7 +396,7 @@ namespace OpenSim.ApplicationPlugins.Rest
|
||||
/// <param name="e">exception causing the failure message</param>
|
||||
/// <remarks>This should probably set a return code as
|
||||
/// well. (?)</remarks>
|
||||
public string Failure(IOSHttpResponse response, OSHttpStatusCode status,
|
||||
public string Failure(OSHttpResponse response, OSHttpStatusCode status,
|
||||
string method, Exception e)
|
||||
{
|
||||
string m = String.Format("exception occurred: {0}", e.Message);
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
// using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Framework.Capabilities
|
||||
{
|
||||
/// <summary>
|
||||
/// XXX Probably not a particularly nice way of allow us to get the scene presence from the scene (chiefly so that
|
||||
/// we can popup a message on the user's client if the inventory service has permanently failed). But I didn't want
|
||||
/// to just pass the whole Scene into CAPS.
|
||||
/// </summary>
|
||||
public delegate IClientAPI GetClientDelegate(UUID agentID);
|
||||
|
||||
public class Caps
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private string m_httpListenerHostName;
|
||||
private uint m_httpListenPort;
|
||||
|
||||
/// <summary>
|
||||
/// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester.
|
||||
/// </summary>
|
||||
private string m_capsObjectPath;
|
||||
public string CapsObjectPath { get { return m_capsObjectPath; } }
|
||||
|
||||
private CapsHandlers m_capsHandlers;
|
||||
private Dictionary<string, string> m_externalCapsHandlers;
|
||||
|
||||
private IHttpServer m_httpListener;
|
||||
private UUID m_agentID;
|
||||
private string m_regionName;
|
||||
|
||||
public UUID AgentID
|
||||
{
|
||||
get { return m_agentID; }
|
||||
}
|
||||
|
||||
public string RegionName
|
||||
{
|
||||
get { return m_regionName; }
|
||||
}
|
||||
|
||||
public string HostName
|
||||
{
|
||||
get { return m_httpListenerHostName; }
|
||||
}
|
||||
|
||||
public uint Port
|
||||
{
|
||||
get { return m_httpListenPort; }
|
||||
}
|
||||
|
||||
public IHttpServer HttpListener
|
||||
{
|
||||
get { return m_httpListener; }
|
||||
}
|
||||
|
||||
public bool SSLCaps
|
||||
{
|
||||
get { return m_httpListener.UseSSL; }
|
||||
}
|
||||
|
||||
public string SSLCommonName
|
||||
{
|
||||
get { return m_httpListener.SSLCommonName; }
|
||||
}
|
||||
|
||||
public CapsHandlers CapsHandlers
|
||||
{
|
||||
get { return m_capsHandlers; }
|
||||
}
|
||||
|
||||
public Dictionary<string, string> ExternalCapsHandlers
|
||||
{
|
||||
get { return m_externalCapsHandlers; }
|
||||
}
|
||||
|
||||
public Caps(IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
|
||||
UUID agent, string regionName)
|
||||
{
|
||||
m_capsObjectPath = capsPath;
|
||||
m_httpListener = httpServer;
|
||||
m_httpListenerHostName = httpListen;
|
||||
|
||||
m_httpListenPort = httpPort;
|
||||
|
||||
if (httpServer != null && httpServer.UseSSL)
|
||||
{
|
||||
m_httpListenPort = httpServer.SSLPort;
|
||||
httpListen = httpServer.SSLCommonName;
|
||||
httpPort = httpServer.SSLPort;
|
||||
}
|
||||
|
||||
m_agentID = agent;
|
||||
m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL);
|
||||
m_externalCapsHandlers = new Dictionary<string, string>();
|
||||
m_regionName = regionName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a handler. This allows modules to register handlers.
|
||||
/// </summary>
|
||||
/// <param name="capName"></param>
|
||||
/// <param name="handler"></param>
|
||||
public void RegisterHandler(string capName, IRequestHandler handler)
|
||||
{
|
||||
m_capsHandlers[capName] = handler;
|
||||
//m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register an external handler. The service for this capability is somewhere else
|
||||
/// given by the URL.
|
||||
/// </summary>
|
||||
/// <param name="capsName"></param>
|
||||
/// <param name="url"></param>
|
||||
public void RegisterHandler(string capsName, string url)
|
||||
{
|
||||
m_externalCapsHandlers.Add(capsName, url);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove all CAPS service handlers.
|
||||
/// </summary>
|
||||
public void DeregisterHandlers()
|
||||
{
|
||||
if (m_capsHandlers != null)
|
||||
{
|
||||
foreach (string capsName in m_capsHandlers.Caps)
|
||||
{
|
||||
m_capsHandlers.Remove(capsName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Capabilities;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class FetchInventory2Handler
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IInventoryService m_inventoryService;
|
||||
|
||||
public FetchInventory2Handler(IInventoryService invService)
|
||||
{
|
||||
m_inventoryService = invService;
|
||||
}
|
||||
|
||||
public string FetchInventoryRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// m_log.DebugFormat("[FETCH INVENTORY HANDLER]: Received FetchInventory capabilty request");
|
||||
|
||||
OSDMap requestmap = (OSDMap)OSDParser.DeserializeLLSDXml(Utils.StringToBytes(request));
|
||||
OSDArray itemsRequested = (OSDArray)requestmap["items"];
|
||||
|
||||
string reply;
|
||||
LLSDFetchInventory llsdReply = new LLSDFetchInventory();
|
||||
|
||||
foreach (OSDMap osdItemId in itemsRequested)
|
||||
{
|
||||
UUID itemId = osdItemId["item_id"].AsUUID();
|
||||
|
||||
InventoryItemBase item = m_inventoryService.GetItem(new InventoryItemBase(itemId));
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
// We don't know the agent that this request belongs to so we'll use the agent id of the item
|
||||
// which will be the same for all items.
|
||||
llsdReply.agent_id = item.Owner;
|
||||
|
||||
llsdReply.items.Array.Add(ConvertInventoryItem(item));
|
||||
}
|
||||
}
|
||||
|
||||
reply = LLSDHelpers.SerialiseLLSDReply(llsdReply);
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert an internal inventory item object into an LLSD object.
|
||||
/// </summary>
|
||||
/// <param name="invItem"></param>
|
||||
/// <returns></returns>
|
||||
private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem)
|
||||
{
|
||||
LLSDInventoryItem llsdItem = new LLSDInventoryItem();
|
||||
llsdItem.asset_id = invItem.AssetID;
|
||||
llsdItem.created_at = invItem.CreationDate;
|
||||
llsdItem.desc = invItem.Description;
|
||||
llsdItem.flags = (int)invItem.Flags;
|
||||
llsdItem.item_id = invItem.ID;
|
||||
llsdItem.name = invItem.Name;
|
||||
llsdItem.parent_id = invItem.Folder;
|
||||
llsdItem.type = invItem.AssetType;
|
||||
llsdItem.inv_type = invItem.InvType;
|
||||
|
||||
llsdItem.permissions = new LLSDPermissions();
|
||||
llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
|
||||
llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
|
||||
llsdItem.permissions.group_id = invItem.GroupID;
|
||||
llsdItem.permissions.group_mask = (int)invItem.GroupPermissions;
|
||||
llsdItem.permissions.is_owner_group = invItem.GroupOwned;
|
||||
llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions;
|
||||
llsdItem.permissions.owner_id = invItem.Owner;
|
||||
llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.sale_info = new LLSDSaleInfo();
|
||||
llsdItem.sale_info.sale_price = invItem.SalePrice;
|
||||
llsdItem.sale_info.sale_type = invItem.SaleType;
|
||||
|
||||
return llsdItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class FetchInventory2ServerConnector : ServiceConnector
|
||||
{
|
||||
private IInventoryService m_InventoryService;
|
||||
private string m_ConfigName = "CapsService";
|
||||
|
||||
public FetchInventory2ServerConnector(IConfigSource config, IHttpServer server, string configName)
|
||||
: base(config, server, configName)
|
||||
{
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
string invService = serverConfig.GetString("InventoryService", String.Empty);
|
||||
|
||||
if (invService == String.Empty)
|
||||
throw new Exception("No InventoryService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(invService, args);
|
||||
|
||||
if (m_InventoryService == null)
|
||||
throw new Exception(String.Format("Failed to load InventoryService from {0}; config is {1}", invService, m_ConfigName));
|
||||
|
||||
FetchInventory2Handler fiHandler = new FetchInventory2Handler(m_InventoryService);
|
||||
IRequestHandler reqHandler
|
||||
= new RestStreamHandler(
|
||||
"POST", "/CAPS/FetchInventory/", fiHandler.FetchInventoryRequest, "FetchInventory", null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using Nini.Config;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenSim.Framework.Servers;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class GetMeshServerConnector : ServiceConnector
|
||||
{
|
||||
private IAssetService m_AssetService;
|
||||
private string m_ConfigName = "CapsService";
|
||||
|
||||
public GetMeshServerConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||
base(config, server, configName)
|
||||
{
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
string assetService = serverConfig.GetString("AssetService", String.Empty);
|
||||
|
||||
if (assetService == String.Empty)
|
||||
throw new Exception("No AssetService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_AssetService =
|
||||
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
||||
|
||||
if (m_AssetService == null)
|
||||
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(),
|
||||
httpMethod => gmeshHandler.ProcessGetMesh(httpMethod, UUID.Zero, null),
|
||||
"GetMesh",
|
||||
null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,369 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Specialized;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenMetaverse.Imaging;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class GetTextureHandler : BaseStreamHandler
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private IAssetService m_assetService;
|
||||
|
||||
public const string DefaultFormat = "x-j2c";
|
||||
|
||||
// TODO: Change this to a config option
|
||||
const string REDIRECT_URL = null;
|
||||
|
||||
public GetTextureHandler(string path, IAssetService assService, string name, string description)
|
||||
: base("GET", path, name, description)
|
||||
{
|
||||
m_assetService = assService;
|
||||
}
|
||||
|
||||
public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// Try to parse the texture ID from the request URL
|
||||
NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query);
|
||||
string textureStr = query.GetOne("texture_id");
|
||||
string format = query.GetOne("format");
|
||||
|
||||
//m_log.DebugFormat("[GETTEXTURE]: called {0}", textureStr);
|
||||
|
||||
if (m_assetService == null)
|
||||
{
|
||||
m_log.Error("[GETTEXTURE]: Cannot fetch texture " + textureStr + " without an asset service");
|
||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||
}
|
||||
|
||||
UUID textureID;
|
||||
if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID))
|
||||
{
|
||||
// m_log.DebugFormat("[GETTEXTURE]: Received request for texture id {0}", textureID);
|
||||
|
||||
string[] formats;
|
||||
if (format != null && format != string.Empty)
|
||||
{
|
||||
formats = new string[1] { format.ToLower() };
|
||||
}
|
||||
else
|
||||
{
|
||||
formats = WebUtil.GetPreferredImageTypes(httpRequest.Headers.Get("Accept"));
|
||||
if (formats.Length == 0)
|
||||
formats = new string[1] { DefaultFormat }; // default
|
||||
|
||||
}
|
||||
// OK, we have an array with preferred formats, possibly with only one entry
|
||||
|
||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||
foreach (string f in formats)
|
||||
{
|
||||
if (FetchTexture(httpRequest, httpResponse, textureID, f))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[GETTEXTURE]: Failed to parse a texture_id from GetTexture request: " + httpRequest.Url);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[GETTEXTURE]: For texture {0} sending back response {1}, data length {2}",
|
||||
// textureID, httpResponse.StatusCode, httpResponse.ContentLength);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="httpRequest"></param>
|
||||
/// <param name="httpResponse"></param>
|
||||
/// <param name="textureID"></param>
|
||||
/// <param name="format"></param>
|
||||
/// <returns>False for "caller try another codec"; true otherwise</returns>
|
||||
private bool FetchTexture(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID textureID, string format)
|
||||
{
|
||||
// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
|
||||
AssetBase texture;
|
||||
|
||||
string fullID = textureID.ToString();
|
||||
if (format != DefaultFormat)
|
||||
fullID = fullID + "-" + format;
|
||||
|
||||
if (!String.IsNullOrEmpty(REDIRECT_URL))
|
||||
{
|
||||
// Only try to fetch locally cached textures. Misses are redirected
|
||||
texture = m_assetService.GetCached(fullID);
|
||||
|
||||
if (texture != null)
|
||||
{
|
||||
if (texture.Type != (sbyte)AssetType.Texture)
|
||||
{
|
||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||
return true;
|
||||
}
|
||||
WriteTextureData(httpRequest, httpResponse, texture, format);
|
||||
}
|
||||
else
|
||||
{
|
||||
string textureUrl = REDIRECT_URL + textureID.ToString();
|
||||
m_log.Debug("[GETTEXTURE]: Redirecting texture request to " + textureUrl);
|
||||
httpResponse.RedirectLocation = textureUrl;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else // no redirect
|
||||
{
|
||||
// try the cache
|
||||
texture = m_assetService.GetCached(fullID);
|
||||
|
||||
if (texture == null)
|
||||
{
|
||||
//m_log.DebugFormat("[GETTEXTURE]: texture was not in the cache");
|
||||
|
||||
// Fetch locally or remotely. Misses return a 404
|
||||
texture = m_assetService.Get(textureID.ToString());
|
||||
|
||||
if (texture != null)
|
||||
{
|
||||
if (texture.Type != (sbyte)AssetType.Texture)
|
||||
{
|
||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||
return true;
|
||||
}
|
||||
if (format == DefaultFormat)
|
||||
{
|
||||
WriteTextureData(httpRequest, httpResponse, texture, format);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.Metadata.CreatorID);
|
||||
newTexture.Data = ConvertTextureData(texture, format);
|
||||
if (newTexture.Data.Length == 0)
|
||||
return false; // !!! Caller try another codec, please!
|
||||
|
||||
newTexture.Flags = AssetFlags.Collectable;
|
||||
newTexture.Temporary = true;
|
||||
m_assetService.Store(newTexture);
|
||||
WriteTextureData(httpRequest, httpResponse, newTexture, format);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // it was on the cache
|
||||
{
|
||||
//m_log.DebugFormat("[GETTEXTURE]: texture was in the cache");
|
||||
WriteTextureData(httpRequest, httpResponse, texture, format);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// not found
|
||||
// m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");
|
||||
httpResponse.StatusCode = (int)System.Net.HttpStatusCode.NotFound;
|
||||
return true;
|
||||
}
|
||||
|
||||
private void WriteTextureData(IOSHttpRequest request, IOSHttpResponse response, AssetBase texture, string format)
|
||||
{
|
||||
string range = request.Headers.GetOne("Range");
|
||||
|
||||
if (!String.IsNullOrEmpty(range)) // JP2's only
|
||||
{
|
||||
// Range request
|
||||
int start, end;
|
||||
if (TryParseRange(range, out start, out end))
|
||||
{
|
||||
|
||||
// Before clamping start make sure we can satisfy it in order to avoid
|
||||
// sending back the last byte instead of an error status
|
||||
if (start >= texture.Data.Length)
|
||||
{
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
|
||||
}
|
||||
else
|
||||
{
|
||||
end = Utils.Clamp(end, 0, texture.Data.Length - 1);
|
||||
start = Utils.Clamp(start, 0, end);
|
||||
int len = end - start + 1;
|
||||
|
||||
//m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
|
||||
|
||||
// Always return PartialContent, even if the range covered the entire data length
|
||||
// We were accidentally sending back 404 before in this situation
|
||||
// https://issues.apache.org/bugzilla/show_bug.cgi?id=51878 supports sending 206 even if the
|
||||
// entire range is requested, and viewer 3.2.2 (and very probably earlier) seems fine with this.
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.PartialContent;
|
||||
|
||||
response.ContentLength = len;
|
||||
response.ContentType = texture.Metadata.ContentType;
|
||||
response.AddHeader("Content-Range", String.Format("bytes {0}-{1}/{2}", start, end, texture.Data.Length));
|
||||
|
||||
response.Body.Write(texture.Data, start, len);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[GETTEXTURE]: Malformed Range header: " + range);
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.BadRequest;
|
||||
}
|
||||
}
|
||||
else // JP2's or other formats
|
||||
{
|
||||
// Full content request
|
||||
response.StatusCode = (int)System.Net.HttpStatusCode.OK;
|
||||
response.ContentLength = texture.Data.Length;
|
||||
if (format == DefaultFormat)
|
||||
response.ContentType = texture.Metadata.ContentType;
|
||||
else
|
||||
response.ContentType = "image/" + format;
|
||||
response.Body.Write(texture.Data, 0, texture.Data.Length);
|
||||
}
|
||||
|
||||
// if (response.StatusCode < 200 || response.StatusCode > 299)
|
||||
// m_log.WarnFormat(
|
||||
// "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})",
|
||||
// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
|
||||
// else
|
||||
// m_log.DebugFormat(
|
||||
// "[GETTEXTURE]: For texture {0} requested range {1} responded {2} with content length {3} (actual {4})",
|
||||
// texture.FullID, range, response.StatusCode, response.ContentLength, texture.Data.Length);
|
||||
}
|
||||
|
||||
private bool TryParseRange(string header, out int start, out int end)
|
||||
{
|
||||
if (header.StartsWith("bytes="))
|
||||
{
|
||||
string[] rangeValues = header.Substring(6).Split('-');
|
||||
if (rangeValues.Length == 2)
|
||||
{
|
||||
if (Int32.TryParse(rangeValues[0], out start) && Int32.TryParse(rangeValues[1], out end))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
start = end = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
private byte[] ConvertTextureData(AssetBase texture, string format)
|
||||
{
|
||||
m_log.DebugFormat("[GETTEXTURE]: Converting texture {0} to {1}", texture.ID, format);
|
||||
byte[] data = new byte[0];
|
||||
|
||||
MemoryStream imgstream = new MemoryStream();
|
||||
Bitmap mTexture = new Bitmap(1, 1);
|
||||
ManagedImage managedImage;
|
||||
Image image = (Image)mTexture;
|
||||
|
||||
try
|
||||
{
|
||||
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
|
||||
|
||||
imgstream = new MemoryStream();
|
||||
|
||||
// Decode image to System.Drawing.Image
|
||||
if (OpenJPEG.DecodeToImage(texture.Data, out managedImage, out image))
|
||||
{
|
||||
// Save to bitmap
|
||||
mTexture = new Bitmap(image);
|
||||
|
||||
EncoderParameters myEncoderParameters = new EncoderParameters();
|
||||
myEncoderParameters.Param[0] = new EncoderParameter(Encoder.Quality, 95L);
|
||||
|
||||
// Save bitmap to stream
|
||||
ImageCodecInfo codec = GetEncoderInfo("image/" + format);
|
||||
if (codec != null)
|
||||
{
|
||||
mTexture.Save(imgstream, codec, myEncoderParameters);
|
||||
// Write the stream to a byte array for output
|
||||
data = imgstream.ToArray();
|
||||
}
|
||||
else
|
||||
m_log.WarnFormat("[GETTEXTURE]: No such codec {0}", format);
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[GETTEXTURE]: Unable to convert texture {0} to {1}: {2}", texture.ID, format, e.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Reclaim memory, these are unmanaged resources
|
||||
// If we encountered an exception, one or more of these will be null
|
||||
if (mTexture != null)
|
||||
mTexture.Dispose();
|
||||
|
||||
if (image != null)
|
||||
image.Dispose();
|
||||
|
||||
if (imgstream != null)
|
||||
{
|
||||
imgstream.Close();
|
||||
imgstream.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
// From msdn
|
||||
private static ImageCodecInfo GetEncoderInfo(String mimeType)
|
||||
{
|
||||
ImageCodecInfo[] encoders;
|
||||
encoders = ImageCodecInfo.GetImageEncoders();
|
||||
for (int j = 0; j < encoders.Length; ++j)
|
||||
{
|
||||
if (encoders[j].MimeType == mimeType)
|
||||
return encoders[j];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class GetTextureServerConnector : ServiceConnector
|
||||
{
|
||||
private IAssetService m_AssetService;
|
||||
private string m_ConfigName = "CapsService";
|
||||
|
||||
public GetTextureServerConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||
base(config, server, configName)
|
||||
{
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
string assetService = serverConfig.GetString("AssetService", String.Empty);
|
||||
|
||||
if (assetService == String.Empty)
|
||||
throw new Exception("No AssetService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_AssetService =
|
||||
ServerUtils.LoadPlugin<IAssetService>(assetService, args);
|
||||
|
||||
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, "GetTexture", null));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Specialized;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenMetaverse.Imaging;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Capabilities;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class UploadBakedTextureHandler
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Caps m_HostCapsObj;
|
||||
private IAssetService m_assetService;
|
||||
private bool m_persistBakedTextures;
|
||||
|
||||
public UploadBakedTextureHandler(Caps caps, IAssetService assetService, bool persistBakedTextures)
|
||||
{
|
||||
m_HostCapsObj = caps;
|
||||
m_assetService = assetService;
|
||||
m_persistBakedTextures = persistBakedTextures;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle a request from the client for a Uri to upload a baked texture.
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <param name="httpRequest"></param>
|
||||
/// <param name="httpResponse"></param>
|
||||
/// <returns>The upload response if the request is successful, null otherwise.</returns>
|
||||
public string UploadBakedTexture(
|
||||
string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
try
|
||||
{
|
||||
string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
|
||||
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
|
||||
|
||||
BakedTextureUploader uploader =
|
||||
new BakedTextureUploader(capsBase + uploaderPath, m_HostCapsObj.HttpListener);
|
||||
uploader.OnUpLoad += BakedTextureUploaded;
|
||||
|
||||
m_HostCapsObj.HttpListener.AddStreamHandler(
|
||||
new BinaryStreamHandler(
|
||||
"POST", capsBase + uploaderPath, uploader.uploaderCaps, "UploadBakedTexture", null));
|
||||
|
||||
string protocol = "http://";
|
||||
|
||||
if (m_HostCapsObj.SSLCaps)
|
||||
protocol = "https://";
|
||||
|
||||
string uploaderURL = protocol + m_HostCapsObj.HostName + ":" +
|
||||
m_HostCapsObj.Port.ToString() + capsBase + uploaderPath;
|
||||
|
||||
LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse();
|
||||
uploadResponse.uploader = uploaderURL;
|
||||
uploadResponse.state = "upload";
|
||||
|
||||
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[UPLOAD BAKED TEXTURE HANDLER]: {0}{1}", e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a baked texture has been successfully uploaded by a client.
|
||||
/// </summary>
|
||||
/// <param name="assetID"></param>
|
||||
/// <param name="data"></param>
|
||||
private void BakedTextureUploaded(UUID assetID, byte[] data)
|
||||
{
|
||||
// m_log.DebugFormat("[UPLOAD BAKED TEXTURE HANDLER]: Received baked texture {0}", assetID.ToString());
|
||||
|
||||
AssetBase asset;
|
||||
asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_HostCapsObj.AgentID.ToString());
|
||||
asset.Data = data;
|
||||
asset.Temporary = true;
|
||||
asset.Local = !m_persistBakedTextures; // Local assets aren't persisted, non-local are
|
||||
m_assetService.Store(asset);
|
||||
}
|
||||
}
|
||||
|
||||
class BakedTextureUploader
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public event Action<UUID, byte[]> OnUpLoad;
|
||||
|
||||
private string uploaderPath = String.Empty;
|
||||
private UUID newAssetID;
|
||||
private IHttpServer httpListener;
|
||||
|
||||
public BakedTextureUploader(string path, IHttpServer httpServer)
|
||||
{
|
||||
newAssetID = UUID.Random();
|
||||
uploaderPath = path;
|
||||
httpListener = httpServer;
|
||||
// m_log.InfoFormat("[CAPS] baked texture upload starting for {0}",newAssetID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle raw uploaded baked texture data.
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="param"></param>
|
||||
/// <returns></returns>
|
||||
public string uploaderCaps(byte[] data, string path, string param)
|
||||
{
|
||||
Action<UUID, byte[]> handlerUpLoad = OnUpLoad;
|
||||
|
||||
// Don't do this asynchronously, otherwise it's possible for the client to send set appearance information
|
||||
// on another thread which might send out avatar updates before the asset has been put into the asset
|
||||
// service.
|
||||
if (handlerUpLoad != null)
|
||||
handlerUpLoad(newAssetID, data);
|
||||
|
||||
string res = String.Empty;
|
||||
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
|
||||
uploadComplete.new_asset = newAssetID.ToString();
|
||||
uploadComplete.new_inventory_item = UUID.Zero;
|
||||
uploadComplete.state = "complete";
|
||||
|
||||
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
|
||||
|
||||
httpListener.RemoveStreamHandler("POST", uploaderPath);
|
||||
|
||||
// m_log.DebugFormat("[BAKED TEXTURE UPLOADER]: baked texture upload completed for {0}", newAssetID);
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,438 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Capabilities;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class WebFetchInvDescHandler
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IInventoryService m_InventoryService;
|
||||
private ILibraryService m_LibraryService;
|
||||
// private object m_fetchLock = new Object();
|
||||
|
||||
public WebFetchInvDescHandler(IInventoryService invService, ILibraryService libService)
|
||||
{
|
||||
m_InventoryService = invService;
|
||||
m_LibraryService = libService;
|
||||
}
|
||||
|
||||
public string FetchInventoryDescendentsRequest(string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
// lock (m_fetchLock)
|
||||
// {
|
||||
// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Received request {0}", request);
|
||||
|
||||
// nasty temporary hack here, the linden client falsely
|
||||
// identifies the uuid 00000000-0000-0000-0000-000000000000
|
||||
// as a string which breaks us
|
||||
//
|
||||
// correctly mark it as a uuid
|
||||
//
|
||||
request = request.Replace("<string>00000000-0000-0000-0000-000000000000</string>", "<uuid>00000000-0000-0000-0000-000000000000</uuid>");
|
||||
|
||||
// another hack <integer>1</integer> results in a
|
||||
// System.ArgumentException: Object type System.Int32 cannot
|
||||
// be converted to target type: System.Boolean
|
||||
//
|
||||
request = request.Replace("<key>fetch_folders</key><integer>0</integer>", "<key>fetch_folders</key><boolean>0</boolean>");
|
||||
request = request.Replace("<key>fetch_folders</key><integer>1</integer>", "<key>fetch_folders</key><boolean>1</boolean>");
|
||||
|
||||
Hashtable hash = new Hashtable();
|
||||
try
|
||||
{
|
||||
hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
|
||||
}
|
||||
catch (LLSD.LLSDParseException e)
|
||||
{
|
||||
m_log.ErrorFormat("[WEB FETCH INV DESC HANDLER]: Fetch error: {0}{1}" + e.Message, e.StackTrace);
|
||||
m_log.Error("Request: " + request);
|
||||
}
|
||||
|
||||
ArrayList foldersrequested = (ArrayList)hash["folders"];
|
||||
|
||||
string response = "";
|
||||
|
||||
for (int i = 0; i < foldersrequested.Count; i++)
|
||||
{
|
||||
string inventoryitemstr = "";
|
||||
Hashtable inventoryhash = (Hashtable)foldersrequested[i];
|
||||
|
||||
LLSDFetchInventoryDescendents llsdRequest = new LLSDFetchInventoryDescendents();
|
||||
|
||||
try
|
||||
{
|
||||
LLSDHelpers.DeserialiseOSDMap(inventoryhash, llsdRequest);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Debug("[WEB FETCH INV DESC HANDLER]: caught exception doing OSD deserialize" + e);
|
||||
}
|
||||
LLSDInventoryDescendents reply = FetchInventoryReply(llsdRequest);
|
||||
|
||||
inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
|
||||
inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", "");
|
||||
inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", "");
|
||||
|
||||
response += inventoryitemstr;
|
||||
}
|
||||
|
||||
if (response.Length == 0)
|
||||
{
|
||||
// Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
|
||||
// Therefore, I'm concluding that the client only has so many threads available to do requests
|
||||
// and when a thread stalls.. is stays stalled.
|
||||
// Therefore we need to return something valid
|
||||
response = "<llsd><map><key>folders</key><array /></map></llsd>";
|
||||
}
|
||||
else
|
||||
{
|
||||
response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>";
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Replying to CAPS fetch inventory request");
|
||||
//m_log.Debug("[WEB FETCH INV DESC HANDLER] "+response);
|
||||
|
||||
return response;
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct an LLSD reply packet to a CAPS inventory request
|
||||
/// </summary>
|
||||
/// <param name="invFetch"></param>
|
||||
/// <returns></returns>
|
||||
private LLSDInventoryDescendents FetchInventoryReply(LLSDFetchInventoryDescendents invFetch)
|
||||
{
|
||||
LLSDInventoryDescendents reply = new LLSDInventoryDescendents();
|
||||
LLSDInventoryFolderContents contents = new LLSDInventoryFolderContents();
|
||||
contents.agent_id = invFetch.owner_id;
|
||||
contents.owner_id = invFetch.owner_id;
|
||||
contents.folder_id = invFetch.folder_id;
|
||||
|
||||
reply.folders.Array.Add(contents);
|
||||
InventoryCollection inv = new InventoryCollection();
|
||||
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, out descendents);
|
||||
|
||||
if (inv != null && inv.Folders != null)
|
||||
{
|
||||
foreach (InventoryFolderBase invFolder in inv.Folders)
|
||||
{
|
||||
contents.categories.Array.Add(ConvertInventoryFolder(invFolder));
|
||||
}
|
||||
|
||||
descendents += inv.Folders.Count;
|
||||
}
|
||||
|
||||
if (inv != null && inv.Items != null)
|
||||
{
|
||||
foreach (InventoryItemBase invItem in inv.Items)
|
||||
{
|
||||
contents.items.Array.Add(ConvertInventoryItem(invItem));
|
||||
}
|
||||
}
|
||||
|
||||
contents.descendents = descendents;
|
||||
contents.version = version;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Replying to request for folder {0} (fetch items {1}, fetch folders {2}) with {3} items and {4} folders for agent {5}",
|
||||
// invFetch.folder_id,
|
||||
// invFetch.fetch_items,
|
||||
// invFetch.fetch_folders,
|
||||
// contents.items.Array.Count,
|
||||
// contents.categories.Array.Count,
|
||||
// invFetch.owner_id);
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handle the caps inventory descendents fetch.
|
||||
/// </summary>
|
||||
/// <param name="agentID"></param>
|
||||
/// <param name="folderID"></param>
|
||||
/// <param name="ownerID"></param>
|
||||
/// <param name="fetchFolders"></param>
|
||||
/// <param name="fetchItems"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="version"></param>
|
||||
/// <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, out int descendents)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
|
||||
// fetchFolders, fetchItems, folderID, agentID);
|
||||
|
||||
// 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)
|
||||
{
|
||||
if ((fold = m_LibraryService.LibraryRootFolder.FindFolder(folderID)) != null)
|
||||
{
|
||||
InventoryCollection ret = new InventoryCollection();
|
||||
ret.Folders = new List<InventoryFolderBase>();
|
||||
ret.Items = fold.RequestListOfItems();
|
||||
descendents = ret.Folders.Count + ret.Items.Count;
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
InventoryCollection contents = new InventoryCollection();
|
||||
|
||||
if (folderID != UUID.Zero)
|
||||
{
|
||||
contents = m_InventoryService.GetFolderContent(agentID, folderID);
|
||||
InventoryFolderBase containingFolder = new InventoryFolderBase();
|
||||
containingFolder.ID = folderID;
|
||||
containingFolder.Owner = agentID;
|
||||
containingFolder = m_InventoryService.GetFolder(containingFolder);
|
||||
|
||||
if (containingFolder != null)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Retrieved folder {0} {1} for agent id {2}",
|
||||
// containingFolder.Name, containingFolder.ID, agentID);
|
||||
|
||||
version = containingFolder.Version;
|
||||
|
||||
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));
|
||||
|
||||
if (linkedItem != null)
|
||||
itemsToReturn.Insert(0, linkedItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// foreach (InventoryItemBase item in contents.Items)
|
||||
// {
|
||||
// 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)
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Inserted linked item {0} for link in folder {1} for agent {2}",
|
||||
// linkedItem.Name, folderID, agentID);
|
||||
//
|
||||
// contents.Items.Add(linkedItem);
|
||||
// }
|
||||
//
|
||||
// // If the folder requested contains links, then we need to send those folders first, otherwise the links
|
||||
// // will be broken in the viewer.
|
||||
// HashSet<UUID> linkedItemFolderIdsToSend = new HashSet<UUID>();
|
||||
// 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)
|
||||
// {
|
||||
// // We don't need to send the folder if source and destination of the link are in the same
|
||||
// // folder.
|
||||
// if (linkedItem.Folder != containingFolder.ID)
|
||||
// linkedItemFolderIdsToSend.Add(linkedItem.Folder);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// foreach (UUID linkedItemFolderId in linkedItemFolderIdsToSend)
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[WEB FETCH INV DESC HANDLER]: Recursively fetching folder {0} linked by item in folder {1} for agent {2}",
|
||||
// linkedItemFolderId, folderID, agentID);
|
||||
//
|
||||
// int dummyVersion;
|
||||
// InventoryCollection linkedCollection
|
||||
// = Fetch(
|
||||
// agentID, linkedItemFolderId, ownerID, fetchFolders, fetchItems, sortOrder, out dummyVersion);
|
||||
//
|
||||
// InventoryFolderBase linkedFolder = new InventoryFolderBase(linkedItemFolderId);
|
||||
// linkedFolder.Owner = agentID;
|
||||
// linkedFolder = m_InventoryService.GetFolder(linkedFolder);
|
||||
//
|
||||
//// contents.Folders.AddRange(linkedCollection.Folders);
|
||||
//
|
||||
// contents.Folders.Add(linkedFolder);
|
||||
// contents.Items.AddRange(linkedCollection.Items);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Lost items don't really need a version
|
||||
version = 1;
|
||||
}
|
||||
|
||||
return contents;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Convert an internal inventory folder object into an LLSD object.
|
||||
/// </summary>
|
||||
/// <param name="invFolder"></param>
|
||||
/// <returns></returns>
|
||||
private LLSDInventoryFolder ConvertInventoryFolder(InventoryFolderBase invFolder)
|
||||
{
|
||||
LLSDInventoryFolder llsdFolder = new LLSDInventoryFolder();
|
||||
llsdFolder.folder_id = invFolder.ID;
|
||||
llsdFolder.parent_id = invFolder.ParentID;
|
||||
llsdFolder.name = invFolder.Name;
|
||||
llsdFolder.type = invFolder.Type;
|
||||
llsdFolder.preferred_type = -1;
|
||||
|
||||
return llsdFolder;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert an internal inventory item object into an LLSD object.
|
||||
/// </summary>
|
||||
/// <param name="invItem"></param>
|
||||
/// <returns></returns>
|
||||
private LLSDInventoryItem ConvertInventoryItem(InventoryItemBase invItem)
|
||||
{
|
||||
LLSDInventoryItem llsdItem = new LLSDInventoryItem();
|
||||
llsdItem.asset_id = invItem.AssetID;
|
||||
llsdItem.created_at = invItem.CreationDate;
|
||||
llsdItem.desc = invItem.Description;
|
||||
llsdItem.flags = (int)invItem.Flags;
|
||||
llsdItem.item_id = invItem.ID;
|
||||
llsdItem.name = invItem.Name;
|
||||
llsdItem.parent_id = invItem.Folder;
|
||||
llsdItem.type = invItem.AssetType;
|
||||
llsdItem.inv_type = invItem.InvType;
|
||||
|
||||
llsdItem.permissions = new LLSDPermissions();
|
||||
llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
|
||||
llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
|
||||
llsdItem.permissions.group_id = invItem.GroupID;
|
||||
llsdItem.permissions.group_mask = (int)invItem.GroupPermissions;
|
||||
llsdItem.permissions.is_owner_group = invItem.GroupOwned;
|
||||
llsdItem.permissions.next_owner_mask = (int)invItem.NextPermissions;
|
||||
llsdItem.permissions.owner_id = invItem.Owner;
|
||||
llsdItem.permissions.owner_mask = (int)invItem.CurrentPermissions;
|
||||
llsdItem.sale_info = new LLSDSaleInfo();
|
||||
llsdItem.sale_info.sale_price = invItem.SalePrice;
|
||||
llsdItem.sale_info.sale_type = invItem.SaleType;
|
||||
|
||||
return llsdItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Server.Handlers.Base;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class WebFetchInvDescServerConnector : ServiceConnector
|
||||
{
|
||||
private IInventoryService m_InventoryService;
|
||||
private ILibraryService m_LibraryService;
|
||||
private string m_ConfigName = "CapsService";
|
||||
|
||||
public WebFetchInvDescServerConnector(IConfigSource config, IHttpServer server, string configName) :
|
||||
base(config, server, configName)
|
||||
{
|
||||
if (configName != String.Empty)
|
||||
m_ConfigName = configName;
|
||||
|
||||
IConfig serverConfig = config.Configs[m_ConfigName];
|
||||
if (serverConfig == null)
|
||||
throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
|
||||
|
||||
string invService = serverConfig.GetString("InventoryService", String.Empty);
|
||||
|
||||
if (invService == String.Empty)
|
||||
throw new Exception("No InventoryService in config file");
|
||||
|
||||
Object[] args = new Object[] { config };
|
||||
m_InventoryService =
|
||||
ServerUtils.LoadPlugin<IInventoryService>(invService, args);
|
||||
|
||||
if (m_InventoryService == null)
|
||||
throw new Exception(String.Format("Failed to load InventoryService from {0}; config is {1}", invService, m_ConfigName));
|
||||
|
||||
string libService = serverConfig.GetString("LibraryService", String.Empty);
|
||||
m_LibraryService =
|
||||
ServerUtils.LoadPlugin<ILibraryService>(libService, args);
|
||||
|
||||
WebFetchInvDescHandler webFetchHandler = new WebFetchInvDescHandler(m_InventoryService, m_LibraryService);
|
||||
IRequestHandler reqHandler
|
||||
= new RestStreamHandler(
|
||||
"POST",
|
||||
"/CAPS/WebFetchInvDesc/" /*+ UUID.Random()*/,
|
||||
webFetchHandler.FetchInventoryDescendentsRequest,
|
||||
"WebFetchInvDesc",
|
||||
null);
|
||||
server.AddStreamHandler(reqHandler);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,94 +26,111 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.ClientStack;
|
||||
using OpenSim.Region.ClientStack.LindenUDP;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.Framework.Monitoring
|
||||
namespace OpenSim.Client.Linden
|
||||
{
|
||||
/// <summary>
|
||||
/// An experimental module to return data on services used by the simulator.
|
||||
/// Linden UDP Stack Region Module
|
||||
/// </summary>
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MonitorServicesModule")]
|
||||
public class MonitorServicesModule : ISharedRegionModule
|
||||
public class LLClientStackModule : INonSharedRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
#region IRegionModule Members
|
||||
|
||||
/// <summary>
|
||||
/// Scene that contains the region's data
|
||||
/// </summary>
|
||||
protected Scene m_scene;
|
||||
protected bool m_createClientStack = false;
|
||||
protected IClientNetworkServer m_clientServer;
|
||||
protected ClientStackManager m_clientStackManager;
|
||||
protected IConfigSource m_source;
|
||||
|
||||
protected string m_clientStackDll = "OpenSim.Region.ClientStack.LindenUDP.dll";
|
||||
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public string Name { get { return "Services Health Monitoring Module"; } }
|
||||
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_scene == null)
|
||||
{
|
||||
m_scene = scene;
|
||||
m_source = source;
|
||||
|
||||
// m_scene.AddCommand(this, "monitor services",
|
||||
// "monitor services",
|
||||
// "Returns the status of services used by the simulator. Experimental.",
|
||||
// HandleMonitorServices);
|
||||
IConfig startupConfig = m_source.Configs["Startup"];
|
||||
if (startupConfig != null)
|
||||
{
|
||||
m_clientStackDll = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
protected void HandleMonitorServices(string module, string[] args)
|
||||
{
|
||||
MainConsole.Instance.Output(GenerateServicesReport());
|
||||
}
|
||||
|
||||
protected string GenerateServicesReport()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("This is an experimental module. Please don't rely on these results\n");
|
||||
sb.Append("Asset service: ");
|
||||
|
||||
try
|
||||
if (m_scene == null)
|
||||
{
|
||||
CheckAssetService();
|
||||
sb.Append("OK");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
sb.AppendFormat("FAIL ({0})", e.Message);
|
||||
m_scene = scene;
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
if ((m_scene != null) && (m_createClientStack))
|
||||
{
|
||||
m_log.Info("[LLClientStackModule] Starting up LLClientStack.");
|
||||
IPEndPoint endPoint = m_scene.RegionInfo.InternalEndPoint;
|
||||
|
||||
uint port = (uint)endPoint.Port;
|
||||
m_clientStackManager = new ClientStackManager(m_clientStackDll);
|
||||
|
||||
m_clientServer
|
||||
= m_clientStackManager.CreateServer(endPoint.Address,
|
||||
ref port, m_scene.RegionInfo.ProxyOffset, m_scene.RegionInfo.m_allow_alternate_ports, m_source,
|
||||
m_scene.AuthenticateHandler);
|
||||
|
||||
m_clientServer.AddScene(m_scene);
|
||||
|
||||
m_clientServer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
protected void CheckAssetService()
|
||||
public void Close()
|
||||
{
|
||||
// Try to fetch an asset that will not exist (and hence avoid hitting cache)
|
||||
m_scene.AssetService.Get(UUID.Random().ToString());
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "LLClientStackModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
13
OpenSim/Client/Linden/Resources/LindenModules.addin.xml
Normal file
13
OpenSim/Client/Linden/Resources/LindenModules.addin.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<Addin id="OpenSim.Client.Linden.LindenModules" version="0.2">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Client.Linden.dll"/>
|
||||
</Runtime>
|
||||
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim" version="0.5" />
|
||||
</Dependencies>
|
||||
|
||||
<Extension path = "/OpenSim/RegionModules">
|
||||
<RegionModule id="LLClientStackModule" type="OpenSim.Client.Linden.LLClientStackModule" />
|
||||
</Extension>
|
||||
</Addin>
|
||||
1733
OpenSim/Client/MXP/ClientStack/MXPClientView.cs
Normal file
1733
OpenSim/Client/MXP/ClientStack/MXPClientView.cs
Normal file
File diff suppressed because it is too large
Load Diff
131
OpenSim/Client/MXP/MXPModule.cs
Normal file
131
OpenSim/Client/MXP/MXPModule.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using MXP;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Client.MXP.PacketHandler;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Client.MXP
|
||||
{
|
||||
|
||||
/**
|
||||
* MXP Client Module which adds MXP support to client / region communication.
|
||||
*/
|
||||
public class MXPModule : IRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private MXPPacketServer m_server;
|
||||
|
||||
private IConfigSource m_config;
|
||||
private int m_port = 1253;
|
||||
private Timer m_ticker;
|
||||
|
||||
private readonly Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
|
||||
private bool m_shutdown;
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
if (!m_scenes.ContainsKey(scene.RegionInfo.RegionID))
|
||||
m_scenes.Add(scene.RegionInfo.RegionID, scene);
|
||||
|
||||
m_config = source;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_config.Configs["MXP"] != null)
|
||||
{
|
||||
IConfig con = m_config.Configs["MXP"];
|
||||
|
||||
if (!con.GetBoolean("Enabled", false))
|
||||
return;
|
||||
|
||||
m_port = con.GetInt("Port", m_port);
|
||||
|
||||
m_server = new MXPPacketServer(m_port, m_scenes,m_config.Configs["StandAlone"].GetBoolean("accounts_authenticate",true));
|
||||
|
||||
m_ticker = new Timer(100);
|
||||
m_ticker.AutoReset = false;
|
||||
m_ticker.Elapsed += ticker_Elapsed;
|
||||
|
||||
lock (m_ticker)
|
||||
m_ticker.Start();
|
||||
|
||||
m_log.Info("[MXP ClientStack] MXP Enabled and Listening");
|
||||
}
|
||||
}
|
||||
|
||||
void ticker_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_server.Process();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("[MXP ClientStack]: Unhandled exception in process loop: " + ex.ToString() + " :" + ex.StackTrace.ToString());
|
||||
}
|
||||
|
||||
if (!m_shutdown)
|
||||
{
|
||||
lock (m_ticker)
|
||||
m_ticker.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_shutdown = true;
|
||||
if (m_ticker != null)
|
||||
{
|
||||
lock (m_ticker)
|
||||
m_ticker.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "MXP ClientStack Module"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,25 +25,18 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenMetaverse;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using pCampBot.Interfaces;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace pCampBot
|
||||
namespace OpenSim.Client.MXP
|
||||
{
|
||||
public class AbstractBehaviour : IBehaviour
|
||||
public static class MXPUtil
|
||||
{
|
||||
public string Name { get; protected set; }
|
||||
|
||||
public Bot Bot { get; protected set; }
|
||||
|
||||
public virtual void Action() {}
|
||||
|
||||
public virtual void Initialize(Bot bot)
|
||||
public static string GenerateMXPURL(string server, int port, UUID bubbleID, Vector3 location)
|
||||
{
|
||||
Bot = bot;
|
||||
return string.Format("mxp://{0}:{1}/{2}/{3}", server, port, bubbleID.Guid, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
561
OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
Normal file
561
OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
Normal file
@@ -0,0 +1,561 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* This file borrows heavily from MXPServer.cs - the reference MXPServer
|
||||
* See http://www.bubblecloud.org for a copy of the original file and
|
||||
* implementation details. */
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using MXP;
|
||||
using MXP.Messages;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Client.MXP.ClientStack;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace OpenSim.Client.MXP.PacketHandler
|
||||
{
|
||||
public class MXPPacketServer
|
||||
{
|
||||
internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
#region Fields
|
||||
|
||||
private readonly List<MXPClientView> m_clients = new List<MXPClientView>();
|
||||
private readonly Dictionary<UUID, Scene> m_scenes;
|
||||
private readonly Transmitter m_transmitter;
|
||||
|
||||
// private readonly Thread m_clientThread;
|
||||
|
||||
private readonly IList<Session> m_sessions = new List<Session>();
|
||||
private readonly IList<Session> m_sessionsToClient = new List<Session>();
|
||||
private readonly IList<MXPClientView> m_sessionsToRemove = new List<MXPClientView>();
|
||||
|
||||
private readonly int m_port;
|
||||
// private readonly bool m_accountsAuthenticate;
|
||||
|
||||
private readonly String m_programName;
|
||||
private readonly byte m_programMajorVersion;
|
||||
private readonly byte m_programMinorVersion;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
public MXPPacketServer(int port, Dictionary<UUID, Scene> scenes, bool accountsAuthenticate)
|
||||
{
|
||||
m_port = port;
|
||||
// m_accountsAuthenticate = accountsAuthenticate;
|
||||
|
||||
m_scenes = scenes;
|
||||
|
||||
m_programMinorVersion = 63;
|
||||
m_programMajorVersion = 0;
|
||||
m_programName = "OpenSimulator";
|
||||
|
||||
m_transmitter = new Transmitter(port);
|
||||
|
||||
StartListener();
|
||||
}
|
||||
|
||||
public void StartListener()
|
||||
{
|
||||
m_log.Info("[MXP ClientStack] Transmitter starting on UDP server port: " + m_port);
|
||||
m_transmitter.Startup();
|
||||
m_log.Info("[MXP ClientStack] Transmitter started. MXP version: "+MxpConstants.ProtocolMajorVersion+"."+MxpConstants.ProtocolMinorVersion+" Source Revision: "+MxpConstants.ProtocolSourceRevision);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Number of sessions pending. (Process() accepts pending sessions).
|
||||
/// </summary>
|
||||
public int PendingSessionCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter.PendingSessionCount;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Number of connected sessions.
|
||||
/// </summary>
|
||||
public int SessionCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_sessions.Count;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Property reflecting whether client transmitter threads are alive.
|
||||
/// </summary>
|
||||
public bool IsTransmitterAlive
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null && m_transmitter.IsAlive;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Number of packets sent.
|
||||
/// </summary>
|
||||
public ulong PacketsSent
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.PacketsSent : 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Number of packets received.
|
||||
/// </summary>
|
||||
public ulong PacketsReceived
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.PacketsReceived : 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Bytes client has received so far.
|
||||
/// </summary>
|
||||
public ulong BytesReceived
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.BytesReceived : 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Bytes client has sent so far.
|
||||
/// </summary>
|
||||
public ulong BytesSent
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.BytesSent : 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Number of bytes received (bytes per second) during past second.
|
||||
/// </summary>
|
||||
public double ReceiveRate
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.ReceiveRate : 0;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Number of bytes sent (bytes per second) during past second.
|
||||
/// </summary>
|
||||
public double SendRate
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_transmitter != null ? m_transmitter.SendRate : 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Session Management
|
||||
|
||||
public void Disconnect(Session session)
|
||||
{
|
||||
if (session.IsConnected)
|
||||
{
|
||||
Message message = MessageFactory.Current.ReserveMessage(typeof(LeaveRequestMessage));
|
||||
session.Send(message);
|
||||
MessageFactory.Current.ReleaseMessage(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("Not connected.");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Processing
|
||||
|
||||
public void Process()
|
||||
{
|
||||
ProcessMessages();
|
||||
Clean();
|
||||
}
|
||||
|
||||
public void Clean()
|
||||
{
|
||||
foreach (MXPClientView clientView in m_clients)
|
||||
{
|
||||
if (clientView.Session.SessionState == SessionState.Disconnected)
|
||||
{
|
||||
m_sessionsToRemove.Add(clientView);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (MXPClientView clientView in m_sessionsToRemove)
|
||||
{
|
||||
clientView.Scene.RemoveClient(clientView.AgentId);
|
||||
clientView.OnClean();
|
||||
m_clients.Remove(clientView);
|
||||
m_sessions.Remove(clientView.Session);
|
||||
}
|
||||
|
||||
m_sessionsToRemove.Clear();
|
||||
}
|
||||
|
||||
public void ProcessMessages()
|
||||
{
|
||||
if (m_transmitter.PendingSessionCount > 0)
|
||||
{
|
||||
Session tmp = m_transmitter.AcceptPendingSession();
|
||||
m_sessions.Add(tmp);
|
||||
m_sessionsToClient.Add(tmp);
|
||||
|
||||
}
|
||||
|
||||
List<Session> tmpRemove = new List<Session>();
|
||||
|
||||
foreach (Session session in m_sessionsToClient)
|
||||
{
|
||||
while (session.AvailableMessages > 0)
|
||||
{
|
||||
Message message = session.Receive();
|
||||
|
||||
if (message.GetType() == typeof (JoinRequestMessage))
|
||||
{
|
||||
|
||||
JoinRequestMessage joinRequestMessage = (JoinRequestMessage) message;
|
||||
|
||||
m_log.Info("[MXP ClientStack]: Session join request: " + session.SessionId + " (" +
|
||||
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
|
||||
session.RemoteEndPoint.Port + ")");
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if (joinRequestMessage.BubbleId == Guid.Empty)
|
||||
{
|
||||
foreach (Scene scene in m_scenes.Values)
|
||||
{
|
||||
if (scene.RegionInfo.RegionName == joinRequestMessage.BubbleName)
|
||||
{
|
||||
m_log.Info("[MXP ClientStack]: Resolved region by name: " + joinRequestMessage.BubbleName + " (" + scene.RegionInfo.RegionID + ")");
|
||||
joinRequestMessage.BubbleId = scene.RegionInfo.RegionID.Guid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (joinRequestMessage.BubbleId == Guid.Empty)
|
||||
{
|
||||
m_log.Warn("[MXP ClientStack]: Failed to resolve region by name: " + joinRequestMessage.BubbleName);
|
||||
}
|
||||
|
||||
UUID sceneId = new UUID(joinRequestMessage.BubbleId);
|
||||
|
||||
bool regionExists = true;
|
||||
if (!m_scenes.ContainsKey(sceneId))
|
||||
{
|
||||
m_log.Info("[MXP ClientStack]: No such region: " + sceneId);
|
||||
regionExists = false;
|
||||
}
|
||||
|
||||
UUID userId = UUID.Zero;
|
||||
UserAccount account = null;
|
||||
bool authorized = regionExists ? AuthoriseUser(joinRequestMessage.ParticipantName,
|
||||
joinRequestMessage.ParticipantPassphrase,
|
||||
new UUID(joinRequestMessage.BubbleId), out account)
|
||||
: false;
|
||||
|
||||
if (authorized)
|
||||
{
|
||||
Scene scene = m_scenes[sceneId];
|
||||
UUID mxpSessionID = UUID.Random();
|
||||
|
||||
string reason;
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Session join request success: " + session.SessionId + " (" +
|
||||
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
|
||||
session.RemoteEndPoint.Port + ")");
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Attaching UserAgent to UserProfile...");
|
||||
UUID secureSession = UUID.Zero;
|
||||
AttachUserAgentToUserProfile(account, session, mxpSessionID, sceneId, out secureSession);
|
||||
m_log.Debug("[MXP ClientStack]: Attached UserAgent to UserProfile.");
|
||||
m_log.Debug("[MXP ClientStack]: Preparing Scene to Connection...");
|
||||
if (!PrepareSceneForConnection(mxpSessionID, secureSession, sceneId, account, out reason))
|
||||
{
|
||||
m_log.DebugFormat("[MXP ClientStack]: Scene refused connection: {0}", reason);
|
||||
DeclineConnection(session, joinRequestMessage);
|
||||
tmpRemove.Add(session);
|
||||
continue;
|
||||
}
|
||||
m_log.Debug("[MXP ClientStack]: Prepared Scene to Connection.");
|
||||
m_log.Debug("[MXP ClientStack]: Accepting connection...");
|
||||
AcceptConnection(session, joinRequestMessage, mxpSessionID, userId);
|
||||
m_log.Info("[MXP ClientStack]: Accepted connection.");
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Creating ClientView....");
|
||||
MXPClientView client = new MXPClientView(session, mxpSessionID, userId, scene, account.FirstName, account.LastName);
|
||||
m_clients.Add(client);
|
||||
m_log.Debug("[MXP ClientStack]: Created ClientView.");
|
||||
|
||||
client.MXPSendSynchronizationBegin(m_scenes[new UUID(joinRequestMessage.BubbleId)].SceneContents.GetTotalObjectsCount());
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Starting ClientView...");
|
||||
try
|
||||
{
|
||||
client.Start();
|
||||
m_log.Debug("[MXP ClientStack]: Started ClientView.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e);
|
||||
}
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Connected");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[MXP ClientStack]: Session join request failure: " + session.SessionId + " (" +
|
||||
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
|
||||
session.RemoteEndPoint.Port + ")");
|
||||
|
||||
DeclineConnection(session, joinRequestMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[MXP ClientStack]: Session join request failure: " + session.SessionId + " (" +
|
||||
(session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" +
|
||||
session.RemoteEndPoint.Port + "): "+e.ToString()+" :"+e.StackTrace.ToString());
|
||||
}
|
||||
tmpRemove.Add(session);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (Session session in tmpRemove)
|
||||
{
|
||||
m_sessionsToClient.Remove(session);
|
||||
}
|
||||
|
||||
foreach (MXPClientView clientView in m_clients)
|
||||
{
|
||||
int messagesProcessedCount = 0;
|
||||
Session session = clientView.Session;
|
||||
|
||||
while (session.AvailableMessages > 0)
|
||||
{
|
||||
Message message = session.Receive();
|
||||
|
||||
if (message.GetType() == typeof(LeaveRequestMessage))
|
||||
{
|
||||
LeaveResponseMessage leaveResponseMessage = (LeaveResponseMessage)MessageFactory.Current.ReserveMessage(
|
||||
typeof(LeaveResponseMessage));
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Session leave request: " + session.SessionId + " (" + (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" + session.RemoteEndPoint.Port + ")");
|
||||
|
||||
leaveResponseMessage.RequestMessageId = message.MessageId;
|
||||
leaveResponseMessage.FailureCode = 0;
|
||||
session.Send(leaveResponseMessage);
|
||||
|
||||
if (session.SessionState != SessionState.Disconnected)
|
||||
{
|
||||
session.SetStateDisconnected();
|
||||
}
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Removing Client from Scene");
|
||||
//clientView.Scene.RemoveClient(clientView.AgentId);
|
||||
}
|
||||
if (message.GetType() == typeof(LeaveResponseMessage))
|
||||
{
|
||||
LeaveResponseMessage leaveResponseMessage = (LeaveResponseMessage)message;
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Session leave response: " + session.SessionId + " (" + (session.IsIncoming ? "from" : "to") + " " + session.RemoteEndPoint.Address + ":" + session.RemoteEndPoint.Port + ")");
|
||||
|
||||
if (leaveResponseMessage.FailureCode == 0)
|
||||
{
|
||||
session.SetStateDisconnected();
|
||||
}
|
||||
|
||||
m_log.Debug("[MXP ClientStack]: Removing Client from Scene");
|
||||
//clientView.Scene.RemoveClient(clientView.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientView.MXPPRocessMessage(message);
|
||||
}
|
||||
|
||||
MessageFactory.Current.ReleaseMessage(message);
|
||||
messagesProcessedCount++;
|
||||
if (messagesProcessedCount > 1000)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void AcceptConnection(Session session, JoinRequestMessage joinRequestMessage, UUID mxpSessionID, UUID userId)
|
||||
{
|
||||
JoinResponseMessage joinResponseMessage = (JoinResponseMessage)MessageFactory.Current.ReserveMessage(
|
||||
typeof(JoinResponseMessage));
|
||||
|
||||
joinResponseMessage.RequestMessageId = joinRequestMessage.MessageId;
|
||||
joinResponseMessage.FailureCode = MxpResponseCodes.SUCCESS;
|
||||
|
||||
joinResponseMessage.BubbleId = joinRequestMessage.BubbleId;
|
||||
joinResponseMessage.ParticipantId = userId.Guid;
|
||||
joinResponseMessage.AvatarId = userId.Guid;
|
||||
joinResponseMessage.BubbleAssetCacheUrl = "http://" +
|
||||
NetworkUtil.GetHostFor(session.RemoteEndPoint.Address,
|
||||
m_scenes[
|
||||
new UUID(joinRequestMessage.BubbleId)].
|
||||
RegionInfo.
|
||||
ExternalHostName) + ":" +
|
||||
m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.
|
||||
HttpPort + "/assets/";
|
||||
|
||||
joinResponseMessage.BubbleName = m_scenes[new UUID(joinRequestMessage.BubbleId)].RegionInfo.RegionName;
|
||||
|
||||
joinResponseMessage.BubbleRange = 128;
|
||||
joinResponseMessage.BubblePerceptionRange = 128 + 256;
|
||||
joinResponseMessage.BubbleRealTime = 0;
|
||||
joinResponseMessage.ProgramName = m_programName;
|
||||
joinResponseMessage.ProgramMajorVersion = m_programMajorVersion;
|
||||
joinResponseMessage.ProgramMinorVersion = m_programMinorVersion;
|
||||
joinResponseMessage.ProtocolMajorVersion = MxpConstants.ProtocolMajorVersion;
|
||||
joinResponseMessage.ProtocolMinorVersion = MxpConstants.ProtocolMinorVersion;
|
||||
joinResponseMessage.ProtocolSourceRevision = MxpConstants.ProtocolSourceRevision;
|
||||
|
||||
session.Send(joinResponseMessage);
|
||||
|
||||
session.SetStateConnected();
|
||||
}
|
||||
|
||||
private void DeclineConnection(Session session, Message joinRequestMessage)
|
||||
{
|
||||
JoinResponseMessage joinResponseMessage = (JoinResponseMessage)MessageFactory.Current.ReserveMessage(typeof(JoinResponseMessage));
|
||||
|
||||
joinResponseMessage.RequestMessageId = joinRequestMessage.MessageId;
|
||||
joinResponseMessage.FailureCode = MxpResponseCodes.UNAUTHORIZED_OPERATION;
|
||||
|
||||
joinResponseMessage.ProgramName = m_programName;
|
||||
joinResponseMessage.ProgramMajorVersion = m_programMajorVersion;
|
||||
joinResponseMessage.ProgramMinorVersion = m_programMinorVersion;
|
||||
joinResponseMessage.ProtocolMajorVersion = MxpConstants.ProtocolMajorVersion;
|
||||
joinResponseMessage.ProtocolMinorVersion = MxpConstants.ProtocolMinorVersion;
|
||||
joinResponseMessage.ProtocolSourceRevision = MxpConstants.ProtocolSourceRevision;
|
||||
|
||||
session.Send(joinResponseMessage);
|
||||
|
||||
session.SetStateDisconnected();
|
||||
}
|
||||
|
||||
public bool AuthoriseUser(string participantName, string password, UUID sceneId, out UserAccount account)
|
||||
{
|
||||
string firstName = "";
|
||||
string lastName = "";
|
||||
account = null;
|
||||
|
||||
string[] nameParts = participantName.Split(' ');
|
||||
if (nameParts.Length != 2)
|
||||
{
|
||||
m_log.Error("[MXP ClientStack]: Login failed as user name is not formed of first and last name separated by space: " + participantName);
|
||||
return false;
|
||||
}
|
||||
firstName = nameParts[0];
|
||||
lastName = nameParts[1];
|
||||
|
||||
account = m_scenes[sceneId].UserAccountService.GetUserAccount(m_scenes[sceneId].RegionInfo.ScopeID, firstName, lastName);
|
||||
if (account != null)
|
||||
return (m_scenes[sceneId].AuthenticationService.Authenticate(account.PrincipalID, password, 1) != string.Empty);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void AttachUserAgentToUserProfile(UserAccount account, Session session, UUID sessionId, UUID sceneId, out UUID secureSessionId)
|
||||
{
|
||||
secureSessionId = UUID.Random();
|
||||
Scene scene = m_scenes[sceneId];
|
||||
scene.PresenceService.LoginAgent(account.PrincipalID.ToString(), sessionId, secureSessionId);
|
||||
}
|
||||
|
||||
private bool PrepareSceneForConnection(UUID sessionId, UUID secureSessionId, UUID sceneId, UserAccount account, out string reason)
|
||||
{
|
||||
Scene scene = m_scenes[sceneId];
|
||||
|
||||
AgentCircuitData agent = new AgentCircuitData();
|
||||
agent.AgentID = account.PrincipalID;
|
||||
agent.firstname = account.FirstName;
|
||||
agent.lastname = account.LastName;
|
||||
agent.SessionID = sessionId;
|
||||
agent.SecureSessionID = secureSessionId;
|
||||
agent.circuitcode = sessionId.CRC();
|
||||
agent.BaseFolder = UUID.Zero;
|
||||
agent.InventoryFolder = UUID.Zero;
|
||||
agent.startpos = new Vector3(0, 0, 0); // TODO Fill in region start position
|
||||
agent.CapsPath = "http://localhost/";
|
||||
agent.Appearance = scene.AvatarService.GetAppearance(account.PrincipalID);
|
||||
|
||||
if (agent.Appearance == null)
|
||||
{
|
||||
m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname);
|
||||
agent.Appearance = new AvatarAppearance();
|
||||
}
|
||||
|
||||
return scene.NewUserConnection(agent, 0, out reason);
|
||||
}
|
||||
|
||||
public void PrintDebugInformation()
|
||||
{
|
||||
m_log.Info("[MXP ClientStack]: Statistics report");
|
||||
m_log.Info("Pending Sessions: " + PendingSessionCount);
|
||||
m_log.Info("Sessions: " + SessionCount + " (Clients: " + m_clients.Count + " )");
|
||||
m_log.Info("Transmitter Alive?: " + IsTransmitterAlive);
|
||||
m_log.Info("Packets Sent/Received: " + PacketsSent + " / " + PacketsReceived);
|
||||
m_log.Info("Bytes Sent/Received: " + BytesSent + " / " + BytesReceived);
|
||||
m_log.Info("Send/Receive Rate (bps): " + SendRate + " / " + ReceiveRate);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
1228
OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
Normal file
1228
OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
Normal file
File diff suppressed because it is too large
Load Diff
133
OpenSim/Client/VWoHTTP/VWoHTTPModule.cs
Normal file
133
OpenSim/Client/VWoHTTP/VWoHTTPModule.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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.Text;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Client.VWoHTTP.ClientStack;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Client.VWoHTTP
|
||||
{
|
||||
class VWoHTTPModule : IRegionModule, IHttpAgentHandler
|
||||
{
|
||||
private bool m_disabled = true;
|
||||
|
||||
private IHttpServer m_httpd;
|
||||
|
||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
private Dictionary<UUID, VWHClientView> m_clients = new Dictionary<UUID, VWHClientView>();
|
||||
|
||||
#region Implementation of IRegionModule
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
|
||||
m_scenes.Add(scene);
|
||||
|
||||
m_httpd = MainServer.Instance;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
|
||||
m_httpd.AddAgentHandler("vwohttp", this);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
if (m_disabled)
|
||||
return;
|
||||
|
||||
m_httpd.RemoveAgentHandler("vwohttp", this);
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "VWoHTTP ClientStack"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Implementation of IHttpAgentHandler
|
||||
|
||||
public bool Handle(OSHttpRequest req, OSHttpResponse resp)
|
||||
{
|
||||
string[] urlparts = req.Url.AbsolutePath.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if (urlparts.Length < 2)
|
||||
return false;
|
||||
|
||||
if (urlparts[1] == "connect")
|
||||
{
|
||||
UUID sessID = UUID.Random();
|
||||
|
||||
VWHClientView client = new VWHClientView(sessID, UUID.Random(), "VWoHTTPClient", m_scenes[0]);
|
||||
|
||||
m_clients.Add(sessID, client);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (urlparts.Length < 3)
|
||||
return false;
|
||||
|
||||
UUID sessionID;
|
||||
if (!UUID.TryParse(urlparts[1], out sessionID))
|
||||
return false;
|
||||
|
||||
if (!m_clients.ContainsKey(sessionID))
|
||||
return false;
|
||||
|
||||
return m_clients[sessionID].ProcessInMsg(req, resp);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Match(OSHttpRequest req, OSHttpResponse resp)
|
||||
{
|
||||
return req.Url.ToString().Contains("vwohttp");
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,6 @@ using System.IO;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
using OpenSim.Server.Base;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenMetaverse;
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenSim.ConsoleClient
|
||||
|
||||
request.ContentType = "application/x-www-form-urlencoded";
|
||||
|
||||
byte[] buffer = Encoding.ASCII.GetBytes(data);
|
||||
byte[] buffer = new System.Text.ASCIIEncoding().GetBytes(data);
|
||||
int length = (int) buffer.Length;
|
||||
request.ContentLength = length;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenSim.Data
|
||||
{
|
||||
public abstract AssetBase GetAsset(UUID uuid);
|
||||
|
||||
public abstract void StoreAsset(AssetBase asset);
|
||||
public abstract bool StoreAsset(AssetBase asset);
|
||||
public abstract bool ExistsAsset(UUID uuid);
|
||||
|
||||
public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenSim.Data
|
||||
public interface IAssetDataPlugin : IPlugin
|
||||
{
|
||||
AssetBase GetAsset(UUID uuid);
|
||||
void StoreAsset(AssetBase asset);
|
||||
bool StoreAsset(AssetBase asset);
|
||||
bool ExistsAsset(UUID uuid);
|
||||
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
void Initialise(string connect);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenSim.Data
|
||||
{
|
||||
public class FriendsData
|
||||
{
|
||||
public string PrincipalID;
|
||||
public UUID PrincipalID;
|
||||
public string Friend;
|
||||
public Dictionary<string, string> Data;
|
||||
}
|
||||
@@ -46,8 +46,6 @@ namespace OpenSim.Data
|
||||
{
|
||||
bool Store(FriendsData data);
|
||||
bool Delete(UUID ownerID, string friend);
|
||||
bool Delete(string ownerID, string friend);
|
||||
FriendsData[] GetFriends(UUID principalID);
|
||||
FriendsData[] GetFriends(string principalID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,30 +37,10 @@ namespace OpenSim.Data
|
||||
public UUID RegionID;
|
||||
public UUID ScopeID;
|
||||
public string RegionName;
|
||||
|
||||
/// <summary>
|
||||
/// The position in meters of this region.
|
||||
/// </summary>
|
||||
public int posX;
|
||||
|
||||
/// <summary>
|
||||
/// The position in meters of this region.
|
||||
/// </summary>
|
||||
public int posY;
|
||||
|
||||
public int sizeX;
|
||||
public int sizeY;
|
||||
|
||||
/// <summary>
|
||||
/// Return the x-coordinate of this region.
|
||||
/// </summary>
|
||||
public int coordX { get { return posX / (int)Constants.RegionSize; } }
|
||||
|
||||
/// <summary>
|
||||
/// Return the y-coordinate of this region.
|
||||
/// </summary>
|
||||
public int coordY { get { return posY / (int)Constants.RegionSize; } }
|
||||
|
||||
public Dictionary<string, object> Data;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* 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.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface exists to distinguish between the normal IAssetDataPlugin and the one used by XAssetService
|
||||
/// for now.
|
||||
/// </summary>
|
||||
public interface IXAssetDataPlugin : IPlugin
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -40,11 +40,6 @@ namespace OpenSim.Data
|
||||
public UUID folderID;
|
||||
public UUID agentID;
|
||||
public UUID parentFolderID;
|
||||
|
||||
public XInventoryFolder Clone()
|
||||
{
|
||||
return (XInventoryFolder)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
|
||||
public class XInventoryItem
|
||||
@@ -69,11 +64,6 @@ namespace OpenSim.Data
|
||||
public UUID avatarID;
|
||||
public UUID parentFolderID;
|
||||
public int inventoryGroupPermissions;
|
||||
|
||||
public XInventoryItem Clone()
|
||||
{
|
||||
return (XInventoryItem)MemberwiseClone();
|
||||
}
|
||||
}
|
||||
|
||||
public interface IXInventoryData
|
||||
@@ -84,38 +74,9 @@ namespace OpenSim.Data
|
||||
bool StoreFolder(XInventoryFolder folder);
|
||||
bool StoreItem(XInventoryItem item);
|
||||
|
||||
/// <summary>
|
||||
/// Delete folders where field == val
|
||||
/// </summary>
|
||||
/// <param name="field"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <returns>true if the delete was successful, false if it was not</returns>
|
||||
bool DeleteFolders(string field, string val);
|
||||
|
||||
/// <summary>
|
||||
/// Delete folders where field1 == val1, field2 == val2...
|
||||
/// </summary>
|
||||
/// <param name="fields"></param>
|
||||
/// <param name="vals"></param>
|
||||
/// <returns>true if the delete was successful, false if it was not</returns>
|
||||
bool DeleteFolders(string[] fields, string[] vals);
|
||||
|
||||
/// <summary>
|
||||
/// Delete items where field == val
|
||||
/// </summary>
|
||||
/// <param name="field"></param>
|
||||
/// <param name="val"></param>
|
||||
/// <returns>true if the delete was successful, false if it was not</returns>
|
||||
bool DeleteItems(string field, string val);
|
||||
|
||||
/// <summary>
|
||||
/// Delete items where field1 == val1, field2 == val2...
|
||||
/// </summary>
|
||||
/// <param name="fields"></param>
|
||||
/// <param name="vals"></param>
|
||||
/// <returns>true if the delete was successful, false if it was not</returns>
|
||||
bool DeleteItems(string[] fields, string[] vals);
|
||||
|
||||
bool MoveItem(string id, string newParent);
|
||||
XInventoryItem[] GetActiveGestures(UUID principalID);
|
||||
int GetAssetPermissions(UUID principalID, UUID assetID);
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// Create asset in m_database
|
||||
/// </summary>
|
||||
/// <param name="asset">the asset</param>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
|
||||
string sql =
|
||||
@@ -192,10 +192,12 @@ namespace OpenSim.Data.MSSQL
|
||||
try
|
||||
{
|
||||
command.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
m_log.Error("[ASSET DB]: Error storing item :" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>,
|
||||
IAvatarData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLAvatarData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Avatar")
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
private const string _migrationStore = "EstateStore";
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog _Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private MSSQLManager _Database;
|
||||
private string m_connectionString;
|
||||
@@ -72,12 +72,7 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
|
||||
//Migration settings
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
Migration m = new Migration(conn, GetType().Assembly, "EstateStore");
|
||||
m.Update();
|
||||
}
|
||||
_Database.CheckMigration(_migrationStore);
|
||||
|
||||
//Interesting way to get parameters! Maybe implement that also with other types
|
||||
Type t = typeof(EstateSettings);
|
||||
@@ -117,19 +112,19 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
FieldInfo f = _FieldMap[name];
|
||||
object v = reader[name];
|
||||
if (f.FieldType == typeof(bool))
|
||||
if (f.FieldType == typeof(bool) )
|
||||
{
|
||||
f.SetValue(es, Convert.ToInt32(v) != 0);
|
||||
}
|
||||
else if (f.FieldType == typeof(UUID))
|
||||
else if (f.FieldType == typeof(UUID) )
|
||||
{
|
||||
f.SetValue(es, new UUID((Guid)v)); // uuid);
|
||||
}
|
||||
else if (f.FieldType == typeof(string))
|
||||
else if (f.FieldType == typeof(string))
|
||||
{
|
||||
f.SetValue(es, v.ToString());
|
||||
}
|
||||
else if (f.FieldType == typeof(UInt32))
|
||||
else if (f.FieldType == typeof(UInt32))
|
||||
{
|
||||
f.SetValue(es, Convert.ToUInt32(v));
|
||||
}
|
||||
@@ -148,10 +143,55 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (insertEstate && create)
|
||||
{
|
||||
DoCreate(es);
|
||||
LinkRegion(regionID, (int)es.EstateID);
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
names.Remove("EstateID");
|
||||
|
||||
sql = string.Format("insert into estate_settings ({0}) values ( @{1})", String.Join(",", names.ToArray()), String.Join(", @", names.ToArray()));
|
||||
|
||||
//_Log.Debug("[DB ESTATE]: SQL: " + sql);
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand insertCommand = new SqlCommand(sql, conn))
|
||||
{
|
||||
insertCommand.CommandText = sql + " SET @ID = SCOPE_IDENTITY()";
|
||||
|
||||
foreach (string name in names)
|
||||
{
|
||||
insertCommand.Parameters.Add(_Database.CreateParameter("@" + name, _FieldMap[name].GetValue(es)));
|
||||
}
|
||||
SqlParameter idParameter = new SqlParameter("@ID", SqlDbType.Int);
|
||||
idParameter.Direction = ParameterDirection.Output;
|
||||
insertCommand.Parameters.Add(idParameter);
|
||||
conn.Open();
|
||||
insertCommand.ExecuteNonQuery();
|
||||
|
||||
es.EstateID = Convert.ToUInt32(idParameter.Value);
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [estate_map] ([RegionID] ,[EstateID]) VALUES (@RegionID, @EstateID)";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionID", regionID));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@EstateID", es.EstateID));
|
||||
// This will throw on dupe key
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_Log.DebugFormat("[ESTATE DB]: Error inserting regionID and EstateID in estate_map: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO check if this is needed??
|
||||
es.Save();
|
||||
}
|
||||
|
||||
LoadBanList(es);
|
||||
@@ -165,53 +205,6 @@ namespace OpenSim.Data.MSSQL
|
||||
return es;
|
||||
}
|
||||
|
||||
public EstateSettings CreateNewEstate()
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
|
||||
DoCreate(es);
|
||||
|
||||
LoadBanList(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
private void DoCreate(EstateSettings es)
|
||||
{
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
names.Remove("EstateID");
|
||||
|
||||
string sql = string.Format("insert into estate_settings ({0}) values ( @{1})", String.Join(",", names.ToArray()), String.Join(", @", names.ToArray()));
|
||||
|
||||
//_Log.Debug("[DB ESTATE]: SQL: " + sql);
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand insertCommand = new SqlCommand(sql, conn))
|
||||
{
|
||||
insertCommand.CommandText = sql + " SET @ID = SCOPE_IDENTITY()";
|
||||
|
||||
foreach (string name in names)
|
||||
{
|
||||
insertCommand.Parameters.Add(_Database.CreateParameter("@" + name, _FieldMap[name].GetValue(es)));
|
||||
}
|
||||
SqlParameter idParameter = new SqlParameter("@ID", SqlDbType.Int);
|
||||
idParameter.Direction = ParameterDirection.Output;
|
||||
insertCommand.Parameters.Add(idParameter);
|
||||
conn.Open();
|
||||
insertCommand.ExecuteNonQuery();
|
||||
|
||||
es.EstateID = Convert.ToUInt32(idParameter.Value);
|
||||
}
|
||||
|
||||
//TODO check if this is needed??
|
||||
es.Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stores the estate settings.
|
||||
/// </summary>
|
||||
@@ -317,12 +310,12 @@ namespace OpenSim.Data.MSSQL
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = conn.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from estateban where EstateID = @EstateID";
|
||||
cmd.CommandText = "delete from estateban where EstateID = @EstateID";
|
||||
cmd.Parameters.AddWithValue("@EstateID", (int)es.EstateID);
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
//Insert after
|
||||
cmd.CommandText = "insert into estateban (EstateID, bannedUUID,bannedIp, bannedIpHostMask, bannedNameMask) values ( @EstateID, @bannedUUID, '','','' )";
|
||||
cmd.CommandText = "insert into estateban (EstateID, bannedUUID) values ( @EstateID, @bannedUUID )";
|
||||
cmd.Parameters.AddWithValue("@bannedUUID", Guid.Empty);
|
||||
foreach (EstateBan b in es.EstateBans)
|
||||
{
|
||||
@@ -357,219 +350,26 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
public EstateSettings LoadEstateSettings(int estateID)
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) + " from estate_settings where EstateID = @EstateID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@EstateID", (int)estateID);
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
FieldInfo f = _FieldMap[name];
|
||||
object v = reader[name];
|
||||
if (f.FieldType == typeof(bool))
|
||||
{
|
||||
f.SetValue(es, Convert.ToInt32(v) != 0);
|
||||
}
|
||||
else if (f.FieldType == typeof(UUID))
|
||||
{
|
||||
f.SetValue(es, new UUID((Guid)v)); // uuid);
|
||||
}
|
||||
else if (f.FieldType == typeof(string))
|
||||
{
|
||||
f.SetValue(es, v.ToString());
|
||||
}
|
||||
else if (f.FieldType == typeof(UInt32))
|
||||
{
|
||||
f.SetValue(es, Convert.ToUInt32(v));
|
||||
}
|
||||
else if (f.FieldType == typeof(Single))
|
||||
{
|
||||
f.SetValue(es, Convert.ToSingle(v));
|
||||
}
|
||||
else
|
||||
f.SetValue(es, v);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
LoadBanList(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
|
||||
//Set event
|
||||
es.OnSave += StoreEstateSettings;
|
||||
return es;
|
||||
|
||||
}
|
||||
|
||||
public List<EstateSettings> LoadEstateSettingsAll()
|
||||
{
|
||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||
|
||||
List<int> allEstateIds = GetEstatesAll();
|
||||
|
||||
foreach (int estateId in allEstateIds)
|
||||
allEstateSettings.Add(LoadEstateSettings(estateId));
|
||||
|
||||
return allEstateSettings;
|
||||
return new EstateSettings();
|
||||
}
|
||||
|
||||
public List<int> GetEstates(string search)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
string sql = "select estateID from estate_settings where EstateName = @EstateName";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@EstateName", search);
|
||||
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(reader["EstateID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesAll()
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
string sql = "select estateID from estate_settings";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(reader["EstateID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesByOwner(UUID ownerID)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
string sql = "select estateID from estate_settings where EstateOwner = @EstateOwner";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@EstateOwner", ownerID);
|
||||
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(reader["EstateID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return new List<int>();
|
||||
}
|
||||
|
||||
public bool LinkRegion(UUID regionID, int estateID)
|
||||
{
|
||||
string deleteSQL = "delete from estate_map where RegionID = @RegionID";
|
||||
string insertSQL = "insert into estate_map values (@RegionID, @EstateID)";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
SqlTransaction transaction = conn.BeginTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(deleteSQL, conn))
|
||||
{
|
||||
cmd.Transaction = transaction;
|
||||
cmd.Parameters.AddWithValue("@RegionID", regionID.Guid);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
using (SqlCommand cmd = new SqlCommand(insertSQL, conn))
|
||||
{
|
||||
cmd.Transaction = transaction;
|
||||
cmd.Parameters.AddWithValue("@RegionID", regionID.Guid);
|
||||
cmd.Parameters.AddWithValue("@EstateID", estateID);
|
||||
|
||||
int ret = cmd.ExecuteNonQuery();
|
||||
|
||||
if (ret != 0)
|
||||
transaction.Commit();
|
||||
else
|
||||
transaction.Rollback();
|
||||
|
||||
return (ret != 0);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
||||
transaction.Rollback();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<UUID> GetRegions(int estateID)
|
||||
{
|
||||
List<UUID> result = new List<UUID>();
|
||||
string sql = "select RegionID from estate_map where EstateID = @EstateID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@EstateID", estateID);
|
||||
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(DBGuid.FromDB(reader["RegionID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
return new List<UUID>();
|
||||
}
|
||||
|
||||
public bool DeleteEstate(int estateID)
|
||||
{
|
||||
// TODO: Implementation!
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -51,11 +51,6 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
|
||||
public bool Delete(UUID principalID, string friend)
|
||||
{
|
||||
return Delete(principalID.ToString(), friend);
|
||||
}
|
||||
|
||||
public bool Delete(string principalID, string friend)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
@@ -72,11 +67,6 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(UUID principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(string principalID)
|
||||
{
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
@@ -89,11 +79,5 @@ namespace OpenSim.Data.MSSQL
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(Guid principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
public class MSSQLGenericTableHandler<T> where T : class, new()
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected string m_ConnectionString;
|
||||
protected MSSQLManager m_database; //used for parameter type translation
|
||||
@@ -56,15 +56,15 @@ namespace OpenSim.Data.MSSQL
|
||||
string realm, string storeName)
|
||||
{
|
||||
m_Realm = realm;
|
||||
|
||||
m_ConnectionString = connectionString;
|
||||
|
||||
if (storeName != String.Empty)
|
||||
{
|
||||
Assembly assem = GetType().Assembly;
|
||||
m_ConnectionString = connectionString;
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
{
|
||||
conn.Open();
|
||||
Migration m = new Migration(conn, GetType().Assembly, storeName);
|
||||
Migration m = new Migration(conn, assem, storeName);
|
||||
m.Update();
|
||||
}
|
||||
|
||||
@@ -168,13 +168,14 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
protected T[] DoQuery(SqlCommand cmd)
|
||||
{
|
||||
List<T> result = new List<T>();
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader == null)
|
||||
return new T[0];
|
||||
|
||||
CheckColumnNames(reader);
|
||||
CheckColumnNames(reader);
|
||||
|
||||
List<T> result = new List<T>();
|
||||
|
||||
while (reader.Read())
|
||||
{
|
||||
@@ -261,15 +262,6 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
names.Add(fi.Name);
|
||||
values.Add("@" + fi.Name);
|
||||
// Temporarily return more information about what field is unexpectedly null for
|
||||
// http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the
|
||||
// InventoryTransferModule or we may be required to substitute a DBNull here.
|
||||
if (fi.GetValue(row) == null)
|
||||
throw new NullReferenceException(
|
||||
string.Format(
|
||||
"[MSSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null",
|
||||
fi.Name, row));
|
||||
|
||||
if (constraintFields.Count > 0 && constraintFields.Contains(fi.Name))
|
||||
{
|
||||
constraints.Add(new KeyValuePair<string, string>(fi.Name, fi.GetValue(row).ToString()));
|
||||
@@ -343,33 +335,16 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Delete(string field, string key)
|
||||
public virtual bool Delete(string field, string val)
|
||||
{
|
||||
return Delete(new string[] { field }, new string[] { key });
|
||||
}
|
||||
|
||||
public virtual bool Delete(string[] fields, string[] keys)
|
||||
{
|
||||
if (fields.Length != keys.Length)
|
||||
return false;
|
||||
|
||||
List<string> terms = new List<string>();
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
for (int i = 0; i < fields.Length; i++)
|
||||
{
|
||||
cmd.Parameters.Add(m_database.CreateParameter(fields[i], keys[i]));
|
||||
terms.Add("[" + fields[i] + "] = @" + fields[i]);
|
||||
}
|
||||
|
||||
string where = String.Join(" AND ", terms.ToArray());
|
||||
|
||||
string query = String.Format("DELETE FROM {0} WHERE {1}", m_Realm, where);
|
||||
|
||||
string deleteCommand = String.Format("DELETE FROM {0} WHERE [{1}] = @{1}", m_Realm, field);
|
||||
cmd.CommandText = deleteCommand;
|
||||
|
||||
cmd.Parameters.Add(m_database.CreateParameter(field, val));
|
||||
cmd.Connection = conn;
|
||||
cmd.CommandText = query;
|
||||
conn.Open();
|
||||
|
||||
if (cmd.ExecuteNonQuery() > 0)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>,
|
||||
IGridUserData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLGridUserData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "GridUserStore")
|
||||
|
||||
@@ -813,7 +813,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID and type=-1", connection))
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID", connection))
|
||||
{
|
||||
command.Parameters.Add(database.CreateParameter("folderID", folderID));
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// </summary>
|
||||
public class MSSQLManager
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Connection string for ADO.net
|
||||
@@ -104,11 +104,6 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
return SqlDbType.BigInt;
|
||||
}
|
||||
if (type == typeof(DateTime))
|
||||
{
|
||||
return SqlDbType.DateTime;
|
||||
}
|
||||
|
||||
return SqlDbType.VarChar;
|
||||
}
|
||||
|
||||
@@ -185,6 +180,8 @@ namespace OpenSim.Data.MSSQL
|
||||
return parameter;
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, string> emptyDictionary = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Checks if we need to do some migrations to the database
|
||||
/// </summary>
|
||||
|
||||
@@ -29,19 +29,16 @@ using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Reflection;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
public class MSSQLMigration : Migration
|
||||
{
|
||||
public MSSQLMigration(DbConnection conn, Assembly assem, string type)
|
||||
: base(conn, assem, type)
|
||||
public MSSQLMigration(DbConnection conn, Assembly assem, string type) : base(conn, assem, type)
|
||||
{
|
||||
}
|
||||
|
||||
public MSSQLMigration(DbConnection conn, Assembly assem, string subtype, string type)
|
||||
: base(conn, assem, subtype, type)
|
||||
public MSSQLMigration(DbConnection conn, Assembly assem, string subtype, string type) : base(conn, assem, subtype, type)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -64,36 +61,10 @@ namespace OpenSim.Data.MSSQL
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Return -1 to indicate table does not exist
|
||||
return -1;
|
||||
// Something went wrong, so we're version 0
|
||||
}
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
protected override void ExecuteScript(DbConnection conn, string[] script)
|
||||
{
|
||||
if (!(conn is SqlConnection))
|
||||
{
|
||||
base.ExecuteScript(conn, script);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (string sql in script)
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCommand cmd = new SqlCommand(sql, (SqlConnection)conn))
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception(sql);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLPresenceData : MSSQLGenericTableHandler<PresenceData>,
|
||||
IPresenceData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLPresenceData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Presence")
|
||||
|
||||
@@ -70,7 +70,6 @@ namespace OpenSim.Data.MSSQL
|
||||
string sql = "select * from ["+m_Realm+"] where regionName like @regionName";
|
||||
if (scopeID != UUID.Zero)
|
||||
sql += " and ScopeID = @scopeID";
|
||||
sql += " order by regionName";
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
|
||||
@@ -55,10 +55,6 @@ namespace OpenSim.Data.MSSQL
|
||||
/// </summary>
|
||||
private MSSQLManager _Database;
|
||||
private string m_connectionString;
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public MSSQLSimulationData()
|
||||
{
|
||||
@@ -78,13 +74,9 @@ namespace OpenSim.Data.MSSQL
|
||||
m_connectionString = connectionString;
|
||||
_Database = new MSSQLManager(connectionString);
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
//New Migration settings
|
||||
Migration m = new Migration(conn, Assembly, "RegionStore");
|
||||
m.Update();
|
||||
}
|
||||
|
||||
//Migration settings
|
||||
_Database.CheckMigration(_migrationStore);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -222,7 +214,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
command.Parameters.Clear();
|
||||
command.Parameters.Add(_Database.CreateParameter("@PrimID", objectPart.UUID));
|
||||
|
||||
|
||||
List<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
|
||||
|
||||
using (SqlDataReader reader = command.ExecuteReader())
|
||||
@@ -249,14 +241,6 @@ namespace OpenSim.Data.MSSQL
|
||||
/// <param name="regionUUID"></param>
|
||||
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
{
|
||||
uint flags = obj.RootPart.GetEffectiveObjectFlags();
|
||||
// Eligibility check
|
||||
//
|
||||
if ((flags & (uint)PrimFlags.Temporary) != 0)
|
||||
return;
|
||||
if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0)
|
||||
return;
|
||||
|
||||
_Log.DebugFormat("[MSSQL]: Adding/Changing SceneObjectGroup: {0} to region: {1}, object has {2} prims.", obj.UUID, regionUUID, obj.Parts.Length);
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
@@ -508,11 +492,12 @@ ELSE
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
foreach (TaskInventoryItem taskItem in items)
|
||||
{
|
||||
cmd.Parameters.AddRange(CreatePrimInventoryParameters(taskItem));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.Parameters.Clear();
|
||||
}
|
||||
}
|
||||
@@ -675,13 +660,13 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags],[Expires]) VALUES (@LandUUID,@AccessUUID,@Flags,@Expires)";
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags]) VALUES (@LandUUID,@AccessUUID,@Flags)";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
foreach (LandAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList)
|
||||
foreach (ParcelManager.ParcelAccessEntry parcelAccessEntry in parcel.LandData.ParcelAccessList)
|
||||
{
|
||||
cmd.Parameters.AddRange(CreateLandAccessParameters(parcelAccessEntry, parcel.RegionUUID));
|
||||
|
||||
@@ -716,537 +701,17 @@ VALUES
|
||||
}
|
||||
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
|
||||
{
|
||||
RegionLightShareData nWP = new RegionLightShareData();
|
||||
nWP.OnSave += StoreRegionWindlightSettings;
|
||||
string sql = "select * from [regionwindlight] where region_id = @regionID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@regionID", regionUUID));
|
||||
conn.Open();
|
||||
using (SqlDataReader result = cmd.ExecuteReader())
|
||||
{
|
||||
if (!result.Read())
|
||||
{
|
||||
//No result, so store our default windlight profile and return it
|
||||
nWP.regionID = regionUUID;
|
||||
StoreRegionWindlightSettings(nWP);
|
||||
return nWP;
|
||||
}
|
||||
else
|
||||
{
|
||||
nWP.regionID = DBGuid.FromDB(result["region_id"]);
|
||||
nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
|
||||
nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
|
||||
nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
|
||||
nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
|
||||
nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
|
||||
nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
|
||||
nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
|
||||
nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
|
||||
nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
|
||||
nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
|
||||
nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
|
||||
nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
|
||||
nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
|
||||
nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
|
||||
nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
|
||||
nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
|
||||
nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
|
||||
UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture);
|
||||
nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
|
||||
nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
|
||||
nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
|
||||
nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
|
||||
nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
|
||||
nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
|
||||
nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
|
||||
nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
|
||||
nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
|
||||
nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
|
||||
nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
|
||||
nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
|
||||
nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
|
||||
nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
|
||||
nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
|
||||
nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
|
||||
nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
|
||||
nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
|
||||
nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
|
||||
nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
|
||||
nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
|
||||
nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
|
||||
nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
|
||||
nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
|
||||
nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
|
||||
nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
|
||||
nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
|
||||
nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
|
||||
nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
|
||||
nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
|
||||
nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
|
||||
nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
|
||||
nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
|
||||
nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
|
||||
nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
|
||||
nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
|
||||
nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
|
||||
nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
|
||||
nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
|
||||
nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
|
||||
nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
|
||||
nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
|
||||
nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
|
||||
nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
|
||||
nWP.valid = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nWP;
|
||||
//This connector doesn't support the windlight module yet
|
||||
//Return default LL windlight settings
|
||||
return new RegionLightShareData();
|
||||
}
|
||||
|
||||
public void RemoveRegionWindlightSettings(UUID regionID)
|
||||
{
|
||||
string sql = "delete from [regionwindlight] where region_id = @region_id";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", regionID));
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
public void StoreRegionWindlightSettings(RegionLightShareData wl)
|
||||
{
|
||||
string sql = "select count (region_id) from regionwindlight where region_id = @region_id";
|
||||
bool exists = false;
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@region_id", wl.regionID));
|
||||
exists = (int)cmd.ExecuteScalar() > 0;
|
||||
}
|
||||
}
|
||||
if (exists)
|
||||
{
|
||||
RemoveRegionWindlightSettings(wl.regionID);
|
||||
}
|
||||
|
||||
// sql insert
|
||||
sql = @"INSERT INTO [regionwindlight]
|
||||
([region_id]
|
||||
,[water_color_r]
|
||||
,[water_color_g]
|
||||
,[water_color_b]
|
||||
,[water_fog_density_exponent]
|
||||
,[underwater_fog_modifier]
|
||||
,[reflection_wavelet_scale_1]
|
||||
,[reflection_wavelet_scale_2]
|
||||
,[reflection_wavelet_scale_3]
|
||||
,[fresnel_scale]
|
||||
,[fresnel_offset]
|
||||
,[refract_scale_above]
|
||||
,[refract_scale_below]
|
||||
,[blur_multiplier]
|
||||
,[big_wave_direction_x]
|
||||
,[big_wave_direction_y]
|
||||
,[little_wave_direction_x]
|
||||
,[little_wave_direction_y]
|
||||
,[normal_map_texture]
|
||||
,[horizon_r]
|
||||
,[horizon_g]
|
||||
,[horizon_b]
|
||||
,[horizon_i]
|
||||
,[haze_horizon]
|
||||
,[blue_density_r]
|
||||
,[blue_density_g]
|
||||
,[blue_density_b]
|
||||
,[blue_density_i]
|
||||
,[haze_density]
|
||||
,[density_multiplier]
|
||||
,[distance_multiplier]
|
||||
,[max_altitude]
|
||||
,[sun_moon_color_r]
|
||||
,[sun_moon_color_g]
|
||||
,[sun_moon_color_b]
|
||||
,[sun_moon_color_i]
|
||||
,[sun_moon_position]
|
||||
,[ambient_r]
|
||||
,[ambient_g]
|
||||
,[ambient_b]
|
||||
,[ambient_i]
|
||||
,[east_angle]
|
||||
,[sun_glow_focus]
|
||||
,[sun_glow_size]
|
||||
,[scene_gamma]
|
||||
,[star_brightness]
|
||||
,[cloud_color_r]
|
||||
,[cloud_color_g]
|
||||
,[cloud_color_b]
|
||||
,[cloud_color_i]
|
||||
,[cloud_x]
|
||||
,[cloud_y]
|
||||
,[cloud_density]
|
||||
,[cloud_coverage]
|
||||
,[cloud_scale]
|
||||
,[cloud_detail_x]
|
||||
,[cloud_detail_y]
|
||||
,[cloud_detail_density]
|
||||
,[cloud_scroll_x]
|
||||
,[cloud_scroll_x_lock]
|
||||
,[cloud_scroll_y]
|
||||
,[cloud_scroll_y_lock]
|
||||
,[draw_classic_clouds])
|
||||
VALUES
|
||||
(@region_id
|
||||
,@water_color_r
|
||||
,@water_color_g
|
||||
,@water_color_b
|
||||
,@water_fog_density_exponent
|
||||
,@underwater_fog_modifier
|
||||
,@reflection_wavelet_scale_1
|
||||
,@reflection_wavelet_scale_2
|
||||
,@reflection_wavelet_scale_3
|
||||
,@fresnel_scale
|
||||
,@fresnel_offset
|
||||
,@refract_scale_above
|
||||
,@refract_scale_below
|
||||
,@blur_multiplier
|
||||
,@big_wave_direction_x
|
||||
,@big_wave_direction_y
|
||||
,@little_wave_direction_x
|
||||
,@little_wave_direction_y
|
||||
,@normal_map_texture
|
||||
,@horizon_r
|
||||
,@horizon_g
|
||||
,@horizon_b
|
||||
,@horizon_i
|
||||
,@haze_horizon
|
||||
,@blue_density_r
|
||||
,@blue_density_g
|
||||
,@blue_density_b
|
||||
,@blue_density_i
|
||||
,@haze_density
|
||||
,@density_multiplier
|
||||
,@distance_multiplier
|
||||
,@max_altitude
|
||||
,@sun_moon_color_r
|
||||
,@sun_moon_color_g
|
||||
,@sun_moon_color_b
|
||||
,@sun_moon_color_i
|
||||
,@sun_moon_position
|
||||
,@ambient_r
|
||||
,@ambient_g
|
||||
,@ambient_b
|
||||
,@ambient_i
|
||||
,@east_angle
|
||||
,@sun_glow_focus
|
||||
,@sun_glow_size
|
||||
,@scene_gamma
|
||||
,@star_brightness
|
||||
,@cloud_color_r
|
||||
,@cloud_color_g
|
||||
,@cloud_color_b
|
||||
,@cloud_color_i
|
||||
,@cloud_x
|
||||
,@cloud_y
|
||||
,@cloud_density
|
||||
,@cloud_coverage
|
||||
,@cloud_scale
|
||||
,@cloud_detail_x
|
||||
,@cloud_detail_y
|
||||
,@cloud_detail_density
|
||||
,@cloud_scroll_x
|
||||
,@cloud_scroll_x_lock
|
||||
,@cloud_scroll_y
|
||||
,@cloud_scroll_y_lock
|
||||
,@draw_classic_clouds)";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
{
|
||||
conn.Open();
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("region_id", wl.regionID));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("water_color_r", wl.waterColor.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("water_color_g", wl.waterColor.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("water_color_b", wl.waterColor.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("water_fog_density_exponent", wl.waterFogDensityExponent));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("underwater_fog_modifier", wl.underwaterFogModifier));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("fresnel_scale", wl.fresnelScale));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("fresnel_offset", wl.fresnelOffset));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("refract_scale_above", wl.refractScaleAbove));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("refract_scale_below", wl.refractScaleBelow));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("blur_multiplier", wl.blurMultiplier));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_x", wl.bigWaveDirection.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("big_wave_direction_y", wl.bigWaveDirection.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_x", wl.littleWaveDirection.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("little_wave_direction_y", wl.littleWaveDirection.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("normal_map_texture", wl.normalMapTexture));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("horizon_r", wl.horizon.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("horizon_g", wl.horizon.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("horizon_b", wl.horizon.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("horizon_i", wl.horizon.W));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("haze_horizon", wl.hazeHorizon));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("blue_density_r", wl.blueDensity.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("blue_density_g", wl.blueDensity.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("blue_density_b", wl.blueDensity.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("blue_density_i", wl.blueDensity.W));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("haze_density", wl.hazeDensity));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("density_multiplier", wl.densityMultiplier));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("distance_multiplier", wl.distanceMultiplier));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("max_altitude", wl.maxAltitude));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_r", wl.sunMoonColor.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_g", wl.sunMoonColor.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_b", wl.sunMoonColor.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_moon_color_i", wl.sunMoonColor.W));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_moon_position", wl.sunMoonPosition));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("ambient_r", wl.ambient.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("ambient_g", wl.ambient.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("ambient_b", wl.ambient.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("ambient_i", wl.ambient.W));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("east_angle", wl.eastAngle));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_glow_focus", wl.sunGlowFocus));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("sun_glow_size", wl.sunGlowSize));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("scene_gamma", wl.sceneGamma));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("star_brightness", wl.starBrightness));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_color_r", wl.cloudColor.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_color_g", wl.cloudColor.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_color_b", wl.cloudColor.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_color_i", wl.cloudColor.W));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_x", wl.cloudXYDensity.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_y", wl.cloudXYDensity.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_density", wl.cloudXYDensity.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_coverage", wl.cloudCoverage));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_scale", wl.cloudScale));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_x", wl.cloudDetailXYDensity.X));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_y", wl.cloudDetailXYDensity.Y));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_detail_density", wl.cloudDetailXYDensity.Z));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_x", wl.cloudScrollX));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_x_lock", wl.cloudScrollXLock));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_y", wl.cloudScrollY));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("cloud_scroll_y_lock", wl.cloudScrollYLock));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("draw_classic_clouds", wl.drawClassicClouds));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
#region update
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // sql update
|
||||
// sql = @"UPDATE [OpenSim].[dbo].[regionwindlight]
|
||||
// SET [region_id] = @region_id
|
||||
// ,[water_color_r] = @water_color_r
|
||||
// ,[water_color_g] = @water_color_g
|
||||
// ,[water_color_b] = @water_color_b
|
||||
// ,[water_fog_density_exponent] = @water_fog_density_exponent
|
||||
// ,[underwater_fog_modifier] = @underwater_fog_modifier
|
||||
// ,[reflection_wavelet_scale_1] = @reflection_wavelet_scale_1
|
||||
// ,[reflection_wavelet_scale_2] = @reflection_wavelet_scale_2
|
||||
// ,[reflection_wavelet_scale_3] = @reflection_wavelet_scale_3
|
||||
// ,[fresnel_scale] = @fresnel_scale
|
||||
// ,[fresnel_offset] = @fresnel_offset
|
||||
// ,[refract_scale_above] = @refract_scale_above
|
||||
// ,[refract_scale_below] = @refract_scale_below
|
||||
// ,[blur_multiplier] = @blur_multiplier
|
||||
// ,[big_wave_direction_x] = @big_wave_direction_x
|
||||
// ,[big_wave_direction_y] = @big_wave_direction_y
|
||||
// ,[little_wave_direction_x] = @little_wave_direction_x
|
||||
// ,[little_wave_direction_y] = @little_wave_direction_y
|
||||
// ,[normal_map_texture] = @normal_map_texture
|
||||
// ,[horizon_r] = @horizon_r
|
||||
// ,[horizon_g] = @horizon_g
|
||||
// ,[horizon_b] = @horizon_b
|
||||
// ,[horizon_i] = @horizon_i
|
||||
// ,[haze_horizon] = @haze_horizon
|
||||
// ,[blue_density_r] = @blue_density_r
|
||||
// ,[blue_density_g] = @blue_density_g
|
||||
// ,[blue_density_b] = @blue_density_b
|
||||
// ,[blue_density_i] = @blue_density_i
|
||||
// ,[haze_density] = @haze_density
|
||||
// ,[density_multiplier] = @density_multiplier
|
||||
// ,[distance_multiplier] = @distance_multiplier
|
||||
// ,[max_altitude] = @max_altitude
|
||||
// ,[sun_moon_color_r] = @sun_moon_color_r
|
||||
// ,[sun_moon_color_g] = @sun_moon_color_g
|
||||
// ,[sun_moon_color_b] = @sun_moon_color_b
|
||||
// ,[sun_moon_color_i] = @sun_moon_color_i
|
||||
// ,[sun_moon_position] = @sun_moon_position
|
||||
// ,[ambient_r] = @ambient_r
|
||||
// ,[ambient_g] = @ambient_g
|
||||
// ,[ambient_b] = @ambient_b
|
||||
// ,[ambient_i] = @ambient_i
|
||||
// ,[east_angle] = @east_angle
|
||||
// ,[sun_glow_focus] = @sun_glow_focus
|
||||
// ,[sun_glow_size] = @sun_glow_size
|
||||
// ,[scene_gamma] = @scene_gamma
|
||||
// ,[star_brightness] = @star_brightness
|
||||
// ,[cloud_color_r] = @cloud_color_r
|
||||
// ,[cloud_color_g] = @cloud_color_g
|
||||
// ,[cloud_color_b] = @cloud_color_b
|
||||
// ,[cloud_color_i] = @cloud_color_i
|
||||
// ,[cloud_x] = @cloud_x
|
||||
// ,[cloud_y] = @cloud_y
|
||||
// ,[cloud_density] = @cloud_density
|
||||
// ,[cloud_coverage] = @cloud_coverage
|
||||
// ,[cloud_scale] = @cloud_scale
|
||||
// ,[cloud_detail_x] = @cloud_detail_x
|
||||
// ,[cloud_detail_y] = @cloud_detail_y
|
||||
// ,[cloud_detail_density] = @cloud_detail_density
|
||||
// ,[cloud_scroll_x] = @cloud_scroll_x
|
||||
// ,[cloud_scroll_x_lock] = @cloud_scroll_x_lock
|
||||
// ,[cloud_scroll_y] = @cloud_scroll_y
|
||||
// ,[cloud_scroll_y_lock] = @cloud_scroll_y_lock
|
||||
// ,[draw_classic_clouds] = @draw_classic_clouds
|
||||
// WHERE region_id = @region_id";
|
||||
// using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
// {
|
||||
// conn.Open();
|
||||
// using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
// {
|
||||
// cmd.Parameters.AddWithValue("region_id", wl.regionID);
|
||||
// cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
|
||||
// cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y);
|
||||
// cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z);
|
||||
// cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent);
|
||||
// cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier);
|
||||
// cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X);
|
||||
// cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y);
|
||||
// cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z);
|
||||
// cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale);
|
||||
// cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset);
|
||||
// cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove);
|
||||
// cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow);
|
||||
// cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier);
|
||||
// cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X);
|
||||
// cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y);
|
||||
// cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X);
|
||||
// cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y);
|
||||
// cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture);
|
||||
// cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X);
|
||||
// cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y);
|
||||
// cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z);
|
||||
// cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W);
|
||||
// cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon);
|
||||
// cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X);
|
||||
// cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y);
|
||||
// cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z);
|
||||
// cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W);
|
||||
// cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity);
|
||||
// cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier);
|
||||
// cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier);
|
||||
// cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude);
|
||||
// cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X);
|
||||
// cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y);
|
||||
// cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z);
|
||||
// cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W);
|
||||
// cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition);
|
||||
// cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X);
|
||||
// cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y);
|
||||
// cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z);
|
||||
// cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W);
|
||||
// cmd.Parameters.AddWithValue("east_angle", wl.eastAngle);
|
||||
// cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus);
|
||||
// cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize);
|
||||
// cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma);
|
||||
// cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness);
|
||||
// cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X);
|
||||
// cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y);
|
||||
// cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z);
|
||||
// cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W);
|
||||
// cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X);
|
||||
// cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y);
|
||||
// cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z);
|
||||
// cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage);
|
||||
// cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale);
|
||||
// cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X);
|
||||
// cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y);
|
||||
// cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z);
|
||||
// cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX);
|
||||
// cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock);
|
||||
// cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
|
||||
// cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
|
||||
// cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
|
||||
|
||||
// cmd.ExecuteNonQuery();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
#endregion
|
||||
//This connector doesn't support the windlight module yet
|
||||
}
|
||||
|
||||
#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>
|
||||
@@ -1281,8 +746,6 @@ VALUES
|
||||
//Store new values
|
||||
StoreNewRegionSettings(regionSettings);
|
||||
|
||||
LoadSpawnPoints(regionSettings);
|
||||
|
||||
return regionSettings;
|
||||
}
|
||||
|
||||
@@ -1320,7 +783,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, [map_tile_id] = @TerrainImageID, [telehubobject] = @telehubobject, [parcel_tile_id] = @ParcelImageID
|
||||
,[covenant] = @covenant , [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
|
||||
WHERE [regionUUID] = @regionUUID";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
@@ -1331,7 +794,6 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
SaveSpawnPoints(regionSettings);
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
@@ -1376,14 +838,14 @@ VALUES
|
||||
[block_show_in_search],[agent_limit],[object_bonus],[maturity],[disable_scripts],[disable_collisions],[disable_physics],
|
||||
[terrain_texture_1],[terrain_texture_2],[terrain_texture_3],[terrain_texture_4],[elevation_1_nw],[elevation_2_nw],[elevation_1_ne],
|
||||
[elevation_2_ne],[elevation_1_se],[elevation_2_se],[elevation_1_sw],[elevation_2_sw],[water_height],[terrain_raise_limit],
|
||||
[terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[covenant_datetime],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id]
|
||||
[terrain_lower_limit],[use_estate_sun],[fixed_sun],[sun_position],[covenant],[sunvectorx], [sunvectory], [sunvectorz],[Sandbox], [loaded_creation_datetime], [loaded_creation_id]
|
||||
)
|
||||
VALUES
|
||||
(@regionUUID,@block_terraform,@block_fly,@allow_damage,@restrict_pushing,@allow_land_resell,@allow_land_join_divide,
|
||||
@block_show_in_search,@agent_limit,@object_bonus,@maturity,@disable_scripts,@disable_collisions,@disable_physics,
|
||||
@terrain_texture_1,@terrain_texture_2,@terrain_texture_3,@terrain_texture_4,@elevation_1_nw,@elevation_2_nw,@elevation_1_ne,
|
||||
@elevation_2_ne,@elevation_1_se,@elevation_2_se,@elevation_1_sw,@elevation_2_sw,@water_height,@terrain_raise_limit,
|
||||
@terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant, @covenant_datetime, @sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)";
|
||||
@terrain_lower_limit,@use_estate_sun,@fixed_sun,@sun_position,@covenant,@sunvectorx,@sunvectory, @sunvectorz, @Sandbox, @loaded_creation_datetime, @loaded_creation_id)";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
@@ -1436,7 +898,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(
|
||||
@@ -1445,18 +907,13 @@ VALUES
|
||||
Convert.ToSingle(row["sunvectorz"])
|
||||
);
|
||||
newSettings.Covenant = new UUID((Guid)row["covenant"]);
|
||||
newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
|
||||
|
||||
newSettings.LoadedCreationDateTime = Convert.ToInt32(row["loaded_creation_datetime"]);
|
||||
|
||||
if (row["loaded_creation_id"] is DBNull)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1527,14 +984,7 @@ VALUES
|
||||
_Log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name);
|
||||
}
|
||||
|
||||
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"]);
|
||||
newData.ParcelAccessList = new List<ParcelManager.ParcelAccessEntry>();
|
||||
|
||||
return newData;
|
||||
}
|
||||
@@ -1544,12 +994,12 @@ VALUES
|
||||
/// </summary>
|
||||
/// <param name="row">datarecord with landaccess data</param>
|
||||
/// <returns></returns>
|
||||
private static LandAccessEntry BuildLandAccessData(IDataRecord row)
|
||||
private static ParcelManager.ParcelAccessEntry BuildLandAccessData(IDataRecord row)
|
||||
{
|
||||
LandAccessEntry entry = new LandAccessEntry();
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
|
||||
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
|
||||
entry.Expires = Convert.ToInt32(row["Expires"]);
|
||||
entry.Time = new DateTime();
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -1578,8 +1028,7 @@ VALUES
|
||||
prim.TouchName = (string)primRow["TouchName"];
|
||||
// permissions
|
||||
prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
|
||||
//prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
prim.CreatorIdentification = (string)primRow["CreatorID"];
|
||||
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
|
||||
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
|
||||
prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
|
||||
@@ -1688,7 +1137,7 @@ VALUES
|
||||
if (Convert.ToInt16(primRow["PassTouches"]) != 0)
|
||||
prim.PassTouches = true;
|
||||
prim.LinkNum = Convert.ToInt32(primRow["LinkNumber"]);
|
||||
|
||||
|
||||
if (!(primRow["MediaURL"] is System.DBNull))
|
||||
prim.MediaUrl = (string)primRow["MediaURL"];
|
||||
|
||||
@@ -1705,9 +1154,9 @@ VALUES
|
||||
PrimitiveBaseShape baseShape = new PrimitiveBaseShape();
|
||||
|
||||
baseShape.Scale = new Vector3(
|
||||
(float)Convert.ToDouble(shapeRow["ScaleX"]),
|
||||
(float)Convert.ToDouble(shapeRow["ScaleY"]),
|
||||
(float)Convert.ToDouble(shapeRow["ScaleZ"]));
|
||||
Convert.ToSingle(shapeRow["ScaleX"]),
|
||||
Convert.ToSingle(shapeRow["ScaleY"]),
|
||||
Convert.ToSingle(shapeRow["ScaleZ"]));
|
||||
|
||||
// paths
|
||||
baseShape.PCode = Convert.ToByte(shapeRow["PCode"]);
|
||||
@@ -1745,10 +1194,7 @@ VALUES
|
||||
}
|
||||
|
||||
if (!(shapeRow["Media"] is System.DBNull))
|
||||
{
|
||||
baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]);
|
||||
}
|
||||
|
||||
|
||||
return baseShape;
|
||||
}
|
||||
@@ -1773,8 +1219,7 @@ 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.CreatorIdentification = (string)inventoryRow["creatorID"];
|
||||
taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
|
||||
taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]);
|
||||
taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]);
|
||||
taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]);
|
||||
@@ -1865,19 +1310,15 @@ 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));
|
||||
parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y));
|
||||
parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z));
|
||||
parameters.Add(_Database.CreateParameter("covenant", settings.Covenant));
|
||||
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();
|
||||
}
|
||||
@@ -1938,14 +1379,13 @@ VALUES
|
||||
/// <param name="parcelAccessEntry">parcel access entry.</param>
|
||||
/// <param name="parcelID">parcel ID.</param>
|
||||
/// <returns></returns>
|
||||
private SqlParameter[] CreateLandAccessParameters(LandAccessEntry parcelAccessEntry, UUID parcelID)
|
||||
private SqlParameter[] CreateLandAccessParameters(ParcelManager.ParcelAccessEntry parcelAccessEntry, UUID parcelID)
|
||||
{
|
||||
List<SqlParameter> parameters = new List<SqlParameter>();
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -2133,16 +1573,7 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("Texture", s.TextureEntry));
|
||||
parameters.Add(_Database.CreateParameter("ExtraParams", s.ExtraParams));
|
||||
parameters.Add(_Database.CreateParameter("State", s.State));
|
||||
|
||||
if (null == s.Media)
|
||||
{
|
||||
parameters.Add(_Database.CreateParameter("Media", DBNull.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml()));
|
||||
}
|
||||
|
||||
parameters.Add(_Database.CreateParameter("Media", null == s.Media ? null : s.Media.ToXml()));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
@@ -2150,70 +1581,5 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveExtra(UUID regionID, string name, string value)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveExtra(UUID regionID, string name)
|
||||
{
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetExtra(UUID regionID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,27 +218,23 @@ namespace OpenSim.Data.MSSQL
|
||||
if (words.Length > 2)
|
||||
return new UserAccountData[0];
|
||||
|
||||
string sql = "";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand())
|
||||
{
|
||||
if (words.Length == 1)
|
||||
{
|
||||
sql = 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.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.Add(m_database.CreateParameter("@scopeID", scopeID));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@search", "%" + words[0] + "%"));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@search", "%" + words[0] + "%"));
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = 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.Add(m_database.CreateParameter("@searchFirst", "%" + words[0] + "%"));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@searchLast", "%" + words[1] + "%"));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@ScopeID", scopeID.ToString()));
|
||||
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.Add(m_database.CreateParameter("@searchFirst", "%" + words[0] + "%"));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@searchLast", "%" + words[1] + "%"));
|
||||
cmd.Parameters.Add(m_database.CreateParameter("@ScopeID", scopeID.ToString()));
|
||||
}
|
||||
cmd.Connection = conn;
|
||||
cmd.CommandText = sql;
|
||||
conn.Open();
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
public class MSSQLXInventoryData : IXInventoryData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(
|
||||
// MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private MSSQLGenericTableHandler<XInventoryFolder> m_Folders;
|
||||
private MSSQLItemHandler m_Items;
|
||||
@@ -66,18 +66,11 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
public bool StoreFolder(XInventoryFolder folder)
|
||||
{
|
||||
if (folder.folderName.Length > 64)
|
||||
folder.folderName = folder.folderName.Substring(0, 64);
|
||||
return m_Folders.Store(folder);
|
||||
}
|
||||
|
||||
public bool StoreItem(XInventoryItem item)
|
||||
{
|
||||
if (item.inventoryName.Length > 64)
|
||||
item.inventoryName = item.inventoryName.Substring(0, 64);
|
||||
if (item.inventoryDescription.Length > 128)
|
||||
item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
|
||||
|
||||
return m_Items.Store(item);
|
||||
}
|
||||
|
||||
@@ -85,19 +78,12 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
return m_Folders.Delete(field, val);
|
||||
}
|
||||
public bool DeleteFolders(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Folders.Delete(fields, vals);
|
||||
}
|
||||
|
||||
public bool DeleteItems(string field, string val)
|
||||
{
|
||||
return m_Items.Delete(field, val);
|
||||
}
|
||||
public bool DeleteItems(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Items.Delete(fields, vals);
|
||||
}
|
||||
|
||||
public bool MoveItem(string id, string newParent)
|
||||
{
|
||||
return m_Items.MoveItem(id, newParent);
|
||||
@@ -176,27 +162,5 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
}
|
||||
}
|
||||
public override bool Store(XInventoryItem item)
|
||||
{
|
||||
if (!base.Store(item))
|
||||
return false;
|
||||
string sql = "update inventoryfolders set version=version+1 where folderID = @folderID";
|
||||
using (SqlConnection conn = new SqlConnection(m_ConnectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString());
|
||||
try
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,11 +22,7 @@ COMMIT
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users]') AND type in (N'U'))
|
||||
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey, accountType) SELECT [UUID] AS UUID, [passwordHash] AS passwordHash, [passwordSalt] AS passwordSalt, [webLoginKey] AS webLoginKey, 'UserAccount' as [accountType] FROM users;
|
||||
|
||||
COMMIT
|
||||
|
||||
|
||||
INSERT INTO auth (UUID, passwordHash, passwordSalt, webLoginKey, accountType) SELECT [UUID] AS UUID, [passwordHash] AS passwordHash, [passwordSalt] AS passwordSalt, [webLoginKey] AS webLoginKey, 'UserAccount' as [accountType] FROM users;
|
||||
|
||||
|
||||
COMMIT
|
||||
@@ -13,52 +13,5 @@ PRIMARY KEY CLUSTERED
|
||||
) ON [PRIMARY]
|
||||
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 2
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE dbo.Tmp_Avatars
|
||||
(
|
||||
PrincipalID uniqueidentifier NOT NULL,
|
||||
[Name] varchar(32) NOT NULL,
|
||||
Value text NOT NULL DEFAULT '',
|
||||
) ON [PRIMARY]
|
||||
TEXTIMAGE_ON [PRIMARY]
|
||||
|
||||
IF EXISTS(SELECT * FROM dbo.Avatars)
|
||||
EXEC('INSERT INTO dbo.Tmp_Avatars (PrincipalID, Name, Value)
|
||||
SELECT PrincipalID, CONVERT(text, Name), Value FROM dbo.Avatars WITH (HOLDLOCK TABLOCKX)')
|
||||
|
||||
DROP TABLE dbo.Avatars
|
||||
|
||||
EXECUTE sp_rename N'dbo.Tmp_Avatars', N'Avatars', 'OBJECT'
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 3
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE dbo.Tmp_Avatars
|
||||
(
|
||||
PrincipalID uniqueidentifier NOT NULL,
|
||||
[Name] varchar(32) NOT NULL,
|
||||
Value text NOT NULL DEFAULT '',
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[PrincipalID] ASC, [Name] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
TEXTIMAGE_ON [PRIMARY]
|
||||
|
||||
IF EXISTS(SELECT * FROM dbo.Avatars)
|
||||
EXEC('INSERT INTO dbo.Tmp_Avatars (PrincipalID, Name, Value)
|
||||
SELECT PrincipalID, CONVERT(text, Name), Value FROM dbo.Avatars WITH (HOLDLOCK TABLOCKX)')
|
||||
|
||||
DROP TABLE dbo.Avatars
|
||||
|
||||
EXECUTE sp_rename N'dbo.Tmp_Avatars', N'Avatars', 'OBJECT'
|
||||
COMMIT
|
||||
|
||||
COMMIT
|
||||
@@ -15,36 +15,6 @@ COMMIT
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[userfriends]') AND type in (N'U'))
|
||||
INSERT INTO Friends (PrincipalID, Friend, Flags, Offered)
|
||||
SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends;
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 3
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE [Tmp_Friends]
|
||||
([PrincipalID] varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
[Friend] varchar(255) NOT NULL,
|
||||
[Flags] char(16) NOT NULL DEFAULT '0',
|
||||
[Offered] varchar(32) NOT NULL DEFAULT 0)
|
||||
ON [PRIMARY]
|
||||
|
||||
|
||||
IF EXISTS(SELECT * FROM dbo.Friends)
|
||||
EXEC('INSERT INTO dbo.Tmp_Friends (PrincipalID, Friend, Flags, Offered)
|
||||
SELECT CONVERT(varchar(255),PrincipalID), Friend, Flags, Offered FROM dbo.Friends WITH (HOLDLOCK TABLOCKX)')
|
||||
|
||||
DROP TABLE dbo.Friends
|
||||
|
||||
EXECUTE sp_rename N'dbo.Tmp_Friends', N'Friends', 'OBJECT'
|
||||
|
||||
ALTER TABLE dbo.Friends ADD
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[PrincipalID] ASC, [Friend] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
INSERT INTO Friends (PrincipalID, Friend, Flags, Offered) SELECT [ownerID], [friendID], [friendPerms], 0 FROM userfriends;
|
||||
|
||||
COMMIT
|
||||
@@ -222,24 +222,4 @@ ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 8
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ALTER COLUMN regionName VarChar(128)
|
||||
|
||||
DROP INDEX IX_regions_name ON dbo.regions
|
||||
ALTER TABLE regions ALTER COLUMN regionName VarChar(128) null
|
||||
|
||||
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
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
:VERSION 1 # --------------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE "GridUser" (
|
||||
"UserID" VARCHAR(255) NOT NULL,
|
||||
"HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
"HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
"HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
"LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
"LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
"LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
"Online" CHAR(5) NOT NULL DEFAULT 'false',
|
||||
"Login" CHAR(16) NOT NULL DEFAULT '0',
|
||||
"Logout" CHAR(16) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY ("UserID")
|
||||
)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 2 # --------------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE [GridUser_tmp] (
|
||||
[UserID] VARCHAR(255) NOT NULL,
|
||||
[HomeRegionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
[HomePosition] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[HomeLookAt] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[LastRegionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
[LastPosition] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[LastLookAt] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[Online] CHAR(5) NOT NULL DEFAULT 'false',
|
||||
[Login] CHAR(16) NOT NULL DEFAULT '0',
|
||||
[Logout] CHAR(16) NOT NULL DEFAULT '0',
|
||||
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[UserID] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
|
||||
IF EXISTS(SELECT * FROM dbo.GridUser)
|
||||
EXEC('INSERT INTO dbo.GridUser_tmp ([UserID]
|
||||
,[HomeRegionID]
|
||||
,[HomePosition]
|
||||
,[HomeLookAt]
|
||||
,[LastRegionID]
|
||||
,[LastPosition]
|
||||
,[LastLookAt]
|
||||
,[Online]
|
||||
,[Login]
|
||||
,[Logout])
|
||||
SELECT CONVERT(varchar(36), [HomeRegionID]), [HomePosition] ,[HomeLookAt] , CONVERT(varchar(36),[LastRegionID])
|
||||
,[LastPosition]
|
||||
,[LastLookAt]
|
||||
,[Online]
|
||||
,[Login]
|
||||
,[Logout] FROM dbo.GridUser WITH (HOLDLOCK TABLOCKX)')
|
||||
|
||||
DROP TABLE dbo.GridUser
|
||||
|
||||
EXECUTE sp_rename N'dbo.GridUser_tmp', N'GridUser', 'OBJECT'
|
||||
@@ -238,42 +238,7 @@ alter table inventoryitems
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 8
|
||||
|
||||
|
||||
ALTER TABLE inventoryitems
|
||||
ADD CONSTRAINT DF_inventoryitems_creatorID
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000' FOR creatorID
|
||||
|
||||
:GO
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
# CreatorID goes up to VARCHAR(255)
|
||||
|
||||
exec sp_rename 'inventoryitems.CreatorID', 'cr_old', 'COLUMN'
|
||||
|
||||
:GO
|
||||
|
||||
alter table inventoryitems
|
||||
add creatorID varchar(255) NULL
|
||||
|
||||
:GO
|
||||
|
||||
update inventoryitems set creatorID = cr_old
|
||||
|
||||
alter table inventoryitems
|
||||
drop CONSTRAINT DF_inventoryitems_creatorID
|
||||
:GO
|
||||
|
||||
alter table inventoryitems
|
||||
drop column cr_old
|
||||
:GO
|
||||
COMMIT
|
||||
|
||||
ALTER TABLE inventoryitems
|
||||
ADD CONSTRAINT DF_inventoryitems_creatorID
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000' FOR creatorID
|
||||
|
||||
:GO
|
||||
23
OpenSim/Data/MSSQL/Resources/OpenSim.Data.MSSQL.addin.xml
Normal file
23
OpenSim/Data/MSSQL/Resources/OpenSim.Data.MSSQL.addin.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<Addin id="OpenSim.Data.MSSQL" version="0.1">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Data.MSSQL.dll"/>
|
||||
</Runtime>
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim.Data" version="0.5" />
|
||||
</Dependencies>
|
||||
<Extension path = "/OpenSim/GridData">
|
||||
<Plugin id="MSSQLGridData" provider="OpenSim.Data.MSSQL.dll" type="OpenSim.Data.MSSQL.MSSQLGridData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/LogData">
|
||||
<Plugin id="MSSQLLogData" provider="OpenSim.Data.MSSQL.dll" type="OpenSim.Data.MSSQL.MSSQLLogData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/AssetData">
|
||||
<Plugin id="MSSQLAssetData" provider="OpenSim.Data.MSSQL.dll" type="OpenSim.Data.MSSQL.MSSQLAssetData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/InventoryData">
|
||||
<Plugin id="MSSQLInventoryData" provider="OpenSim.Data.MSSQL.dll" type="OpenSim.Data.MSSQL.MSSQLInventoryData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/UserData">
|
||||
<Plugin id="MSSQLUserData" provider="OpenSim.Data.MSSQL.dll" type="OpenSim.Data.MSSQL.MSSQLUserData" />
|
||||
</Extension>
|
||||
</Addin>
|
||||
@@ -7,7 +7,14 @@ CREATE TABLE [Presence] (
|
||||
[RegionID] uniqueidentifier NOT NULL,
|
||||
[SessionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
[SecureSessionID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000',
|
||||
|
||||
[Online] char(5) NOT NULL DEFAULT 'false',
|
||||
[Login] char(16) NOT NULL DEFAULT '0',
|
||||
[Logout] char(16) NOT NULL DEFAULT '0',
|
||||
[Position] char(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[LookAt] char(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[HomeRegionID] uniqueidentifier NOT NULL,
|
||||
[HomePosition] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
[HomeLookAt] CHAR(64) NOT NULL DEFAULT '<0,0,0>',
|
||||
)
|
||||
ON [PRIMARY]
|
||||
|
||||
@@ -20,12 +27,4 @@ BEGIN TRANSACTION
|
||||
CREATE UNIQUE INDEX SessionID ON Presence(SessionID);
|
||||
CREATE INDEX UserID ON Presence(UserID);
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 2
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE Presence ADD LastSeen DateTime
|
||||
|
||||
COMMIT
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
:VERSION 1
|
||||
|
||||
CREATE TABLE [dbo].[prims](
|
||||
@@ -925,226 +926,11 @@ ALTER TABLE regionsettings ADD loaded_creation_datetime int NOT NULL default 0
|
||||
COMMIT
|
||||
|
||||
:VERSION 24
|
||||
-- Added post 0.7
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims ADD MediaURL varchar(255)
|
||||
ALTER TABLE primshapes ADD Media TEXT NULL
|
||||
ALTER TABLE prims ADD COLUMN MediaURL varchar(255)
|
||||
ALTER TABLE primshapes ADD COLUMN Media TEXT
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 25
|
||||
|
||||
BEGIN TRANSACTION
|
||||
CREATE TABLE "regionwindlight" (
|
||||
"region_id" varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
"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_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" int 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" tinyint NOT NULL DEFAULT '0',
|
||||
"cloud_scroll_y" [float] NOT NULL DEFAULT '0.01',
|
||||
"cloud_scroll_y_lock" tinyint NOT NULL DEFAULT '0',
|
||||
"draw_classic_clouds" tinyint NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY ("region_id")
|
||||
)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 26
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE regionsettings ADD map_tile_ID CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 27 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE land ADD MediaType VARCHAR(32) NOT NULL DEFAULT 'none/none'
|
||||
ALTER TABLE land ADD MediaDescription VARCHAR(255) NOT NULL DEFAULT ''
|
||||
ALTER TABLE land ADD MediaSize VARCHAR(16) NOT NULL DEFAULT '0,0'
|
||||
ALTER TABLE land ADD MediaLoop bit NOT NULL DEFAULT 0
|
||||
ALTER TABLE land ADD ObscureMusic bit NOT NULL DEFAULT 0
|
||||
ALTER TABLE land ADD ObscureMedia bit NOT NULL DEFAULT 0
|
||||
COMMIT
|
||||
|
||||
:VERSION 28 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims
|
||||
ADD CONSTRAINT DF_prims_CreatorID
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE prims ALTER COLUMN CreatorID uniqueidentifier NOT NULL
|
||||
|
||||
ALTER TABLE primitems
|
||||
ADD CONSTRAINT DF_primitems_CreatorID
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL
|
||||
|
||||
COMMIT
|
||||
|
||||
: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
|
||||
COMMIT
|
||||
@@ -19,7 +19,7 @@ CREATE TABLE [UserAccounts] (
|
||||
:VERSION 2
|
||||
|
||||
BEGIN TRANSACTION
|
||||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[users]') AND type in (N'U'))
|
||||
|
||||
INSERT INTO UserAccounts (PrincipalID, ScopeID, FirstName, LastName, Email, ServiceURLs, Created) SELECT [UUID] AS PrincipalID, '00000000-0000-0000-0000-000000000000' AS ScopeID,
|
||||
username AS FirstName,
|
||||
lastname AS LastName,
|
||||
|
||||
@@ -47,11 +47,6 @@ namespace OpenSim.Data.MySQL
|
||||
private string m_connectionString;
|
||||
private object m_dbLock = new object();
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
#region IPlugin Members
|
||||
|
||||
public override string Version { get { return "1.0.0.0"; } }
|
||||
@@ -71,10 +66,13 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
m_connectionString = connect;
|
||||
|
||||
// This actually does the roll forward assembly stuff
|
||||
Assembly assem = GetType().Assembly;
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, "AssetStore");
|
||||
Migration m = new Migration(dbcon, assem, "AssetStore");
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
@@ -155,7 +153,7 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset UUID to create</param>
|
||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -163,52 +161,55 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd =
|
||||
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))
|
||||
dbcon);
|
||||
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
{
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
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)
|
||||
{
|
||||
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);
|
||||
// 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();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -220,42 +221,42 @@ 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);
|
||||
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand("update assets set access_time=?access_time where id=?id", dbcon))
|
||||
// need to ensure we dispose
|
||||
try
|
||||
{
|
||||
try
|
||||
using (cmd)
|
||||
{
|
||||
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);
|
||||
// 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>
|
||||
/// Check if the asset exists in the database
|
||||
/// check if the asset UUID exist in database
|
||||
/// </summary>
|
||||
/// <param name="uuid">The asset UUID</param>
|
||||
/// <returns>true if it exists, false otherwise.</returns>
|
||||
/// <returns>true if exist.</returns>
|
||||
override public bool ExistsAsset(UUID uuid)
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||
|
||||
bool assetExists = false;
|
||||
|
||||
lock (m_dbLock)
|
||||
@@ -272,10 +273,7 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||
assetExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -307,41 +305,35 @@ 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);
|
||||
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand(
|
||||
"SELECT name,description,assetType,temporary,id,asset_flags,CreatorID FROM assets LIMIT ?start, ?count",
|
||||
dbcon))
|
||||
try
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?start", start);
|
||||
cmd.Parameters.AddWithValue("?count", count);
|
||||
|
||||
try
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
while (dbReader.Read())
|
||||
{
|
||||
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);
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,12 +348,11 @@ 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();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
cmd.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,4 +361,4 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -43,11 +42,6 @@ namespace OpenSim.Data.MySQL
|
||||
private int m_LastExpire;
|
||||
// private string m_connectionString;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public MySqlAuthenticationData(string connectionString, string realm)
|
||||
: base(connectionString)
|
||||
{
|
||||
@@ -57,7 +51,7 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, "AuthStore");
|
||||
Migration m = new Migration(dbcon, GetType().Assembly, "AuthStore");
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
@@ -70,52 +64,41 @@ 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());
|
||||
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand("select * from `" + m_Realm + "` where UUID = ?principalID", dbcon))
|
||||
IDataReader result = cmd.ExecuteReader();
|
||||
|
||||
if (result.Read())
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
ret.PrincipalID = principalID;
|
||||
|
||||
IDataReader result = cmd.ExecuteReader();
|
||||
|
||||
if (result.Read())
|
||||
if (m_ColumnNames == null)
|
||||
{
|
||||
ret.PrincipalID = principalID;
|
||||
|
||||
CheckColumnNames(result);
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
if (s == "UUID")
|
||||
continue;
|
||||
|
||||
ret.Data[s] = result[s].ToString();
|
||||
}
|
||||
|
||||
return ret;
|
||||
m_ColumnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = result.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
else
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
return null;
|
||||
if (s == "UUID")
|
||||
continue;
|
||||
|
||||
ret.Data[s] = result[s].ToString();
|
||||
}
|
||||
|
||||
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"))
|
||||
@@ -123,53 +106,57 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
string[] fields = new List<string>(data.Data.Keys).ToArray();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
string update = "update `"+m_Realm+"` set ";
|
||||
bool first = true;
|
||||
foreach (string field in fields)
|
||||
{
|
||||
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 (!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;
|
||||
|
||||
if (ExecuteNonQuery(cmd) < 1)
|
||||
{
|
||||
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 false;
|
||||
}
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool SetDataItem(UUID principalID, string item, string value)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
@@ -179,18 +166,18 @@ namespace OpenSim.Data.MySQL
|
||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||
DoExpire();
|
||||
|
||||
using (MySqlCommand cmd
|
||||
= new MySqlCommand(
|
||||
"insert into tokens (UUID, token, validity) values (?principalID, ?token, date_add(now(), interval ?lifetime minute))"))
|
||||
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)
|
||||
{
|
||||
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 true;
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -199,29 +186,30 @@ namespace OpenSim.Data.MySQL
|
||||
if (System.Environment.TickCount - m_LastExpire > 30000)
|
||||
DoExpire();
|
||||
|
||||
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.Parameters.AddWithValue("?principalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?token", token);
|
||||
cmd.Parameters.AddWithValue("?lifetime", lifetime.ToString());
|
||||
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)
|
||||
return true;
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
{
|
||||
cmd.Dispose();
|
||||
return true;
|
||||
}
|
||||
|
||||
cmd.Dispose();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void DoExpire()
|
||||
{
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from tokens where validity < now()"))
|
||||
{
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
MySqlCommand cmd = new MySqlCommand("delete from tokens where validity < now()");
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
cmd.Dispose();
|
||||
|
||||
m_LastExpire = System.Environment.TickCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MySQL
|
||||
public class MySQLAvatarData : MySQLGenericTableHandler<AvatarBaseData>,
|
||||
IAvatarData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MySQLAvatarData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Avatar")
|
||||
@@ -52,15 +52,14 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public bool Delete(UUID principalID, string name)
|
||||
{
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -48,17 +48,12 @@ namespace OpenSim.Data.MySQL
|
||||
private string m_connectionString;
|
||||
private long m_waitTimeout;
|
||||
private long m_waitTimeoutLeeway = 60 * TimeSpan.TicksPerSecond;
|
||||
// private long m_lastConnectionUse;
|
||||
private long m_lastConnectionUse;
|
||||
|
||||
private FieldInfo[] m_Fields;
|
||||
private Dictionary<string, FieldInfo> m_FieldMap =
|
||||
new Dictionary<string, FieldInfo>();
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public MySQLEstateStore()
|
||||
{
|
||||
}
|
||||
@@ -87,7 +82,8 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
Migration m = new Migration(dbcon, Assembly, "EstateStore");
|
||||
Assembly assem = GetType().Assembly;
|
||||
Migration m = new Migration(dbcon, assem, "EstateStore");
|
||||
m.Update();
|
||||
|
||||
Type t = typeof(EstateSettings);
|
||||
@@ -127,7 +123,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
// m_lastConnectionUse = DateTime.Now.Ticks;
|
||||
m_lastConnectionUse = DateTime.Now.Ticks;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[REGION DB]: Connection wait timeout {0} seconds",
|
||||
@@ -149,22 +145,6 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public EstateSettings CreateNewEstate()
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
|
||||
DoCreate(es);
|
||||
|
||||
LoadBanList(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
private EstateSettings DoLoad(MySqlCommand cmd, UUID regionID, bool create)
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
@@ -204,66 +184,65 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
if (!found && create)
|
||||
{
|
||||
DoCreate(es);
|
||||
LinkRegion(regionID, (int)es.EstateID);
|
||||
// Migration case
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
names.Remove("EstateID");
|
||||
|
||||
string sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
|
||||
|
||||
using (MySqlCommand cmd2 = dbcon.CreateCommand())
|
||||
{
|
||||
cmd2.CommandText = sql;
|
||||
cmd2.Parameters.Clear();
|
||||
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
if (m_FieldMap[name].GetValue(es) is bool)
|
||||
{
|
||||
if ((bool)m_FieldMap[name].GetValue(es))
|
||||
cmd2.Parameters.AddWithValue("?" + name, "1");
|
||||
else
|
||||
cmd2.Parameters.AddWithValue("?" + name, "0");
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd2.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString());
|
||||
}
|
||||
}
|
||||
|
||||
cmd2.ExecuteNonQuery();
|
||||
|
||||
cmd2.CommandText = "select LAST_INSERT_ID() as id";
|
||||
cmd2.Parameters.Clear();
|
||||
|
||||
using (IDataReader r = cmd2.ExecuteReader())
|
||||
{
|
||||
r.Read();
|
||||
es.EstateID = Convert.ToUInt32(r["id"]);
|
||||
}
|
||||
|
||||
cmd2.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
|
||||
cmd2.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
cmd2.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
|
||||
|
||||
// This will throw on dupe key
|
||||
try { cmd2.ExecuteNonQuery(); }
|
||||
catch (Exception) { }
|
||||
|
||||
es.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LoadBanList(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
return es;
|
||||
}
|
||||
|
||||
private void DoCreate(EstateSettings es)
|
||||
{
|
||||
// Migration case
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
names.Remove("EstateID");
|
||||
|
||||
string sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
using (MySqlCommand cmd2 = dbcon.CreateCommand())
|
||||
{
|
||||
cmd2.CommandText = sql;
|
||||
cmd2.Parameters.Clear();
|
||||
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
if (m_FieldMap[name].GetValue(es) is bool)
|
||||
{
|
||||
if ((bool)m_FieldMap[name].GetValue(es))
|
||||
cmd2.Parameters.AddWithValue("?" + name, "1");
|
||||
else
|
||||
cmd2.Parameters.AddWithValue("?" + name, "0");
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd2.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString());
|
||||
}
|
||||
}
|
||||
|
||||
cmd2.ExecuteNonQuery();
|
||||
|
||||
cmd2.CommandText = "select LAST_INSERT_ID() as id";
|
||||
cmd2.Parameters.Clear();
|
||||
|
||||
using (IDataReader r = cmd2.ExecuteReader())
|
||||
{
|
||||
r.Read();
|
||||
es.EstateID = Convert.ToUInt32(r["id"]);
|
||||
}
|
||||
|
||||
es.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void StoreEstateSettings(EstateSettings es)
|
||||
{
|
||||
string sql = "replace into estate_settings (" + String.Join(",", FieldList) + ") values ( ?" + String.Join(", ?", FieldList) + ")";
|
||||
@@ -430,46 +409,6 @@ namespace OpenSim.Data.MySQL
|
||||
return DoLoad(cmd, UUID.Zero, false);
|
||||
}
|
||||
}
|
||||
|
||||
public List<EstateSettings> LoadEstateSettingsAll()
|
||||
{
|
||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||
|
||||
List<int> allEstateIds = GetEstatesAll();
|
||||
|
||||
foreach (int estateId in allEstateIds)
|
||||
allEstateSettings.Add(LoadEstateSettings(estateId));
|
||||
|
||||
return allEstateSettings;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesAll()
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "select estateID from estate_settings";
|
||||
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(reader["EstateID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstates(string search)
|
||||
{
|
||||
@@ -494,34 +433,6 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesByOwner(UUID ownerID)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "select estateID from estate_settings where EstateOwner = ?EstateOwner";
|
||||
cmd.Parameters.AddWithValue("?EstateOwner", ownerID);
|
||||
|
||||
using (IDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(reader["EstateID"]));
|
||||
}
|
||||
reader.Close();
|
||||
}
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
}
|
||||
@@ -534,34 +445,16 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlTransaction transaction = dbcon.BeginTransaction();
|
||||
|
||||
try
|
||||
{
|
||||
// Delete any existing association of this region with an estate.
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = transaction;
|
||||
cmd.CommandText = "delete from estate_map where RegionID = ?RegionID";
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.Transaction = transaction;
|
||||
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID);
|
||||
cmd.Parameters.AddWithValue("?EstateID", estateID);
|
||||
|
||||
int ret = cmd.ExecuteNonQuery();
|
||||
|
||||
if (ret != 0)
|
||||
transaction.Commit();
|
||||
else
|
||||
transaction.Rollback();
|
||||
|
||||
dbcon.Close();
|
||||
|
||||
return (ret != 0);
|
||||
@@ -570,7 +463,6 @@ namespace OpenSim.Data.MySQL
|
||||
catch (MySqlException ex)
|
||||
{
|
||||
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
|
||||
transaction.Rollback();
|
||||
}
|
||||
|
||||
dbcon.Close();
|
||||
|
||||
@@ -44,43 +44,25 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public bool Delete(UUID principalID, string friend)
|
||||
{
|
||||
return Delete(principalID.ToString(), friend);
|
||||
}
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
public bool Delete(string principalID, string friend)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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());
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
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());
|
||||
|
||||
public FriendsData[] GetFriends(string principalID)
|
||||
{
|
||||
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() + '%');
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
public class MySQLGenericTableHandler<T> : MySqlFramework where T: class, new()
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Dictionary<string, FieldInfo> m_Fields =
|
||||
new Dictionary<string, FieldInfo>();
|
||||
|
||||
@@ -48,11 +46,6 @@ namespace OpenSim.Data.MySQL
|
||||
protected string m_Realm;
|
||||
protected FieldInfo m_DataField = null;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public MySQLGenericTableHandler(string connectionString,
|
||||
string realm, string storeName) : base(connectionString)
|
||||
{
|
||||
@@ -64,7 +57,7 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, storeName);
|
||||
Migration m = new Migration(dbcon, GetType().Assembly, storeName);
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
@@ -91,17 +84,15 @@ namespace OpenSim.Data.MySQL
|
||||
if (m_ColumnNames != null)
|
||||
return;
|
||||
|
||||
List<string> columnNames = new List<string>();
|
||||
m_ColumnNames = new List<string>();
|
||||
|
||||
DataTable schemaTable = reader.GetSchemaTable();
|
||||
foreach (DataRow row in schemaTable.Rows)
|
||||
{
|
||||
if (row["ColumnName"] != null &&
|
||||
(!m_Fields.ContainsKey(row["ColumnName"].ToString())))
|
||||
columnNames.Add(row["ColumnName"].ToString());
|
||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
||||
}
|
||||
|
||||
m_ColumnNames = columnNames;
|
||||
}
|
||||
|
||||
public virtual T[] Get(string field, string key)
|
||||
@@ -221,6 +212,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
|
||||
string query = "";
|
||||
List<String> names = new List<String>();
|
||||
List<String> values = new List<String>();
|
||||
@@ -229,16 +221,6 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
names.Add(fi.Name);
|
||||
values.Add("?" + fi.Name);
|
||||
|
||||
// Temporarily return more information about what field is unexpectedly null for
|
||||
// http://opensimulator.org/mantis/view.php?id=5403. This might be due to a bug in the
|
||||
// InventoryTransferModule or we may be required to substitute a DBNull here.
|
||||
if (fi.GetValue(row) == null)
|
||||
throw new NullReferenceException(
|
||||
string.Format(
|
||||
"[MYSQL GENERIC TABLE HANDLER]: Trying to store field {0} for {1} which is unexpectedly null",
|
||||
fi.Name, row));
|
||||
|
||||
cmd.Parameters.AddWithValue(fi.Name, fi.GetValue(row).ToString());
|
||||
}
|
||||
|
||||
@@ -266,34 +248,19 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Delete(string field, string key)
|
||||
public virtual bool Delete(string field, string val)
|
||||
{
|
||||
return Delete(new string[] { field }, new string[] { key });
|
||||
}
|
||||
|
||||
public virtual bool Delete(string[] fields, string[] keys)
|
||||
{
|
||||
if (fields.Length != keys.Length)
|
||||
return false;
|
||||
|
||||
List<string> terms = new List<string>();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
for (int i = 0 ; i < fields.Length ; i++)
|
||||
{
|
||||
cmd.Parameters.AddWithValue(fields[i], keys[i]);
|
||||
terms.Add("`" + fields[i] + "` = ?" + fields[i]);
|
||||
}
|
||||
|
||||
string where = String.Join(" and ", terms.ToArray());
|
||||
cmd.CommandText = String.Format("delete from {0} where `{1}` = ?{1}", m_Realm, field);
|
||||
cmd.Parameters.AddWithValue(field, val);
|
||||
|
||||
string query = String.Format("delete from {0} where {1}", m_Realm, where);
|
||||
if (ExecuteNonQuery(cmd) > 0)
|
||||
return true;
|
||||
|
||||
cmd.CommandText = query;
|
||||
|
||||
return ExecuteNonQuery(cmd) > 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,43 +467,43 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand result = new MySqlCommand(sql, dbcon))
|
||||
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)
|
||||
{
|
||||
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.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
using (MySqlCommand result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon))
|
||||
{
|
||||
result.Parameters.AddWithValue("?folderID", item.Folder.ToString());
|
||||
result.Dispose();
|
||||
|
||||
lock (m_dbLock)
|
||||
result.ExecuteNonQuery();
|
||||
result = new MySqlCommand("update inventoryfolders set version=version+1 where folderID = ?folderID", dbcon);
|
||||
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();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
|
||||
MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", dbcon);
|
||||
cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
|
||||
|
||||
lock (m_dbLock)
|
||||
cmd.ExecuteNonQuery();
|
||||
lock (m_dbLock)
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -579,27 +579,25 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
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);
|
||||
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
|
||||
try
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -626,23 +624,21 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(sql, dbcon))
|
||||
MySqlCommand cmd = new MySqlCommand(sql, dbcon);
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?folderID", folder.ID.ToString());
|
||||
cmd.Parameters.AddWithValue("?parentFolderID", folder.ParentID.ToString());
|
||||
|
||||
try
|
||||
lock (m_dbLock)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -798,8 +794,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
// System folders can never be deleted. Period.
|
||||
using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid and type=-1", dbcon))
|
||||
using (MySqlCommand cmd = new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?uuid", folderID.ToString());
|
||||
|
||||
@@ -872,7 +867,7 @@ namespace OpenSim.Data.MySQL
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand sqlCmd = new MySqlCommand(
|
||||
"SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags & 1", dbcon))
|
||||
"SELECT * FROM inventoryitems WHERE avatarId = ?uuid AND assetType = ?type and flags = 1", dbcon))
|
||||
{
|
||||
sqlCmd.Parameters.AddWithValue("?uuid", avatarID.ToString());
|
||||
sqlCmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MySQL
|
||||
public class MySQLPresenceData : MySQLGenericTableHandler<PresenceData>,
|
||||
IPresenceData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MySQLPresenceData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Presence")
|
||||
@@ -63,14 +63,13 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public void LogoutRegionAgents(UUID regionID)
|
||||
{
|
||||
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);
|
||||
}
|
||||
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)
|
||||
@@ -82,18 +81,17 @@ namespace OpenSim.Data.MySQL
|
||||
if (regionID == UUID.Zero)
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Reflection;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
@@ -44,11 +42,6 @@ namespace OpenSim.Data.MySQL
|
||||
private List<string> m_ColumnNames;
|
||||
//private string m_connectionString;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public MySqlRegionData(string connectionString, string realm)
|
||||
: base(connectionString)
|
||||
{
|
||||
@@ -58,7 +51,7 @@ namespace OpenSim.Data.MySQL
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, "GridStore");
|
||||
Migration m = new Migration(dbcon, GetType().Assembly, "GridStore");
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
@@ -162,7 +155,17 @@ namespace OpenSim.Data.MySQL
|
||||
ret.sizeX = Convert.ToInt32(result["sizeX"]);
|
||||
ret.sizeY = Convert.ToInt32(result["sizeY"]);
|
||||
|
||||
CheckColumnNames(result);
|
||||
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());
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string s in m_ColumnNames)
|
||||
{
|
||||
@@ -177,11 +180,7 @@ namespace OpenSim.Data.MySQL
|
||||
if (s == "locY")
|
||||
continue;
|
||||
|
||||
object value = result[s];
|
||||
if (value is DBNull)
|
||||
ret.Data[s] = null;
|
||||
else
|
||||
ret.Data[s] = result[s].ToString();
|
||||
ret.Data[s] = result[s].ToString();
|
||||
}
|
||||
|
||||
retList.Add(ret);
|
||||
@@ -192,23 +191,6 @@ 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"))
|
||||
@@ -230,8 +212,8 @@ namespace OpenSim.Data.MySQL
|
||||
if (data.Data.ContainsKey("locY"))
|
||||
data.Data.Remove("locY");
|
||||
|
||||
if (data.RegionName.Length > 128)
|
||||
data.RegionName = data.RegionName.Substring(0, 128);
|
||||
if (data.RegionName.Length > 32)
|
||||
data.RegionName = data.RegionName.Substring(0, 32);
|
||||
|
||||
string[] fields = new List<string>(data.Data.Keys).ToArray();
|
||||
|
||||
@@ -329,12 +311,11 @@ namespace OpenSim.Data.MySQL
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
MySqlCommand cmd = new MySqlCommand(command);
|
||||
|
||||
cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString());
|
||||
|
||||
return RunCommand(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -62,24 +62,23 @@ namespace OpenSim.Data.MySQL
|
||||
if (words.Length > 2)
|
||||
return new UserAccountData[0];
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
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());
|
||||
}
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
return DoQuery(cmd);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,500 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
}
|
||||
}
|
||||
@@ -85,21 +85,11 @@ namespace OpenSim.Data.MySQL
|
||||
return m_Folders.Delete(field, val);
|
||||
}
|
||||
|
||||
public bool DeleteFolders(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Folders.Delete(fields, vals);
|
||||
}
|
||||
|
||||
public bool DeleteItems(string field, string val)
|
||||
{
|
||||
return m_Items.Delete(field, val);
|
||||
}
|
||||
|
||||
public bool DeleteItems(string[] fields, string[] vals)
|
||||
{
|
||||
return m_Items.Delete(fields, vals);
|
||||
}
|
||||
|
||||
public bool MoveItem(string id, string newParent)
|
||||
{
|
||||
return m_Items.MoveItem(id, newParent);
|
||||
@@ -140,7 +130,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags & 1", m_Realm);
|
||||
cmd.CommandText = String.Format("select * from inventoryitems where avatarId = ?uuid and assetType = ?type and flags = 1", m_Realm);
|
||||
|
||||
cmd.Parameters.AddWithValue("?uuid", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue("?type", (int)AssetType.Gesture);
|
||||
@@ -199,7 +189,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,12 +21,5 @@ INSERT INTO `Friends` SELECT `ownerID`, `friendID`, `friendPerms`, 0 FROM `userf
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 3 # -------------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE `Friends` MODIFY COLUMN PrincipalID varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
ALTER TABLE `Friends` DROP PRIMARY KEY;
|
||||
ALTER TABLE `Friends` ADD PRIMARY KEY(PrincipalID(36), Friend(36));
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -87,19 +87,3 @@ ALTER TABLE `regions` ADD COLUMN `Token` varchar(255) NOT NULL;
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 8 # ------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
alter table regions modify column regionName varchar(128) default NULL;
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 9 # ------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
alter table regions add column `parcelMapTexture` varchar(36) default NULL;
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
23
OpenSim/Data/MySQL/Resources/OpenSim.Data.MySQL.addin.xml
Normal file
23
OpenSim/Data/MySQL/Resources/OpenSim.Data.MySQL.addin.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<Addin id="OpenSim.Data.MySQL" version="0.1">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Data.MySQL.dll"/>
|
||||
</Runtime>
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim.Data" version="0.5" />
|
||||
</Dependencies>
|
||||
<Extension path = "/OpenSim/GridData">
|
||||
<Plugin id="MySQLGridData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLGridData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/LogData">
|
||||
<Plugin id="MySQLLogData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLLogData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/AssetData">
|
||||
<Plugin id="MySQLAssetData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLAssetData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/InventoryData">
|
||||
<Plugin id="MySQLInventoryData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLInventoryData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/UserData">
|
||||
<Plugin id="MySQLUserData" provider="OpenSim.Data.MySQL.dll" type="OpenSim.Data.MySQL.MySQLUserData" />
|
||||
</Extension>
|
||||
</Addin>
|
||||
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 32
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE `regionwindlight` (
|
||||
@@ -826,79 +826,3 @@ ALTER TABLE `prims` MODIFY COLUMN `CreatorID` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
ALTER TABLE `primitems` MODIFY COLUMN `CreatorID` VARCHAR(255) NOT NULL DEFAULT '';
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 38 #---------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
alter table land ENGINE = MyISAM;
|
||||
alter table landaccesslist ENGINE = MyISAM;
|
||||
alter table migrations ENGINE = MyISAM;
|
||||
alter table primitems ENGINE = MyISAM;
|
||||
alter table prims ENGINE = MyISAM;
|
||||
alter table primshapes ENGINE = MyISAM;
|
||||
alter table regionban ENGINE = MyISAM;
|
||||
alter table regionsettings ENGINE = MyISAM;
|
||||
alter table terrain ENGINE = MyISAM;
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 39 #--------------- Telehub support
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
|
||||
`Yaw` float NOT NULL,
|
||||
`Pitch` float NOT NULL,
|
||||
`Distance` float NOT NULL,
|
||||
KEY `RegionID` (`RegionID`)
|
||||
) ENGINE=Innodb;
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 40 #---------------- Parcels for sale
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
COMMIT;
|
||||
|
||||
:VERSION 41 #---------------- Timed bans/access
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `landaccesslist` ADD COLUMN `Expires` INTEGER NOT NULL DEFAULT 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 42 #--------------------- Region Covenant changed time
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime int unsigned NOT NULL DEFAULT '0';
|
||||
COMMIT;
|
||||
|
||||
:VERSION 43 #---------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
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;
|
||||
|
||||
:VERSION 45
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`));
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# -----------------
|
||||
: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;
|
||||
@@ -1,138 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Data.Null
|
||||
{
|
||||
public class NullEstateStore : IEstateDataStore
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// private string m_connectionString;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public NullEstateStore()
|
||||
{
|
||||
}
|
||||
|
||||
public NullEstateStore(string connectionString)
|
||||
{
|
||||
Initialise(connectionString);
|
||||
}
|
||||
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
// m_connectionString = connectionString;
|
||||
}
|
||||
|
||||
private string[] FieldList
|
||||
{
|
||||
get { return new string[0]; }
|
||||
}
|
||||
|
||||
public EstateSettings LoadEstateSettings(UUID regionID, bool create)
|
||||
{
|
||||
// This fools the initialization caller into thinking an estate was fetched (a check in OpenSimBase).
|
||||
// The estate info is pretty empty so don't try banning anyone.
|
||||
EstateSettings oneEstate = new EstateSettings();
|
||||
oneEstate.EstateID = 1;
|
||||
return oneEstate;
|
||||
}
|
||||
|
||||
public void StoreEstateSettings(EstateSettings es)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
public EstateSettings LoadEstateSettings(int estateID)
|
||||
{
|
||||
return new EstateSettings();
|
||||
}
|
||||
|
||||
public EstateSettings CreateNewEstate()
|
||||
{
|
||||
return new EstateSettings();
|
||||
}
|
||||
|
||||
public List<EstateSettings> LoadEstateSettingsAll()
|
||||
{
|
||||
List<EstateSettings> allEstateSettings = new List<EstateSettings>();
|
||||
allEstateSettings.Add(new EstateSettings());
|
||||
return allEstateSettings;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesAll()
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstates(string search)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool LinkRegion(UUID regionID, int estateID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<UUID> GetRegions(int estateID)
|
||||
{
|
||||
List<UUID> result = new List<UUID>();
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool DeleteEstate(int estateID)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#region IEstateDataStore Members
|
||||
|
||||
|
||||
public List<int> GetEstatesByOwner(UUID ownerID)
|
||||
{
|
||||
return new List<int>();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,6 @@
|
||||
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;
|
||||
@@ -39,31 +36,12 @@ 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());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to implement the Get [] semantics, but it cuts corners.
|
||||
/// Specifically, it gets all friendships even if they weren't accepted yet.
|
||||
@@ -71,33 +49,15 @@ namespace OpenSim.Data.Null
|
||||
/// <param name="fields"></param>
|
||||
/// <param name="values"></param>
|
||||
/// <returns></returns>
|
||||
public FriendsData[] GetFriends(string userID)
|
||||
public FriendsData[] GetFriends(UUID userID)
|
||||
{
|
||||
lock (m_Data)
|
||||
List<FriendsData> lst = m_Data.FindAll(delegate (FriendsData fdata)
|
||||
{
|
||||
List<FriendsData> lst = m_Data.FindAll(fdata =>
|
||||
{
|
||||
return fdata.PrincipalID == userID.ToString();
|
||||
});
|
||||
|
||||
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 fdata.PrincipalID == userID;
|
||||
});
|
||||
|
||||
if (lst != null)
|
||||
return lst.ToArray();
|
||||
|
||||
return new FriendsData[0];
|
||||
}
|
||||
@@ -107,37 +67,21 @@ namespace OpenSim.Data.Null
|
||||
if (data == null)
|
||||
return false;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL FRIENDS DATA]: Storing {0} {1} {2}", data.PrincipalID, data.Friend, data.Data["Flags"]);
|
||||
|
||||
lock (m_Data)
|
||||
m_Data.Add(data);
|
||||
m_Data.Add(data);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Delete(UUID principalID, string friend)
|
||||
public bool Delete(UUID userID, string friendID)
|
||||
{
|
||||
return Delete(principalID.ToString(), friend);
|
||||
}
|
||||
|
||||
public bool Delete(string userID, string friendID)
|
||||
{
|
||||
lock (m_Data)
|
||||
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID; });
|
||||
if (lst != null)
|
||||
{
|
||||
List<FriendsData> lst = m_Data.FindAll(delegate(FriendsData fdata) { return fdata.PrincipalID == userID.ToString(); });
|
||||
if (lst != null)
|
||||
FriendsData friend = lst.Find(delegate(FriendsData fdata) { return fdata.Friend == friendID; });
|
||||
if (friendID != null)
|
||||
{
|
||||
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;
|
||||
}
|
||||
m_Data.Remove(friend);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ namespace OpenSim.Data.Null
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public PresenceData[] Get(string field, string data)
|
||||
{
|
||||
if (Instance != this)
|
||||
|
||||
@@ -40,83 +40,38 @@ namespace OpenSim.Data.Null
|
||||
{
|
||||
private static NullRegionData Instance = null;
|
||||
|
||||
/// <summary>
|
||||
/// Should we use the static instance for all invocations?
|
||||
/// </summary>
|
||||
private bool m_useStaticInstance = true;
|
||||
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>();
|
||||
|
||||
public NullRegionData(string connectionString, string realm)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL REGION DATA]: Constructor got connectionString {0}, realm {1}", connectionString, realm);
|
||||
|
||||
// The !static connection string is a hack so that regression tests can use this module without a high degree of fragility
|
||||
// in having to deal with the static reference in the once-loaded NullRegionData class.
|
||||
//
|
||||
// In standalone operation, we have to use only one instance of this class since the login service and
|
||||
// simulator have no other way of using a common data store.
|
||||
if (connectionString == "!static")
|
||||
m_useStaticInstance = false;
|
||||
else if (Instance == null)
|
||||
if (Instance == null)
|
||||
Instance = this;
|
||||
//Console.WriteLine("[XXX] NullRegionData constructor");
|
||||
}
|
||||
|
||||
private delegate bool Matcher(string value);
|
||||
|
||||
public List<RegionData> Get(string regionName, UUID scopeID)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Get(regionName, scopeID);
|
||||
|
||||
// m_log.DebugFormat("[NULL REGION DATA]: Getting region {0}, scope {1}", regionName, scopeID);
|
||||
|
||||
string cleanName = regionName.ToLower();
|
||||
|
||||
// Handle SQL wildcards
|
||||
const string wildcard = "%";
|
||||
bool wildcardPrefix = false;
|
||||
bool wildcardSuffix = false;
|
||||
if (cleanName.Equals(wildcard))
|
||||
{
|
||||
wildcardPrefix = wildcardSuffix = true;
|
||||
cleanName = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cleanName.StartsWith(wildcard))
|
||||
{
|
||||
wildcardPrefix = true;
|
||||
cleanName = cleanName.Substring(1);
|
||||
}
|
||||
if (regionName.EndsWith(wildcard))
|
||||
{
|
||||
wildcardSuffix = true;
|
||||
cleanName = cleanName.Remove(cleanName.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
Matcher queryMatch;
|
||||
if (wildcardPrefix && wildcardSuffix)
|
||||
queryMatch = delegate(string s) { return s.Contains(cleanName); };
|
||||
else if (wildcardSuffix)
|
||||
queryMatch = delegate(string s) { return s.StartsWith(cleanName); };
|
||||
else if (wildcardPrefix)
|
||||
queryMatch = delegate(string s) { return s.EndsWith(cleanName); };
|
||||
else
|
||||
queryMatch = delegate(string s) { return s.Equals(cleanName); };
|
||||
|
||||
// Find region data
|
||||
List<RegionData> ret = new List<RegionData>();
|
||||
|
||||
foreach (RegionData r in m_regionData.Values)
|
||||
{
|
||||
// m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanName, r.RegionName.ToLower());
|
||||
if (queryMatch(r.RegionName.ToLower()))
|
||||
if (regionName.Contains("%"))
|
||||
{
|
||||
string cleanname = regionName.Replace("%", "");
|
||||
m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanname.ToLower(), r.RegionName.ToLower());
|
||||
if (r.RegionName.ToLower().Contains(cleanname.ToLower()))
|
||||
ret.Add(r);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (r.RegionName.ToLower() == regionName.ToLower())
|
||||
ret.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret.Count > 0)
|
||||
@@ -127,7 +82,7 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public RegionData Get(int posX, int posY, UUID scopeID)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Get(posX, posY, scopeID);
|
||||
|
||||
List<RegionData> ret = new List<RegionData>();
|
||||
@@ -146,7 +101,7 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public RegionData Get(UUID regionID, UUID scopeID)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Get(regionID, scopeID);
|
||||
|
||||
if (m_regionData.ContainsKey(regionID))
|
||||
@@ -157,7 +112,7 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public List<RegionData> Get(int startX, int startY, int endX, int endY, UUID scopeID)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Get(startX, startY, endX, endY, scopeID);
|
||||
|
||||
List<RegionData> ret = new List<RegionData>();
|
||||
@@ -173,12 +128,9 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public bool Store(RegionData data)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Store(data);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL REGION DATA]: Storing region {0} {1}, scope {2}", data.RegionName, data.RegionID, data.ScopeID);
|
||||
|
||||
m_regionData[data.RegionID] = data;
|
||||
|
||||
return true;
|
||||
@@ -186,7 +138,7 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public bool SetDataItem(UUID regionID, string item, string value)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.SetDataItem(regionID, item, value);
|
||||
|
||||
if (!m_regionData.ContainsKey(regionID))
|
||||
@@ -199,11 +151,9 @@ namespace OpenSim.Data.Null
|
||||
|
||||
public bool Delete(UUID regionID)
|
||||
{
|
||||
if (m_useStaticInstance && Instance != this)
|
||||
if (Instance != this)
|
||||
return Instance.Delete(regionID);
|
||||
|
||||
// m_log.DebugFormat("[NULL REGION DATA]: Deleting region {0}", regionID);
|
||||
|
||||
if (!m_regionData.ContainsKey(regionID))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -38,15 +38,6 @@ namespace OpenSim.Data.Null
|
||||
/// </summary>
|
||||
public class NullSimulationData : ISimulationDataStore
|
||||
{
|
||||
public NullSimulationData()
|
||||
{
|
||||
}
|
||||
|
||||
public NullSimulationData(string connectionString)
|
||||
{
|
||||
Initialise(connectionString);
|
||||
}
|
||||
|
||||
public void Initialise(string dbfile)
|
||||
{
|
||||
return;
|
||||
@@ -59,46 +50,22 @@ namespace OpenSim.Data.Null
|
||||
public void StoreRegionSettings(RegionSettings rs)
|
||||
{
|
||||
}
|
||||
|
||||
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
|
||||
{
|
||||
//This connector doesn't support the windlight module yet
|
||||
//Return default LL windlight settings
|
||||
return new RegionLightShareData();
|
||||
}
|
||||
|
||||
public void RemoveRegionWindlightSettings(UUID regionID)
|
||||
{
|
||||
}
|
||||
|
||||
public void StoreRegionWindlightSettings(RegionLightShareData wl)
|
||||
{
|
||||
//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();
|
||||
rs.RegionUUID = regionUUID;
|
||||
return rs;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
@@ -118,20 +85,12 @@ namespace OpenSim.Data.Null
|
||||
return new List<SceneObjectGroup>();
|
||||
}
|
||||
|
||||
Dictionary<UUID, double[,]> m_terrains = new Dictionary<UUID, double[,]>();
|
||||
public void StoreTerrain(double[,] ter, UUID regionID)
|
||||
{
|
||||
if (m_terrains.ContainsKey(regionID))
|
||||
m_terrains.Remove(regionID);
|
||||
m_terrains.Add(regionID, ter);
|
||||
}
|
||||
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
if (m_terrains.ContainsKey(regionID))
|
||||
{
|
||||
return m_terrains[regionID];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -151,18 +110,5 @@ namespace OpenSim.Data.Null
|
||||
public void Shutdown()
|
||||
{
|
||||
}
|
||||
|
||||
public void SaveExtra(UUID regionID, string name, string value)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveExtra(UUID regionID, string name)
|
||||
{
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetExtra(UUID regionID)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
@@ -39,17 +36,12 @@ namespace OpenSim.Data.Null
|
||||
{
|
||||
public class NullUserAccountData : IUserAccountData
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
|
||||
private Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
|
||||
private Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
|
||||
private static Dictionary<UUID, UserAccountData> m_DataByUUID = new Dictionary<UUID, UserAccountData>();
|
||||
private static Dictionary<string, UserAccountData> m_DataByName = new Dictionary<string, UserAccountData>();
|
||||
private static Dictionary<string, UserAccountData> m_DataByEmail = new Dictionary<string, UserAccountData>();
|
||||
|
||||
public NullUserAccountData(string connectionString, string realm)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL USER ACCOUNT DATA]: Initializing new NullUserAccountData with connectionString [{0}], realm [{1}]",
|
||||
// connectionString, realm);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -62,15 +54,6 @@ namespace OpenSim.Data.Null
|
||||
/// <returns></returns>
|
||||
public UserAccountData[] Get(string[] fields, string[] values)
|
||||
{
|
||||
// if (m_log.IsDebugEnabled)
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL USER ACCOUNT DATA]: Called Get with fields [{0}], values [{1}]",
|
||||
// string.Join(", ", fields), string.Join(", ", values));
|
||||
// }
|
||||
|
||||
UserAccountData[] userAccounts = new UserAccountData[0];
|
||||
|
||||
List<string> fieldsLst = new List<string>(fields);
|
||||
if (fieldsLst.Contains("PrincipalID"))
|
||||
{
|
||||
@@ -78,61 +61,41 @@ namespace OpenSim.Data.Null
|
||||
UUID id = UUID.Zero;
|
||||
if (UUID.TryParse(values[i], out id))
|
||||
if (m_DataByUUID.ContainsKey(id))
|
||||
userAccounts = new UserAccountData[] { m_DataByUUID[id] };
|
||||
}
|
||||
else if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
|
||||
return new UserAccountData[] { m_DataByUUID[id] };
|
||||
}
|
||||
if (fieldsLst.Contains("FirstName") && fieldsLst.Contains("LastName"))
|
||||
{
|
||||
int findex = fieldsLst.IndexOf("FirstName");
|
||||
int lindex = fieldsLst.IndexOf("LastName");
|
||||
if (m_DataByName.ContainsKey(values[findex] + " " + values[lindex]))
|
||||
{
|
||||
userAccounts = new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
|
||||
}
|
||||
}
|
||||
else if (fieldsLst.Contains("Email"))
|
||||
return new UserAccountData[] { m_DataByName[values[findex] + " " + values[lindex]] };
|
||||
}
|
||||
if (fieldsLst.Contains("Email"))
|
||||
{
|
||||
int i = fieldsLst.IndexOf("Email");
|
||||
if (m_DataByEmail.ContainsKey(values[i]))
|
||||
userAccounts = new UserAccountData[] { m_DataByEmail[values[i]] };
|
||||
return new UserAccountData[] { m_DataByEmail[values[i]] };
|
||||
}
|
||||
|
||||
// if (m_log.IsDebugEnabled)
|
||||
// {
|
||||
// StringBuilder sb = new StringBuilder();
|
||||
// foreach (UserAccountData uad in userAccounts)
|
||||
// sb.AppendFormat("({0} {1} {2}) ", uad.FirstName, uad.LastName, uad.PrincipalID);
|
||||
//
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL USER ACCOUNT DATA]: Returning {0} user accounts out of {1}: [{2}]", userAccounts.Length, m_DataByName.Count, sb);
|
||||
// }
|
||||
|
||||
return userAccounts;
|
||||
|
||||
// Fail
|
||||
return new UserAccountData[0];
|
||||
}
|
||||
|
||||
public bool Store(UserAccountData data)
|
||||
{
|
||||
if (data == null)
|
||||
return false;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[NULL USER ACCOUNT DATA]: Storing user account {0} {1} {2} {3}",
|
||||
data.FirstName, data.LastName, data.PrincipalID, this.GetHashCode());
|
||||
|
||||
|
||||
m_DataByUUID[data.PrincipalID] = data;
|
||||
m_DataByName[data.FirstName + " " + data.LastName] = data;
|
||||
if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty)
|
||||
m_DataByEmail[data.Data["Email"]] = data;
|
||||
|
||||
// m_log.DebugFormat("m_DataByUUID count is {0}, m_DataByName count is {1}", m_DataByUUID.Count, m_DataByName.Count);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public UserAccountData[] GetUsers(UUID scopeID, string query)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[NULL USER ACCOUNT DATA]: Called GetUsers with scope [{0}], query [{1}]", scopeID, query);
|
||||
|
||||
string[] words = query.Split(new char[] { ' ' });
|
||||
|
||||
for (int i = 0; i < words.Length; i++)
|
||||
|
||||
20
OpenSim/Data/SQLite/Resources/OpenSim.Data.SQLite.addin.xml
Normal file
20
OpenSim/Data/SQLite/Resources/OpenSim.Data.SQLite.addin.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<Addin id="OpenSim.Data.SQLite" version="0.1">
|
||||
<Runtime>
|
||||
<Import assembly="OpenSim.Data.SQLite.dll"/>
|
||||
</Runtime>
|
||||
<Dependencies>
|
||||
<Addin id="OpenSim.Data" version="0.5" />
|
||||
</Dependencies>
|
||||
<Extension path = "/OpenSim/GridData">
|
||||
<Plugin id="SQLiteGridData" provider="OpenSim.Data.SQLite.dll" type="OpenSim.Data.SQLite.SQLiteGridData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/AssetData">
|
||||
<Plugin id="SQLiteAssetData" provider="OpenSim.Data.SQLite.dll" type="OpenSim.Data.SQLite.SQLiteAssetData" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/InventoryData">
|
||||
<Plugin id="SQLiteInventoryData" provider="OpenSim.Data.SQLite.dll" type="OpenSim.Data.SQLite.SQLiteInventoryStore" />
|
||||
</Extension>
|
||||
<Extension path = "/OpenSim/UserData">
|
||||
<Plugin id="SQLiteUserData" provider="OpenSim.Data.SQLite.dll" type="OpenSim.Data.SQLite.SQLiteUserData" />
|
||||
</Extension>
|
||||
</Addin>
|
||||
@@ -466,112 +466,4 @@ ALTER TABLE `land` ADD COLUMN `MediaSize` VARCHAR(16) NOT NULL DEFAULT '0,0';
|
||||
ALTER TABLE `land` ADD COLUMN `MediaLoop` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE `land` ADD COLUMN `ObscureMusic` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
ALTER TABLE `land` ADD COLUMN `ObscureMedia` BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 22
|
||||
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;
|
||||
COMMIT;
|
||||
@@ -41,9 +41,11 @@ COMMIT;
|
||||
|
||||
:VERSION 2
|
||||
|
||||
ATTACH 'inventoryStore.db' AS old;
|
||||
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
INSERT INTO inventoryfolders (folderName, type, version, folderID, agentID, parentFolderID) SELECT `name` AS folderName, `type` AS type, `version` AS version, `UUID` AS folderID, `agentID` AS agentID, `parentID` AS parentFolderID from old.inventoryfolders;
|
||||
INSERT INTO inventoryitems (assetID, assetType, inventoryName, inventoryDescription, inventoryNextPermissions, inventoryCurrentPermissions, invType, creatorID, inventoryBasePermissions, inventoryEveryOnePermissions, salePrice, saleType, creationDate, groupID, groupOwned, flags, inventoryID, parentFolderID, avatarID, inventoryGroupPermissions) SELECT `assetID`, `assetType` AS assetType, `inventoryName` AS inventoryName, `inventoryDescription` AS inventoryDescription, `inventoryNextPermissions` AS inventoryNextPermissions, `inventoryCurrentPermissions` AS inventoryCurrentPermissions, `invType` AS invType, `creatorsID` AS creatorID, `inventoryBasePermissions` AS inventoryBasePermissions, `inventoryEveryOnePermissions` AS inventoryEveryOnePermissions, `salePrice` AS salePrice, `saleType` AS saleType, `creationDate` AS creationDate, `groupID` AS groupID, `groupOwned` AS groupOwned, `flags` AS flags, `UUID` AS inventoryID, `parentFolderID` AS parentFolderID, `avatarID` AS avatarID, `inventoryGroupPermissions` AS inventoryGroupPermissions FROM old.inventoryitems;
|
||||
|
||||
COMMIT;
|
||||
COMMIT;
|
||||
@@ -57,11 +57,6 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
private SqliteConnection m_conn;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
override public void Dispose()
|
||||
{
|
||||
if (m_conn != null)
|
||||
@@ -81,9 +76,6 @@ 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";
|
||||
@@ -91,7 +83,8 @@ namespace OpenSim.Data.SQLite
|
||||
m_conn = new SqliteConnection(dbconnect);
|
||||
m_conn.Open();
|
||||
|
||||
Migration m = new Migration(m_conn, Assembly, "AssetStore");
|
||||
Assembly assem = GetType().Assembly;
|
||||
Migration m = new Migration(m_conn, assem, "AssetStore");
|
||||
m.Update();
|
||||
|
||||
return;
|
||||
@@ -131,7 +124,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Create an asset
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset Base</param>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
{
|
||||
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
|
||||
if (ExistsAsset(asset.FullID))
|
||||
@@ -153,6 +146,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,6 +167,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
using log4net;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
@@ -49,29 +49,23 @@ namespace OpenSim.Data.SQLite
|
||||
private string m_Realm;
|
||||
private List<string> m_ColumnNames;
|
||||
private int m_LastExpire;
|
||||
private string m_connectionString;
|
||||
|
||||
protected static SqliteConnection m_Connection;
|
||||
private static bool m_initialized = false;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public SQLiteAuthenticationData(string connectionString, string realm)
|
||||
: base(connectionString)
|
||||
{
|
||||
m_Realm = realm;
|
||||
m_connectionString = connectionString;
|
||||
|
||||
if (!m_initialized)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Connection = new SqliteConnection(connectionString);
|
||||
m_Connection.Open();
|
||||
|
||||
Migration m = new Migration(m_Connection, Assembly, "AuthStore");
|
||||
Migration m = new Migration(m_Connection, GetType().Assembly, "AuthStore");
|
||||
m.Update();
|
||||
|
||||
m_initialized = true;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite
|
||||
public class SQLiteAvatarData : SQLiteGenericTableHandler<AvatarBaseData>,
|
||||
IAvatarData
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public SQLiteAvatarData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Avatar")
|
||||
|
||||
@@ -53,11 +53,6 @@ namespace OpenSim.Data.SQLite
|
||||
private Dictionary<string, FieldInfo> m_FieldMap =
|
||||
new Dictionary<string, FieldInfo>();
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public SQLiteEstateStore()
|
||||
{
|
||||
}
|
||||
@@ -69,9 +64,6 @@ 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);
|
||||
@@ -79,7 +71,8 @@ namespace OpenSim.Data.SQLite
|
||||
m_connection = new SqliteConnection(m_connectionString);
|
||||
m_connection.Open();
|
||||
|
||||
Migration m = new Migration(m_connection, Assembly, "EstateStore");
|
||||
Assembly assem = GetType().Assembly;
|
||||
Migration m = new Migration(m_connection, assem, "EstateStore");
|
||||
m.Update();
|
||||
|
||||
//m_connection.Close();
|
||||
@@ -154,77 +147,67 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
else if (create)
|
||||
{
|
||||
DoCreate(es);
|
||||
LinkRegion(regionID, (int)es.EstateID);
|
||||
}
|
||||
r.Close();
|
||||
|
||||
LoadBanList(es);
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
return es;
|
||||
}
|
||||
names.Remove("EstateID");
|
||||
|
||||
public EstateSettings CreateNewEstate()
|
||||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
|
||||
|
||||
DoCreate(es);
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
LoadBanList(es);
|
||||
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
|
||||
return es;
|
||||
}
|
||||
|
||||
private void DoCreate(EstateSettings es)
|
||||
{
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
IDataReader r = null;
|
||||
|
||||
names.Remove("EstateID");
|
||||
|
||||
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
|
||||
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
if (m_FieldMap[name].GetValue(es) is bool)
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
if ((bool)m_FieldMap[name].GetValue(es))
|
||||
cmd.Parameters.AddWithValue(":"+name, "1");
|
||||
if (m_FieldMap[name].GetValue(es) is bool)
|
||||
{
|
||||
if ((bool)m_FieldMap[name].GetValue(es))
|
||||
cmd.Parameters.AddWithValue(":"+name, "1");
|
||||
else
|
||||
cmd.Parameters.AddWithValue(":"+name, "0");
|
||||
}
|
||||
else
|
||||
cmd.Parameters.AddWithValue(":"+name, "0");
|
||||
{
|
||||
cmd.Parameters.AddWithValue(":"+name, m_FieldMap[name].GetValue(es).ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
|
||||
cmd.CommandText = "select LAST_INSERT_ROWID() as id";
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
r = cmd.ExecuteReader();
|
||||
|
||||
r.Read();
|
||||
|
||||
es.EstateID = Convert.ToUInt32(r["id"]);
|
||||
|
||||
r.Close();
|
||||
|
||||
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||
cmd.Parameters.AddWithValue(":EstateID", es.EstateID.ToString());
|
||||
|
||||
// This will throw on dupe key
|
||||
try
|
||||
{
|
||||
cmd.Parameters.AddWithValue(":"+name, m_FieldMap[name].GetValue(es).ToString());
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
es.Save();
|
||||
}
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
LoadBanList(es);
|
||||
|
||||
cmd.CommandText = "select LAST_INSERT_ROWID() as id";
|
||||
cmd.Parameters.Clear();
|
||||
|
||||
r = cmd.ExecuteReader();
|
||||
|
||||
r.Read();
|
||||
|
||||
es.EstateID = Convert.ToUInt32(r["id"]);
|
||||
|
||||
r.Close();
|
||||
|
||||
es.Save();
|
||||
es.EstateManagers = LoadUUIDList(es.EstateID, "estate_managers");
|
||||
es.EstateAccess = LoadUUIDList(es.EstateID, "estate_users");
|
||||
es.EstateGroups = LoadUUIDList(es.EstateID, "estate_groups");
|
||||
return es;
|
||||
}
|
||||
|
||||
public void StoreEstateSettings(EstateSettings es)
|
||||
@@ -374,17 +357,6 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
return DoLoad(cmd, UUID.Zero, false);
|
||||
}
|
||||
|
||||
public List<EstateSettings> LoadEstateSettingsAll()
|
||||
{
|
||||
List<EstateSettings> estateSettings = new List<EstateSettings>();
|
||||
|
||||
List<int> estateIds = GetEstatesAll();
|
||||
foreach (int estateId in estateIds)
|
||||
estateSettings.Add(LoadEstateSettings(estateId));
|
||||
|
||||
return estateSettings;
|
||||
}
|
||||
|
||||
public List<int> GetEstates(string search)
|
||||
{
|
||||
@@ -407,82 +379,19 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesAll()
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
string sql = "select EstateID from estate_settings";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
cmd.CommandText = sql;
|
||||
|
||||
IDataReader r = cmd.ExecuteReader();
|
||||
|
||||
while (r.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(r["EstateID"]));
|
||||
}
|
||||
r.Close();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<int> GetEstatesByOwner(UUID ownerID)
|
||||
{
|
||||
List<int> result = new List<int>();
|
||||
|
||||
string sql = "select EstateID from estate_settings where estate_settings.EstateOwner = :EstateOwner";
|
||||
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.AddWithValue(":EstateOwner", ownerID);
|
||||
|
||||
IDataReader r = cmd.ExecuteReader();
|
||||
|
||||
while (r.Read())
|
||||
{
|
||||
result.Add(Convert.ToInt32(r["EstateID"]));
|
||||
}
|
||||
r.Close();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public bool LinkRegion(UUID regionID, int estateID)
|
||||
{
|
||||
SqliteTransaction transaction = m_connection.BeginTransaction();
|
||||
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
|
||||
|
||||
// Delete any existing estate mapping for this region.
|
||||
using(SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from estate_map where RegionID = :RegionID";
|
||||
cmd.Transaction = transaction;
|
||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||
cmd.Parameters.AddWithValue(":EstateID", estateID.ToString());
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
if (cmd.ExecuteNonQuery() == 0)
|
||||
return false;
|
||||
|
||||
using(SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
|
||||
cmd.Transaction = transaction;
|
||||
cmd.Parameters.AddWithValue(":RegionID", regionID.ToString());
|
||||
cmd.Parameters.AddWithValue(":EstateID", estateID.ToString());
|
||||
|
||||
if (cmd.ExecuteNonQuery() == 0)
|
||||
{
|
||||
transaction.Rollback();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
transaction.Commit();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<UUID> GetRegions(int estateID)
|
||||
|
||||
@@ -48,8 +48,6 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
protected SQLiteFramework(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -46,12 +46,7 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(UUID principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(string userID)
|
||||
public FriendsData[] GetFriends(UUID userID)
|
||||
{
|
||||
SqliteCommand cmd = new SqliteCommand();
|
||||
|
||||
@@ -63,11 +58,6 @@ namespace OpenSim.Data.SQLite
|
||||
}
|
||||
|
||||
public bool Delete(UUID principalID, string friend)
|
||||
{
|
||||
return Delete(principalID.ToString(), friend);
|
||||
}
|
||||
|
||||
public bool Delete(string principalID, string friend)
|
||||
{
|
||||
SqliteCommand cmd = new SqliteCommand();
|
||||
|
||||
@@ -75,7 +65,7 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString());
|
||||
cmd.Parameters.AddWithValue(":Friend", friend);
|
||||
|
||||
ExecuteNonQuery(cmd, m_Connection);
|
||||
ExecuteNonQuery(cmd, cmd.Connection);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,11 +55,6 @@ namespace OpenSim.Data.SQLite
|
||||
protected static SqliteConnection m_Connection;
|
||||
private static bool m_initialized;
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
public SQLiteGenericTableHandler(string connectionString,
|
||||
string realm, string storeName) : base(connectionString)
|
||||
{
|
||||
@@ -73,12 +68,13 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
if (storeName != String.Empty)
|
||||
{
|
||||
Assembly assem = GetType().Assembly;
|
||||
//SqliteConnection newConnection =
|
||||
// (SqliteConnection)((ICloneable)m_Connection).Clone();
|
||||
//newConnection.Open();
|
||||
|
||||
//Migration m = new Migration(newConnection, Assembly, storeName);
|
||||
Migration m = new Migration(m_Connection, Assembly, storeName);
|
||||
//Migration m = new Migration(newConnection, assem, storeName);
|
||||
Migration m = new Migration(m_Connection, assem, storeName);
|
||||
m.Update();
|
||||
//newConnection.Close();
|
||||
//newConnection.Dispose();
|
||||
@@ -262,33 +258,17 @@ namespace OpenSim.Data.SQLite
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool Delete(string field, string key)
|
||||
public bool Delete(string field, string val)
|
||||
{
|
||||
return Delete(new string[] { field }, new string[] { key });
|
||||
}
|
||||
|
||||
public bool Delete(string[] fields, string[] keys)
|
||||
{
|
||||
if (fields.Length != keys.Length)
|
||||
return false;
|
||||
|
||||
List<string> terms = new List<string>();
|
||||
|
||||
SqliteCommand cmd = new SqliteCommand();
|
||||
|
||||
for (int i = 0 ; i < fields.Length ; i++)
|
||||
{
|
||||
cmd.Parameters.Add(new SqliteParameter(":" + fields[i], keys[i]));
|
||||
terms.Add("`" + fields[i] + "` = :" + fields[i]);
|
||||
}
|
||||
cmd.CommandText = String.Format("delete from {0} where `{1}` = :{1}", m_Realm, field);
|
||||
cmd.Parameters.Add(new SqliteParameter(field, val));
|
||||
|
||||
string where = String.Join(" and ", terms.ToArray());
|
||||
if (ExecuteNonQuery(cmd, m_Connection) > 0)
|
||||
return true;
|
||||
|
||||
string query = String.Format("delete from {0} where {1}", m_Realm, where);
|
||||
|
||||
cmd.CommandText = query;
|
||||
|
||||
return ExecuteNonQuery(cmd, m_Connection) > 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,6 @@ 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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user