Compare commits
779 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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" />
|
||||
|
||||
@@ -72,11 +91,6 @@
|
||||
the assembly here as an exec, and you add the fail clause later.
|
||||
This lets all the unit tests run and tells you if they fail at the
|
||||
end, instead of stopping short -->
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.tests">
|
||||
<arg value="./bin/OpenSim.Tests.dll" />
|
||||
</exec>
|
||||
<fail message="Failures reported in unit tests." unless="${int::parse(testresult.opensim.tests)==0}" />
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="true" resultproperty="testresult.opensim.framework.tests">
|
||||
<arg value="./bin/OpenSim.Framework.Tests.dll" />
|
||||
</exec>
|
||||
@@ -92,15 +106,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 +123,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 +133,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,19 +245,17 @@
|
||||
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">
|
||||
<arg value="./bin/OpenSim.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Tests.dll-Results.xml" />
|
||||
</exec>
|
||||
|
||||
<exec program="${nunitcmd}" failonerror="false" resultproperty="testresult.opensim.framework.tests">
|
||||
<arg value="./bin/OpenSim.Framework.Tests.dll" />
|
||||
<arg value="-xml=test-results/OpenSim.Framework.Tests.dll-Results.xml" />
|
||||
@@ -195,15 +271,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 +288,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 +298,42 @@
|
||||
<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" />
|
||||
|
||||
15
BUILDING.txt
15
BUILDING.txt
@@ -1,4 +1,4 @@
|
||||
==== Building OpenSim ====
|
||||
=== Building OpenSim ===
|
||||
|
||||
=== Building on Windows ===
|
||||
|
||||
@@ -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
|
||||
@@ -198,7 +167,6 @@ This software uses components from the following developers:
|
||||
* GlynnTucker.Cache (http://gtcache.sourceforge.net/)
|
||||
* NDesk.Options 0.2.1 (http://www.ndesk.org/Options)
|
||||
* Json.NET 3.5 Release 6. The binary used is actually Newtonsoft.Json.Net20.dll for Mono 2.4 compatability (http://james.newtonking.com/projects/json-net.aspx)
|
||||
* zlib.net for C# 1.0.4 (http://www.componentace.com/zlib_.NET.htm)
|
||||
|
||||
Some plugins are based on Cable Beach
|
||||
Cable Beach is Copyright (c) 2008 Intel Corporation
|
||||
@@ -208,4 +176,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,44 @@ 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.CreateRegion(regionsToLoad[i], true, out scene);
|
||||
if (changed)
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
|
||||
if (scene != null)
|
||||
{
|
||||
m_newRegionCreatedHandler = OnNewRegionCreated;
|
||||
@@ -154,20 +150,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 +160,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 +168,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 +184,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
@@ -27,7 +27,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -44,7 +43,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 +73,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 +94,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
public void Close()
|
||||
{
|
||||
// enabled = false;
|
||||
enabled = false;
|
||||
Rest.Log.InfoFormat("{0} User appearance services closing down", MsgId);
|
||||
}
|
||||
|
||||
@@ -385,7 +384,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
// }
|
||||
//
|
||||
// rdata.Respond(String.Format("Appearance {0} : Normal completion", rdata.method));
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
@@ -450,7 +449,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
// rdata.userAppearance = new AvatarAppearance();
|
||||
// rdata.userAppearance.Owner = old.Owner;
|
||||
// adata = new AvatarData(rdata.userAppearance);
|
||||
//
|
||||
//
|
||||
// Rest.AvatarServices.SetAvatar(rdata.userProfile.ID, adata);
|
||||
//
|
||||
// rdata.Complete();
|
||||
@@ -488,18 +487,17 @@ 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);
|
||||
indata = true;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case "Body" :
|
||||
if (xml.MoveToAttribute("Item"))
|
||||
{
|
||||
@@ -656,7 +654,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
indata = true;
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case "Attachment" :
|
||||
{
|
||||
|
||||
@@ -747,11 +744,10 @@ 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());
|
||||
|
||||
/*
|
||||
FormatPart(rdata, "Body", rdata.userAppearance.BodyItem, rdata.userAppearance.BodyAsset);
|
||||
FormatPart(rdata, "Skin", rdata.userAppearance.SkinItem, rdata.userAppearance.SkinAsset);
|
||||
FormatPart(rdata, "Hair", rdata.userAppearance.HairItem, rdata.userAppearance.HairAsset);
|
||||
@@ -768,20 +764,26 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
|
||||
FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset);
|
||||
FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset);
|
||||
*/
|
||||
Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId);
|
||||
|
||||
rdata.writer.WriteStartElement("Attachments");
|
||||
List<AvatarAttachment> attachments = rdata.userAppearance.GetAttachments();
|
||||
foreach (AvatarAttachment attach in attachments)
|
||||
Hashtable attachments = rdata.userAppearance.GetAttachments();
|
||||
|
||||
if (attachments != null)
|
||||
{
|
||||
rdata.writer.WriteStartElement("Attachment");
|
||||
rdata.writer.WriteAttributeString("AtPoint", attach.AttachPoint.ToString());
|
||||
rdata.writer.WriteAttributeString("Item", attach.ItemID.ToString());
|
||||
rdata.writer.WriteAttributeString("Asset", attach.AssetID.ToString());
|
||||
|
||||
Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId);
|
||||
|
||||
rdata.writer.WriteStartElement("Attachments");
|
||||
for (int i = 0; i < attachments.Count; i++)
|
||||
{
|
||||
Hashtable attachment = attachments[i] as Hashtable;
|
||||
rdata.writer.WriteStartElement("Attachment");
|
||||
rdata.writer.WriteAttributeString("AtPoint", i.ToString());
|
||||
rdata.writer.WriteAttributeString("Item", (string) attachment["item"]);
|
||||
rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]);
|
||||
rdata.writer.WriteEndElement();
|
||||
}
|
||||
rdata.writer.WriteEndElement();
|
||||
}
|
||||
rdata.writer.WriteEndElement();
|
||||
|
||||
Primitive.TextureEntry texture = rdata.userAppearance.Texture;
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -1295,7 +1295,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
|
||||
rdata.writer.WriteAttributeString("folder", String.Empty, i.Folder.ToString());
|
||||
rdata.writer.WriteAttributeString("owner", String.Empty, i.Owner.ToString());
|
||||
rdata.writer.WriteAttributeString("creator", String.Empty, i.CreatorId);
|
||||
rdata.writer.WriteAttributeString("creatordata", String.Empty, i.CreatorData);
|
||||
rdata.writer.WriteAttributeString("creationdate", String.Empty, i.CreationDate.ToString());
|
||||
rdata.writer.WriteAttributeString("invtype", String.Empty, i.InvType.ToString());
|
||||
rdata.writer.WriteAttributeString("assettype", String.Empty, i.AssetType.ToString());
|
||||
@@ -2129,17 +2128,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,116 +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.Reflection;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
|
||||
namespace OpenSim.Capabilities.Handlers
|
||||
{
|
||||
public class GetMeshHandler
|
||||
{
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IAssetService m_assetService;
|
||||
|
||||
public GetMeshHandler(IAssetService assService)
|
||||
{
|
||||
m_assetService = assService;
|
||||
}
|
||||
|
||||
public Hashtable ProcessGetMesh(Hashtable request, UUID AgentId, Caps cap)
|
||||
{
|
||||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["int_response_code"] = 400; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Request wasn't what was expected";
|
||||
|
||||
string meshStr = string.Empty;
|
||||
|
||||
if (request.ContainsKey("mesh_id"))
|
||||
meshStr = request["mesh_id"].ToString();
|
||||
|
||||
UUID meshID = UUID.Zero;
|
||||
if (!String.IsNullOrEmpty(meshStr) && UUID.TryParse(meshStr, out meshID))
|
||||
{
|
||||
if (m_assetService == null)
|
||||
{
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "The asset service is unavailable. So is your mesh.";
|
||||
return responsedata;
|
||||
}
|
||||
|
||||
AssetBase mesh = m_assetService.Get(meshID.ToString());
|
||||
|
||||
if (mesh != null)
|
||||
{
|
||||
if (mesh.Type == (SByte)AssetType.Mesh)
|
||||
{
|
||||
responsedata["str_response_string"] = Convert.ToBase64String(mesh.Data);
|
||||
responsedata["content_type"] = "application/vnd.ll.mesh";
|
||||
responsedata["int_response_code"] = 200;
|
||||
}
|
||||
// Optionally add additional mesh types here
|
||||
else
|
||||
{
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Unfortunately, this asset isn't a mesh.";
|
||||
return responsedata;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
responsedata["int_response_code"] = 404; //501; //410; //404;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["str_response_string"] = "Your Mesh wasn't found. Sorry!";
|
||||
return responsedata;
|
||||
}
|
||||
}
|
||||
|
||||
return responsedata;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
1726
OpenSim/Client/MXP/ClientStack/MXPClientView.cs
Normal file
1726
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
564
OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
Normal file
564
OpenSim/Client/MXP/PacketHandler/MXPPacketServer.cs
Normal file
@@ -0,0 +1,564 @@
|
||||
/*
|
||||
* 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)
|
||||
{
|
||||
UUID userId = UUID.Zero;
|
||||
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/";
|
||||
AvatarData avatar = scene.AvatarService.GetAvatar(account.PrincipalID);
|
||||
if (avatar != null)
|
||||
agent.Appearance = avatar.ToAvatarAppearance(account.PrincipalID); //userService.GetUserAppearance(userProfile.ID);
|
||||
|
||||
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
|
||||
|
||||
}
|
||||
}
|
||||
1212
OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
Normal file
1212
OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
Normal file
File diff suppressed because it is too large
Load Diff
630
OpenSim/Client/Sirikata/Protocol/MessageHeader.cs
Normal file
630
OpenSim/Client/Sirikata/Protocol/MessageHeader.cs
Normal file
@@ -0,0 +1,630 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
namespace Sirikata.Protocol._PBJ_Internal {
|
||||
|
||||
public static partial class MessageHeader {
|
||||
|
||||
#region Extension registration
|
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
||||
}
|
||||
#endregion
|
||||
#region Static variables
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Protocol._PBJ_Internal.Header, global::Sirikata.Protocol._PBJ_Internal.Header.Builder> internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable;
|
||||
#endregion
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbd::FileDescriptor descriptor;
|
||||
|
||||
static MessageHeader() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
"ChNNZXNzYWdlSGVhZGVyLnByb3RvEh9TaXJpa2F0YS5Qcm90b2NvbC5fUEJK" +
|
||||
"X0ludGVybmFsIooDCgZIZWFkZXISFQoNc291cmNlX29iamVjdBgBIAEoDBIT" +
|
||||
"Cgtzb3VyY2VfcG9ydBgDIAEoDRIVCgxzb3VyY2Vfc3BhY2UYgAwgASgMEhoK" +
|
||||
"EmRlc3RpbmF0aW9uX29iamVjdBgCIAEoDBIYChBkZXN0aW5hdGlvbl9wb3J0" +
|
||||
"GAQgASgNEhoKEWRlc3RpbmF0aW9uX3NwYWNlGIEMIAEoDBIKCgJpZBgHIAEo" +
|
||||
"AxIQCghyZXBseV9pZBgIIAEoAxJMCg1yZXR1cm5fc3RhdHVzGIAOIAEoDjI0" +
|
||||
"LlNpcmlrYXRhLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuSGVhZGVyLlJldHVy" +
|
||||
"blN0YXR1cyJ/CgxSZXR1cm5TdGF0dXMSCwoHU1VDQ0VTUxAAEhMKD05FVFdP" +
|
||||
"UktfRkFJTFVSRRABEhMKD1RJTUVPVVRfRkFJTFVSRRADEhIKDlBST1RPQ09M" +
|
||||
"X0VSUk9SEAQSEAoMUE9SVF9GQUlMVVJFEAUSEgoOVU5LTk9XTl9PQkpFQ1QQ" +
|
||||
"Bg==");
|
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor = Descriptor.MessageTypes[0];
|
||||
internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Protocol._PBJ_Internal.Header, global::Sirikata.Protocol._PBJ_Internal.Header.Builder>(internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor,
|
||||
new string[] { "SourceObject", "SourcePort", "SourceSpace", "DestinationObject", "DestinationPort", "DestinationSpace", "Id", "ReplyId", "ReturnStatus", });
|
||||
return null;
|
||||
};
|
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
|
||||
new pbd::FileDescriptor[] {
|
||||
}, assigner);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
public sealed partial class Header : pb::GeneratedMessage<Header, Header.Builder> {
|
||||
private static readonly Header defaultInstance = new Builder().BuildPartial();
|
||||
public static Header DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override Header DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override Header ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<Header, Header.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public enum ReturnStatus {
|
||||
SUCCESS = 0,
|
||||
NETWORK_FAILURE = 1,
|
||||
TIMEOUT_FAILURE = 3,
|
||||
PROTOCOL_ERROR = 4,
|
||||
PORT_FAILURE = 5,
|
||||
UNKNOWN_OBJECT = 6,
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
public const int SourceObjectFieldNumber = 1;
|
||||
private bool hasSourceObject;
|
||||
private pb::ByteString sourceObject_ = pb::ByteString.Empty;
|
||||
public bool HasSourceObject {
|
||||
get { return hasSourceObject; }
|
||||
}
|
||||
public pb::ByteString SourceObject {
|
||||
get { return sourceObject_; }
|
||||
}
|
||||
|
||||
public const int SourcePortFieldNumber = 3;
|
||||
private bool hasSourcePort;
|
||||
private uint sourcePort_ = 0;
|
||||
public bool HasSourcePort {
|
||||
get { return hasSourcePort; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint SourcePort {
|
||||
get { return sourcePort_; }
|
||||
}
|
||||
|
||||
public const int SourceSpaceFieldNumber = 1536;
|
||||
private bool hasSourceSpace;
|
||||
private pb::ByteString sourceSpace_ = pb::ByteString.Empty;
|
||||
public bool HasSourceSpace {
|
||||
get { return hasSourceSpace; }
|
||||
}
|
||||
public pb::ByteString SourceSpace {
|
||||
get { return sourceSpace_; }
|
||||
}
|
||||
|
||||
public const int DestinationObjectFieldNumber = 2;
|
||||
private bool hasDestinationObject;
|
||||
private pb::ByteString destinationObject_ = pb::ByteString.Empty;
|
||||
public bool HasDestinationObject {
|
||||
get { return hasDestinationObject; }
|
||||
}
|
||||
public pb::ByteString DestinationObject {
|
||||
get { return destinationObject_; }
|
||||
}
|
||||
|
||||
public const int DestinationPortFieldNumber = 4;
|
||||
private bool hasDestinationPort;
|
||||
private uint destinationPort_ = 0;
|
||||
public bool HasDestinationPort {
|
||||
get { return hasDestinationPort; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint DestinationPort {
|
||||
get { return destinationPort_; }
|
||||
}
|
||||
|
||||
public const int DestinationSpaceFieldNumber = 1537;
|
||||
private bool hasDestinationSpace;
|
||||
private pb::ByteString destinationSpace_ = pb::ByteString.Empty;
|
||||
public bool HasDestinationSpace {
|
||||
get { return hasDestinationSpace; }
|
||||
}
|
||||
public pb::ByteString DestinationSpace {
|
||||
get { return destinationSpace_; }
|
||||
}
|
||||
|
||||
public const int IdFieldNumber = 7;
|
||||
private bool hasId;
|
||||
private long id_ = 0L;
|
||||
public bool HasId {
|
||||
get { return hasId; }
|
||||
}
|
||||
public long Id {
|
||||
get { return id_; }
|
||||
}
|
||||
|
||||
public const int ReplyIdFieldNumber = 8;
|
||||
private bool hasReplyId;
|
||||
private long replyId_ = 0L;
|
||||
public bool HasReplyId {
|
||||
get { return hasReplyId; }
|
||||
}
|
||||
public long ReplyId {
|
||||
get { return replyId_; }
|
||||
}
|
||||
|
||||
public const int ReturnStatusFieldNumber = 1792;
|
||||
private bool hasReturnStatus;
|
||||
private global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS;
|
||||
public bool HasReturnStatus {
|
||||
get { return hasReturnStatus; }
|
||||
}
|
||||
public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus {
|
||||
get { return returnStatus_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasSourceObject) {
|
||||
output.WriteBytes(1, SourceObject);
|
||||
}
|
||||
if (HasDestinationObject) {
|
||||
output.WriteBytes(2, DestinationObject);
|
||||
}
|
||||
if (HasSourcePort) {
|
||||
output.WriteUInt32(3, SourcePort);
|
||||
}
|
||||
if (HasDestinationPort) {
|
||||
output.WriteUInt32(4, DestinationPort);
|
||||
}
|
||||
if (HasId) {
|
||||
output.WriteInt64(7, Id);
|
||||
}
|
||||
if (HasReplyId) {
|
||||
output.WriteInt64(8, ReplyId);
|
||||
}
|
||||
if (HasSourceSpace) {
|
||||
output.WriteBytes(1536, SourceSpace);
|
||||
}
|
||||
if (HasDestinationSpace) {
|
||||
output.WriteBytes(1537, DestinationSpace);
|
||||
}
|
||||
if (HasReturnStatus) {
|
||||
output.WriteEnum(1792, (int) ReturnStatus);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasSourceObject) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(1, SourceObject);
|
||||
}
|
||||
if (HasSourcePort) {
|
||||
size += pb::CodedOutputStream.ComputeUInt32Size(3, SourcePort);
|
||||
}
|
||||
if (HasSourceSpace) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(1536, SourceSpace);
|
||||
}
|
||||
if (HasDestinationObject) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(2, DestinationObject);
|
||||
}
|
||||
if (HasDestinationPort) {
|
||||
size += pb::CodedOutputStream.ComputeUInt32Size(4, DestinationPort);
|
||||
}
|
||||
if (HasDestinationSpace) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(1537, DestinationSpace);
|
||||
}
|
||||
if (HasId) {
|
||||
size += pb::CodedOutputStream.ComputeInt64Size(7, Id);
|
||||
}
|
||||
if (HasReplyId) {
|
||||
size += pb::CodedOutputStream.ComputeInt64Size(8, ReplyId);
|
||||
}
|
||||
if (HasReturnStatus) {
|
||||
size += pb::CodedOutputStream.ComputeEnumSize(1792, (int) ReturnStatus);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static Header ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Header ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static Header ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Header ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Header prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<Header, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
Header result = new Header();
|
||||
|
||||
protected override Header MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new Header();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Protocol._PBJ_Internal.Header.Descriptor; }
|
||||
}
|
||||
|
||||
public override Header DefaultInstanceForType {
|
||||
get { return global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override Header BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
Header returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is Header) {
|
||||
return MergeFrom((Header) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(Header other) {
|
||||
if (other == global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance) return this;
|
||||
if (other.HasSourceObject) {
|
||||
SourceObject = other.SourceObject;
|
||||
}
|
||||
if (other.HasSourcePort) {
|
||||
SourcePort = other.SourcePort;
|
||||
}
|
||||
if (other.HasSourceSpace) {
|
||||
SourceSpace = other.SourceSpace;
|
||||
}
|
||||
if (other.HasDestinationObject) {
|
||||
DestinationObject = other.DestinationObject;
|
||||
}
|
||||
if (other.HasDestinationPort) {
|
||||
DestinationPort = other.DestinationPort;
|
||||
}
|
||||
if (other.HasDestinationSpace) {
|
||||
DestinationSpace = other.DestinationSpace;
|
||||
}
|
||||
if (other.HasId) {
|
||||
Id = other.Id;
|
||||
}
|
||||
if (other.HasReplyId) {
|
||||
ReplyId = other.ReplyId;
|
||||
}
|
||||
if (other.HasReturnStatus) {
|
||||
ReturnStatus = other.ReturnStatus;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
SourceObject = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
DestinationObject = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 24: {
|
||||
SourcePort = input.ReadUInt32();
|
||||
break;
|
||||
}
|
||||
case 32: {
|
||||
DestinationPort = input.ReadUInt32();
|
||||
break;
|
||||
}
|
||||
case 56: {
|
||||
Id = input.ReadInt64();
|
||||
break;
|
||||
}
|
||||
case 64: {
|
||||
ReplyId = input.ReadInt64();
|
||||
break;
|
||||
}
|
||||
case 12290: {
|
||||
SourceSpace = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 12298: {
|
||||
DestinationSpace = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 14336: {
|
||||
int rawValue = input.ReadEnum();
|
||||
if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus), rawValue)) {
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
unknownFields.MergeVarintField(1792, (ulong) rawValue);
|
||||
} else {
|
||||
ReturnStatus = (global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus) rawValue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasSourceObject {
|
||||
get { return result.HasSourceObject; }
|
||||
}
|
||||
public pb::ByteString SourceObject {
|
||||
get { return result.SourceObject; }
|
||||
set { SetSourceObject(value); }
|
||||
}
|
||||
public Builder SetSourceObject(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasSourceObject = true;
|
||||
result.sourceObject_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearSourceObject() {
|
||||
result.hasSourceObject = false;
|
||||
result.sourceObject_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasSourcePort {
|
||||
get { return result.HasSourcePort; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint SourcePort {
|
||||
get { return result.SourcePort; }
|
||||
set { SetSourcePort(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetSourcePort(uint value) {
|
||||
result.hasSourcePort = true;
|
||||
result.sourcePort_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearSourcePort() {
|
||||
result.hasSourcePort = false;
|
||||
result.sourcePort_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasSourceSpace {
|
||||
get { return result.HasSourceSpace; }
|
||||
}
|
||||
public pb::ByteString SourceSpace {
|
||||
get { return result.SourceSpace; }
|
||||
set { SetSourceSpace(value); }
|
||||
}
|
||||
public Builder SetSourceSpace(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasSourceSpace = true;
|
||||
result.sourceSpace_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearSourceSpace() {
|
||||
result.hasSourceSpace = false;
|
||||
result.sourceSpace_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasDestinationObject {
|
||||
get { return result.HasDestinationObject; }
|
||||
}
|
||||
public pb::ByteString DestinationObject {
|
||||
get { return result.DestinationObject; }
|
||||
set { SetDestinationObject(value); }
|
||||
}
|
||||
public Builder SetDestinationObject(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasDestinationObject = true;
|
||||
result.destinationObject_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearDestinationObject() {
|
||||
result.hasDestinationObject = false;
|
||||
result.destinationObject_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasDestinationPort {
|
||||
get { return result.HasDestinationPort; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint DestinationPort {
|
||||
get { return result.DestinationPort; }
|
||||
set { SetDestinationPort(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetDestinationPort(uint value) {
|
||||
result.hasDestinationPort = true;
|
||||
result.destinationPort_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearDestinationPort() {
|
||||
result.hasDestinationPort = false;
|
||||
result.destinationPort_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasDestinationSpace {
|
||||
get { return result.HasDestinationSpace; }
|
||||
}
|
||||
public pb::ByteString DestinationSpace {
|
||||
get { return result.DestinationSpace; }
|
||||
set { SetDestinationSpace(value); }
|
||||
}
|
||||
public Builder SetDestinationSpace(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasDestinationSpace = true;
|
||||
result.destinationSpace_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearDestinationSpace() {
|
||||
result.hasDestinationSpace = false;
|
||||
result.destinationSpace_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasId {
|
||||
get { return result.HasId; }
|
||||
}
|
||||
public long Id {
|
||||
get { return result.Id; }
|
||||
set { SetId(value); }
|
||||
}
|
||||
public Builder SetId(long value) {
|
||||
result.hasId = true;
|
||||
result.id_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearId() {
|
||||
result.hasId = false;
|
||||
result.id_ = 0L;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasReplyId {
|
||||
get { return result.HasReplyId; }
|
||||
}
|
||||
public long ReplyId {
|
||||
get { return result.ReplyId; }
|
||||
set { SetReplyId(value); }
|
||||
}
|
||||
public Builder SetReplyId(long value) {
|
||||
result.hasReplyId = true;
|
||||
result.replyId_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearReplyId() {
|
||||
result.hasReplyId = false;
|
||||
result.replyId_ = 0L;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasReturnStatus {
|
||||
get { return result.HasReturnStatus; }
|
||||
}
|
||||
public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus {
|
||||
get { return result.ReturnStatus; }
|
||||
set { SetReturnStatus(value); }
|
||||
}
|
||||
public Builder SetReturnStatus(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus value) {
|
||||
result.hasReturnStatus = true;
|
||||
result.returnStatus_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearReturnStatus() {
|
||||
result.hasReturnStatus = false;
|
||||
result.returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static Header() {
|
||||
object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.MessageHeader.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
339
OpenSim/Client/Sirikata/Protocol/MessageHeader.pbj.cs
Normal file
339
OpenSim/Client/Sirikata/Protocol/MessageHeader.pbj.cs
Normal file
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* 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 pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
namespace Sirikata.Protocol {
|
||||
public class Header : PBJ.IMessage {
|
||||
protected _PBJ_Internal.Header super;
|
||||
public _PBJ_Internal.Header _PBJSuper{ get { return super;} }
|
||||
public Header() {
|
||||
super=new _PBJ_Internal.Header();
|
||||
}
|
||||
public Header(_PBJ_Internal.Header reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static Header defaultInstance= new Header (_PBJ_Internal.Header.DefaultInstance);
|
||||
public static Header DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.Header.Descriptor; } }
|
||||
public static class Types {
|
||||
public enum ReturnStatus {
|
||||
SUCCESS=_PBJ_Internal.Header.Types.ReturnStatus.SUCCESS,
|
||||
NETWORK_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.NETWORK_FAILURE,
|
||||
TIMEOUT_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.TIMEOUT_FAILURE,
|
||||
PROTOCOL_ERROR=_PBJ_Internal.Header.Types.ReturnStatus.PROTOCOL_ERROR,
|
||||
PORT_FAILURE=_PBJ_Internal.Header.Types.ReturnStatus.PORT_FAILURE,
|
||||
UNKNOWN_OBJECT=_PBJ_Internal.Header.Types.ReturnStatus.UNKNOWN_OBJECT
|
||||
};
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912);
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int SourceObjectFieldTag=1;
|
||||
public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} }
|
||||
public PBJ.UUID SourceObject{ get {
|
||||
if (HasSourceObject) {
|
||||
return PBJ._PBJ.CastUuid(super.SourceObject);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int SourcePortFieldTag=3;
|
||||
public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} }
|
||||
public uint SourcePort{ get {
|
||||
if (HasSourcePort) {
|
||||
return PBJ._PBJ.CastUint32(super.SourcePort);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint32();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int SourceSpaceFieldTag=1536;
|
||||
public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} }
|
||||
public PBJ.UUID SourceSpace{ get {
|
||||
if (HasSourceSpace) {
|
||||
return PBJ._PBJ.CastUuid(super.SourceSpace);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int DestinationObjectFieldTag=2;
|
||||
public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} }
|
||||
public PBJ.UUID DestinationObject{ get {
|
||||
if (HasDestinationObject) {
|
||||
return PBJ._PBJ.CastUuid(super.DestinationObject);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int DestinationPortFieldTag=4;
|
||||
public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} }
|
||||
public uint DestinationPort{ get {
|
||||
if (HasDestinationPort) {
|
||||
return PBJ._PBJ.CastUint32(super.DestinationPort);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint32();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int DestinationSpaceFieldTag=1537;
|
||||
public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} }
|
||||
public PBJ.UUID DestinationSpace{ get {
|
||||
if (HasDestinationSpace) {
|
||||
return PBJ._PBJ.CastUuid(super.DestinationSpace);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int IdFieldTag=7;
|
||||
public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} }
|
||||
public long Id{ get {
|
||||
if (HasId) {
|
||||
return PBJ._PBJ.CastInt64(super.Id);
|
||||
} else {
|
||||
return PBJ._PBJ.CastInt64();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ReplyIdFieldTag=8;
|
||||
public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} }
|
||||
public long ReplyId{ get {
|
||||
if (HasReplyId) {
|
||||
return PBJ._PBJ.CastInt64(super.ReplyId);
|
||||
} else {
|
||||
return PBJ._PBJ.CastInt64();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ReturnStatusFieldTag=1792;
|
||||
public bool HasReturnStatus{ get {return super.HasReturnStatus;} }
|
||||
public Types.ReturnStatus ReturnStatus{ get {
|
||||
if (HasReturnStatus) {
|
||||
return (Types.ReturnStatus)super.ReturnStatus;
|
||||
} else {
|
||||
return new Types.ReturnStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Header prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static Header ParseFrom(pb::ByteString data) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data));
|
||||
}
|
||||
public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data,er));
|
||||
}
|
||||
public static Header ParseFrom(byte[] data) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data));
|
||||
}
|
||||
public static Header ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data,er));
|
||||
}
|
||||
public static Header ParseFrom(global::System.IO.Stream data) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data));
|
||||
}
|
||||
public static Header ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data,er));
|
||||
}
|
||||
public static Header ParseFrom(pb::CodedInputStream data) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data));
|
||||
}
|
||||
public static Header ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new Header(_PBJ_Internal.Header.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.Header.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.Header.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.Header.Builder();}
|
||||
public Builder(_PBJ_Internal.Header.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(Header prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public Header BuildPartial() {return new Header(super.BuildPartial());}
|
||||
public Header Build() {if (_HasAllPBJFields) return new Header(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return Header.Descriptor; } }
|
||||
public Builder ClearSourceObject() { super.ClearSourceObject();return this;}
|
||||
public const int SourceObjectFieldTag=1;
|
||||
public bool HasSourceObject{ get {return super.HasSourceObject&&PBJ._PBJ.ValidateUuid(super.SourceObject);} }
|
||||
public PBJ.UUID SourceObject{ get {
|
||||
if (HasSourceObject) {
|
||||
return PBJ._PBJ.CastUuid(super.SourceObject);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.SourceObject=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearSourcePort() { super.ClearSourcePort();return this;}
|
||||
public const int SourcePortFieldTag=3;
|
||||
public bool HasSourcePort{ get {return super.HasSourcePort&&PBJ._PBJ.ValidateUint32(super.SourcePort);} }
|
||||
public uint SourcePort{ get {
|
||||
if (HasSourcePort) {
|
||||
return PBJ._PBJ.CastUint32(super.SourcePort);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint32();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.SourcePort=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearSourceSpace() { super.ClearSourceSpace();return this;}
|
||||
public const int SourceSpaceFieldTag=1536;
|
||||
public bool HasSourceSpace{ get {return super.HasSourceSpace&&PBJ._PBJ.ValidateUuid(super.SourceSpace);} }
|
||||
public PBJ.UUID SourceSpace{ get {
|
||||
if (HasSourceSpace) {
|
||||
return PBJ._PBJ.CastUuid(super.SourceSpace);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.SourceSpace=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearDestinationObject() { super.ClearDestinationObject();return this;}
|
||||
public const int DestinationObjectFieldTag=2;
|
||||
public bool HasDestinationObject{ get {return super.HasDestinationObject&&PBJ._PBJ.ValidateUuid(super.DestinationObject);} }
|
||||
public PBJ.UUID DestinationObject{ get {
|
||||
if (HasDestinationObject) {
|
||||
return PBJ._PBJ.CastUuid(super.DestinationObject);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.DestinationObject=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearDestinationPort() { super.ClearDestinationPort();return this;}
|
||||
public const int DestinationPortFieldTag=4;
|
||||
public bool HasDestinationPort{ get {return super.HasDestinationPort&&PBJ._PBJ.ValidateUint32(super.DestinationPort);} }
|
||||
public uint DestinationPort{ get {
|
||||
if (HasDestinationPort) {
|
||||
return PBJ._PBJ.CastUint32(super.DestinationPort);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint32();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.DestinationPort=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearDestinationSpace() { super.ClearDestinationSpace();return this;}
|
||||
public const int DestinationSpaceFieldTag=1537;
|
||||
public bool HasDestinationSpace{ get {return super.HasDestinationSpace&&PBJ._PBJ.ValidateUuid(super.DestinationSpace);} }
|
||||
public PBJ.UUID DestinationSpace{ get {
|
||||
if (HasDestinationSpace) {
|
||||
return PBJ._PBJ.CastUuid(super.DestinationSpace);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.DestinationSpace=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearId() { super.ClearId();return this;}
|
||||
public const int IdFieldTag=7;
|
||||
public bool HasId{ get {return super.HasId&&PBJ._PBJ.ValidateInt64(super.Id);} }
|
||||
public long Id{ get {
|
||||
if (HasId) {
|
||||
return PBJ._PBJ.CastInt64(super.Id);
|
||||
} else {
|
||||
return PBJ._PBJ.CastInt64();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.Id=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearReplyId() { super.ClearReplyId();return this;}
|
||||
public const int ReplyIdFieldTag=8;
|
||||
public bool HasReplyId{ get {return super.HasReplyId&&PBJ._PBJ.ValidateInt64(super.ReplyId);} }
|
||||
public long ReplyId{ get {
|
||||
if (HasReplyId) {
|
||||
return PBJ._PBJ.CastInt64(super.ReplyId);
|
||||
} else {
|
||||
return PBJ._PBJ.CastInt64();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.ReplyId=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearReturnStatus() { super.ClearReturnStatus();return this;}
|
||||
public const int ReturnStatusFieldTag=1792;
|
||||
public bool HasReturnStatus{ get {return super.HasReturnStatus;} }
|
||||
public Types.ReturnStatus ReturnStatus{ get {
|
||||
if (HasReturnStatus) {
|
||||
return (Types.ReturnStatus)super.ReturnStatus;
|
||||
} else {
|
||||
return new Types.ReturnStatus();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.ReturnStatus=((_PBJ_Internal.Header.Types.ReturnStatus)value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2104
OpenSim/Client/Sirikata/Protocol/PBJ.cs
Normal file
2104
OpenSim/Client/Sirikata/Protocol/PBJ.cs
Normal file
File diff suppressed because it is too large
Load Diff
3299
OpenSim/Client/Sirikata/Protocol/Persistence.cs
Normal file
3299
OpenSim/Client/Sirikata/Protocol/Persistence.cs
Normal file
File diff suppressed because it is too large
Load Diff
1543
OpenSim/Client/Sirikata/Protocol/Persistence.pbj.cs
Normal file
1543
OpenSim/Client/Sirikata/Protocol/Persistence.pbj.cs
Normal file
File diff suppressed because it is too large
Load Diff
840
OpenSim/Client/Sirikata/Protocol/Physics.cs
Normal file
840
OpenSim/Client/Sirikata/Protocol/Physics.cs
Normal file
@@ -0,0 +1,840 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
namespace Sirikata.Physics.Protocol._PBJ_Internal {
|
||||
|
||||
public static partial class Physics {
|
||||
|
||||
#region Extension registration
|
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
||||
}
|
||||
#endregion
|
||||
#region Static variables
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin, global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.Builder> internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable;
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd, global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.Builder> internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable;
|
||||
#endregion
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbd::FileDescriptor descriptor;
|
||||
|
||||
static Physics() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
"Cg1QaHlzaWNzLnByb3RvEidTaXJpa2F0YS5QaHlzaWNzLlByb3RvY29sLl9Q" +
|
||||
"QkpfSW50ZXJuYWwiqAEKDkNvbGxpc2lvbkJlZ2luEhEKCXRpbWVzdGFtcBgC" +
|
||||
"IAEoBhIZCg10aGlzX3Bvc2l0aW9uGAMgAygBQgIQARIaCg5vdGhlcl9wb3Np" +
|
||||
"dGlvbhgEIAMoAUICEAESFwoLdGhpc19ub3JtYWwYBSADKAJCAhABEhMKB2lt" +
|
||||
"cHVsc2UYBiADKAJCAhABEh4KFm90aGVyX29iamVjdF9yZWZlcmVuY2UYByAB" +
|
||||
"KAwiQQoMQ29sbGlzaW9uRW5kEhEKCXRpbWVzdGFtcBgCIAEoBhIeChZvdGhl" +
|
||||
"cl9vYmplY3RfcmVmZXJlbmNlGAYgASgM");
|
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor = Descriptor.MessageTypes[0];
|
||||
internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin, global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.Builder>(internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor,
|
||||
new string[] { "Timestamp", "ThisPosition", "OtherPosition", "ThisNormal", "Impulse", "OtherObjectReference", });
|
||||
internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor = Descriptor.MessageTypes[1];
|
||||
internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd, global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.Builder>(internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor,
|
||||
new string[] { "Timestamp", "OtherObjectReference", });
|
||||
return null;
|
||||
};
|
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
|
||||
new pbd::FileDescriptor[] {
|
||||
}, assigner);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
public sealed partial class CollisionBegin : pb::GeneratedMessage<CollisionBegin, CollisionBegin.Builder> {
|
||||
private static readonly CollisionBegin defaultInstance = new Builder().BuildPartial();
|
||||
public static CollisionBegin DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override CollisionBegin DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override CollisionBegin ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<CollisionBegin, CollisionBegin.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionBegin__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
public const int TimestampFieldNumber = 2;
|
||||
private bool hasTimestamp;
|
||||
private ulong timestamp_ = 0;
|
||||
public bool HasTimestamp {
|
||||
get { return hasTimestamp; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong Timestamp {
|
||||
get { return timestamp_; }
|
||||
}
|
||||
|
||||
public const int ThisPositionFieldNumber = 3;
|
||||
private int thisPositionMemoizedSerializedSize;
|
||||
private pbc::PopsicleList<double> thisPosition_ = new pbc::PopsicleList<double>();
|
||||
public scg::IList<double> ThisPositionList {
|
||||
get { return pbc::Lists.AsReadOnly(thisPosition_); }
|
||||
}
|
||||
public int ThisPositionCount {
|
||||
get { return thisPosition_.Count; }
|
||||
}
|
||||
public double GetThisPosition(int index) {
|
||||
return thisPosition_[index];
|
||||
}
|
||||
|
||||
public const int OtherPositionFieldNumber = 4;
|
||||
private int otherPositionMemoizedSerializedSize;
|
||||
private pbc::PopsicleList<double> otherPosition_ = new pbc::PopsicleList<double>();
|
||||
public scg::IList<double> OtherPositionList {
|
||||
get { return pbc::Lists.AsReadOnly(otherPosition_); }
|
||||
}
|
||||
public int OtherPositionCount {
|
||||
get { return otherPosition_.Count; }
|
||||
}
|
||||
public double GetOtherPosition(int index) {
|
||||
return otherPosition_[index];
|
||||
}
|
||||
|
||||
public const int ThisNormalFieldNumber = 5;
|
||||
private int thisNormalMemoizedSerializedSize;
|
||||
private pbc::PopsicleList<float> thisNormal_ = new pbc::PopsicleList<float>();
|
||||
public scg::IList<float> ThisNormalList {
|
||||
get { return pbc::Lists.AsReadOnly(thisNormal_); }
|
||||
}
|
||||
public int ThisNormalCount {
|
||||
get { return thisNormal_.Count; }
|
||||
}
|
||||
public float GetThisNormal(int index) {
|
||||
return thisNormal_[index];
|
||||
}
|
||||
|
||||
public const int ImpulseFieldNumber = 6;
|
||||
private int impulseMemoizedSerializedSize;
|
||||
private pbc::PopsicleList<float> impulse_ = new pbc::PopsicleList<float>();
|
||||
public scg::IList<float> ImpulseList {
|
||||
get { return pbc::Lists.AsReadOnly(impulse_); }
|
||||
}
|
||||
public int ImpulseCount {
|
||||
get { return impulse_.Count; }
|
||||
}
|
||||
public float GetImpulse(int index) {
|
||||
return impulse_[index];
|
||||
}
|
||||
|
||||
public const int OtherObjectReferenceFieldNumber = 7;
|
||||
private bool hasOtherObjectReference;
|
||||
private pb::ByteString otherObjectReference_ = pb::ByteString.Empty;
|
||||
public bool HasOtherObjectReference {
|
||||
get { return hasOtherObjectReference; }
|
||||
}
|
||||
public pb::ByteString OtherObjectReference {
|
||||
get { return otherObjectReference_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasTimestamp) {
|
||||
output.WriteFixed64(2, Timestamp);
|
||||
}
|
||||
if (thisPosition_.Count > 0) {
|
||||
output.WriteRawVarint32(26);
|
||||
output.WriteRawVarint32((uint) thisPositionMemoizedSerializedSize);
|
||||
foreach (double element in thisPosition_) {
|
||||
output.WriteDoubleNoTag(element);
|
||||
}
|
||||
}
|
||||
if (otherPosition_.Count > 0) {
|
||||
output.WriteRawVarint32(34);
|
||||
output.WriteRawVarint32((uint) otherPositionMemoizedSerializedSize);
|
||||
foreach (double element in otherPosition_) {
|
||||
output.WriteDoubleNoTag(element);
|
||||
}
|
||||
}
|
||||
if (thisNormal_.Count > 0) {
|
||||
output.WriteRawVarint32(42);
|
||||
output.WriteRawVarint32((uint) thisNormalMemoizedSerializedSize);
|
||||
foreach (float element in thisNormal_) {
|
||||
output.WriteFloatNoTag(element);
|
||||
}
|
||||
}
|
||||
if (impulse_.Count > 0) {
|
||||
output.WriteRawVarint32(50);
|
||||
output.WriteRawVarint32((uint) impulseMemoizedSerializedSize);
|
||||
foreach (float element in impulse_) {
|
||||
output.WriteFloatNoTag(element);
|
||||
}
|
||||
}
|
||||
if (HasOtherObjectReference) {
|
||||
output.WriteBytes(7, OtherObjectReference);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasTimestamp) {
|
||||
size += pb::CodedOutputStream.ComputeFixed64Size(2, Timestamp);
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
dataSize = 8 * thisPosition_.Count;
|
||||
size += dataSize;
|
||||
if (thisPosition_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
|
||||
thisPositionMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
dataSize = 8 * otherPosition_.Count;
|
||||
size += dataSize;
|
||||
if (otherPosition_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
|
||||
otherPositionMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
dataSize = 4 * thisNormal_.Count;
|
||||
size += dataSize;
|
||||
if (thisNormal_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
|
||||
thisNormalMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
{
|
||||
int dataSize = 0;
|
||||
dataSize = 4 * impulse_.Count;
|
||||
size += dataSize;
|
||||
if (impulse_.Count!=0) size += 1 + pb::CodedOutputStream.ComputeInt32SizeNoTag(dataSize);
|
||||
impulseMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
if (HasOtherObjectReference) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(7, OtherObjectReference);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static CollisionBegin ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(CollisionBegin prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<CollisionBegin, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
CollisionBegin result = new CollisionBegin();
|
||||
|
||||
protected override CollisionBegin MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new CollisionBegin();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.Descriptor; }
|
||||
}
|
||||
|
||||
public override CollisionBegin DefaultInstanceForType {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override CollisionBegin BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
result.thisPosition_.MakeReadOnly();
|
||||
result.otherPosition_.MakeReadOnly();
|
||||
result.thisNormal_.MakeReadOnly();
|
||||
result.impulse_.MakeReadOnly();
|
||||
CollisionBegin returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is CollisionBegin) {
|
||||
return MergeFrom((CollisionBegin) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(CollisionBegin other) {
|
||||
if (other == global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionBegin.DefaultInstance) return this;
|
||||
if (other.HasTimestamp) {
|
||||
Timestamp = other.Timestamp;
|
||||
}
|
||||
if (other.thisPosition_.Count != 0) {
|
||||
base.AddRange(other.thisPosition_, result.thisPosition_);
|
||||
}
|
||||
if (other.otherPosition_.Count != 0) {
|
||||
base.AddRange(other.otherPosition_, result.otherPosition_);
|
||||
}
|
||||
if (other.thisNormal_.Count != 0) {
|
||||
base.AddRange(other.thisNormal_, result.thisNormal_);
|
||||
}
|
||||
if (other.impulse_.Count != 0) {
|
||||
base.AddRange(other.impulse_, result.impulse_);
|
||||
}
|
||||
if (other.HasOtherObjectReference) {
|
||||
OtherObjectReference = other.OtherObjectReference;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 17: {
|
||||
Timestamp = input.ReadFixed64();
|
||||
break;
|
||||
}
|
||||
case 26: {
|
||||
int length = input.ReadInt32();
|
||||
int limit = input.PushLimit(length);
|
||||
while (!input.ReachedLimit) {
|
||||
AddThisPosition(input.ReadDouble());
|
||||
}
|
||||
input.PopLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 34: {
|
||||
int length = input.ReadInt32();
|
||||
int limit = input.PushLimit(length);
|
||||
while (!input.ReachedLimit) {
|
||||
AddOtherPosition(input.ReadDouble());
|
||||
}
|
||||
input.PopLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 42: {
|
||||
int length = input.ReadInt32();
|
||||
int limit = input.PushLimit(length);
|
||||
while (!input.ReachedLimit) {
|
||||
AddThisNormal(input.ReadFloat());
|
||||
}
|
||||
input.PopLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 50: {
|
||||
int length = input.ReadInt32();
|
||||
int limit = input.PushLimit(length);
|
||||
while (!input.ReachedLimit) {
|
||||
AddImpulse(input.ReadFloat());
|
||||
}
|
||||
input.PopLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
OtherObjectReference = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasTimestamp {
|
||||
get { return result.HasTimestamp; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong Timestamp {
|
||||
get { return result.Timestamp; }
|
||||
set { SetTimestamp(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetTimestamp(ulong value) {
|
||||
result.hasTimestamp = true;
|
||||
result.timestamp_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearTimestamp() {
|
||||
result.hasTimestamp = false;
|
||||
result.timestamp_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public pbc::IPopsicleList<double> ThisPositionList {
|
||||
get { return result.thisPosition_; }
|
||||
}
|
||||
public int ThisPositionCount {
|
||||
get { return result.ThisPositionCount; }
|
||||
}
|
||||
public double GetThisPosition(int index) {
|
||||
return result.GetThisPosition(index);
|
||||
}
|
||||
public Builder SetThisPosition(int index, double value) {
|
||||
result.thisPosition_[index] = value;
|
||||
return this;
|
||||
}
|
||||
public Builder AddThisPosition(double value) {
|
||||
result.thisPosition_.Add(value);
|
||||
return this;
|
||||
}
|
||||
public Builder AddRangeThisPosition(scg::IEnumerable<double> values) {
|
||||
base.AddRange(values, result.thisPosition_);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearThisPosition() {
|
||||
result.thisPosition_.Clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public pbc::IPopsicleList<double> OtherPositionList {
|
||||
get { return result.otherPosition_; }
|
||||
}
|
||||
public int OtherPositionCount {
|
||||
get { return result.OtherPositionCount; }
|
||||
}
|
||||
public double GetOtherPosition(int index) {
|
||||
return result.GetOtherPosition(index);
|
||||
}
|
||||
public Builder SetOtherPosition(int index, double value) {
|
||||
result.otherPosition_[index] = value;
|
||||
return this;
|
||||
}
|
||||
public Builder AddOtherPosition(double value) {
|
||||
result.otherPosition_.Add(value);
|
||||
return this;
|
||||
}
|
||||
public Builder AddRangeOtherPosition(scg::IEnumerable<double> values) {
|
||||
base.AddRange(values, result.otherPosition_);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOtherPosition() {
|
||||
result.otherPosition_.Clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public pbc::IPopsicleList<float> ThisNormalList {
|
||||
get { return result.thisNormal_; }
|
||||
}
|
||||
public int ThisNormalCount {
|
||||
get { return result.ThisNormalCount; }
|
||||
}
|
||||
public float GetThisNormal(int index) {
|
||||
return result.GetThisNormal(index);
|
||||
}
|
||||
public Builder SetThisNormal(int index, float value) {
|
||||
result.thisNormal_[index] = value;
|
||||
return this;
|
||||
}
|
||||
public Builder AddThisNormal(float value) {
|
||||
result.thisNormal_.Add(value);
|
||||
return this;
|
||||
}
|
||||
public Builder AddRangeThisNormal(scg::IEnumerable<float> values) {
|
||||
base.AddRange(values, result.thisNormal_);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearThisNormal() {
|
||||
result.thisNormal_.Clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public pbc::IPopsicleList<float> ImpulseList {
|
||||
get { return result.impulse_; }
|
||||
}
|
||||
public int ImpulseCount {
|
||||
get { return result.ImpulseCount; }
|
||||
}
|
||||
public float GetImpulse(int index) {
|
||||
return result.GetImpulse(index);
|
||||
}
|
||||
public Builder SetImpulse(int index, float value) {
|
||||
result.impulse_[index] = value;
|
||||
return this;
|
||||
}
|
||||
public Builder AddImpulse(float value) {
|
||||
result.impulse_.Add(value);
|
||||
return this;
|
||||
}
|
||||
public Builder AddRangeImpulse(scg::IEnumerable<float> values) {
|
||||
base.AddRange(values, result.impulse_);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearImpulse() {
|
||||
result.impulse_.Clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasOtherObjectReference {
|
||||
get { return result.HasOtherObjectReference; }
|
||||
}
|
||||
public pb::ByteString OtherObjectReference {
|
||||
get { return result.OtherObjectReference; }
|
||||
set { SetOtherObjectReference(value); }
|
||||
}
|
||||
public Builder SetOtherObjectReference(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasOtherObjectReference = true;
|
||||
result.otherObjectReference_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOtherObjectReference() {
|
||||
result.hasOtherObjectReference = false;
|
||||
result.otherObjectReference_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static CollisionBegin() {
|
||||
object.ReferenceEquals(global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class CollisionEnd : pb::GeneratedMessage<CollisionEnd, CollisionEnd.Builder> {
|
||||
private static readonly CollisionEnd defaultInstance = new Builder().BuildPartial();
|
||||
public static CollisionEnd DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override CollisionEnd DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override CollisionEnd ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<CollisionEnd, CollisionEnd.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.internal__static_Sirikata_Physics_Protocol__PBJ_Internal_CollisionEnd__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
public const int TimestampFieldNumber = 2;
|
||||
private bool hasTimestamp;
|
||||
private ulong timestamp_ = 0;
|
||||
public bool HasTimestamp {
|
||||
get { return hasTimestamp; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong Timestamp {
|
||||
get { return timestamp_; }
|
||||
}
|
||||
|
||||
public const int OtherObjectReferenceFieldNumber = 6;
|
||||
private bool hasOtherObjectReference;
|
||||
private pb::ByteString otherObjectReference_ = pb::ByteString.Empty;
|
||||
public bool HasOtherObjectReference {
|
||||
get { return hasOtherObjectReference; }
|
||||
}
|
||||
public pb::ByteString OtherObjectReference {
|
||||
get { return otherObjectReference_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasTimestamp) {
|
||||
output.WriteFixed64(2, Timestamp);
|
||||
}
|
||||
if (HasOtherObjectReference) {
|
||||
output.WriteBytes(6, OtherObjectReference);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasTimestamp) {
|
||||
size += pb::CodedOutputStream.ComputeFixed64Size(2, Timestamp);
|
||||
}
|
||||
if (HasOtherObjectReference) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(6, OtherObjectReference);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static CollisionEnd ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(CollisionEnd prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<CollisionEnd, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
CollisionEnd result = new CollisionEnd();
|
||||
|
||||
protected override CollisionEnd MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new CollisionEnd();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.Descriptor; }
|
||||
}
|
||||
|
||||
public override CollisionEnd DefaultInstanceForType {
|
||||
get { return global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override CollisionEnd BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
CollisionEnd returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is CollisionEnd) {
|
||||
return MergeFrom((CollisionEnd) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(CollisionEnd other) {
|
||||
if (other == global::Sirikata.Physics.Protocol._PBJ_Internal.CollisionEnd.DefaultInstance) return this;
|
||||
if (other.HasTimestamp) {
|
||||
Timestamp = other.Timestamp;
|
||||
}
|
||||
if (other.HasOtherObjectReference) {
|
||||
OtherObjectReference = other.OtherObjectReference;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 17: {
|
||||
Timestamp = input.ReadFixed64();
|
||||
break;
|
||||
}
|
||||
case 50: {
|
||||
OtherObjectReference = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasTimestamp {
|
||||
get { return result.HasTimestamp; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong Timestamp {
|
||||
get { return result.Timestamp; }
|
||||
set { SetTimestamp(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetTimestamp(ulong value) {
|
||||
result.hasTimestamp = true;
|
||||
result.timestamp_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearTimestamp() {
|
||||
result.hasTimestamp = false;
|
||||
result.timestamp_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasOtherObjectReference {
|
||||
get { return result.HasOtherObjectReference; }
|
||||
}
|
||||
public pb::ByteString OtherObjectReference {
|
||||
get { return result.OtherObjectReference; }
|
||||
set { SetOtherObjectReference(value); }
|
||||
}
|
||||
public Builder SetOtherObjectReference(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasOtherObjectReference = true;
|
||||
result.otherObjectReference_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOtherObjectReference() {
|
||||
result.hasOtherObjectReference = false;
|
||||
result.otherObjectReference_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static CollisionEnd() {
|
||||
object.ReferenceEquals(global::Sirikata.Physics.Protocol._PBJ_Internal.Physics.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
421
OpenSim/Client/Sirikata/Protocol/Physics.pbj.cs
Normal file
421
OpenSim/Client/Sirikata/Protocol/Physics.pbj.cs
Normal file
@@ -0,0 +1,421 @@
|
||||
/*
|
||||
* 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 pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
namespace Sirikata.Physics.Protocol {
|
||||
public class CollisionBegin : PBJ.IMessage {
|
||||
protected _PBJ_Internal.CollisionBegin super;
|
||||
public _PBJ_Internal.CollisionBegin _PBJSuper{ get { return super;} }
|
||||
public CollisionBegin() {
|
||||
super=new _PBJ_Internal.CollisionBegin();
|
||||
}
|
||||
public CollisionBegin(_PBJ_Internal.CollisionBegin reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static CollisionBegin defaultInstance= new CollisionBegin (_PBJ_Internal.CollisionBegin.DefaultInstance);
|
||||
public static CollisionBegin DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.CollisionBegin.Descriptor; } }
|
||||
public static class Types {
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int TimestampFieldTag=2;
|
||||
public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} }
|
||||
public PBJ.Time Timestamp{ get {
|
||||
if (HasTimestamp) {
|
||||
return PBJ._PBJ.CastTime(super.Timestamp);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ThisPositionFieldTag=3;
|
||||
public int ThisPositionCount { get { return super.ThisPositionCount/3;} }
|
||||
public bool HasThisPosition(int index) { return true; }
|
||||
public PBJ.Vector3d GetThisPosition(int index) {
|
||||
if (HasThisPosition(index)) {
|
||||
return PBJ._PBJ.CastVector3d(super.GetThisPosition(index*3+0),super.GetThisPosition(index*3+1),super.GetThisPosition(index*3+2));
|
||||
} else {
|
||||
return PBJ._PBJ.CastVector3d();
|
||||
}
|
||||
}
|
||||
public const int OtherPositionFieldTag=4;
|
||||
public int OtherPositionCount { get { return super.OtherPositionCount/3;} }
|
||||
public bool HasOtherPosition(int index) { return true; }
|
||||
public PBJ.Vector3d GetOtherPosition(int index) {
|
||||
if (HasOtherPosition(index)) {
|
||||
return PBJ._PBJ.CastVector3d(super.GetOtherPosition(index*3+0),super.GetOtherPosition(index*3+1),super.GetOtherPosition(index*3+2));
|
||||
} else {
|
||||
return PBJ._PBJ.CastVector3d();
|
||||
}
|
||||
}
|
||||
public const int ThisNormalFieldTag=5;
|
||||
public int ThisNormalCount { get { return super.ThisNormalCount/2;} }
|
||||
public bool HasThisNormal(int index) { return true; }
|
||||
public PBJ.Vector3f GetThisNormal(int index) {
|
||||
if (HasThisNormal(index)) {
|
||||
return PBJ._PBJ.CastNormal(super.GetThisNormal(index*2+0),super.GetThisNormal(index*2+1));
|
||||
} else {
|
||||
return PBJ._PBJ.CastNormal();
|
||||
}
|
||||
}
|
||||
public const int ImpulseFieldTag=6;
|
||||
public int ImpulseCount { get { return super.ImpulseCount;} }
|
||||
public bool HasImpulse(int index) {return PBJ._PBJ.ValidateFloat(super.GetImpulse(index));}
|
||||
public float Impulse(int index) {
|
||||
return (float)PBJ._PBJ.CastFloat(super.GetImpulse(index));
|
||||
}
|
||||
public const int OtherObjectReferenceFieldTag=7;
|
||||
public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} }
|
||||
public PBJ.UUID OtherObjectReference{ get {
|
||||
if (HasOtherObjectReference) {
|
||||
return PBJ._PBJ.CastUuid(super.OtherObjectReference);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(CollisionBegin prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::ByteString data) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(byte[] data) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(global::System.IO.Stream data) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::CodedInputStream data) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data));
|
||||
}
|
||||
public static CollisionBegin ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new CollisionBegin(_PBJ_Internal.CollisionBegin.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.CollisionBegin.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.CollisionBegin.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.CollisionBegin.Builder();}
|
||||
public Builder(_PBJ_Internal.CollisionBegin.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(CollisionBegin prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public CollisionBegin BuildPartial() {return new CollisionBegin(super.BuildPartial());}
|
||||
public CollisionBegin Build() {if (_HasAllPBJFields) return new CollisionBegin(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return CollisionBegin.Descriptor; } }
|
||||
public Builder ClearTimestamp() { super.ClearTimestamp();return this;}
|
||||
public const int TimestampFieldTag=2;
|
||||
public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} }
|
||||
public PBJ.Time Timestamp{ get {
|
||||
if (HasTimestamp) {
|
||||
return PBJ._PBJ.CastTime(super.Timestamp);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.Timestamp=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearThisPosition() { super.ClearThisPosition();return this;}
|
||||
public const int ThisPositionFieldTag=3;
|
||||
public int ThisPositionCount { get { return super.ThisPositionCount/3;} }
|
||||
public bool HasThisPosition(int index) { return true; }
|
||||
public PBJ.Vector3d GetThisPosition(int index) {
|
||||
if (HasThisPosition(index)) {
|
||||
return PBJ._PBJ.CastVector3d(super.GetThisPosition(index*3+0),super.GetThisPosition(index*3+1),super.GetThisPosition(index*3+2));
|
||||
} else {
|
||||
return PBJ._PBJ.CastVector3d();
|
||||
}
|
||||
}
|
||||
public Builder AddThisPosition(PBJ.Vector3d value) {
|
||||
double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value);
|
||||
super.AddThisPosition(_PBJtempArray[0]);
|
||||
super.AddThisPosition(_PBJtempArray[1]);
|
||||
super.AddThisPosition(_PBJtempArray[2]);
|
||||
return this;
|
||||
}
|
||||
public Builder SetThisPosition(int index,PBJ.Vector3d value) {
|
||||
double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value);
|
||||
super.SetThisPosition(index*3+0,_PBJtempArray[0]);
|
||||
super.SetThisPosition(index*3+1,_PBJtempArray[1]);
|
||||
super.SetThisPosition(index*3+2,_PBJtempArray[2]);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOtherPosition() { super.ClearOtherPosition();return this;}
|
||||
public const int OtherPositionFieldTag=4;
|
||||
public int OtherPositionCount { get { return super.OtherPositionCount/3;} }
|
||||
public bool HasOtherPosition(int index) { return true; }
|
||||
public PBJ.Vector3d GetOtherPosition(int index) {
|
||||
if (HasOtherPosition(index)) {
|
||||
return PBJ._PBJ.CastVector3d(super.GetOtherPosition(index*3+0),super.GetOtherPosition(index*3+1),super.GetOtherPosition(index*3+2));
|
||||
} else {
|
||||
return PBJ._PBJ.CastVector3d();
|
||||
}
|
||||
}
|
||||
public Builder AddOtherPosition(PBJ.Vector3d value) {
|
||||
double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value);
|
||||
super.AddOtherPosition(_PBJtempArray[0]);
|
||||
super.AddOtherPosition(_PBJtempArray[1]);
|
||||
super.AddOtherPosition(_PBJtempArray[2]);
|
||||
return this;
|
||||
}
|
||||
public Builder SetOtherPosition(int index,PBJ.Vector3d value) {
|
||||
double[] _PBJtempArray=PBJ._PBJ.ConstructVector3d(value);
|
||||
super.SetOtherPosition(index*3+0,_PBJtempArray[0]);
|
||||
super.SetOtherPosition(index*3+1,_PBJtempArray[1]);
|
||||
super.SetOtherPosition(index*3+2,_PBJtempArray[2]);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearThisNormal() { super.ClearThisNormal();return this;}
|
||||
public const int ThisNormalFieldTag=5;
|
||||
public int ThisNormalCount { get { return super.ThisNormalCount/2;} }
|
||||
public bool HasThisNormal(int index) { return true; }
|
||||
public PBJ.Vector3f GetThisNormal(int index) {
|
||||
if (HasThisNormal(index)) {
|
||||
return PBJ._PBJ.CastNormal(super.GetThisNormal(index*2+0),super.GetThisNormal(index*2+1));
|
||||
} else {
|
||||
return PBJ._PBJ.CastNormal();
|
||||
}
|
||||
}
|
||||
public Builder AddThisNormal(PBJ.Vector3f value) {
|
||||
float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value);
|
||||
super.AddThisNormal(_PBJtempArray[0]);
|
||||
super.AddThisNormal(_PBJtempArray[1]);
|
||||
return this;
|
||||
}
|
||||
public Builder SetThisNormal(int index,PBJ.Vector3f value) {
|
||||
float[] _PBJtempArray=PBJ._PBJ.ConstructNormal(value);
|
||||
super.SetThisNormal(index*2+0,_PBJtempArray[0]);
|
||||
super.SetThisNormal(index*2+1,_PBJtempArray[1]);
|
||||
return this;
|
||||
}
|
||||
public Builder ClearImpulse() { super.ClearImpulse();return this;}
|
||||
public Builder SetImpulse(int index, float value) {
|
||||
super.SetImpulse(index,PBJ._PBJ.Construct(value));
|
||||
return this;
|
||||
}
|
||||
public const int ImpulseFieldTag=6;
|
||||
public int ImpulseCount { get { return super.ImpulseCount;} }
|
||||
public bool HasImpulse(int index) {return PBJ._PBJ.ValidateFloat(super.GetImpulse(index));}
|
||||
public float Impulse(int index) {
|
||||
return (float)PBJ._PBJ.CastFloat(super.GetImpulse(index));
|
||||
}
|
||||
public Builder AddImpulse(float value) {
|
||||
super.AddImpulse(PBJ._PBJ.Construct(value));
|
||||
return this;
|
||||
}
|
||||
public Builder ClearOtherObjectReference() { super.ClearOtherObjectReference();return this;}
|
||||
public const int OtherObjectReferenceFieldTag=7;
|
||||
public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} }
|
||||
public PBJ.UUID OtherObjectReference{ get {
|
||||
if (HasOtherObjectReference) {
|
||||
return PBJ._PBJ.CastUuid(super.OtherObjectReference);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.OtherObjectReference=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Sirikata.Physics.Protocol {
|
||||
public class CollisionEnd : PBJ.IMessage {
|
||||
protected _PBJ_Internal.CollisionEnd super;
|
||||
public _PBJ_Internal.CollisionEnd _PBJSuper{ get { return super;} }
|
||||
public CollisionEnd() {
|
||||
super=new _PBJ_Internal.CollisionEnd();
|
||||
}
|
||||
public CollisionEnd(_PBJ_Internal.CollisionEnd reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static CollisionEnd defaultInstance= new CollisionEnd (_PBJ_Internal.CollisionEnd.DefaultInstance);
|
||||
public static CollisionEnd DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.CollisionEnd.Descriptor; } }
|
||||
public static class Types {
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int TimestampFieldTag=2;
|
||||
public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} }
|
||||
public PBJ.Time Timestamp{ get {
|
||||
if (HasTimestamp) {
|
||||
return PBJ._PBJ.CastTime(super.Timestamp);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int OtherObjectReferenceFieldTag=6;
|
||||
public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} }
|
||||
public PBJ.UUID OtherObjectReference{ get {
|
||||
if (HasOtherObjectReference) {
|
||||
return PBJ._PBJ.CastUuid(super.OtherObjectReference);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(CollisionEnd prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::ByteString data) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(byte[] data) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(global::System.IO.Stream data) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::CodedInputStream data) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data));
|
||||
}
|
||||
public static CollisionEnd ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new CollisionEnd(_PBJ_Internal.CollisionEnd.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.CollisionEnd.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.CollisionEnd.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.CollisionEnd.Builder();}
|
||||
public Builder(_PBJ_Internal.CollisionEnd.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(CollisionEnd prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public CollisionEnd BuildPartial() {return new CollisionEnd(super.BuildPartial());}
|
||||
public CollisionEnd Build() {if (_HasAllPBJFields) return new CollisionEnd(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return CollisionEnd.Descriptor; } }
|
||||
public Builder ClearTimestamp() { super.ClearTimestamp();return this;}
|
||||
public const int TimestampFieldTag=2;
|
||||
public bool HasTimestamp{ get {return super.HasTimestamp&&PBJ._PBJ.ValidateTime(super.Timestamp);} }
|
||||
public PBJ.Time Timestamp{ get {
|
||||
if (HasTimestamp) {
|
||||
return PBJ._PBJ.CastTime(super.Timestamp);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.Timestamp=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearOtherObjectReference() { super.ClearOtherObjectReference();return this;}
|
||||
public const int OtherObjectReferenceFieldTag=6;
|
||||
public bool HasOtherObjectReference{ get {return super.HasOtherObjectReference&&PBJ._PBJ.ValidateUuid(super.OtherObjectReference);} }
|
||||
public PBJ.UUID OtherObjectReference{ get {
|
||||
if (HasOtherObjectReference) {
|
||||
return PBJ._PBJ.CastUuid(super.OtherObjectReference);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.OtherObjectReference=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
8074
OpenSim/Client/Sirikata/Protocol/Sirikata.cs
Normal file
8074
OpenSim/Client/Sirikata/Protocol/Sirikata.cs
Normal file
File diff suppressed because it is too large
Load Diff
3934
OpenSim/Client/Sirikata/Protocol/Sirikata.pbj.cs
Normal file
3934
OpenSim/Client/Sirikata/Protocol/Sirikata.pbj.cs
Normal file
File diff suppressed because it is too large
Load Diff
856
OpenSim/Client/Sirikata/Protocol/Subscription.cs
Normal file
856
OpenSim/Client/Sirikata/Protocol/Subscription.cs
Normal file
@@ -0,0 +1,856 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
namespace Sirikata.Subscription.Protocol._PBJ_Internal {
|
||||
|
||||
public static partial class Subscription {
|
||||
|
||||
#region Extension registration
|
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
||||
}
|
||||
#endregion
|
||||
#region Static variables
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Address, global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder> internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable;
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe, global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.Builder> internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable;
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast, global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.Builder> internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable;
|
||||
#endregion
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbd::FileDescriptor descriptor;
|
||||
|
||||
static Subscription() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
"ChJTdWJzY3JpcHRpb24ucHJvdG8SLFNpcmlrYXRhLlN1YnNjcmlwdGlvbi5Q" +
|
||||
"cm90b2NvbC5fUEJKX0ludGVybmFsIiwKB0FkZHJlc3MSEAoIaG9zdG5hbWUY" +
|
||||
"ASABKAkSDwoHc2VydmljZRgCIAEoCSKMAQoJU3Vic2NyaWJlElAKEWJyb2Fk" +
|
||||
"Y2FzdF9hZGRyZXNzGAcgASgLMjUuU2lyaWthdGEuU3Vic2NyaXB0aW9uLlBy" +
|
||||
"b3RvY29sLl9QQkpfSW50ZXJuYWwuQWRkcmVzcxIWCg5icm9hZGNhc3RfbmFt" +
|
||||
"ZRgIIAEoDBIVCg11cGRhdGVfcGVyaW9kGAkgASgQIiMKCUJyb2FkY2FzdBIW" +
|
||||
"Cg5icm9hZGNhc3RfbmFtZRgHIAEoDA==");
|
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor = Descriptor.MessageTypes[0];
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Address, global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder>(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor,
|
||||
new string[] { "Hostname", "Service", });
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor = Descriptor.MessageTypes[1];
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe, global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.Builder>(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor,
|
||||
new string[] { "BroadcastAddress", "BroadcastName", "UpdatePeriod", });
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor = Descriptor.MessageTypes[2];
|
||||
internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast, global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.Builder>(internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor,
|
||||
new string[] { "BroadcastName", });
|
||||
return null;
|
||||
};
|
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
|
||||
new pbd::FileDescriptor[] {
|
||||
}, assigner);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
public sealed partial class Address : pb::GeneratedMessage<Address, Address.Builder> {
|
||||
private static readonly Address defaultInstance = new Builder().BuildPartial();
|
||||
public static Address DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override Address DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override Address ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<Address, Address.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Address__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
public const int HostnameFieldNumber = 1;
|
||||
private bool hasHostname;
|
||||
private string hostname_ = "";
|
||||
public bool HasHostname {
|
||||
get { return hasHostname; }
|
||||
}
|
||||
public string Hostname {
|
||||
get { return hostname_; }
|
||||
}
|
||||
|
||||
public const int ServiceFieldNumber = 2;
|
||||
private bool hasService;
|
||||
private string service_ = "";
|
||||
public bool HasService {
|
||||
get { return hasService; }
|
||||
}
|
||||
public string Service {
|
||||
get { return service_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasHostname) {
|
||||
output.WriteString(1, Hostname);
|
||||
}
|
||||
if (HasService) {
|
||||
output.WriteString(2, Service);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasHostname) {
|
||||
size += pb::CodedOutputStream.ComputeStringSize(1, Hostname);
|
||||
}
|
||||
if (HasService) {
|
||||
size += pb::CodedOutputStream.ComputeStringSize(2, Service);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static Address ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Address ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static Address ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Address ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Address prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<Address, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
Address result = new Address();
|
||||
|
||||
protected override Address MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new Address();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Descriptor; }
|
||||
}
|
||||
|
||||
public override Address DefaultInstanceForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override Address BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
Address returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is Address) {
|
||||
return MergeFrom((Address) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(Address other) {
|
||||
if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance) return this;
|
||||
if (other.HasHostname) {
|
||||
Hostname = other.Hostname;
|
||||
}
|
||||
if (other.HasService) {
|
||||
Service = other.Service;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
Hostname = input.ReadString();
|
||||
break;
|
||||
}
|
||||
case 18: {
|
||||
Service = input.ReadString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasHostname {
|
||||
get { return result.HasHostname; }
|
||||
}
|
||||
public string Hostname {
|
||||
get { return result.Hostname; }
|
||||
set { SetHostname(value); }
|
||||
}
|
||||
public Builder SetHostname(string value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasHostname = true;
|
||||
result.hostname_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearHostname() {
|
||||
result.hasHostname = false;
|
||||
result.hostname_ = "";
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasService {
|
||||
get { return result.HasService; }
|
||||
}
|
||||
public string Service {
|
||||
get { return result.Service; }
|
||||
set { SetService(value); }
|
||||
}
|
||||
public Builder SetService(string value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasService = true;
|
||||
result.service_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearService() {
|
||||
result.hasService = false;
|
||||
result.service_ = "";
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static Address() {
|
||||
object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class Subscribe : pb::GeneratedMessage<Subscribe, Subscribe.Builder> {
|
||||
private static readonly Subscribe defaultInstance = new Builder().BuildPartial();
|
||||
public static Subscribe DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override Subscribe DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override Subscribe ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<Subscribe, Subscribe.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Subscribe__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
public const int BroadcastAddressFieldNumber = 7;
|
||||
private bool hasBroadcastAddress;
|
||||
private global::Sirikata.Subscription.Protocol._PBJ_Internal.Address broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance;
|
||||
public bool HasBroadcastAddress {
|
||||
get { return hasBroadcastAddress; }
|
||||
}
|
||||
public global::Sirikata.Subscription.Protocol._PBJ_Internal.Address BroadcastAddress {
|
||||
get { return broadcastAddress_; }
|
||||
}
|
||||
|
||||
public const int BroadcastNameFieldNumber = 8;
|
||||
private bool hasBroadcastName;
|
||||
private pb::ByteString broadcastName_ = pb::ByteString.Empty;
|
||||
public bool HasBroadcastName {
|
||||
get { return hasBroadcastName; }
|
||||
}
|
||||
public pb::ByteString BroadcastName {
|
||||
get { return broadcastName_; }
|
||||
}
|
||||
|
||||
public const int UpdatePeriodFieldNumber = 9;
|
||||
private bool hasUpdatePeriod;
|
||||
private long updatePeriod_ = 0;
|
||||
public bool HasUpdatePeriod {
|
||||
get { return hasUpdatePeriod; }
|
||||
}
|
||||
public long UpdatePeriod {
|
||||
get { return updatePeriod_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasBroadcastAddress) {
|
||||
output.WriteMessage(7, BroadcastAddress);
|
||||
}
|
||||
if (HasBroadcastName) {
|
||||
output.WriteBytes(8, BroadcastName);
|
||||
}
|
||||
if (HasUpdatePeriod) {
|
||||
output.WriteSFixed64(9, UpdatePeriod);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasBroadcastAddress) {
|
||||
size += pb::CodedOutputStream.ComputeMessageSize(7, BroadcastAddress);
|
||||
}
|
||||
if (HasBroadcastName) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(8, BroadcastName);
|
||||
}
|
||||
if (HasUpdatePeriod) {
|
||||
size += pb::CodedOutputStream.ComputeSFixed64Size(9, UpdatePeriod);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static Subscribe ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Subscribe prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<Subscribe, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
Subscribe result = new Subscribe();
|
||||
|
||||
protected override Subscribe MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new Subscribe();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.Descriptor; }
|
||||
}
|
||||
|
||||
public override Subscribe DefaultInstanceForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override Subscribe BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
Subscribe returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is Subscribe) {
|
||||
return MergeFrom((Subscribe) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(Subscribe other) {
|
||||
if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscribe.DefaultInstance) return this;
|
||||
if (other.HasBroadcastAddress) {
|
||||
MergeBroadcastAddress(other.BroadcastAddress);
|
||||
}
|
||||
if (other.HasBroadcastName) {
|
||||
BroadcastName = other.BroadcastName;
|
||||
}
|
||||
if (other.HasUpdatePeriod) {
|
||||
UpdatePeriod = other.UpdatePeriod;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder subBuilder = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.CreateBuilder();
|
||||
if (HasBroadcastAddress) {
|
||||
subBuilder.MergeFrom(BroadcastAddress);
|
||||
}
|
||||
input.ReadMessage(subBuilder, extensionRegistry);
|
||||
BroadcastAddress = subBuilder.BuildPartial();
|
||||
break;
|
||||
}
|
||||
case 66: {
|
||||
BroadcastName = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
case 73: {
|
||||
UpdatePeriod = input.ReadSFixed64();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasBroadcastAddress {
|
||||
get { return result.HasBroadcastAddress; }
|
||||
}
|
||||
public global::Sirikata.Subscription.Protocol._PBJ_Internal.Address BroadcastAddress {
|
||||
get { return result.BroadcastAddress; }
|
||||
set { SetBroadcastAddress(value); }
|
||||
}
|
||||
public Builder SetBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasBroadcastAddress = true;
|
||||
result.broadcastAddress_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder SetBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.Builder builderForValue) {
|
||||
pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
|
||||
result.hasBroadcastAddress = true;
|
||||
result.broadcastAddress_ = builderForValue.Build();
|
||||
return this;
|
||||
}
|
||||
public Builder MergeBroadcastAddress(global::Sirikata.Subscription.Protocol._PBJ_Internal.Address value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
if (result.HasBroadcastAddress &&
|
||||
result.broadcastAddress_ != global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance) {
|
||||
result.broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.CreateBuilder(result.broadcastAddress_).MergeFrom(value).BuildPartial();
|
||||
} else {
|
||||
result.broadcastAddress_ = value;
|
||||
}
|
||||
result.hasBroadcastAddress = true;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearBroadcastAddress() {
|
||||
result.hasBroadcastAddress = false;
|
||||
result.broadcastAddress_ = global::Sirikata.Subscription.Protocol._PBJ_Internal.Address.DefaultInstance;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasBroadcastName {
|
||||
get { return result.HasBroadcastName; }
|
||||
}
|
||||
public pb::ByteString BroadcastName {
|
||||
get { return result.BroadcastName; }
|
||||
set { SetBroadcastName(value); }
|
||||
}
|
||||
public Builder SetBroadcastName(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasBroadcastName = true;
|
||||
result.broadcastName_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearBroadcastName() {
|
||||
result.hasBroadcastName = false;
|
||||
result.broadcastName_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasUpdatePeriod {
|
||||
get { return result.HasUpdatePeriod; }
|
||||
}
|
||||
public long UpdatePeriod {
|
||||
get { return result.UpdatePeriod; }
|
||||
set { SetUpdatePeriod(value); }
|
||||
}
|
||||
public Builder SetUpdatePeriod(long value) {
|
||||
result.hasUpdatePeriod = true;
|
||||
result.updatePeriod_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearUpdatePeriod() {
|
||||
result.hasUpdatePeriod = false;
|
||||
result.updatePeriod_ = 0;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static Subscribe() {
|
||||
object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed partial class Broadcast : pb::GeneratedMessage<Broadcast, Broadcast.Builder> {
|
||||
private static readonly Broadcast defaultInstance = new Builder().BuildPartial();
|
||||
public static Broadcast DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override Broadcast DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override Broadcast ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<Broadcast, Broadcast.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.internal__static_Sirikata_Subscription_Protocol__PBJ_Internal_Broadcast__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
public const int BroadcastNameFieldNumber = 7;
|
||||
private bool hasBroadcastName;
|
||||
private pb::ByteString broadcastName_ = pb::ByteString.Empty;
|
||||
public bool HasBroadcastName {
|
||||
get { return hasBroadcastName; }
|
||||
}
|
||||
public pb::ByteString BroadcastName {
|
||||
get { return broadcastName_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasBroadcastName) {
|
||||
output.WriteBytes(7, BroadcastName);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasBroadcastName) {
|
||||
size += pb::CodedOutputStream.ComputeBytesSize(7, BroadcastName);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static Broadcast ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Broadcast prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<Broadcast, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
Broadcast result = new Broadcast();
|
||||
|
||||
protected override Broadcast MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new Broadcast();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.Descriptor; }
|
||||
}
|
||||
|
||||
public override Broadcast DefaultInstanceForType {
|
||||
get { return global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override Broadcast BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
Broadcast returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is Broadcast) {
|
||||
return MergeFrom((Broadcast) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(Broadcast other) {
|
||||
if (other == global::Sirikata.Subscription.Protocol._PBJ_Internal.Broadcast.DefaultInstance) return this;
|
||||
if (other.HasBroadcastName) {
|
||||
BroadcastName = other.BroadcastName;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 58: {
|
||||
BroadcastName = input.ReadBytes();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasBroadcastName {
|
||||
get { return result.HasBroadcastName; }
|
||||
}
|
||||
public pb::ByteString BroadcastName {
|
||||
get { return result.BroadcastName; }
|
||||
set { SetBroadcastName(value); }
|
||||
}
|
||||
public Builder SetBroadcastName(pb::ByteString value) {
|
||||
pb::ThrowHelper.ThrowIfNull(value, "value");
|
||||
result.hasBroadcastName = true;
|
||||
result.broadcastName_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearBroadcastName() {
|
||||
result.hasBroadcastName = false;
|
||||
result.broadcastName_ = pb::ByteString.Empty;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static Broadcast() {
|
||||
object.ReferenceEquals(global::Sirikata.Subscription.Protocol._PBJ_Internal.Subscription.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
431
OpenSim/Client/Sirikata/Protocol/Subscription.pbj.cs
Normal file
431
OpenSim/Client/Sirikata/Protocol/Subscription.pbj.cs
Normal file
@@ -0,0 +1,431 @@
|
||||
/*
|
||||
* 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 pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
namespace Sirikata.Subscription.Protocol {
|
||||
public class Address : PBJ.IMessage {
|
||||
protected _PBJ_Internal.Address super;
|
||||
public _PBJ_Internal.Address _PBJSuper{ get { return super;} }
|
||||
public Address() {
|
||||
super=new _PBJ_Internal.Address();
|
||||
}
|
||||
public Address(_PBJ_Internal.Address reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static Address defaultInstance= new Address (_PBJ_Internal.Address.DefaultInstance);
|
||||
public static Address DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.Address.Descriptor; } }
|
||||
public static class Types {
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int HostnameFieldTag=1;
|
||||
public bool HasHostname{ get {return super.HasHostname&&PBJ._PBJ.ValidateString(super.Hostname);} }
|
||||
public string Hostname{ get {
|
||||
if (HasHostname) {
|
||||
return PBJ._PBJ.CastString(super.Hostname);
|
||||
} else {
|
||||
return PBJ._PBJ.CastString();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ServiceFieldTag=2;
|
||||
public bool HasService{ get {return super.HasService&&PBJ._PBJ.ValidateString(super.Service);} }
|
||||
public string Service{ get {
|
||||
if (HasService) {
|
||||
return PBJ._PBJ.CastString(super.Service);
|
||||
} else {
|
||||
return PBJ._PBJ.CastString();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Address prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static Address ParseFrom(pb::ByteString data) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data));
|
||||
}
|
||||
public static Address ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data,er));
|
||||
}
|
||||
public static Address ParseFrom(byte[] data) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data));
|
||||
}
|
||||
public static Address ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data,er));
|
||||
}
|
||||
public static Address ParseFrom(global::System.IO.Stream data) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data));
|
||||
}
|
||||
public static Address ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data,er));
|
||||
}
|
||||
public static Address ParseFrom(pb::CodedInputStream data) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data));
|
||||
}
|
||||
public static Address ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new Address(_PBJ_Internal.Address.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.Address.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.Address.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.Address.Builder();}
|
||||
public Builder(_PBJ_Internal.Address.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(Address prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public Address BuildPartial() {return new Address(super.BuildPartial());}
|
||||
public Address Build() {if (_HasAllPBJFields) return new Address(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return Address.Descriptor; } }
|
||||
public Builder ClearHostname() { super.ClearHostname();return this;}
|
||||
public const int HostnameFieldTag=1;
|
||||
public bool HasHostname{ get {return super.HasHostname&&PBJ._PBJ.ValidateString(super.Hostname);} }
|
||||
public string Hostname{ get {
|
||||
if (HasHostname) {
|
||||
return PBJ._PBJ.CastString(super.Hostname);
|
||||
} else {
|
||||
return PBJ._PBJ.CastString();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.Hostname=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearService() { super.ClearService();return this;}
|
||||
public const int ServiceFieldTag=2;
|
||||
public bool HasService{ get {return super.HasService&&PBJ._PBJ.ValidateString(super.Service);} }
|
||||
public string Service{ get {
|
||||
if (HasService) {
|
||||
return PBJ._PBJ.CastString(super.Service);
|
||||
} else {
|
||||
return PBJ._PBJ.CastString();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.Service=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Sirikata.Subscription.Protocol {
|
||||
public class Subscribe : PBJ.IMessage {
|
||||
protected _PBJ_Internal.Subscribe super;
|
||||
public _PBJ_Internal.Subscribe _PBJSuper{ get { return super;} }
|
||||
public Subscribe() {
|
||||
super=new _PBJ_Internal.Subscribe();
|
||||
}
|
||||
public Subscribe(_PBJ_Internal.Subscribe reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static Subscribe defaultInstance= new Subscribe (_PBJ_Internal.Subscribe.DefaultInstance);
|
||||
public static Subscribe DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.Subscribe.Descriptor; } }
|
||||
public static class Types {
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false||(field_tag>=1&&field_tag<=6)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912);
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int BroadcastAddressFieldTag=7;
|
||||
public bool HasBroadcastAddress{ get {return super.HasBroadcastAddress;} }
|
||||
public Address BroadcastAddress{ get {
|
||||
if (HasBroadcastAddress) {
|
||||
return new Address(super.BroadcastAddress);
|
||||
} else {
|
||||
return new Address();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int BroadcastNameFieldTag=8;
|
||||
public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} }
|
||||
public PBJ.UUID BroadcastName{ get {
|
||||
if (HasBroadcastName) {
|
||||
return PBJ._PBJ.CastUuid(super.BroadcastName);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int UpdatePeriodFieldTag=9;
|
||||
public bool HasUpdatePeriod{ get {return super.HasUpdatePeriod&&PBJ._PBJ.ValidateDuration(super.UpdatePeriod);} }
|
||||
public PBJ.Duration UpdatePeriod{ get {
|
||||
if (HasUpdatePeriod) {
|
||||
return PBJ._PBJ.CastDuration(super.UpdatePeriod);
|
||||
} else {
|
||||
return PBJ._PBJ.CastDuration();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Subscribe prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::ByteString data) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data));
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er));
|
||||
}
|
||||
public static Subscribe ParseFrom(byte[] data) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data));
|
||||
}
|
||||
public static Subscribe ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er));
|
||||
}
|
||||
public static Subscribe ParseFrom(global::System.IO.Stream data) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data));
|
||||
}
|
||||
public static Subscribe ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er));
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::CodedInputStream data) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data));
|
||||
}
|
||||
public static Subscribe ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new Subscribe(_PBJ_Internal.Subscribe.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.Subscribe.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.Subscribe.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.Subscribe.Builder();}
|
||||
public Builder(_PBJ_Internal.Subscribe.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(Subscribe prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public Subscribe BuildPartial() {return new Subscribe(super.BuildPartial());}
|
||||
public Subscribe Build() {if (_HasAllPBJFields) return new Subscribe(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return Subscribe.Descriptor; } }
|
||||
public Builder ClearBroadcastAddress() { super.ClearBroadcastAddress();return this;}
|
||||
public const int BroadcastAddressFieldTag=7;
|
||||
public bool HasBroadcastAddress{ get {return super.HasBroadcastAddress;} }
|
||||
public Address BroadcastAddress{ get {
|
||||
if (HasBroadcastAddress) {
|
||||
return new Address(super.BroadcastAddress);
|
||||
} else {
|
||||
return new Address();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.BroadcastAddress=value._PBJSuper;
|
||||
}
|
||||
}
|
||||
public Builder ClearBroadcastName() { super.ClearBroadcastName();return this;}
|
||||
public const int BroadcastNameFieldTag=8;
|
||||
public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} }
|
||||
public PBJ.UUID BroadcastName{ get {
|
||||
if (HasBroadcastName) {
|
||||
return PBJ._PBJ.CastUuid(super.BroadcastName);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.BroadcastName=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearUpdatePeriod() { super.ClearUpdatePeriod();return this;}
|
||||
public const int UpdatePeriodFieldTag=9;
|
||||
public bool HasUpdatePeriod{ get {return super.HasUpdatePeriod&&PBJ._PBJ.ValidateDuration(super.UpdatePeriod);} }
|
||||
public PBJ.Duration UpdatePeriod{ get {
|
||||
if (HasUpdatePeriod) {
|
||||
return PBJ._PBJ.CastDuration(super.UpdatePeriod);
|
||||
} else {
|
||||
return PBJ._PBJ.CastDuration();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.UpdatePeriod=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace Sirikata.Subscription.Protocol {
|
||||
public class Broadcast : PBJ.IMessage {
|
||||
protected _PBJ_Internal.Broadcast super;
|
||||
public _PBJ_Internal.Broadcast _PBJSuper{ get { return super;} }
|
||||
public Broadcast() {
|
||||
super=new _PBJ_Internal.Broadcast();
|
||||
}
|
||||
public Broadcast(_PBJ_Internal.Broadcast reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static Broadcast defaultInstance= new Broadcast (_PBJ_Internal.Broadcast.DefaultInstance);
|
||||
public static Broadcast DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.Broadcast.Descriptor; } }
|
||||
public static class Types {
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false||(field_tag>=1&&field_tag<=6)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912);
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int BroadcastNameFieldTag=7;
|
||||
public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} }
|
||||
public PBJ.UUID BroadcastName{ get {
|
||||
if (HasBroadcastName) {
|
||||
return PBJ._PBJ.CastUuid(super.BroadcastName);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(Broadcast prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::ByteString data) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data));
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er));
|
||||
}
|
||||
public static Broadcast ParseFrom(byte[] data) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data));
|
||||
}
|
||||
public static Broadcast ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er));
|
||||
}
|
||||
public static Broadcast ParseFrom(global::System.IO.Stream data) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data));
|
||||
}
|
||||
public static Broadcast ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er));
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::CodedInputStream data) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data));
|
||||
}
|
||||
public static Broadcast ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new Broadcast(_PBJ_Internal.Broadcast.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.Broadcast.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.Broadcast.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.Broadcast.Builder();}
|
||||
public Builder(_PBJ_Internal.Broadcast.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(Broadcast prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public Broadcast BuildPartial() {return new Broadcast(super.BuildPartial());}
|
||||
public Broadcast Build() {if (_HasAllPBJFields) return new Broadcast(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return Broadcast.Descriptor; } }
|
||||
public Builder ClearBroadcastName() { super.ClearBroadcastName();return this;}
|
||||
public const int BroadcastNameFieldTag=7;
|
||||
public bool HasBroadcastName{ get {return super.HasBroadcastName&&PBJ._PBJ.ValidateUuid(super.BroadcastName);} }
|
||||
public PBJ.UUID BroadcastName{ get {
|
||||
if (HasBroadcastName) {
|
||||
return PBJ._PBJ.CastUuid(super.BroadcastName);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUuid();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.BroadcastName=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3773
OpenSim/Client/Sirikata/Protocol/Test.cs
Normal file
3773
OpenSim/Client/Sirikata/Protocol/Test.cs
Normal file
File diff suppressed because it is too large
Load Diff
1761
OpenSim/Client/Sirikata/Protocol/Test.pbj.cs
Normal file
1761
OpenSim/Client/Sirikata/Protocol/Test.pbj.cs
Normal file
File diff suppressed because it is too large
Load Diff
454
OpenSim/Client/Sirikata/Protocol/Time.cs
Normal file
454
OpenSim/Client/Sirikata/Protocol/Time.cs
Normal file
@@ -0,0 +1,454 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
using pbc = global::Google.ProtocolBuffers.Collections;
|
||||
using pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using scg = global::System.Collections.Generic;
|
||||
namespace Sirikata.Network.Protocol._PBJ_Internal {
|
||||
|
||||
public static partial class Time {
|
||||
|
||||
#region Extension registration
|
||||
public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
|
||||
}
|
||||
#endregion
|
||||
#region Static variables
|
||||
internal static pbd::MessageDescriptor internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor;
|
||||
internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync, global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.Builder> internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable;
|
||||
#endregion
|
||||
#region Descriptor
|
||||
public static pbd::FileDescriptor Descriptor {
|
||||
get { return descriptor; }
|
||||
}
|
||||
private static pbd::FileDescriptor descriptor;
|
||||
|
||||
static Time() {
|
||||
byte[] descriptorData = global::System.Convert.FromBase64String(
|
||||
"CgpUaW1lLnByb3RvEidTaXJpa2F0YS5OZXR3b3JrLlByb3RvY29sLl9QQkpf" +
|
||||
"SW50ZXJuYWwirQEKCFRpbWVTeW5jEhMKC2NsaWVudF90aW1lGAkgASgGEhMK" +
|
||||
"C3NlcnZlcl90aW1lGAogASgGEhIKCnN5bmNfcm91bmQYCyABKAQSFgoOcmV0" +
|
||||
"dXJuX29wdGlvbnMYDiABKA0SEwoKcm91bmRfdHJpcBiBFCABKAYiNgoNUmV0" +
|
||||
"dXJuT3B0aW9ucxISCg5SRVBMWV9SRUxJQUJMRRABEhEKDVJFUExZX09SREVS" +
|
||||
"RUQQAg==");
|
||||
pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
|
||||
descriptor = root;
|
||||
internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor = Descriptor.MessageTypes[0];
|
||||
internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable =
|
||||
new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync, global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.Builder>(internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor,
|
||||
new string[] { "ClientTime", "ServerTime", "SyncRound", "ReturnOptions", "RoundTrip", });
|
||||
return null;
|
||||
};
|
||||
pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
|
||||
new pbd::FileDescriptor[] {
|
||||
}, assigner);
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
#region Messages
|
||||
public sealed partial class TimeSync : pb::GeneratedMessage<TimeSync, TimeSync.Builder> {
|
||||
private static readonly TimeSync defaultInstance = new Builder().BuildPartial();
|
||||
public static TimeSync DefaultInstance {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
public override TimeSync DefaultInstanceForType {
|
||||
get { return defaultInstance; }
|
||||
}
|
||||
|
||||
protected override TimeSync ThisMessage {
|
||||
get { return this; }
|
||||
}
|
||||
|
||||
public static pbd::MessageDescriptor Descriptor {
|
||||
get { return global::Sirikata.Network.Protocol._PBJ_Internal.Time.internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__Descriptor; }
|
||||
}
|
||||
|
||||
protected override pb::FieldAccess.FieldAccessorTable<TimeSync, TimeSync.Builder> InternalFieldAccessors {
|
||||
get { return global::Sirikata.Network.Protocol._PBJ_Internal.Time.internal__static_Sirikata_Network_Protocol__PBJ_Internal_TimeSync__FieldAccessorTable; }
|
||||
}
|
||||
|
||||
#region Nested types
|
||||
public static class Types {
|
||||
public enum ReturnOptions {
|
||||
REPLY_RELIABLE = 1,
|
||||
REPLY_ORDERED = 2,
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
public const int ClientTimeFieldNumber = 9;
|
||||
private bool hasClientTime;
|
||||
private ulong clientTime_ = 0;
|
||||
public bool HasClientTime {
|
||||
get { return hasClientTime; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong ClientTime {
|
||||
get { return clientTime_; }
|
||||
}
|
||||
|
||||
public const int ServerTimeFieldNumber = 10;
|
||||
private bool hasServerTime;
|
||||
private ulong serverTime_ = 0;
|
||||
public bool HasServerTime {
|
||||
get { return hasServerTime; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong ServerTime {
|
||||
get { return serverTime_; }
|
||||
}
|
||||
|
||||
public const int SyncRoundFieldNumber = 11;
|
||||
private bool hasSyncRound;
|
||||
private ulong syncRound_ = 0UL;
|
||||
public bool HasSyncRound {
|
||||
get { return hasSyncRound; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong SyncRound {
|
||||
get { return syncRound_; }
|
||||
}
|
||||
|
||||
public const int ReturnOptionsFieldNumber = 14;
|
||||
private bool hasReturnOptions;
|
||||
private uint returnOptions_ = 0;
|
||||
public bool HasReturnOptions {
|
||||
get { return hasReturnOptions; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint ReturnOptions {
|
||||
get { return returnOptions_; }
|
||||
}
|
||||
|
||||
public const int RoundTripFieldNumber = 2561;
|
||||
private bool hasRoundTrip;
|
||||
private ulong roundTrip_ = 0;
|
||||
public bool HasRoundTrip {
|
||||
get { return hasRoundTrip; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong RoundTrip {
|
||||
get { return roundTrip_; }
|
||||
}
|
||||
|
||||
public override bool IsInitialized {
|
||||
get {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void WriteTo(pb::CodedOutputStream output) {
|
||||
if (HasClientTime) {
|
||||
output.WriteFixed64(9, ClientTime);
|
||||
}
|
||||
if (HasServerTime) {
|
||||
output.WriteFixed64(10, ServerTime);
|
||||
}
|
||||
if (HasSyncRound) {
|
||||
output.WriteUInt64(11, SyncRound);
|
||||
}
|
||||
if (HasReturnOptions) {
|
||||
output.WriteUInt32(14, ReturnOptions);
|
||||
}
|
||||
if (HasRoundTrip) {
|
||||
output.WriteFixed64(2561, RoundTrip);
|
||||
}
|
||||
UnknownFields.WriteTo(output);
|
||||
}
|
||||
|
||||
private int memoizedSerializedSize = -1;
|
||||
public override int SerializedSize {
|
||||
get {
|
||||
int size = memoizedSerializedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
if (HasClientTime) {
|
||||
size += pb::CodedOutputStream.ComputeFixed64Size(9, ClientTime);
|
||||
}
|
||||
if (HasServerTime) {
|
||||
size += pb::CodedOutputStream.ComputeFixed64Size(10, ServerTime);
|
||||
}
|
||||
if (HasSyncRound) {
|
||||
size += pb::CodedOutputStream.ComputeUInt64Size(11, SyncRound);
|
||||
}
|
||||
if (HasReturnOptions) {
|
||||
size += pb::CodedOutputStream.ComputeUInt32Size(14, ReturnOptions);
|
||||
}
|
||||
if (HasRoundTrip) {
|
||||
size += pb::CodedOutputStream.ComputeFixed64Size(2561, RoundTrip);
|
||||
}
|
||||
size += UnknownFields.SerializedSize;
|
||||
memoizedSerializedSize = size;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
public static TimeSync ParseFrom(pb::ByteString data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(byte[] data) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(global::System.IO.Stream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseDelimitedFrom(global::System.IO.Stream input) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::CodedInputStream input) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
|
||||
}
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public override Builder ToBuilder() { return CreateBuilder(this); }
|
||||
public override Builder CreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder(TimeSync prototype) {
|
||||
return (Builder) new Builder().MergeFrom(prototype);
|
||||
}
|
||||
|
||||
public sealed partial class Builder : pb::GeneratedBuilder<TimeSync, Builder> {
|
||||
protected override Builder ThisBuilder {
|
||||
get { return this; }
|
||||
}
|
||||
public Builder() {}
|
||||
|
||||
TimeSync result = new TimeSync();
|
||||
|
||||
protected override TimeSync MessageBeingBuilt {
|
||||
get { return result; }
|
||||
}
|
||||
|
||||
public override Builder Clear() {
|
||||
result = new TimeSync();
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder Clone() {
|
||||
return new Builder().MergeFrom(result);
|
||||
}
|
||||
|
||||
public override pbd::MessageDescriptor DescriptorForType {
|
||||
get { return global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.Descriptor; }
|
||||
}
|
||||
|
||||
public override TimeSync DefaultInstanceForType {
|
||||
get { return global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.DefaultInstance; }
|
||||
}
|
||||
|
||||
public override TimeSync BuildPartial() {
|
||||
if (result == null) {
|
||||
throw new global::System.InvalidOperationException("build() has already been called on this Builder");
|
||||
}
|
||||
TimeSync returnMe = result;
|
||||
result = null;
|
||||
return returnMe;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::IMessage other) {
|
||||
if (other is TimeSync) {
|
||||
return MergeFrom((TimeSync) other);
|
||||
} else {
|
||||
base.MergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(TimeSync other) {
|
||||
if (other == global::Sirikata.Network.Protocol._PBJ_Internal.TimeSync.DefaultInstance) return this;
|
||||
if (other.HasClientTime) {
|
||||
ClientTime = other.ClientTime;
|
||||
}
|
||||
if (other.HasServerTime) {
|
||||
ServerTime = other.ServerTime;
|
||||
}
|
||||
if (other.HasSyncRound) {
|
||||
SyncRound = other.SyncRound;
|
||||
}
|
||||
if (other.HasReturnOptions) {
|
||||
ReturnOptions = other.ReturnOptions;
|
||||
}
|
||||
if (other.HasRoundTrip) {
|
||||
RoundTrip = other.RoundTrip;
|
||||
}
|
||||
this.MergeUnknownFields(other.UnknownFields);
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input) {
|
||||
return MergeFrom(input, pb::ExtensionRegistry.Empty);
|
||||
}
|
||||
|
||||
public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
|
||||
pb::UnknownFieldSet.Builder unknownFields = null;
|
||||
while (true) {
|
||||
uint tag = input.ReadTag();
|
||||
switch (tag) {
|
||||
case 0: {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
default: {
|
||||
if (pb::WireFormat.IsEndGroupTag(tag)) {
|
||||
if (unknownFields != null) {
|
||||
this.UnknownFields = unknownFields.Build();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
if (unknownFields == null) {
|
||||
unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
|
||||
}
|
||||
ParseUnknownField(input, unknownFields, extensionRegistry, tag);
|
||||
break;
|
||||
}
|
||||
case 73: {
|
||||
ClientTime = input.ReadFixed64();
|
||||
break;
|
||||
}
|
||||
case 81: {
|
||||
ServerTime = input.ReadFixed64();
|
||||
break;
|
||||
}
|
||||
case 88: {
|
||||
SyncRound = input.ReadUInt64();
|
||||
break;
|
||||
}
|
||||
case 112: {
|
||||
ReturnOptions = input.ReadUInt32();
|
||||
break;
|
||||
}
|
||||
case 20489: {
|
||||
RoundTrip = input.ReadFixed64();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool HasClientTime {
|
||||
get { return result.HasClientTime; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong ClientTime {
|
||||
get { return result.ClientTime; }
|
||||
set { SetClientTime(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetClientTime(ulong value) {
|
||||
result.hasClientTime = true;
|
||||
result.clientTime_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearClientTime() {
|
||||
result.hasClientTime = false;
|
||||
result.clientTime_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasServerTime {
|
||||
get { return result.HasServerTime; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong ServerTime {
|
||||
get { return result.ServerTime; }
|
||||
set { SetServerTime(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetServerTime(ulong value) {
|
||||
result.hasServerTime = true;
|
||||
result.serverTime_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearServerTime() {
|
||||
result.hasServerTime = false;
|
||||
result.serverTime_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasSyncRound {
|
||||
get { return result.HasSyncRound; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong SyncRound {
|
||||
get { return result.SyncRound; }
|
||||
set { SetSyncRound(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetSyncRound(ulong value) {
|
||||
result.hasSyncRound = true;
|
||||
result.syncRound_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearSyncRound() {
|
||||
result.hasSyncRound = false;
|
||||
result.syncRound_ = 0UL;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasReturnOptions {
|
||||
get { return result.HasReturnOptions; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public uint ReturnOptions {
|
||||
get { return result.ReturnOptions; }
|
||||
set { SetReturnOptions(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetReturnOptions(uint value) {
|
||||
result.hasReturnOptions = true;
|
||||
result.returnOptions_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearReturnOptions() {
|
||||
result.hasReturnOptions = false;
|
||||
result.returnOptions_ = 0;
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool HasRoundTrip {
|
||||
get { return result.HasRoundTrip; }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public ulong RoundTrip {
|
||||
get { return result.RoundTrip; }
|
||||
set { SetRoundTrip(value); }
|
||||
}
|
||||
[global::System.CLSCompliant(false)]
|
||||
public Builder SetRoundTrip(ulong value) {
|
||||
result.hasRoundTrip = true;
|
||||
result.roundTrip_ = value;
|
||||
return this;
|
||||
}
|
||||
public Builder ClearRoundTrip() {
|
||||
result.hasRoundTrip = false;
|
||||
result.roundTrip_ = 0;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
static TimeSync() {
|
||||
object.ReferenceEquals(global::Sirikata.Network.Protocol._PBJ_Internal.Time.Descriptor, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
245
OpenSim/Client/Sirikata/Protocol/Time.pbj.cs
Normal file
245
OpenSim/Client/Sirikata/Protocol/Time.pbj.cs
Normal file
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* 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 pbd = global::Google.ProtocolBuffers.Descriptors;
|
||||
using pb = global::Google.ProtocolBuffers;
|
||||
namespace Sirikata.Network.Protocol {
|
||||
public class TimeSync : PBJ.IMessage {
|
||||
protected _PBJ_Internal.TimeSync super;
|
||||
public _PBJ_Internal.TimeSync _PBJSuper{ get { return super;} }
|
||||
public TimeSync() {
|
||||
super=new _PBJ_Internal.TimeSync();
|
||||
}
|
||||
public TimeSync(_PBJ_Internal.TimeSync reference) {
|
||||
super=reference;
|
||||
}
|
||||
public static TimeSync defaultInstance= new TimeSync (_PBJ_Internal.TimeSync.DefaultInstance);
|
||||
public static TimeSync DefaultInstance{
|
||||
get {return defaultInstance;}
|
||||
}
|
||||
public static pbd.MessageDescriptor Descriptor {
|
||||
get { return _PBJ_Internal.TimeSync.Descriptor; } }
|
||||
public static class Types {
|
||||
public enum ReturnOptions {
|
||||
REPLY_RELIABLE=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_RELIABLE,
|
||||
REPLY_ORDERED=_PBJ_Internal.TimeSync.Types.ReturnOptions.REPLY_ORDERED
|
||||
};
|
||||
}
|
||||
public static bool WithinReservedFieldTagRange(int field_tag) {
|
||||
return false||(field_tag>=1&&field_tag<=8)||(field_tag>=1536&&field_tag<=2560)||(field_tag>=229376&&field_tag<=294912);
|
||||
}
|
||||
public static bool WithinExtensionFieldTagRange(int field_tag) {
|
||||
return false;
|
||||
}
|
||||
public const int ClientTimeFieldTag=9;
|
||||
public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} }
|
||||
public PBJ.Time ClientTime{ get {
|
||||
if (HasClientTime) {
|
||||
return PBJ._PBJ.CastTime(super.ClientTime);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ServerTimeFieldTag=10;
|
||||
public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} }
|
||||
public PBJ.Time ServerTime{ get {
|
||||
if (HasServerTime) {
|
||||
return PBJ._PBJ.CastTime(super.ServerTime);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int SyncRoundFieldTag=11;
|
||||
public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} }
|
||||
public ulong SyncRound{ get {
|
||||
if (HasSyncRound) {
|
||||
return PBJ._PBJ.CastUint64(super.SyncRound);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint64();
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int ReturnOptionsFieldTag=14;
|
||||
public bool HasReturnOptions { get {
|
||||
if (!super.HasReturnOptions) return false;
|
||||
return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
} }
|
||||
public uint ReturnOptions{ get {
|
||||
if (HasReturnOptions) {
|
||||
return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
} else {
|
||||
return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
}
|
||||
}
|
||||
}
|
||||
public const int RoundTripFieldTag=2561;
|
||||
public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} }
|
||||
public PBJ.Time RoundTrip{ get {
|
||||
if (HasRoundTrip) {
|
||||
return PBJ._PBJ.CastTime(super.RoundTrip);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
public override Google.ProtocolBuffers.IMessage _PBJISuper { get { return super; } }
|
||||
public override PBJ.IMessage.IBuilder WeakCreateBuilderForType() { return new Builder(); }
|
||||
public static Builder CreateBuilder() { return new Builder(); }
|
||||
public static Builder CreateBuilder(TimeSync prototype) {
|
||||
return (Builder)new Builder().MergeFrom(prototype);
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::ByteString data) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::ByteString data, pb::ExtensionRegistry er) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
|
||||
}
|
||||
public static TimeSync ParseFrom(byte[] data) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
|
||||
}
|
||||
public static TimeSync ParseFrom(byte[] data, pb::ExtensionRegistry er) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
|
||||
}
|
||||
public static TimeSync ParseFrom(global::System.IO.Stream data) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
|
||||
}
|
||||
public static TimeSync ParseFrom(global::System.IO.Stream data, pb::ExtensionRegistry er) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::CodedInputStream data) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data));
|
||||
}
|
||||
public static TimeSync ParseFrom(pb::CodedInputStream data, pb::ExtensionRegistry er) {
|
||||
return new TimeSync(_PBJ_Internal.TimeSync.ParseFrom(data,er));
|
||||
}
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
public class Builder : global::PBJ.IMessage.IBuilder{
|
||||
protected override bool _HasAllPBJFields{ get {
|
||||
return true
|
||||
;
|
||||
} }
|
||||
public bool IsInitialized { get {
|
||||
return super.IsInitialized&&_HasAllPBJFields;
|
||||
} }
|
||||
protected _PBJ_Internal.TimeSync.Builder super;
|
||||
public override Google.ProtocolBuffers.IBuilder _PBJISuper { get { return super; } }
|
||||
public _PBJ_Internal.TimeSync.Builder _PBJSuper{ get { return super;} }
|
||||
public Builder() {super = new _PBJ_Internal.TimeSync.Builder();}
|
||||
public Builder(_PBJ_Internal.TimeSync.Builder other) {
|
||||
super=other;
|
||||
}
|
||||
public Builder Clone() {return new Builder(super.Clone());}
|
||||
public Builder MergeFrom(TimeSync prototype) { super.MergeFrom(prototype._PBJSuper);return this;}
|
||||
public Builder Clear() {super.Clear();return this;}
|
||||
public TimeSync BuildPartial() {return new TimeSync(super.BuildPartial());}
|
||||
public TimeSync Build() {if (_HasAllPBJFields) return new TimeSync(super.Build());return null;}
|
||||
public pbd::MessageDescriptor DescriptorForType {
|
||||
get { return TimeSync.Descriptor; } }
|
||||
public Builder ClearClientTime() { super.ClearClientTime();return this;}
|
||||
public const int ClientTimeFieldTag=9;
|
||||
public bool HasClientTime{ get {return super.HasClientTime&&PBJ._PBJ.ValidateTime(super.ClientTime);} }
|
||||
public PBJ.Time ClientTime{ get {
|
||||
if (HasClientTime) {
|
||||
return PBJ._PBJ.CastTime(super.ClientTime);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.ClientTime=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearServerTime() { super.ClearServerTime();return this;}
|
||||
public const int ServerTimeFieldTag=10;
|
||||
public bool HasServerTime{ get {return super.HasServerTime&&PBJ._PBJ.ValidateTime(super.ServerTime);} }
|
||||
public PBJ.Time ServerTime{ get {
|
||||
if (HasServerTime) {
|
||||
return PBJ._PBJ.CastTime(super.ServerTime);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.ServerTime=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearSyncRound() { super.ClearSyncRound();return this;}
|
||||
public const int SyncRoundFieldTag=11;
|
||||
public bool HasSyncRound{ get {return super.HasSyncRound&&PBJ._PBJ.ValidateUint64(super.SyncRound);} }
|
||||
public ulong SyncRound{ get {
|
||||
if (HasSyncRound) {
|
||||
return PBJ._PBJ.CastUint64(super.SyncRound);
|
||||
} else {
|
||||
return PBJ._PBJ.CastUint64();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.SyncRound=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
public Builder ClearReturnOptions() { super.ClearReturnOptions();return this;}
|
||||
public const int ReturnOptionsFieldTag=14;
|
||||
public bool HasReturnOptions { get {
|
||||
if (!super.HasReturnOptions) return false;
|
||||
return PBJ._PBJ.ValidateFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
} }
|
||||
public uint ReturnOptions{ get {
|
||||
if (HasReturnOptions) {
|
||||
return (uint)PBJ._PBJ.CastFlags(super.ReturnOptions,(ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
} else {
|
||||
return (uint)PBJ._PBJ.CastFlags((ulong)Types.ReturnOptions.REPLY_RELIABLE|(ulong)Types.ReturnOptions.REPLY_ORDERED);
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.ReturnOptions=((value));
|
||||
}
|
||||
}
|
||||
public Builder ClearRoundTrip() { super.ClearRoundTrip();return this;}
|
||||
public const int RoundTripFieldTag=2561;
|
||||
public bool HasRoundTrip{ get {return super.HasRoundTrip&&PBJ._PBJ.ValidateTime(super.RoundTrip);} }
|
||||
public PBJ.Time RoundTrip{ get {
|
||||
if (HasRoundTrip) {
|
||||
return PBJ._PBJ.CastTime(super.RoundTrip);
|
||||
} else {
|
||||
return PBJ._PBJ.CastTime();
|
||||
}
|
||||
}
|
||||
set {
|
||||
super.RoundTrip=(PBJ._PBJ.Construct(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
139
OpenSim/Client/Sirikata/SirikataModule.cs
Normal file
139
OpenSim/Client/Sirikata/SirikataModule.cs
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
// THIS MODULE USES CODE FROM SIRIKATA, THE SIRIKATA LICENSE IS BELOW
|
||||
/*
|
||||
Sirikata is Licensed using the revised BSD license.
|
||||
If you have any questions, contact Patrick Horn at <patrick.horn@gmail.com>
|
||||
|
||||
|
||||
Copyright (c) 2008, the Sirikata developers (see AUTHORS file for credit).
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* Neither the name of Sirikata nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Client.Sirikata.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.Sirikata
|
||||
{
|
||||
class SirikataModule : IRegionModule
|
||||
{
|
||||
private bool m_enabled = false;
|
||||
|
||||
private TcpListener m_listener;
|
||||
private bool m_running = true;
|
||||
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
private Dictionary<UUID,SirikataClientView> m_clients = new Dictionary<UUID, SirikataClientView>();
|
||||
|
||||
#region Implementation of IRegionModule
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
lock (m_scenes)
|
||||
m_scenes.Add(scene);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (!m_enabled)
|
||||
return;
|
||||
|
||||
m_listener = new TcpListener(IPAddress.Any, 5943);
|
||||
|
||||
}
|
||||
|
||||
private void ListenLoop()
|
||||
{
|
||||
while (m_running)
|
||||
{
|
||||
m_listener.BeginAcceptTcpClient(AcceptSocket, m_listener);
|
||||
}
|
||||
}
|
||||
|
||||
private void AcceptSocket(IAsyncResult ar)
|
||||
{
|
||||
TcpListener listener = (TcpListener) ar.AsyncState;
|
||||
TcpClient client = listener.EndAcceptTcpClient(ar);
|
||||
|
||||
SirikataClientView clientView = new SirikataClientView(client);
|
||||
|
||||
lock (m_clients)
|
||||
m_clients.Add(clientView.SessionId, clientView);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Sirikata ClientStack Module"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
1226
OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
Normal file
1226
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);
|
||||
|
||||
@@ -1,31 +1,4 @@
|
||||
/*
|
||||
* 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;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
@@ -44,7 +17,7 @@ namespace OpenSim.Data
|
||||
/// <returns></returns>
|
||||
public static UUID FromDB(object id)
|
||||
{
|
||||
if ((id == null) || (id == DBNull.Value))
|
||||
if( (id == null) || (id == DBNull.Value))
|
||||
return UUID.Zero;
|
||||
|
||||
if (id.GetType() == typeof(Guid))
|
||||
|
||||
@@ -34,10 +34,21 @@ 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);
|
||||
bool Delete(string id);
|
||||
}
|
||||
|
||||
public class AssetDataInitialiser : PluginInitialiserBase
|
||||
{
|
||||
private string connect;
|
||||
public AssetDataInitialiser (string s) { connect = s; }
|
||||
public override void Initialise (IPlugin plugin)
|
||||
{
|
||||
IAssetDataPlugin p = plugin as IAssetDataPlugin;
|
||||
p.Initialise (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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,4 +155,15 @@ namespace OpenSim.Data
|
||||
/// </returns>
|
||||
List<InventoryItemBase> fetchActiveGestures(UUID avatarID);
|
||||
}
|
||||
|
||||
public class InventoryDataInitialiser : PluginInitialiserBase
|
||||
{
|
||||
private string connect;
|
||||
public InventoryDataInitialiser (string s) { connect = s; }
|
||||
public override void Initialise (IPlugin plugin)
|
||||
{
|
||||
IInventoryDataPlugin p = plugin as IInventoryDataPlugin;
|
||||
p.Initialise (connect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -99,26 +79,4 @@ namespace OpenSim.Data
|
||||
Authenticate = 256, // Require authentication
|
||||
Hyperlink = 512 // Record represents a HG link
|
||||
}
|
||||
|
||||
public class RegionDataDistanceCompare : IComparer<RegionData>
|
||||
{
|
||||
private Vector2 m_origin;
|
||||
|
||||
public RegionDataDistanceCompare(int x, int y)
|
||||
{
|
||||
m_origin = new Vector2(x, y);
|
||||
}
|
||||
|
||||
public int Compare(RegionData regionA, RegionData regionB)
|
||||
{
|
||||
Vector2 vectorA = new Vector2(regionA.posX, regionA.posY);
|
||||
Vector2 vectorB = new Vector2(regionB.posX, regionB.posY);
|
||||
return Math.Sign(VectorDistance(m_origin, vectorA) - VectorDistance(m_origin, vectorB));
|
||||
}
|
||||
|
||||
private float VectorDistance(Vector2 x, Vector2 y)
|
||||
{
|
||||
return (x - y).Length();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -50,15 +50,6 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
#region Public methods
|
||||
|
||||
public MSSQLEstateStore()
|
||||
{
|
||||
}
|
||||
|
||||
public MSSQLEstateStore(string connectionString)
|
||||
{
|
||||
Initialise(connectionString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialises the estatedata class.
|
||||
/// </summary>
|
||||
@@ -72,12 +63,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 +103,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 +134,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 +196,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 +301,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 +341,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));
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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))
|
||||
{
|
||||
@@ -316,11 +315,8 @@ namespace OpenSim.Data.MSSQL
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
List<RegionData> regions = Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y);
|
||||
regions.Sort(distanceComparer);
|
||||
|
||||
return regions;
|
||||
// TODO: distance-sort results
|
||||
return Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetHyperlinks(UUID scopeID)
|
||||
|
||||
@@ -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](
|
||||
@@ -924,227 +925,5 @@ ALTER TABLE regionsettings ADD loaded_creation_datetime int NOT NULL default 0
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 24
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims ADD MediaURL varchar(255)
|
||||
ALTER TABLE primshapes ADD Media TEXT NULL
|
||||
|
||||
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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace OpenSim.Data
|
||||
int ver = FindVersion(_conn, "migrations");
|
||||
if (ver <= 0) // -1 = no table, 0 = no version record
|
||||
{
|
||||
if (ver < 0)
|
||||
if( ver < 0 )
|
||||
ExecuteScript("create table migrations(name varchar(100), version int)");
|
||||
InsertVersion("migrations", 1);
|
||||
}
|
||||
@@ -204,7 +204,7 @@ namespace OpenSim.Data
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[MIGRATIONS]: Cmd was {0}", e.Message.Replace("\n", " "));
|
||||
m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. If you're running OpenSim for the first time then you can probably safely ignore this, since certain migration commands attempt to fetch data out of old tables. However, if you're using an existing database and you see database related errors while running OpenSim then you will need to fix these problems manually. Continuing.");
|
||||
m_log.Debug("[MIGRATIONS]: An error has occurred in the migration. This may mean you could see errors trying to run OpenSim. If you see database related errors, you will need to fix the issue manually. Continuing.");
|
||||
ExecuteScript("ROLLBACK;");
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace OpenSim.Data
|
||||
SortedList<int, string[]> migrations = new SortedList<int, string[]>();
|
||||
|
||||
string[] names = _assem.GetManifestResourceNames();
|
||||
if (names.Length == 0) // should never happen
|
||||
if( names.Length == 0 ) // should never happen
|
||||
return migrations;
|
||||
|
||||
Array.Sort(names); // we want all the migrations ordered
|
||||
@@ -297,7 +297,7 @@ namespace OpenSim.Data
|
||||
Match m = null;
|
||||
string sFile = Array.FindLast(names, nm => { m = _match_new.Match(nm); return m.Success; }); // ; nm.StartsWith(sPrefix, StringComparison.InvariantCultureIgnoreCase
|
||||
|
||||
if ((m != null) && !String.IsNullOrEmpty(sFile))
|
||||
if( (m != null) && !String.IsNullOrEmpty(sFile) )
|
||||
{
|
||||
/* The filename should be '<StoreName>.migrations[.NNN]' where NNN
|
||||
* is the last version number defined in the file. If the '.NNN' part is recognized, the code can skip
|
||||
@@ -312,7 +312,7 @@ namespace OpenSim.Data
|
||||
|
||||
if (m.Groups.Count > 1 && int.TryParse(m.Groups[1].Value, out nLastVerFound))
|
||||
{
|
||||
if (nLastVerFound <= after)
|
||||
if( nLastVerFound <= after )
|
||||
goto scan_old_style;
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace OpenSim.Data
|
||||
sb.Length = 0;
|
||||
}
|
||||
|
||||
if ((nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list
|
||||
if ( (nVersion > 0) && (nVersion > after) && (script.Count > 0) && !migrations.ContainsKey(nVersion)) // script to the versioned script list
|
||||
{
|
||||
migrations[nVersion] = script.ToArray();
|
||||
}
|
||||
@@ -345,7 +345,7 @@ namespace OpenSim.Data
|
||||
string sLine = resourceReader.ReadLine();
|
||||
nLineNo++;
|
||||
|
||||
if (String.IsNullOrEmpty(sLine) || sLine.StartsWith("#")) // ignore a comment or empty line
|
||||
if( String.IsNullOrEmpty(sLine) || sLine.StartsWith("#") ) // ignore a comment or empty line
|
||||
continue;
|
||||
|
||||
if (sLine.Trim().Equals(":GO", StringComparison.InvariantCultureIgnoreCase))
|
||||
@@ -392,7 +392,7 @@ scan_old_style:
|
||||
if (m.Success)
|
||||
{
|
||||
int version = int.Parse(m.Groups[1].ToString());
|
||||
if ((version > after) && !migrations.ContainsKey(version))
|
||||
if ( (version > after) && !migrations.ContainsKey(version) )
|
||||
{
|
||||
using (Stream resource = _assem.GetManifestResourceStream(s))
|
||||
{
|
||||
@@ -407,8 +407,9 @@ scan_old_style:
|
||||
}
|
||||
|
||||
if (migrations.Count < 1)
|
||||
m_log.DebugFormat("[MIGRATIONS]: {0} data tables already up to date at revision {1}", _type, after);
|
||||
|
||||
{
|
||||
m_log.InfoFormat("[MIGRATIONS]: {0} up to date, no migrations to apply", _type);
|
||||
}
|
||||
return migrations;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,99 +161,105 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAccessTime(AssetBase asset)
|
||||
{
|
||||
// Writing to the database every time Get() is called on an asset is killing us. Seriously. -jph
|
||||
return;
|
||||
|
||||
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);
|
||||
|
||||
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 +276,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 +308,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 +351,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 +364,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,26 +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()
|
||||
{
|
||||
}
|
||||
|
||||
public MySQLEstateStore(string connectionString)
|
||||
{
|
||||
Initialise(connectionString);
|
||||
}
|
||||
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
m_connectionString = connectionString;
|
||||
@@ -87,7 +73,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 +114,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 +136,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 +175,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 +400,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 +424,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 +436,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 +454,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)
|
||||
@@ -157,10 +148,6 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
foreach (string name in m_Fields.Keys)
|
||||
{
|
||||
if (reader[name] is DBNull)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (m_Fields[name].FieldType == typeof(bool))
|
||||
{
|
||||
int v = Convert.ToInt32(reader[name]);
|
||||
@@ -221,6 +208,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 +217,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 +244,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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ namespace OpenSim.Data.MySQL
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
|
||||
// TODO: this is to handle a case where NULLs creep in there, which we are not sure is endemic to the system, or legacy. It would be nice to live fix these.
|
||||
// (DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero)
|
||||
// ( DBGuid.FromDB() reads db NULLs as well, returns UUID.Zero )
|
||||
item.CreatorId = reader["creatorID"].ToString();
|
||||
|
||||
// Be a bit safer in parsing these because the
|
||||
@@ -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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -69,8 +62,6 @@ namespace OpenSim.Data.MySQL
|
||||
if (scopeID != UUID.Zero)
|
||||
command += " and ScopeID = ?scopeID";
|
||||
|
||||
command += " order by regionName";
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(command))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?regionName", regionName);
|
||||
@@ -162,7 +153,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 +178,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 +189,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,9 +210,6 @@ 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);
|
||||
|
||||
string[] fields = new List<string>(data.Data.Keys).ToArray();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand())
|
||||
@@ -312,10 +289,8 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
List<RegionData> regions = Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y);
|
||||
regions.Sort(distanceComparer);
|
||||
return regions;
|
||||
// TODO: distance-sort results
|
||||
return Get((int)RegionFlags.FallbackRegion, scopeID);
|
||||
}
|
||||
|
||||
public List<RegionData> GetHyperlinks(UUID scopeID)
|
||||
@@ -329,12 +304,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,3 @@ CREATE TABLE Avatars (
|
||||
KEY(PrincipalID));
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 2
|
||||
|
||||
BEGIN;
|
||||
|
||||
alter table Avatars change column Value Value text;
|
||||
|
||||
COMMIT;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user