Compare commits
521 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
@@ -126,6 +126,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
availableMethods["admin_region_query"] = XmlRpcRegionQueryMethod;
|
||||
availableMethods["admin_shutdown"] = XmlRpcShutdownMethod;
|
||||
availableMethods["admin_broadcast"] = XmlRpcAlertMethod;
|
||||
availableMethods["admin_dialog"] = XmlRpcDialogMethod;
|
||||
availableMethods["admin_restart"] = XmlRpcRestartMethod;
|
||||
availableMethods["admin_load_heightmap"] = XmlRpcLoadHeightmapMethod;
|
||||
// User management
|
||||
@@ -215,9 +216,59 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene))
|
||||
throw new Exception("region not found");
|
||||
|
||||
int timeout = 30000;
|
||||
string message;
|
||||
|
||||
if (requestData.ContainsKey("restart")
|
||||
&& ((string)requestData["restart"] == "delayed")
|
||||
&& requestData.ContainsKey("milliseconds"))
|
||||
{
|
||||
timeout = Int32.Parse(requestData["milliseconds"].ToString());
|
||||
|
||||
if (timeout < 15000)
|
||||
{
|
||||
//It must be at least 15 seconds or we'll cancel the reboot request
|
||||
timeout = 15000;
|
||||
}
|
||||
|
||||
message
|
||||
= "Region is restarting in " + ((int)(timeout / 1000)).ToString()
|
||||
+ " second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = "Region is restarting in 30 second(s). Please save what you are doing and log out.";
|
||||
}
|
||||
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string)requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
responseData["rebooting"] = true;
|
||||
response.Value = responseData;
|
||||
rebootedScene.Restart(30);
|
||||
rebootedScene.Restart(timeout / 1000,false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -280,6 +331,53 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
public XmlRpcResponse XmlRpcDialogMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable responseData = new Hashtable();
|
||||
|
||||
m_log.Info("[RADMIN]: Dialog request started");
|
||||
|
||||
try
|
||||
{
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
checkStringParameters(request, new string[] { "password", "from", "message" });
|
||||
|
||||
if (m_requiredPassword != String.Empty &&
|
||||
(!requestData.Contains("password") || (string)requestData["password"] != m_requiredPassword))
|
||||
throw new Exception("wrong password");
|
||||
|
||||
string message = (string)requestData["message"];
|
||||
string fromuuid = (string)requestData["from"];
|
||||
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
|
||||
|
||||
responseData["accepted"] = true;
|
||||
responseData["success"] = true;
|
||||
response.Value = responseData;
|
||||
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[RADMIN]: Broadcasting: failed: {0}", e.Message);
|
||||
m_log.DebugFormat("[RADMIN]: Broadcasting: failed: {0}", e.ToString());
|
||||
|
||||
responseData["accepted"] = false;
|
||||
responseData["success"] = false;
|
||||
responseData["error"] = e.Message;
|
||||
response.Value = responseData;
|
||||
}
|
||||
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
return response;
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRpcLoadHeightmapMethod(XmlRpcRequest request, IPEndPoint remoteClient)
|
||||
{
|
||||
@@ -387,13 +485,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
message = "Region is going down now.";
|
||||
}
|
||||
|
||||
m_app.SceneManager.ForEachScene(
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string) requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_app.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Perform shutdown
|
||||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||
|
||||
@@ -819,6 +819,10 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
//throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
//throw new System.NotImplementedException();
|
||||
@@ -834,11 +838,19 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.Info("[MXP ClientStack] Close Called");
|
||||
|
||||
// Tell the client to go
|
||||
SendLogoutPacket();
|
||||
if (sendStop == true)
|
||||
{
|
||||
SendLogoutPacket();
|
||||
}
|
||||
|
||||
// Let MXPPacketServer clean it up
|
||||
if (Session.SessionState != SessionState.Disconnected)
|
||||
|
||||
@@ -439,12 +439,21 @@ namespace OpenSim.Client.Sirikata.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -445,12 +445,21 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -717,6 +717,79 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE `regionwindlight` (
|
||||
`region_id` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
`water_color_r` float(9,6) unsigned NOT NULL DEFAULT '4.000000',
|
||||
`water_color_g` float(9,6) unsigned NOT NULL DEFAULT '38.000000',
|
||||
`water_color_b` float(9,6) unsigned NOT NULL DEFAULT '64.000000',
|
||||
`water_fog_density_exponent` float(3,1) unsigned NOT NULL DEFAULT '4.0',
|
||||
`underwater_fog_modifier` float(3,2) unsigned NOT NULL DEFAULT '0.25',
|
||||
`reflection_wavelet_scale_1` float(3,1) unsigned NOT NULL DEFAULT '2.0',
|
||||
`reflection_wavelet_scale_2` float(3,1) unsigned NOT NULL DEFAULT '2.0',
|
||||
`reflection_wavelet_scale_3` float(3,1) unsigned NOT NULL DEFAULT '2.0',
|
||||
`fresnel_scale` float(3,2) unsigned NOT NULL DEFAULT '0.40',
|
||||
`fresnel_offset` float(3,2) unsigned NOT NULL DEFAULT '0.50',
|
||||
`refract_scale_above` float(3,2) unsigned NOT NULL DEFAULT '0.03',
|
||||
`refract_scale_below` float(3,2) unsigned NOT NULL DEFAULT '0.20',
|
||||
`blur_multiplier` float(4,3) unsigned NOT NULL DEFAULT '0.040',
|
||||
`big_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.05',
|
||||
`big_wave_direction_y` float(3,2) NOT NULL DEFAULT '-0.42',
|
||||
`little_wave_direction_x` float(3,2) NOT NULL DEFAULT '1.11',
|
||||
`little_wave_direction_y` float(3,2) NOT NULL DEFAULT '-1.16',
|
||||
`normal_map_texture` varchar(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
`horizon_r` float(3,2) unsigned NOT NULL DEFAULT '0.25',
|
||||
`horizon_g` float(3,2) unsigned NOT NULL DEFAULT '0.25',
|
||||
`horizon_b` float(3,2) unsigned NOT NULL DEFAULT '0.32',
|
||||
`horizon_i` float(3,2) unsigned NOT NULL DEFAULT '0.32',
|
||||
`haze_horizon` float(3,2) unsigned NOT NULL DEFAULT '0.19',
|
||||
`blue_density_r` float(3,2) unsigned NOT NULL DEFAULT '0.12',
|
||||
`blue_density_g` float(3,2) unsigned NOT NULL DEFAULT '0.22',
|
||||
`blue_density_b` float(3,2) unsigned NOT NULL DEFAULT '0.38',
|
||||
`blue_density_i` float(3,2) unsigned NOT NULL DEFAULT '0.38',
|
||||
`haze_density` float(3,2) unsigned NOT NULL DEFAULT '0.70',
|
||||
`density_multiplier` float(3,2) unsigned NOT NULL DEFAULT '0.18',
|
||||
`distance_multiplier` float(4,1) unsigned NOT NULL DEFAULT '0.8',
|
||||
`max_altitude` int(4) unsigned NOT NULL DEFAULT '1605',
|
||||
`sun_moon_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.24',
|
||||
`sun_moon_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.26',
|
||||
`sun_moon_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.30',
|
||||
`sun_moon_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.30',
|
||||
`sun_moon_position` float(4,3) unsigned NOT NULL DEFAULT '0.317',
|
||||
`ambient_r` float(3,2) unsigned NOT NULL DEFAULT '0.35',
|
||||
`ambient_g` float(3,2) unsigned NOT NULL DEFAULT '0.35',
|
||||
`ambient_b` float(3,2) unsigned NOT NULL DEFAULT '0.35',
|
||||
`ambient_i` float(3,2) unsigned NOT NULL DEFAULT '0.35',
|
||||
`east_angle` float(3,2) unsigned NOT NULL DEFAULT '0.00',
|
||||
`sun_glow_focus` float(3,2) unsigned NOT NULL DEFAULT '0.10',
|
||||
`sun_glow_size` float(3,2) unsigned NOT NULL DEFAULT '1.75',
|
||||
`scene_gamma` float(4,2) unsigned NOT NULL DEFAULT '1.00',
|
||||
`star_brightness` float(3,2) unsigned NOT NULL DEFAULT '0.00',
|
||||
`cloud_color_r` float(3,2) unsigned NOT NULL DEFAULT '0.41',
|
||||
`cloud_color_g` float(3,2) unsigned NOT NULL DEFAULT '0.41',
|
||||
`cloud_color_b` float(3,2) unsigned NOT NULL DEFAULT '0.41',
|
||||
`cloud_color_i` float(3,2) unsigned NOT NULL DEFAULT '0.41',
|
||||
`cloud_x` float(3,2) unsigned NOT NULL DEFAULT '1.00',
|
||||
`cloud_y` float(3,2) unsigned NOT NULL DEFAULT '0.53',
|
||||
`cloud_density` float(3,2) unsigned NOT NULL DEFAULT '1.00',
|
||||
`cloud_coverage` float(3,2) unsigned NOT NULL DEFAULT '0.27',
|
||||
`cloud_scale` float(3,2) unsigned NOT NULL DEFAULT '0.42',
|
||||
`cloud_detail_x` float(3,2) unsigned NOT NULL DEFAULT '1.00',
|
||||
`cloud_detail_y` float(3,2) unsigned NOT NULL DEFAULT '0.53',
|
||||
`cloud_detail_density` float(3,2) unsigned NOT NULL DEFAULT '0.12',
|
||||
`cloud_scroll_x` float(3,2) unsigned NOT NULL DEFAULT '0.20',
|
||||
`cloud_scroll_x_lock` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`cloud_scroll_y` float(3,2) unsigned NOT NULL DEFAULT '0.01',
|
||||
`cloud_scroll_y_lock` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`draw_classic_clouds` tinyint(1) unsigned NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`region_id`)
|
||||
);
|
||||
|
||||
ALTER TABLE estate_settings AUTO_INCREMENT = 100;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 33 #---------------------
|
||||
|
||||
BEGIN;
|
||||
|
||||
@@ -940,8 +940,10 @@ namespace OpenSim.Framework
|
||||
void SetDebugPacketLevel(int newDebug);
|
||||
|
||||
void InPacket(object NewPack);
|
||||
void ProcessPendingPackets();
|
||||
void ProcessInPacket(Packet NewPack);
|
||||
void Close();
|
||||
void Close(bool sendStop);
|
||||
void Kick(string message);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7";
|
||||
private const string VERSION_NUMBER = "0.7CM";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
{
|
||||
Unknown,
|
||||
Dev,
|
||||
RC1,
|
||||
@@ -71,4 +71,4 @@ namespace OpenSim
|
||||
/// </value>
|
||||
public readonly static int MajorInterfaceVersion = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,9 +27,12 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -45,6 +48,111 @@ namespace OpenSim.Framework
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Thread LockedByThread;
|
||||
/// <value>
|
||||
/// An advanced lock for inventory data
|
||||
/// </value>
|
||||
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
/// <summary>
|
||||
/// Are we readlocked by the calling thread?
|
||||
/// </summary>
|
||||
public bool IsReadLockedByMe()
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for reading (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
|
||||
{
|
||||
if (!LockedByThread.IsAlive)
|
||||
{
|
||||
//Locked by dead thread, reset.
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_itemLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount>0)
|
||||
{
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for writing (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
//Enter a write lock, wait indefinately for one to open.
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
while (!m_itemLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
LockedByThread = Thread.CurrentThread;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
@@ -52,13 +160,12 @@ namespace OpenSim.Framework
|
||||
{
|
||||
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
||||
|
||||
lock (this)
|
||||
m_itemLock.EnterReadLock();
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
m_itemLock.ExitReadLock();
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
@@ -997,19 +997,19 @@ namespace OpenSim.Framework
|
||||
{
|
||||
string os = String.Empty;
|
||||
|
||||
if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
{
|
||||
os = Environment.OSVersion.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
os = ReadEtcIssue();
|
||||
}
|
||||
|
||||
if (os.Length > 45)
|
||||
{
|
||||
os = os.Substring(0, 45);
|
||||
}
|
||||
// if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
// {
|
||||
// os = Environment.OSVersion.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// os = ReadEtcIssue();
|
||||
// }
|
||||
//
|
||||
// if (os.Length > 45)
|
||||
// {
|
||||
// os = os.Substring(0, 45);
|
||||
// }
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
@@ -427,7 +427,7 @@ namespace OpenSim
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
else
|
||||
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
|
||||
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
|
||||
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
|
||||
@@ -343,10 +343,26 @@ namespace OpenSim
|
||||
else m_log.Error("[MODULES]: The new RegionModulesController is missing...");
|
||||
|
||||
scene.SetModuleInterfaces();
|
||||
// First Step of bootreport sequence
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.ColdStart(1,scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Loading prins", scene);
|
||||
}
|
||||
|
||||
// Prims have to be loaded after module configuration since some modules may be invoked during the load
|
||||
scene.LoadPrimsFromStorage(regionInfo.originRegionID);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Creating region texture", scene);
|
||||
}
|
||||
|
||||
// moved these here as the terrain texture has to be created after the modules are initialized
|
||||
// and has to happen before the region is registered with the grid.
|
||||
scene.CreateTerrainTexture();
|
||||
@@ -354,6 +370,10 @@ namespace OpenSim
|
||||
// TODO : Try setting resource for region xstats here on scene
|
||||
MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo));
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
|
||||
}
|
||||
try
|
||||
{
|
||||
scene.RegisterRegionWithGrid();
|
||||
@@ -362,11 +382,20 @@ namespace OpenSim
|
||||
{
|
||||
m_log.ErrorFormat("[STARTUP]: Registration of region with grid failed, aborting startup - {0}", e.StackTrace);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
|
||||
}
|
||||
// Carrying on now causes a lot of confusion down the
|
||||
// line - we need to get the user's attention
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration done", scene);
|
||||
}
|
||||
|
||||
// We need to do this after we've initialized the
|
||||
// scripting engines.
|
||||
scene.CreateScriptInstances();
|
||||
@@ -374,6 +403,11 @@ namespace OpenSim
|
||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("ScriptEngine started", scene);
|
||||
}
|
||||
|
||||
m_sceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
@@ -382,6 +416,10 @@ namespace OpenSim
|
||||
clientServer.Start();
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Initializing region modules", scene);
|
||||
}
|
||||
if (do_post_init)
|
||||
{
|
||||
foreach (IRegionModule module in modules)
|
||||
@@ -393,6 +431,12 @@ namespace OpenSim
|
||||
|
||||
mscene = scene;
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is operational", scene);
|
||||
scene.SnmpService.LinkUp(scene);
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
|
||||
return clientServer;
|
||||
@@ -401,6 +445,11 @@ namespace OpenSim
|
||||
private void ShutdownRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is shutting down", scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
IRegionModulesController controller;
|
||||
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
|
||||
{
|
||||
|
||||
@@ -202,6 +202,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_stopPacket = TexturePacketCount();
|
||||
}
|
||||
|
||||
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
|
||||
if (m_stopPacket == 1 && Layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
|
||||
|
||||
m_currentPacket = StartPacket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,6 +337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
private AgentUpdateArgs lastarg;
|
||||
private bool m_IsActive = true;
|
||||
private bool m_IsLoggingOut = false;
|
||||
private bool m_IsPresenceReady = false;
|
||||
|
||||
protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
|
||||
protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
|
||||
@@ -360,6 +361,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private Timer m_propertiesPacketTimer;
|
||||
private List<ObjectPropertiesPacket.ObjectDataBlock> m_propertiesBlocks = new List<ObjectPropertiesPacket.ObjectDataBlock>();
|
||||
private List<Packet> m_pendingPackets;
|
||||
|
||||
#endregion Class Members
|
||||
|
||||
@@ -400,6 +402,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_IsActive; }
|
||||
set { m_IsActive = value; }
|
||||
}
|
||||
|
||||
public bool IsLoggingOut
|
||||
{
|
||||
get { return m_IsLoggingOut; }
|
||||
@@ -463,18 +466,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Client Methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[CLIENT]: Close has been called for {0} attached to scene {1}",
|
||||
Name, m_scene.RegionInfo.RegionName);
|
||||
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
if (sendStop)
|
||||
{
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
|
||||
IsActive = false;
|
||||
|
||||
@@ -1040,6 +1055,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public virtual void SendLayerData(float[] map)
|
||||
{
|
||||
Util.FireAndForget(DoSendLayerData, map);
|
||||
|
||||
// Send it sync, and async. It's not that much data
|
||||
// and it improves user experience just so much!
|
||||
DoSendLayerData(map);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1052,16 +1071,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
try
|
||||
{
|
||||
//for (int y = 0; y < 16; y++)
|
||||
//{
|
||||
// for (int x = 0; x < 16; x++)
|
||||
// {
|
||||
// SendLayerData(x, y, map);
|
||||
// }
|
||||
//}
|
||||
|
||||
// Send LayerData in a spiral pattern. Fun!
|
||||
SendLayerTopRight(map, 0, 0, 15, 15);
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 0; x < 16; x+=4)
|
||||
{
|
||||
SendLayerPacket(x, y, map);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1069,51 +1085,35 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row
|
||||
for (int i = x1; i <= x2; i++)
|
||||
SendLayerData(i, y1, map);
|
||||
|
||||
// Column
|
||||
for (int j = y1 + 1; j <= y2; j++)
|
||||
SendLayerData(x2, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
|
||||
}
|
||||
|
||||
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row in reverse
|
||||
for (int i = x2; i >= x1; i--)
|
||||
SendLayerData(i, y2, map);
|
||||
|
||||
// Column in reverse
|
||||
for (int j = y2 - 1; j >= y1; j--)
|
||||
SendLayerData(x1, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
|
||||
/// </summary>
|
||||
/// <param name="map">heightmap</param>
|
||||
/// <param name="px">X coordinate for patches 0..12</param>
|
||||
/// <param name="py">Y coordinate for patches 0..15</param>
|
||||
// private void SendLayerPacket(float[] map, int y, int x)
|
||||
// {
|
||||
// int[] patches = new int[4];
|
||||
// patches[0] = x + 0 + y * 16;
|
||||
// patches[1] = x + 1 + y * 16;
|
||||
// patches[2] = x + 2 + y * 16;
|
||||
// patches[3] = x + 3 + y * 16;
|
||||
private void SendLayerPacket(int x, int y, float[] map)
|
||||
{
|
||||
int[] patches = new int[4];
|
||||
patches[0] = x + 0 + y * 16;
|
||||
patches[1] = x + 1 + y * 16;
|
||||
patches[2] = x + 2 + y * 16;
|
||||
patches[3] = x + 3 + y * 16;
|
||||
|
||||
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
|
||||
// OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
// }
|
||||
float[] heightmap = (map.Length == 65536) ?
|
||||
map :
|
||||
LLHeightFieldMoronize(map);
|
||||
|
||||
try
|
||||
{
|
||||
Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
catch
|
||||
{
|
||||
for (int px = x ; px < x + 4 ; px++)
|
||||
SendLayerData(px, y, map);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a specified patch to a client
|
||||
@@ -1133,7 +1133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
layerpack.Header.Reliable = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Task);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -3896,6 +3896,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
m_propertiesPacketTimer.Stop();
|
||||
|
||||
if (m_propertiesBlocks.Count == 0)
|
||||
return;
|
||||
|
||||
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[m_propertiesBlocks.Count];
|
||||
|
||||
int index = 0;
|
||||
@@ -4887,6 +4890,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
|
||||
(x.ControlFlags != lastarg.ControlFlags) ||
|
||||
(x.ControlFlags != 0) ||
|
||||
(x.Far != lastarg.Far) ||
|
||||
(x.Flags != lastarg.Flags) ||
|
||||
(x.State != lastarg.State) ||
|
||||
@@ -5258,7 +5262,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
args.Channel = ch;
|
||||
args.From = String.Empty;
|
||||
args.Message = Utils.BytesToString(msg);
|
||||
args.Type = ChatTypeEnum.Shout;
|
||||
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
|
||||
args.Position = new Vector3();
|
||||
args.Scene = Scene;
|
||||
args.Sender = this;
|
||||
@@ -11175,19 +11179,45 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This processes packets which have accumulated while the presence was still in the process of initialising.
|
||||
/// </summary>
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
m_IsPresenceReady = true;
|
||||
if (m_pendingPackets == null)
|
||||
return;
|
||||
foreach (Packet p in m_pendingPackets)
|
||||
{
|
||||
ProcessInPacket(p);
|
||||
}
|
||||
m_pendingPackets.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Entryway from the client to the simulator. All UDP packets from the client will end up here
|
||||
/// </summary>
|
||||
/// <param name="Pack">OpenMetaverse.packet</param>
|
||||
public void ProcessInPacket(Packet Pack)
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
if (!m_IsPresenceReady)
|
||||
{
|
||||
if (m_pendingPackets == null)
|
||||
{
|
||||
m_pendingPackets = new List<Packet>();
|
||||
}
|
||||
m_pendingPackets.Add(Pack);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_debugPacketLevel >= 255)
|
||||
m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type);
|
||||
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
if (!ProcessPacketMethod(Pack))
|
||||
m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type);
|
||||
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
}
|
||||
}
|
||||
|
||||
private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket)
|
||||
|
||||
@@ -899,7 +899,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
client.OnLogout += LogoutHandler;
|
||||
|
||||
// Start the IClientAPI
|
||||
client.Start();
|
||||
// Spin it off so that it doesn't clog up the LLUDPServer
|
||||
Util.FireAndForget(delegate(object o) { client.Start(); });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -915,7 +916,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_scene.TryGetClient(udpClient.AgentID, out client))
|
||||
{
|
||||
client.IsLoggingOut = true;
|
||||
client.Close();
|
||||
client.Close(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
this.parent = parent;
|
||||
MaxBurst = maxBurst;
|
||||
DripRate = dripRate;
|
||||
lastDrip = Environment.TickCount & Int32.MaxValue;
|
||||
lastDrip = Environment.TickCount;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -143,41 +143,31 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount)
|
||||
{
|
||||
bool dummy;
|
||||
return RemoveTokens(amount, out dummy);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove a given number of tokens from the bucket
|
||||
/// </summary>
|
||||
/// <param name="amount">Number of tokens to remove from the bucket</param>
|
||||
/// <param name="dripSucceeded">True if tokens were added to the bucket
|
||||
/// during this call, otherwise false</param>
|
||||
/// <returns>True if the requested number of tokens were removed from
|
||||
/// the bucket, otherwise false</returns>
|
||||
public bool RemoveTokens(int amount, out bool dripSucceeded)
|
||||
{
|
||||
if (maxBurst == 0)
|
||||
{
|
||||
dripSucceeded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
dripSucceeded = Drip();
|
||||
|
||||
if (content - amount >= 0)
|
||||
if (amount > maxBurst)
|
||||
{
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
return false;
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
throw new Exception("amount " + amount + " exceeds maxBurst " + maxBurst);
|
||||
}
|
||||
else
|
||||
|
||||
Drip();
|
||||
|
||||
if (content < amount)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parent != null && !parent.RemoveTokens(amount))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
content -= amount;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -193,25 +183,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
content = maxBurst;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
int now = Environment.TickCount;
|
||||
int deltaMS = now - lastDrip;
|
||||
lastDrip = now;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
int deltaMS = now - lastDrip;
|
||||
|
||||
if (deltaMS <= 0)
|
||||
{
|
||||
if (deltaMS < 0)
|
||||
lastDrip = now;
|
||||
return false;
|
||||
}
|
||||
|
||||
int dripAmount = deltaMS * tokensPerMS;
|
||||
|
||||
content = Math.Min(content + dripAmount, maxBurst);
|
||||
lastDrip = now;
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
long dripAmount = (long)deltaMS * (long)tokensPerMS + (long)content;
|
||||
if (dripAmount > maxBurst)
|
||||
{
|
||||
dripAmount = maxBurst;
|
||||
}
|
||||
content = (int)dripAmount;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -35,6 +36,7 @@ using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
@@ -190,8 +192,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus)
|
||||
{
|
||||
return RezSingleAttachmentFromInventory(remoteClient, itemID, AttachmentPt, true, null);
|
||||
}
|
||||
|
||||
public UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt);
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(remoteClient, itemID, AttachmentPt, doc);
|
||||
|
||||
if (updateInventoryStatus)
|
||||
{
|
||||
@@ -210,7 +218,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, XmlDocument doc)
|
||||
{
|
||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
@@ -236,13 +244,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
if (doc != null)
|
||||
{
|
||||
objatt.LoadScriptState(doc);
|
||||
objatt.ResetOwnerChangeFlag();
|
||||
}
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 3 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 3);
|
||||
objatt.ResumeScripts();
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
//m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -271,7 +285,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
||||
{
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
if (m_scene.InventoryService != null)
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /*att.UUID*/);
|
||||
}
|
||||
@@ -316,6 +331,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
// XXYY!!
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
if (item == null)
|
||||
m_log.Error("[ATTACHMENT]: item == null");
|
||||
if (m_scene == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene == null");
|
||||
if (m_scene.InventoryService == null)
|
||||
m_log.Error("[ATTACHMENT]: m_scene.InventoryService == null");
|
||||
item = m_scene.InventoryService.GetItem(item);
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
|
||||
|
||||
@@ -404,6 +425,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
if (group.GetFromItemID() == itemID)
|
||||
{
|
||||
m_scene.EventManager.TriggerOnAttach(group.LocalId, itemID, UUID.Zero);
|
||||
// CM / XMREngine!!!! Needed to conclude attach event
|
||||
SceneObjectSerializer.ToOriginalXmlFormat(group);
|
||||
group.DetachToInventoryPrep();
|
||||
m_log.Debug("[ATTACHMENTS MODULE]: Saving attachpoint: " + ((uint)group.GetAttachmentPoint()).ToString());
|
||||
m_scene.UpdateKnownItem(remoteClient, group,group.GetFromItemID(), group.OwnerID);
|
||||
|
||||
@@ -49,7 +49,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
private int m_shoutdistance = 100;
|
||||
private int m_whisperdistance = 10;
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
|
||||
private List<string> FreezeCache = new List<string>();
|
||||
private string m_adminPrefix = "";
|
||||
internal object m_syncy = new object();
|
||||
|
||||
internal IConfig m_config;
|
||||
@@ -76,6 +77,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
||||
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
||||
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
||||
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
|
||||
}
|
||||
|
||||
public virtual void AddRegion(Scene scene)
|
||||
@@ -171,7 +173,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
|
||||
{
|
||||
if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
|
||||
c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
|
||||
@@ -185,6 +195,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
||||
{
|
||||
string fromName = c.From;
|
||||
string fromNamePrefix = "";
|
||||
UUID fromID = UUID.Zero;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
@@ -207,7 +218,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
fromPos = avatar.AbsolutePosition;
|
||||
fromName = avatar.Name;
|
||||
fromID = c.Sender.AgentId;
|
||||
|
||||
if (avatar.GodLevel > 200)
|
||||
{
|
||||
fromNamePrefix = m_adminPrefix;
|
||||
}
|
||||
break;
|
||||
|
||||
case ChatSourceType.Object:
|
||||
@@ -227,7 +241,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType);
|
||||
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
if (Presencecheck != null)
|
||||
{
|
||||
if (Presencecheck.IsEitherBannedOrRestricted(c.SenderUUID) != true)
|
||||
{
|
||||
TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix+fromName, c.Type, message, sourceType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -270,25 +292,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||
|
||||
((Scene)c.Scene).ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
});
|
||||
if (c.Scene != null)
|
||||
{
|
||||
((Scene)c.Scene).ForEachScenePresence
|
||||
(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
// ignore chat from child agents
|
||||
if (presence.IsChildAgent) return;
|
||||
|
||||
IClientAPI client = presence.ControllingClient;
|
||||
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -317,5 +343,35 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
presence.ControllingClient.SendChatMessage(message, (byte) type, fromPos, fromName,
|
||||
fromAgentID,(byte)src,(byte)ChatAudibleLevel.Fully);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
System.Threading.Timer Timer;
|
||||
if (flags == 0)
|
||||
{
|
||||
FreezeCache.Add(target.ToString());
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
|
||||
Timers.Add(target, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreezeCache.Remove(target.ToString());
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
UUID target = (UUID)avatar;
|
||||
FreezeCache.Remove(target.ToString());
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected List<Scene> m_Scenes = new List<Scene>();
|
||||
@@ -201,9 +201,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
UserFriendData data = m_Friends[principalID];
|
||||
|
||||
string searchFor = friendID.ToString();
|
||||
foreach (FriendInfo fi in data.Friends)
|
||||
{
|
||||
if (fi.Friend == friendID.ToString())
|
||||
if (fi.Friend == searchFor)
|
||||
return (uint)fi.TheirFlags;
|
||||
}
|
||||
return 0;
|
||||
@@ -234,7 +235,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
newFriends.RegionID = UUID.Zero;
|
||||
|
||||
m_Friends.Add(client.AgentId, newFriends);
|
||||
|
||||
|
||||
//StatusChange(client.AgentId, true);
|
||||
}
|
||||
|
||||
@@ -289,7 +290,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
// Inform the friends that this user is online
|
||||
StatusChange(agentID, true);
|
||||
|
||||
|
||||
// Register that we need to send the list of online friends to this user
|
||||
lock (m_NeedsListOfFriends)
|
||||
if (!m_NeedsListOfFriends.Contains(agentID))
|
||||
@@ -439,11 +440,47 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
if (((fi.MyFlags & 1) != 0) && (fi.TheirFlags != -1))
|
||||
friendList.Add(fi);
|
||||
}
|
||||
/*
|
||||
foreach (FriendInfo fi in friendList)
|
||||
{
|
||||
// Notify about this user status
|
||||
StatusNotify(fi, agentID, online);
|
||||
}
|
||||
*/
|
||||
|
||||
StatusNotifyMass(friendList, agentID, online);
|
||||
}
|
||||
}
|
||||
|
||||
private void StatusNotifyMass(List<FriendInfo> friendList, UUID userID, bool online)
|
||||
{
|
||||
int fct = friendList.Count;
|
||||
string[] friendIDs = new string[fct];
|
||||
int notlocal = 0;
|
||||
for (int x = 0 ; x < fct ; x++)
|
||||
{
|
||||
UUID friendID = UUID.Zero;
|
||||
if (UUID.TryParse(friendList[x].Friend, out friendID))
|
||||
{
|
||||
if (!LocalStatusNotification(userID, friendID, online))
|
||||
{
|
||||
friendIDs[notlocal++] = friendID.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(friendIDs);
|
||||
|
||||
for (int x = 0; x < friendSessions.GetLength(0); x++)
|
||||
{
|
||||
if (friendIDs.Length <= x)
|
||||
continue;
|
||||
PresenceInfo friendSession = friendSessions[x];
|
||||
if (friendSession != null)
|
||||
{
|
||||
GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID);
|
||||
m_FriendsSimConnector.StatusNotify(region, userID, new UUID(friendIDs[x]), online);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
// Try local
|
||||
if (LocalStatusNotification(userID, friendID, online))
|
||||
return;
|
||||
|
||||
|
||||
// The friend is not here [as root]. Let's forward.
|
||||
PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() });
|
||||
if (friendSessions != null && friendSessions.Length > 0)
|
||||
@@ -476,7 +513,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
if (im.dialog == (byte)OpenMetaverse.InstantMessageDialog.FriendshipOffered)
|
||||
{
|
||||
{
|
||||
// we got a friendship offer
|
||||
UUID principalID = new UUID(im.fromAgentID);
|
||||
UUID friendID = new UUID(im.toAgentID);
|
||||
@@ -701,7 +738,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
// we're done
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -172,13 +172,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void RetrieveInstantMessages(IClientAPI client)
|
||||
{
|
||||
if (m_RestURL != "")
|
||||
{
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
if (m_RestURL == String.Empty)
|
||||
return;
|
||||
|
||||
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING] Retrieving stored messages for {0}", client.AgentId);
|
||||
|
||||
List<GridInstantMessage> msglist = SynchronousRestObjectPoster.BeginPostObject<UUID, List<GridInstantMessage>>(
|
||||
"POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
|
||||
|
||||
if (msglist != null)
|
||||
{
|
||||
foreach (GridInstantMessage im in msglist)
|
||||
{
|
||||
// client.SendInstantMessage(im);
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
// Check if this is ours to handle
|
||||
//
|
||||
m_log.Info("OnFridInstantMessage");
|
||||
//m_log.Info("OnFridInstantMessage");
|
||||
if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
|
||||
return;
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
|
||||
// it's actually doing a lot of work.
|
||||
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
||||
if (endPoint.Address != null)
|
||||
if (endPoint != null && endPoint.Address != null)
|
||||
{
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
@@ -825,15 +825,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||
|
||||
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
||||
if (eq != null)
|
||||
IPEndPoint neighbourExternal = neighbourRegion.ExternalEndPoint;
|
||||
if (neighbourExternal != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
||||
capsPath);
|
||||
if (eq != null)
|
||||
{
|
||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourExternal,
|
||||
capsPath);
|
||||
}
|
||||
}
|
||||
|
||||
if (!WaitForCallback(agent.UUID))
|
||||
@@ -906,10 +910,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.child = true;
|
||||
agent.Appearance = sp.Appearance;
|
||||
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
|
||||
IPEndPoint external = region.ExternalEndPoint;
|
||||
if (external != null)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, external, true,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1038,6 +1046,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
//neighbour.ExternalEndPoint may return null, which will be caught
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
|
||||
@@ -290,6 +290,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
foreach (Scene s in m_sceneList)
|
||||
{
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
{
|
||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
||||
return s.IncomingCloseChildAgent(id);
|
||||
}
|
||||
}
|
||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Object-related communications
|
||||
*/
|
||||
|
||||
@@ -253,6 +253,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.CloseChildAgent(destination, id))
|
||||
return true;
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
return m_remoteConnector.CloseChildAgent(destination, id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
|
||||
@@ -261,10 +261,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// Fix ownership/creator of inventory items
|
||||
// Not doing so results in inventory items
|
||||
// being no copy/no mod for everyone
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
{
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
if (!ResolveUserUuid(kvp.Value.OwnerID))
|
||||
{
|
||||
@@ -276,6 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
}
|
||||
}
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
|
||||
|
||||
@@ -82,6 +82,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
|
||||
|
||||
private bool m_allowedForcefulBans = true;
|
||||
private UUID DefaultGodParcelGroup;
|
||||
private string DefaultGodParcelName;
|
||||
|
||||
// caches ExtendedLandData
|
||||
private Cache parcelInfoCache;
|
||||
@@ -96,6 +98,12 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig cnf = source.Configs["LandManagement"];
|
||||
if (cnf != null)
|
||||
{
|
||||
DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
|
||||
DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -351,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
|
||||
{
|
||||
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
|
||||
if (parcelAvatarIsEntering.IsEitherBannedOrRestricted(avatar.UUID))
|
||||
{
|
||||
SendYouAreBannedNotice(avatar);
|
||||
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
|
||||
@@ -991,6 +999,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//Owner Flag
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
|
||||
{
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.SalePrice > 0 &&
|
||||
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
|
||||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
|
||||
@@ -1520,5 +1532,321 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
UpdateLandObject(localID, land.LandData);
|
||||
}
|
||||
|
||||
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
|
||||
{
|
||||
ILandObject land = null;
|
||||
List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
|
||||
foreach (ILandObject landObject in Land)
|
||||
{
|
||||
if (landObject.LandData.LocalID == landID)
|
||||
{
|
||||
land = landObject;
|
||||
}
|
||||
}
|
||||
land.DeedToGroup(DefaultGodParcelGroup);
|
||||
land.LandData.Name = DefaultGodParcelName;
|
||||
land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
|
||||
{
|
||||
ScenePresence SP;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
|
||||
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
|
||||
if (SP.GodLevel != 0)
|
||||
{
|
||||
if (flags == 0) //All parcels, scripted or not
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //All parcels, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //not target parcel, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
|
||||
if (landobject.LandData.OwnerID != e.OwnerID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
foreach (SceneObjectGroup ol in returns)
|
||||
{
|
||||
ReturnObject(ol, client);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
|
||||
{
|
||||
SceneObjectGroup[] objs = new SceneObjectGroup[1];
|
||||
objs[0] = obj;
|
||||
((Scene)client.Scene).returnObjects(objs, client.AgentId);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
|
||||
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
System.Threading.Timer Timer;
|
||||
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
if (flags == 0)
|
||||
{
|
||||
targetAvatar.AllowMovement = false;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
|
||||
Timers.Add(targetAvatar.UUID, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetAvatar.AllowMovement = true;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
ScenePresence targetAvatar = (ScenePresence)avatar;
|
||||
targetAvatar.AllowMovement = true;
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
|
||||
}
|
||||
|
||||
|
||||
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
//Just eject
|
||||
if (flags == 0)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//Eject and ban
|
||||
if (flags == 1)
|
||||
{
|
||||
if (targetAvatar.GodLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcel(client.AgentId, land))
|
||||
return;
|
||||
|
||||
Vector3 position = new Vector3(0, 0, 0);
|
||||
List<ILandObject> allParcels = new List<ILandObject>();
|
||||
allParcels = AllParcels();
|
||||
if (allParcels.Count != 1)
|
||||
{
|
||||
foreach (ILandObject parcel in allParcels)
|
||||
{
|
||||
if (parcel.LandData.GlobalID != land.LandData.GlobalID)
|
||||
{
|
||||
if (parcel.IsEitherBannedOrRestricted(targetAvatar.UUID) != true)
|
||||
{
|
||||
for (int x = 1; x <= Constants.RegionSize; x += 2)
|
||||
{
|
||||
for (int y = 1; y <= Constants.RegionSize; y += 2)
|
||||
{
|
||||
if (parcel.ContainsPoint(x, y))
|
||||
{
|
||||
position = new Vector3(x, y, targetAvatar.AbsolutePosition.Z);
|
||||
targetAvatar.TeleportWithMomentum(position);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector3 targetVector;
|
||||
if (targetAvatar.AbsolutePosition.X > targetAvatar.AbsolutePosition.Y)
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.X > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(Constants.RegionSize, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(0, targetAvatar.AbsolutePosition.Y, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (targetAvatar.AbsolutePosition.Y > .5 * Constants.RegionSize)
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, Constants.RegionSize, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetVector = new Vector3(targetAvatar.AbsolutePosition.X, 0, targetAvatar.AbsolutePosition.Z); ;
|
||||
targetAvatar.TeleportWithMomentum(targetVector);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected and banned by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected and Banned.");
|
||||
ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Time = new DateTime();
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -821,11 +821,20 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
using OpenSim.Framework;
|
||||
@@ -82,6 +83,10 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus);
|
||||
|
||||
// Same as above, but also load script states from a separate doc
|
||||
UUID RezSingleAttachmentFromInventory(
|
||||
IClientAPI remoteClient, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
|
||||
|
||||
/// <summary>
|
||||
/// Rez multiple attachments from a user's inventory
|
||||
/// </summary>
|
||||
@@ -132,4 +137,4 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </param>
|
||||
void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="stateSource"></param>
|
||||
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
@@ -214,5 +216,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// A <see cref="Dictionary`2"/>
|
||||
/// </returns>
|
||||
Dictionary<UUID, string> GetScriptStates();
|
||||
Dictionary<UUID, string> GetScriptStates(bool oldIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <returns></returns>
|
||||
bool SendReleaseAgent(ulong regionHandle, UUID id, string uri);
|
||||
|
||||
/// <summary>
|
||||
/// Close chid agent.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
bool SendCloseChildAgent(ulong regionHandle, UUID id);
|
||||
|
||||
/// <summary>
|
||||
/// Close agent.
|
||||
/// </summary>
|
||||
|
||||
27
OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
Normal file
27
OpenSim/Region/Framework/Interfaces/ISnmpModule.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
///////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (c) Careminster LImited, Melanie Thielker and the Meta7 Team
|
||||
//
|
||||
// This file is not open source. All rights reserved
|
||||
// Mod 2
|
||||
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
public interface ISnmpModule
|
||||
{
|
||||
void Trap(int code, string Message, Scene scene);
|
||||
void Critical(string Message, Scene scene);
|
||||
void Warning(string Message, Scene scene);
|
||||
void Major(string Message, Scene scene);
|
||||
void ColdStart(int step , Scene scene);
|
||||
void Shutdown(int step , Scene scene);
|
||||
//
|
||||
// Node Start/stop events
|
||||
//
|
||||
void LinkUp(Scene scene);
|
||||
void LinkDown(Scene scene);
|
||||
void BootInfo(string data, Scene scene);
|
||||
void trapDebug(string Module,string data, Scene scene);
|
||||
void trapXMRE(int data, string Message, Scene scene);
|
||||
|
||||
}
|
||||
@@ -226,7 +226,8 @@ namespace OpenSim.Region.Framework
|
||||
"[MODULES]: Could not load types for [{0}]. Exception {1}", pluginAssembly.FullName, e);
|
||||
|
||||
// justincc: Right now this is fatal to really get the user's attention
|
||||
throw e;
|
||||
// TomMeta: WTF? No, how about we /don't/ throw a fatal exception when there's no need to?
|
||||
//throw e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,10 +53,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
{
|
||||
get { return m_movementAnimation; }
|
||||
}
|
||||
protected string m_movementAnimation = "DEFAULT";
|
||||
|
||||
// protected string m_movementAnimation = "DEFAULT"; //KF: 'DEFAULT' does not exist!
|
||||
protected string m_movementAnimation = "CROUCH"; //KF: CROUCH ensures reliable Av Anim. init.
|
||||
private int m_animTickFall;
|
||||
private int m_animTickJump;
|
||||
// private int m_animTickJump;
|
||||
public int m_animTickJump; // ScenePresence has to see this to control +Z force
|
||||
|
||||
/// <value>
|
||||
/// The scene presence that this animator applies to
|
||||
@@ -123,8 +124,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
/// </summary>
|
||||
public void TrySetMovementAnimation(string anim)
|
||||
{
|
||||
//m_log.DebugFormat("Updating movement animation to {0}", anim);
|
||||
|
||||
if (!m_scenePresence.IsChildAgent)
|
||||
{
|
||||
if (m_animations.TrySetDefaultAnimation(
|
||||
@@ -146,10 +145,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
const float PREJUMP_DELAY = 0.25f;
|
||||
|
||||
#region Inputs
|
||||
if (m_scenePresence.SitGround)
|
||||
{
|
||||
return "SIT_GROUND_CONSTRAINED";
|
||||
}
|
||||
|
||||
AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags;
|
||||
PhysicsActor actor = m_scenePresence.PhysicsActor;
|
||||
|
||||
@@ -159,11 +155,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
Vector3 left = Vector3.Transform(Vector3.UnitY, rotMatrix);
|
||||
|
||||
// Check control flags
|
||||
bool heldForward =
|
||||
(((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) || ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS));
|
||||
bool heldBack = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG;
|
||||
bool heldLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS;
|
||||
bool heldRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG;
|
||||
bool heldForward = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_AT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_POS);
|
||||
bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG);
|
||||
bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS);
|
||||
bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG);
|
||||
//bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT;
|
||||
//bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT;
|
||||
bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
|
||||
@@ -266,7 +261,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
m_animTickJump = Environment.TickCount;
|
||||
return "PREJUMP";
|
||||
}
|
||||
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 1000.0f)
|
||||
else if (Environment.TickCount - m_animTickJump > PREJUMP_DELAY * 800.0f)
|
||||
{
|
||||
// Start actual jump
|
||||
if (m_animTickJump == -1)
|
||||
@@ -316,7 +311,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
public void UpdateMovementAnimations()
|
||||
{
|
||||
m_movementAnimation = GetMovementAnimation();
|
||||
|
||||
if (m_movementAnimation == "PREJUMP" && !m_scenePresence.Scene.m_usePreJump)
|
||||
{
|
||||
// This was the previous behavior before PREJUMP
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private readonly Dictionary<UUID,EntityBase> m_eb_uuid = new Dictionary<UUID, EntityBase>();
|
||||
private readonly Dictionary<uint, EntityBase> m_eb_localID = new Dictionary<uint, EntityBase>();
|
||||
//private readonly Dictionary<UUID, ScenePresence> m_pres_uuid = new Dictionary<UUID, ScenePresence>();
|
||||
private readonly Object m_lock = new Object();
|
||||
private System.Threading.ReaderWriterLockSlim m_lock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
[Obsolete("Use Add() instead.")]
|
||||
public void Add(UUID id, EntityBase eb)
|
||||
@@ -50,7 +50,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void Add(EntityBase entity)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -62,11 +63,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat("Add Entity failed: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertOrReplace(EntityBase entity)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -78,15 +84,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat("Insert or Replace Entity failed: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
m_eb_uuid.Clear();
|
||||
m_eb_localID.Clear();
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public int Count
|
||||
@@ -123,7 +138,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool Remove(uint localID)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -141,11 +157,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public bool Remove(UUID id)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -163,13 +184,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
public List<EntityBase> GetAllByType<T>()
|
||||
{
|
||||
List<EntityBase> tmp = new List<EntityBase>();
|
||||
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -187,23 +213,33 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
tmp = null;
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public List<EntityBase> GetEntities()
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return new List<EntityBase>(m_eb_uuid.Values);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
public EntityBase this[UUID id]
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
EntityBase entity;
|
||||
if (m_eb_uuid.TryGetValue(id, out entity))
|
||||
@@ -211,6 +247,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -222,7 +262,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
EntityBase entity;
|
||||
if (m_eb_localID.TryGetValue(localID, out entity))
|
||||
@@ -230,6 +271,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -239,18 +284,28 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool TryGetValue(UUID key, out EntityBase obj)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return m_eb_uuid.TryGetValue(key, out obj);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetValue(uint key, out EntityBase obj)
|
||||
{
|
||||
lock (m_lock)
|
||||
m_lock.EnterReadLock();
|
||||
try
|
||||
{
|
||||
return m_eb_localID.TryGetValue(key, out obj);
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_lock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -94,6 +94,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void AddInventoryItem(UUID AgentID, InventoryItemBase item)
|
||||
{
|
||||
InventoryFolderBase folder;
|
||||
|
||||
if (item.Folder == UUID.Zero)
|
||||
{
|
||||
folder = InventoryService.GetFolderForType(AgentID, (AssetType)item.AssetType);
|
||||
if (folder == null)
|
||||
{
|
||||
folder = InventoryService.GetRootFolder(AgentID);
|
||||
|
||||
if (folder == null)
|
||||
return;
|
||||
}
|
||||
|
||||
item.Folder = folder.ID;
|
||||
}
|
||||
|
||||
if (InventoryService.AddItem(item))
|
||||
{
|
||||
int userlevel = 0;
|
||||
@@ -214,8 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// Needs to determine which engine was running it and use that
|
||||
//
|
||||
part.Inventory.CreateScriptInstance(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
errors = part.Inventory.GetScriptErrors(item.ItemID);
|
||||
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -836,8 +851,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void RemoveTaskInventory(IClientAPI remoteClient, UUID itemID, uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
SceneObjectGroup group = null;
|
||||
if (part != null)
|
||||
{
|
||||
group = part.ParentGroup;
|
||||
}
|
||||
if (part != null && group != null)
|
||||
{
|
||||
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
||||
if (item == null)
|
||||
|
||||
@@ -149,6 +149,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public IXfer XferManager;
|
||||
|
||||
protected ISnmpModule m_snmpService = null;
|
||||
public ISnmpModule SnmpService
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_snmpService == null)
|
||||
{
|
||||
m_snmpService = RequestModuleInterface<ISnmpModule>();
|
||||
}
|
||||
|
||||
return m_snmpService;
|
||||
}
|
||||
}
|
||||
|
||||
protected IAssetService m_AssetService;
|
||||
protected IAuthorizationService m_AuthorizationService;
|
||||
|
||||
@@ -608,6 +622,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Load region settings
|
||||
m_regInfo.RegionSettings = m_storageManager.DataStore.LoadRegionSettings(m_regInfo.RegionID);
|
||||
m_regInfo.WindlightSettings = m_storageManager.DataStore.LoadRegionWindlightSettings(m_regInfo.RegionID);
|
||||
|
||||
if (m_storageManager.EstateDataStore != null)
|
||||
{
|
||||
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
|
||||
@@ -710,7 +726,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
|
||||
// TODO: Change default to true once the feature is supported
|
||||
m_usePreJump = startupConfig.GetBoolean("enableprejump", false);
|
||||
|
||||
m_usePreJump = true; // Above line fails!?
|
||||
m_maxNonphys = startupConfig.GetFloat("NonPhysicalPrimMax", m_maxNonphys);
|
||||
if (RegionInfo.NonphysPrimMax > 0)
|
||||
{
|
||||
@@ -1029,6 +1045,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds)
|
||||
{
|
||||
Restart(seconds, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given float seconds, this will restart the region. showDialog will optionally alert the users.
|
||||
/// </summary>
|
||||
/// <param name="seconds">float indicating duration before restart.</param>
|
||||
public virtual void Restart(float seconds, bool showDialog)
|
||||
{
|
||||
// notifications are done in 15 second increments
|
||||
// so .. if the number of seconds is less then 15 seconds, it's not really a restart request
|
||||
@@ -1050,8 +1075,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
|
||||
m_log.Info("[REGION]: Restarting Region in " + (seconds / 60) + " minutes");
|
||||
m_restartTimer.Start();
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
if (showDialog)
|
||||
{
|
||||
m_dialogModule.SendNotificationToUsersInRegion(
|
||||
UUID.Random(), String.Empty, RegionInfo.RegionName + String.Format(": Restarting in {0} Minutes", (int)(seconds / 60.0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1407,16 +1435,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Check if any objects have reached their targets
|
||||
CheckAtTargets();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
// Run through all ScenePresences looking for updates
|
||||
// Presence updates and queued object updates for each presence are sent to clients
|
||||
if (m_frame % m_update_presences == 0)
|
||||
m_sceneGraph.UpdatePresences();
|
||||
|
||||
// Update SceneObjectGroups that have scheduled themselves for updates
|
||||
// Objects queue their updates onto all scene presences
|
||||
if (m_frame % m_update_objects == 0)
|
||||
m_sceneGraph.UpdateObjectGroups();
|
||||
|
||||
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
|
||||
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
|
||||
m_sceneGraph.UpdatePreparePhysics();
|
||||
@@ -2118,7 +2146,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
|
||||
{
|
||||
return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete every object from the scene. This does not include attachments worn by avatars.
|
||||
@@ -3464,12 +3492,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
// We have a zombie from a crashed session. Kill it.
|
||||
m_log.DebugFormat("[SCENE]: Zombie scene presence detected for {0} in {1}", agent.AgentID, RegionInfo.RegionName);
|
||||
sp.ControllingClient.Close();
|
||||
sp.ControllingClient.Close(false);
|
||||
}
|
||||
}
|
||||
|
||||
CapsModule.AddCapsHandler(agent.AgentID);
|
||||
|
||||
if ((teleportFlags & ((uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.ViaLocation | (uint)TeleportFlags.ViaLandmark | (uint)TeleportFlags.Default)) != 0)
|
||||
System.Threading.Thread.Sleep(2000);
|
||||
|
||||
if (!agent.child)
|
||||
{
|
||||
if (TestBorderCross(agent.startpos,Cardinals.E))
|
||||
@@ -3528,6 +3559,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
// Honor parcel landing type and position.
|
||||
/*
|
||||
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
|
||||
if (land != null)
|
||||
{
|
||||
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero)
|
||||
@@ -3535,6 +3568,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos = land.LandData.UserLocation;
|
||||
}
|
||||
}
|
||||
*/// This is now handled properly in ScenePresence.MakeRootAgent
|
||||
}
|
||||
|
||||
agent.teleportFlags = teleportFlags;
|
||||
@@ -3883,12 +3917,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, false);
|
||||
}
|
||||
|
||||
public bool IncomingCloseChildAgent(UUID agentID)
|
||||
{
|
||||
return IncomingCloseAgent(agentID, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tell a single agent to disconnect from the region.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="agentID"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID)
|
||||
/// <param name="childOnly"></param>
|
||||
public bool IncomingCloseAgent(UUID agentID, bool childOnly)
|
||||
{
|
||||
//m_log.DebugFormat("[SCENE]: Processing incoming close agent for {0}", agentID);
|
||||
|
||||
@@ -3900,7 +3944,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_sceneGraph.removeUserCount(false);
|
||||
}
|
||||
else
|
||||
else if (!childOnly)
|
||||
{
|
||||
m_sceneGraph.removeUserCount(true);
|
||||
}
|
||||
@@ -3916,9 +3960,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
presence.ControllingClient.SendShutdownConnectionNotice();
|
||||
presence.ControllingClient.Close(false);
|
||||
}
|
||||
else if (!childOnly)
|
||||
{
|
||||
presence.ControllingClient.Close(true);
|
||||
}
|
||||
|
||||
presence.ControllingClient.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
uint x = 0, y = 0;
|
||||
Utils.LongToUInts(regionHandle, out x, out y);
|
||||
GridRegion destination = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||
m_scene.SimulationService.CloseAgent(destination, agentID);
|
||||
m_scene.SimulationService.CloseChildAgent(destination, agentID);
|
||||
}
|
||||
|
||||
private void SendCloseChildAgentCompleted(IAsyncResult iar)
|
||||
@@ -300,7 +300,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
d);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||
{
|
||||
return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#region Fields
|
||||
|
||||
protected object m_presenceLock = new object();
|
||||
protected OpenMetaverse.ReaderWriterLockSlim m_scenePresencesLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
protected Dictionary<UUID, ScenePresence> m_scenePresenceMap = new Dictionary<UUID, ScenePresence>();
|
||||
protected List<ScenePresence> m_scenePresenceArray = new List<ScenePresence>();
|
||||
|
||||
@@ -133,13 +133,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
protected internal void Close()
|
||||
{
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>();
|
||||
List<ScenePresence> newlist = new List<ScenePresence>();
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
lock (m_dictionary_lock)
|
||||
{
|
||||
@@ -228,6 +233,30 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
protected internal bool AddRestoredSceneObject(
|
||||
SceneObjectGroup sceneObject, bool attachToBackup, bool alreadyPersisted)
|
||||
{
|
||||
// KF: Check for out-of-region, move inside and make static.
|
||||
Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X,
|
||||
sceneObject.RootPart.GroupPosition.Y,
|
||||
sceneObject.RootPart.GroupPosition.Z);
|
||||
if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 ||
|
||||
npos.X > Constants.RegionSize ||
|
||||
npos.Y > Constants.RegionSize))
|
||||
{
|
||||
if (npos.X < 0.0) npos.X = 1.0f;
|
||||
if (npos.Y < 0.0) npos.Y = 1.0f;
|
||||
if (npos.Z < 0.0) npos.Z = 0.0f;
|
||||
if (npos.X > Constants.RegionSize) npos.X = Constants.RegionSize - 1.0f;
|
||||
if (npos.Y > Constants.RegionSize) npos.Y = Constants.RegionSize - 1.0f;
|
||||
|
||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||
{
|
||||
part.GroupPosition = npos;
|
||||
}
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
sceneObject.RootPart.AngularVelocity = Vector3.Zero;
|
||||
sceneObject.RootPart.Acceleration = Vector3.Zero;
|
||||
sceneObject.RootPart.Velocity = Vector3.Zero;
|
||||
}
|
||||
|
||||
if (!alreadyPersisted)
|
||||
{
|
||||
sceneObject.ForceInventoryPersistence();
|
||||
@@ -524,7 +553,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
Entities[presence.UUID] = presence;
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -548,6 +578,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_scenePresenceMap = newmap;
|
||||
m_scenePresenceArray = newlist;
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -562,7 +596,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agentID);
|
||||
}
|
||||
|
||||
lock (m_presenceLock)
|
||||
m_scenePresencesLock.EnterWriteLock();
|
||||
try
|
||||
{
|
||||
Dictionary<UUID, ScenePresence> newmap = new Dictionary<UUID, ScenePresence>(m_scenePresenceMap);
|
||||
List<ScenePresence> newlist = new List<ScenePresence>(m_scenePresenceArray);
|
||||
@@ -583,6 +618,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.WarnFormat("[SCENE] Tried to remove non-existent scene presence with agent ID {0} from scene ScenePresences list", agentID);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_scenePresencesLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
|
||||
protected internal void SwapRootChildAgent(bool direction_RC_CR_T_F)
|
||||
@@ -1460,10 +1499,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="childPrims"></param>
|
||||
protected internal void LinkObjects(SceneObjectPart root, List<SceneObjectPart> children)
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
if (parentGroup == null) return;
|
||||
Monitor.Enter(m_updateLock);
|
||||
|
||||
try
|
||||
{
|
||||
SceneObjectGroup parentGroup = root.ParentGroup;
|
||||
parentGroup.areUpdatesSuspended = true;
|
||||
|
||||
List<SceneObjectGroup> childGroups = new List<SceneObjectGroup>();
|
||||
if (parentGroup != null)
|
||||
@@ -1502,12 +1544,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// occur on link to invoke this elsewhere (such as object selection)
|
||||
parentGroup.RootPart.CreateSelected = true;
|
||||
parentGroup.TriggerScriptChangedEvent(Changed.LINK);
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
|
||||
}
|
||||
finally
|
||||
{
|
||||
parentGroup.areUpdatesSuspended = false;
|
||||
parentGroup.HasGroupChanged = true;
|
||||
parentGroup.ScheduleGroupForFullUpdate();
|
||||
Monitor.Exit(m_updateLock);
|
||||
}
|
||||
}
|
||||
@@ -1544,11 +1586,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
if (childParts.Count > 0)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
try
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart child in childParts)
|
||||
{
|
||||
// Unlink all child parts from their groups
|
||||
//
|
||||
child.ParentGroup.DelinkFromGroup(child, true);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
childParts[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (SceneObjectPart root in rootParts)
|
||||
@@ -1572,10 +1625,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (numChildren > 1)
|
||||
sendEventsToRemainder = false;
|
||||
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
if (newSet.Count > 0)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
try
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = true;
|
||||
foreach (SceneObjectPart p in newSet)
|
||||
{
|
||||
if (p != group.RootPart)
|
||||
group.DelinkFromGroup(p, sendEventsToRemainder);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
newSet[0].ParentGroup.areUpdatesSuspended = false;
|
||||
}
|
||||
}
|
||||
|
||||
// If there is more than one prim remaining, we
|
||||
|
||||
@@ -46,12 +46,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public void ForceInventoryPersistence()
|
||||
{
|
||||
lock (m_parts)
|
||||
lockPartsForRead(true);
|
||||
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
|
||||
lockPartsForRead(false);
|
||||
foreach (SceneObjectPart part in values)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.Inventory.ForceInventoryPersistence();
|
||||
}
|
||||
part.Inventory.ForceInventoryPersistence();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,19 +74,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Stop the scripts contained in all the prims in this group
|
||||
/// </summary>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
/// Should be true if these scripts are being removed because the scene
|
||||
/// object is being deleted. This will prevent spurious updates to the client.
|
||||
/// </param>
|
||||
public void RemoveScriptInstances(bool sceneObjectBeingDeleted)
|
||||
{
|
||||
lock (m_parts)
|
||||
lockPartsForRead(true);
|
||||
List<SceneObjectPart> values = new List<SceneObjectPart>(m_parts.Values);
|
||||
lockPartsForRead(false);
|
||||
|
||||
foreach (SceneObjectPart part in values)
|
||||
{
|
||||
foreach (SceneObjectPart part in m_parts.Values)
|
||||
{
|
||||
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
||||
}
|
||||
part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -147,7 +147,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// TODO: This needs to be persisted in next XML version update!
|
||||
[XmlIgnore]
|
||||
public readonly int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
public int[] PayPrice = {-2,-2,-2,-2,-2};
|
||||
[XmlIgnore]
|
||||
public PhysicsActor PhysActor;
|
||||
|
||||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private Quaternion m_sitTargetOrientation = Quaternion.Identity;
|
||||
private Vector3 m_sitTargetPosition;
|
||||
private string m_sitAnimation = "SIT";
|
||||
private bool m_occupied; // KF if any av is sitting on this prim
|
||||
private string m_text = String.Empty;
|
||||
private string m_touchName = String.Empty;
|
||||
private readonly UndoStack<UndoState> m_undo = new UndoStack<UndoState>(5);
|
||||
@@ -453,12 +454,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <value>
|
||||
/// Access should be via Inventory directly - this property temporarily remains for xml serialization purposes
|
||||
/// Get the inventory list
|
||||
/// </value>
|
||||
public TaskInventoryDictionary TaskInventory
|
||||
{
|
||||
get { return m_inventory.Items; }
|
||||
set { m_inventory.Items = value; }
|
||||
get {
|
||||
return m_inventory.Items;
|
||||
}
|
||||
set {
|
||||
m_inventory.Items = value;
|
||||
}
|
||||
}
|
||||
|
||||
public uint ObjectFlags
|
||||
@@ -587,14 +592,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_LoopSoundSlavePrims = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] TextureAnimation
|
||||
{
|
||||
get { return m_TextureAnimation; }
|
||||
set { m_TextureAnimation = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public Byte[] ParticleSystem
|
||||
{
|
||||
get { return m_particleSystem; }
|
||||
@@ -648,7 +651,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set
|
||||
{
|
||||
m_groupPosition = value;
|
||||
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
@@ -835,7 +837,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary></summary>
|
||||
public Vector3 Acceleration
|
||||
{
|
||||
get { return m_acceleration; }
|
||||
get
|
||||
{
|
||||
PhysicsActor actor = PhysActor;
|
||||
if (actor != null)
|
||||
{
|
||||
m_acceleration = actor.Acceleration;
|
||||
}
|
||||
return m_acceleration;
|
||||
}
|
||||
|
||||
set { m_acceleration = value; }
|
||||
}
|
||||
|
||||
@@ -986,7 +997,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (IsAttachment)
|
||||
return GroupPosition;
|
||||
|
||||
return m_offsetPosition + m_groupPosition; }
|
||||
// return m_offsetPosition + m_groupPosition; }
|
||||
return m_groupPosition + (m_offsetPosition * ParentGroup.RootPart.RotationOffset) ; } //KF: Rotation was ignored!
|
||||
}
|
||||
|
||||
public SceneObjectGroup ParentGroup
|
||||
@@ -1137,6 +1149,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return _flags; }
|
||||
set { _flags = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public bool IsOccupied // KF If an av is sittingon this prim
|
||||
{
|
||||
get { return m_occupied; }
|
||||
set { m_occupied = value; }
|
||||
}
|
||||
|
||||
[XmlIgnore]
|
||||
public UUID SitTargetAvatar
|
||||
@@ -1212,14 +1231,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear all pending updates of parts to clients
|
||||
/// </summary>
|
||||
private void ClearUpdateSchedule()
|
||||
{
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
private void SendObjectPropertiesToClient(UUID AgentID)
|
||||
{
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||
@@ -1962,12 +1973,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public Vector3 GetWorldPosition()
|
||||
{
|
||||
Quaternion parentRot = ParentGroup.RootPart.RotationOffset;
|
||||
|
||||
Vector3 axPos = OffsetPosition;
|
||||
|
||||
axPos *= parentRot;
|
||||
Vector3 translationOffsetPosition = axPos;
|
||||
return GroupPosition + translationOffsetPosition;
|
||||
if(_parentID == 0)
|
||||
{
|
||||
return GroupPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1978,7 +1994,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
Quaternion newRot;
|
||||
|
||||
if (this.LinkNum == 0)
|
||||
if (this.LinkNum < 2) //KF Single or root prim
|
||||
{
|
||||
newRot = RotationOffset;
|
||||
}
|
||||
@@ -2624,17 +2640,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
//Trys to fetch sound id from prim's inventory.
|
||||
//Prim's inventory doesn't support non script items yet
|
||||
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
if (item.Value.Name == sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
@@ -2703,38 +2720,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void RotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
rotLookAt(target, strength, damping);
|
||||
}
|
||||
|
||||
public void rotLookAt(Quaternion target, float strength, float damping)
|
||||
{
|
||||
if (IsAttachment)
|
||||
{
|
||||
/*
|
||||
ScenePresence avatar = m_scene.GetScenePresence(rootpart.AttachedAvatar);
|
||||
if (avatar != null)
|
||||
{
|
||||
Rotate the Av?
|
||||
} */
|
||||
}
|
||||
else
|
||||
{
|
||||
APIDDamp = damping;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = target;
|
||||
}
|
||||
}
|
||||
|
||||
public void startLookAt(Quaternion rot, float damp, float strength)
|
||||
{
|
||||
APIDDamp = damp;
|
||||
APIDStrength = strength;
|
||||
APIDTarget = rot;
|
||||
}
|
||||
|
||||
public void stopLookAt()
|
||||
{
|
||||
APIDTarget = Quaternion.Identity;
|
||||
m_parentGroup.rotLookAt(target, strength, damping); // This calls method in SceneObjectGroup.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2746,7 +2732,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (m_parentGroup != null)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
if (!m_parentGroup.areUpdatesSuspended)
|
||||
{
|
||||
m_parentGroup.QueueForUpdateCheck();
|
||||
}
|
||||
}
|
||||
|
||||
int timeNow = Util.UnixTimeSinceEpoch();
|
||||
@@ -2963,8 +2952,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
const float ROTATION_TOLERANCE = 0.01f;
|
||||
const float VELOCITY_TOLERANCE = 0.001f;
|
||||
const float POSITION_TOLERANCE = 0.05f;
|
||||
const int TIME_MS_TOLERANCE = 3000;
|
||||
const float POSITION_TOLERANCE = 0.05f; // I don't like this, but I suppose it's necessary
|
||||
const int TIME_MS_TOLERANCE = 200; //llSetPos has a 200ms delay. This should NOT be 3 seconds.
|
||||
|
||||
if (m_updateFlag == 1)
|
||||
{
|
||||
@@ -2978,7 +2967,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
|
||||
{
|
||||
AddTerseUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
|
||||
|
||||
// This causes the Scene to 'poll' physical objects every couple of frames
|
||||
// bad, so it's been replaced by an event driven method.
|
||||
@@ -2996,16 +2985,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_lastAngularVelocity = AngularVelocity;
|
||||
m_lastTerseSent = Environment.TickCount;
|
||||
}
|
||||
//Moved this outside of the if clause so updates don't get blocked.. *sigh*
|
||||
m_updateFlag = 0; //Why were we calling a function to do this? Inefficient! *screams*
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_updateFlag == 2) // is a new prim, just created/reloaded or has major changes
|
||||
{
|
||||
AddFullUpdateToAllAvatars();
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0; //Same here
|
||||
}
|
||||
}
|
||||
ClearUpdateSchedule();
|
||||
m_updateFlag = 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -3032,17 +3023,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!UUID.TryParse(sound, out soundID))
|
||||
{
|
||||
// search sound file from inventory
|
||||
lock (TaskInventory)
|
||||
TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> item in TaskInventory)
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
if (item.Value.Name == sound && item.Value.Type == (int)AssetType.Sound)
|
||||
{
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
soundID = item.Value.ItemID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (soundID == UUID.Zero)
|
||||
@@ -3477,7 +3467,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void StopLookAt()
|
||||
{
|
||||
m_parentGroup.stopLookAt();
|
||||
m_parentGroup.stopLookAt(); // This calls method in SceneObjectGroup.
|
||||
|
||||
m_parentGroup.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
@@ -4471,8 +4461,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_shape.TextureEntry = textureEntry;
|
||||
TriggerScriptChangedEvent(Changed.TEXTURE);
|
||||
|
||||
m_updateFlag = 1;
|
||||
ParentGroup.HasGroupChanged = true;
|
||||
|
||||
//This is madness..
|
||||
//ParentGroup.ScheduleGroupForFullUpdate();
|
||||
//This is sparta
|
||||
@@ -4717,5 +4708,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Color color = Color;
|
||||
return new Color4(color.R, color.G, color.B, (byte)(0xFF - color.A));
|
||||
}
|
||||
|
||||
public void ResetOwnerChangeFlag()
|
||||
{
|
||||
List<UUID> inv = Inventory.GetInventoryList();
|
||||
|
||||
foreach (UUID itemID in inv)
|
||||
{
|
||||
TaskInventoryItem item = Inventory.GetInventoryItem(itemID);
|
||||
item.OwnerChanged = false;
|
||||
Inventory.UpdateInventoryItem(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -73,99 +73,105 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_pendingObjects = new Queue<SceneObjectGroup>();
|
||||
|
||||
foreach (EntityBase e in m_presence.Scene.Entities)
|
||||
lock(m_pendingObjects)
|
||||
{
|
||||
if (e is SceneObjectGroup)
|
||||
m_pendingObjects.Enqueue((SceneObjectGroup)e);
|
||||
foreach (EntityBase e in m_presence.Scene.Entities)
|
||||
{
|
||||
if (e != null && e is SceneObjectGroup)
|
||||
m_pendingObjects.Enqueue((SceneObjectGroup)e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (m_pendingObjects != null && m_pendingObjects.Count > 0)
|
||||
lock(m_pendingObjects)
|
||||
{
|
||||
SceneObjectGroup g = m_pendingObjects.Dequeue();
|
||||
// Yes, this can really happen
|
||||
if (g == null)
|
||||
continue;
|
||||
|
||||
// This is where we should check for draw distance
|
||||
// do culling and stuff. Problem with that is that until
|
||||
// we recheck in movement, that won't work right.
|
||||
// So it's not implemented now.
|
||||
//
|
||||
|
||||
// Don't even queue if we have sent this one
|
||||
//
|
||||
if (!m_updateTimes.ContainsKey(g.UUID))
|
||||
g.ScheduleFullUpdateToAvatar(m_presence);
|
||||
}
|
||||
|
||||
while (m_partsUpdateQueue.Count > 0)
|
||||
{
|
||||
SceneObjectPart part = m_partsUpdateQueue.Dequeue();
|
||||
|
||||
if (part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||
continue;
|
||||
|
||||
if (m_updateTimes.ContainsKey(part.UUID))
|
||||
while (m_pendingObjects != null && m_pendingObjects.Count > 0)
|
||||
{
|
||||
ScenePartUpdate update = m_updateTimes[part.UUID];
|
||||
SceneObjectGroup g = m_pendingObjects.Dequeue();
|
||||
// Yes, this can really happen
|
||||
if (g == null)
|
||||
continue;
|
||||
|
||||
// We deal with the possibility that two updates occur at
|
||||
// the same unix time at the update point itself.
|
||||
// This is where we should check for draw distance
|
||||
// do culling and stuff. Problem with that is that until
|
||||
// we recheck in movement, that won't work right.
|
||||
// So it's not implemented now.
|
||||
//
|
||||
|
||||
if ((update.LastFullUpdateTime < part.TimeStampFull) ||
|
||||
part.IsAttachment)
|
||||
// Don't even queue if we have sent this one
|
||||
//
|
||||
if (!m_updateTimes.ContainsKey(g.UUID))
|
||||
g.ScheduleFullUpdateToAvatar(m_presence);
|
||||
}
|
||||
|
||||
while (m_partsUpdateQueue.Count > 0)
|
||||
{
|
||||
SceneObjectPart part = m_partsUpdateQueue.Dequeue();
|
||||
|
||||
if (part.ParentGroup == null || part.ParentGroup.IsDeleted)
|
||||
continue;
|
||||
|
||||
if (m_updateTimes.ContainsKey(part.UUID))
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
||||
// part.Name, part.UUID, part.TimeStampFull);
|
||||
ScenePartUpdate update = m_updateTimes[part.UUID];
|
||||
|
||||
// We deal with the possibility that two updates occur at
|
||||
// the same unix time at the update point itself.
|
||||
|
||||
if ((update.LastFullUpdateTime < part.TimeStampFull) ||
|
||||
part.IsAttachment)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Fully updating prim {0}, {1} - part timestamp {2}",
|
||||
// part.Name, part.UUID, part.TimeStampFull);
|
||||
|
||||
part.SendFullUpdate(m_presence.ControllingClient,
|
||||
m_presence.GenerateClientFlags(part.UUID));
|
||||
|
||||
// We'll update to the part's timestamp rather than
|
||||
// the current time to avoid the race condition
|
||||
// whereby the next tick occurs while we are doing
|
||||
// this update. If this happened, then subsequent
|
||||
// updates which occurred on the same tick or the
|
||||
// next tick of the last update would be ignored.
|
||||
|
||||
update.LastFullUpdateTime = part.TimeStampFull;
|
||||
|
||||
}
|
||||
else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
|
||||
// part.Name, part.UUID, part.TimeStampTerse);
|
||||
|
||||
part.SendTerseUpdateToClient(m_presence.ControllingClient);
|
||||
|
||||
update.LastTerseUpdateTime = part.TimeStampTerse;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//never been sent to client before so do full update
|
||||
ScenePartUpdate update = new ScenePartUpdate();
|
||||
update.FullID = part.UUID;
|
||||
update.LastFullUpdateTime = part.TimeStampFull;
|
||||
m_updateTimes.Add(part.UUID, update);
|
||||
|
||||
// Attachment handling
|
||||
//
|
||||
if (part.ParentGroup.RootPart.Shape.PCode == 9 && part.ParentGroup.RootPart.Shape.State != 0)
|
||||
{
|
||||
if (part != part.ParentGroup.RootPart)
|
||||
continue;
|
||||
|
||||
part.ParentGroup.SendFullUpdateToClient(m_presence.ControllingClient);
|
||||
continue;
|
||||
}
|
||||
|
||||
part.SendFullUpdate(m_presence.ControllingClient,
|
||||
m_presence.GenerateClientFlags(part.UUID));
|
||||
|
||||
// We'll update to the part's timestamp rather than
|
||||
// the current time to avoid the race condition
|
||||
// whereby the next tick occurs while we are doing
|
||||
// this update. If this happened, then subsequent
|
||||
// updates which occurred on the same tick or the
|
||||
// next tick of the last update would be ignored.
|
||||
|
||||
update.LastFullUpdateTime = part.TimeStampFull;
|
||||
|
||||
m_presence.GenerateClientFlags(part.UUID));
|
||||
}
|
||||
else if (update.LastTerseUpdateTime <= part.TimeStampTerse)
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Tersely updating prim {0}, {1} - part timestamp {2}",
|
||||
// part.Name, part.UUID, part.TimeStampTerse);
|
||||
|
||||
part.SendTerseUpdateToClient(m_presence.ControllingClient);
|
||||
|
||||
update.LastTerseUpdateTime = part.TimeStampTerse;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//never been sent to client before so do full update
|
||||
ScenePartUpdate update = new ScenePartUpdate();
|
||||
update.FullID = part.UUID;
|
||||
update.LastFullUpdateTime = part.TimeStampFull;
|
||||
m_updateTimes.Add(part.UUID, update);
|
||||
|
||||
// Attachment handling
|
||||
//
|
||||
if (part.ParentGroup.RootPart.Shape.PCode == 9 && part.ParentGroup.RootPart.Shape.State != 0)
|
||||
{
|
||||
if (part != part.ParentGroup.RootPart)
|
||||
continue;
|
||||
|
||||
part.ParentGroup.SendFullUpdateToClient(m_presence.ControllingClient);
|
||||
continue;
|
||||
}
|
||||
|
||||
part.SendFullUpdate(m_presence.ControllingClient,
|
||||
m_presence.GenerateClientFlags(part.UUID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,12 +878,21 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
Disconnect();
|
||||
}
|
||||
|
||||
@@ -836,11 +836,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -624,8 +624,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
|
||||
@@ -996,7 +996,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void VehicleFlags(int param, bool remove)
|
||||
{
|
||||
|
||||
|
||||
58
OpenSim/Region/Physics/ChOdePlugin/AssemblyInfo.cs
Normal file
58
OpenSim/Region/Physics/ChOdePlugin/AssemblyInfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Information about this assembly is defined by the following
|
||||
// attributes.
|
||||
//
|
||||
// change them to the information which is associated with the assembly
|
||||
// you compile.
|
||||
|
||||
[assembly : AssemblyTitle("OdePlugin")]
|
||||
[assembly : AssemblyDescription("")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("http://opensimulator.org")]
|
||||
[assembly : AssemblyProduct("OdePlugin")]
|
||||
[assembly : AssemblyCopyright("Copyright (c) OpenSimulator.org Developers 2007-2009")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.6.5.*")]
|
||||
1369
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
1369
OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
Normal file
File diff suppressed because it is too large
Load Diff
3788
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
3788
OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs
Normal file
File diff suppressed because it is too large
Load Diff
375
OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs
Normal file
375
OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs
Normal file
@@ -0,0 +1,375 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using Ode.NET;
|
||||
using log4net;
|
||||
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Processes raycast requests as ODE is in a state to be able to do them.
|
||||
/// This ensures that it's thread safe and there will be no conflicts.
|
||||
/// Requests get returned by a different thread then they were requested by.
|
||||
/// </summary>
|
||||
public class ODERayCastRequestManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Pending Raycast Requests
|
||||
/// </summary>
|
||||
protected List<ODERayCastRequest> m_PendingRequests = new List<ODERayCastRequest>();
|
||||
|
||||
/// <summary>
|
||||
/// Scene that created this object.
|
||||
/// </summary>
|
||||
private OdeScene m_scene;
|
||||
|
||||
/// <summary>
|
||||
/// ODE contact array to be filled by the collision testing
|
||||
/// </summary>
|
||||
d.ContactGeom[] contacts = new d.ContactGeom[5];
|
||||
|
||||
/// <summary>
|
||||
/// ODE near callback delegate
|
||||
/// </summary>
|
||||
private d.NearCallback nearCallback;
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private List<ContactResult> m_contactResults = new List<ContactResult>();
|
||||
|
||||
|
||||
public ODERayCastRequestManager(OdeScene pScene)
|
||||
{
|
||||
m_scene = pScene;
|
||||
nearCallback = near;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Queues a raycast
|
||||
/// </summary>
|
||||
/// <param name="position">Origin of Ray</param>
|
||||
/// <param name="direction">Ray normal</param>
|
||||
/// <param name="length">Ray length</param>
|
||||
/// <param name="retMethod">Return method to send the results</param>
|
||||
public void QueueRequest(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod)
|
||||
{
|
||||
lock (m_PendingRequests)
|
||||
{
|
||||
ODERayCastRequest req = new ODERayCastRequest();
|
||||
req.callbackMethod = retMethod;
|
||||
req.length = length;
|
||||
req.Normal = direction;
|
||||
req.Origin = position;
|
||||
|
||||
m_PendingRequests.Add(req);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Process all queued raycast requests
|
||||
/// </summary>
|
||||
/// <returns>Time in MS the raycasts took to process.</returns>
|
||||
public int ProcessQueuedRequests()
|
||||
{
|
||||
int time = System.Environment.TickCount;
|
||||
lock (m_PendingRequests)
|
||||
{
|
||||
if (m_PendingRequests.Count > 0)
|
||||
{
|
||||
ODERayCastRequest[] reqs = m_PendingRequests.ToArray();
|
||||
for (int i = 0; i < reqs.Length; i++)
|
||||
{
|
||||
if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast
|
||||
RayCast(reqs[i]); // if there isn't anyone to send results
|
||||
}
|
||||
/*
|
||||
foreach (ODERayCastRequest req in m_PendingRequests)
|
||||
{
|
||||
if (req.callbackMethod != null) // quick optimization here, don't raycast
|
||||
RayCast(req); // if there isn't anyone to send results to
|
||||
|
||||
}
|
||||
*/
|
||||
m_PendingRequests.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Clear();
|
||||
|
||||
return System.Environment.TickCount - time;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method that actually initiates the raycast
|
||||
/// </summary>
|
||||
/// <param name="req"></param>
|
||||
private void RayCast(ODERayCastRequest req)
|
||||
{
|
||||
// Create the ray
|
||||
IntPtr ray = d.CreateRay(m_scene.space, req.length);
|
||||
d.GeomRaySet(ray, req.Origin.X, req.Origin.Y, req.Origin.Z, req.Normal.X, req.Normal.Y, req.Normal.Z);
|
||||
|
||||
// Collide test
|
||||
d.SpaceCollide2(m_scene.space, ray, IntPtr.Zero, nearCallback);
|
||||
|
||||
// Remove Ray
|
||||
d.GeomDestroy(ray);
|
||||
|
||||
|
||||
// Define default results
|
||||
bool hitYN = false;
|
||||
uint hitConsumerID = 0;
|
||||
float distance = 999999999999f;
|
||||
Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f);
|
||||
Vector3 snormal = Vector3.Zero;
|
||||
|
||||
// Find closest contact and object.
|
||||
lock (m_contactResults)
|
||||
{
|
||||
foreach (ContactResult cResult in m_contactResults)
|
||||
{
|
||||
if (Vector3.Distance(req.Origin, cResult.Pos) < Vector3.Distance(req.Origin, closestcontact))
|
||||
{
|
||||
closestcontact = cResult.Pos;
|
||||
hitConsumerID = cResult.ConsumerID;
|
||||
distance = cResult.Depth;
|
||||
hitYN = true;
|
||||
snormal = cResult.Normal;
|
||||
}
|
||||
}
|
||||
|
||||
m_contactResults.Clear();
|
||||
}
|
||||
|
||||
// Return results
|
||||
if (req.callbackMethod != null)
|
||||
req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal);
|
||||
}
|
||||
|
||||
// This is the standard Near. Uses space AABBs to speed up detection.
|
||||
private void near(IntPtr space, IntPtr g1, IntPtr g2)
|
||||
{
|
||||
|
||||
//Don't test against heightfield Geom, or you'll be sorry!
|
||||
|
||||
/*
|
||||
terminate called after throwing an instance of 'std::bad_alloc'
|
||||
what(): std::bad_alloc
|
||||
Stacktrace:
|
||||
|
||||
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0x00004>
|
||||
at (wrapper managed-to-native) Ode.NET.d.Collide (intptr,intptr,int,Ode.NET.d/ContactGeom[],int) <0xffffffff>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0x00280>
|
||||
at (wrapper native-to-managed) OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.near (intptr,intptr,intptr) <0xfff
|
||||
fffff>
|
||||
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0x00004>
|
||||
at (wrapper managed-to-native) Ode.NET.d.SpaceCollide2 (intptr,intptr,intptr,Ode.NET.d/NearCallback) <0xffffffff>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.RayCast (OpenSim.Region.Physics.OdePlugin.ODERayCastRequest) <
|
||||
0x00114>
|
||||
at OpenSim.Region.Physics.OdePlugin.ODERayCastRequestManager.ProcessQueuedRequests () <0x000eb>
|
||||
at OpenSim.Region.Physics.OdePlugin.OdeScene.Simulate (single) <0x017e6>
|
||||
at OpenSim.Region.Framework.Scenes.SceneGraph.UpdatePhysics (double) <0x00042>
|
||||
at OpenSim.Region.Framework.Scenes.Scene.Update () <0x0039e>
|
||||
at OpenSim.Region.Framework.Scenes.Scene.Heartbeat (object) <0x00019>
|
||||
at (wrapper runtime-invoke) object.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff>
|
||||
|
||||
Native stacktrace:
|
||||
|
||||
mono [0x80d2a42]
|
||||
[0xb7f5840c]
|
||||
/lib/i686/cmov/libc.so.6(abort+0x188) [0xb7d1a018]
|
||||
/usr/lib/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x158) [0xb45fc988]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa865]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa8a2]
|
||||
/usr/lib/libstdc++.so.6 [0xb45fa9da]
|
||||
/usr/lib/libstdc++.so.6(_Znwj+0x83) [0xb45fb033]
|
||||
/usr/lib/libstdc++.so.6(_Znaj+0x1d) [0xb45fb11d]
|
||||
libode.so(_ZN13dxHeightfield23dCollideHeightfieldZoneEiiiiP6dxGeomiiP12dContactGeomi+0xd04) [0xb46678e4]
|
||||
libode.so(_Z19dCollideHeightfieldP6dxGeomS0_iP12dContactGeomi+0x54b) [0xb466832b]
|
||||
libode.so(dCollide+0x102) [0xb46571b2]
|
||||
[0x95cfdec9]
|
||||
[0x8ea07fe1]
|
||||
[0xab260146]
|
||||
libode.so [0xb465a5c4]
|
||||
libode.so(_ZN11dxHashSpace8collide2EPvP6dxGeomPFvS0_S2_S2_E+0x75) [0xb465bcf5]
|
||||
libode.so(dSpaceCollide2+0x177) [0xb465ac67]
|
||||
[0x95cf978e]
|
||||
[0x8ea07945]
|
||||
[0x95cf2bbc]
|
||||
[0xab2787e7]
|
||||
[0xab419fb3]
|
||||
[0xab416657]
|
||||
[0xab415bda]
|
||||
[0xb609b08e]
|
||||
mono(mono_runtime_delegate_invoke+0x34) [0x8192534]
|
||||
mono [0x81a2f0f]
|
||||
mono [0x81d28b6]
|
||||
mono [0x81ea2c6]
|
||||
/lib/i686/cmov/libpthread.so.0 [0xb7e744c0]
|
||||
/lib/i686/cmov/libc.so.6(clone+0x5e) [0xb7dcd6de]
|
||||
*/
|
||||
|
||||
// Exclude heightfield geom
|
||||
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
if (d.GeomGetClass(g1) == d.GeomClassID.HeightfieldClass || d.GeomGetClass(g2) == d.GeomClassID.HeightfieldClass)
|
||||
return;
|
||||
|
||||
// Raytest against AABBs of spaces first, then dig into the spaces it hits for actual geoms.
|
||||
if (d.GeomIsSpace(g1) || d.GeomIsSpace(g2))
|
||||
{
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
// Separating static prim geometry spaces.
|
||||
// We'll be calling near recursivly if one
|
||||
// of them is a space to find all of the
|
||||
// contact points in the space
|
||||
try
|
||||
{
|
||||
d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
|
||||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to collide test a space");
|
||||
return;
|
||||
}
|
||||
//Colliding a space or a geom with a space or a geom. so drill down
|
||||
|
||||
//Collide all geoms in each space..
|
||||
//if (d.GeomIsSpace(g1)) d.SpaceCollide(g1, IntPtr.Zero, nearCallback);
|
||||
//if (d.GeomIsSpace(g2)) d.SpaceCollide(g2, IntPtr.Zero, nearCallback);
|
||||
return;
|
||||
}
|
||||
|
||||
if (g1 == IntPtr.Zero || g2 == IntPtr.Zero)
|
||||
return;
|
||||
|
||||
int count = 0;
|
||||
try
|
||||
{
|
||||
|
||||
if (g1 == g2)
|
||||
return; // Can't collide with yourself
|
||||
|
||||
lock (contacts)
|
||||
{
|
||||
count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf);
|
||||
}
|
||||
}
|
||||
catch (SEHException)
|
||||
{
|
||||
m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to collide test an object: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
PhysicsActor p1 = null;
|
||||
PhysicsActor p2 = null;
|
||||
|
||||
if (g1 != IntPtr.Zero)
|
||||
m_scene.actor_name_map.TryGetValue(g1, out p1);
|
||||
|
||||
if (g2 != IntPtr.Zero)
|
||||
m_scene.actor_name_map.TryGetValue(g1, out p2);
|
||||
|
||||
// Loop over contacts, build results.
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
if (p1 != null) {
|
||||
if (p1 is OdePrim)
|
||||
{
|
||||
ContactResult collisionresult = new ContactResult();
|
||||
|
||||
collisionresult.ConsumerID = ((OdePrim)p1).m_localID;
|
||||
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
|
||||
collisionresult.Depth = contacts[i].depth;
|
||||
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
|
||||
contacts[i].normal.Z);
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Add(collisionresult);
|
||||
}
|
||||
}
|
||||
|
||||
if (p2 != null)
|
||||
{
|
||||
if (p2 is OdePrim)
|
||||
{
|
||||
ContactResult collisionresult = new ContactResult();
|
||||
|
||||
collisionresult.ConsumerID = ((OdePrim)p2).m_localID;
|
||||
collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
|
||||
collisionresult.Depth = contacts[i].depth;
|
||||
collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
|
||||
contacts[i].normal.Z);
|
||||
|
||||
lock (m_contactResults)
|
||||
m_contactResults.Add(collisionresult);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dereference the creator scene so that it can be garbage collected if needed.
|
||||
/// </summary>
|
||||
internal void Dispose()
|
||||
{
|
||||
m_scene = null;
|
||||
}
|
||||
}
|
||||
|
||||
public struct ODERayCastRequest
|
||||
{
|
||||
public Vector3 Origin;
|
||||
public Vector3 Normal;
|
||||
public float length;
|
||||
public RaycastCallback callbackMethod;
|
||||
}
|
||||
|
||||
public struct ContactResult
|
||||
{
|
||||
public Vector3 Pos;
|
||||
public float Depth;
|
||||
public uint ConsumerID;
|
||||
public Vector3 Normal;
|
||||
}
|
||||
}
|
||||
@@ -26,51 +26,23 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using Ode.NET;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using PhysXWrapper;
|
||||
using Quaternion=OpenMetaverse.Quaternion;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Region.Physics.OdePlugin;
|
||||
|
||||
namespace OpenSim.Region.Physics.PhysXPlugin
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
/// <summary>
|
||||
/// Will be the PhysX plugin but for now will be a very basic physics engine
|
||||
/// </summary>
|
||||
public class PhysXPlugin : IPhysicsPlugin
|
||||
class OdePhysicsJoint : PhysicsJoint
|
||||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private PhysXScene _mScene;
|
||||
|
||||
public PhysXPlugin()
|
||||
public override bool IsInPhysicsEngine
|
||||
{
|
||||
}
|
||||
|
||||
public bool Init()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public PhysicsScene GetScene(string sceneIdentifier)
|
||||
{
|
||||
if (_mScene == null)
|
||||
get
|
||||
{
|
||||
_mScene = new PhysXScene(sceneIdentifier);
|
||||
return (jointID != IntPtr.Zero);
|
||||
}
|
||||
return (_mScene);
|
||||
}
|
||||
|
||||
public string GetName()
|
||||
{
|
||||
return ("RealPhysX");
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
}
|
||||
public IntPtr jointID;
|
||||
}
|
||||
}
|
||||
3853
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
3853
OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
Normal file
File diff suppressed because it is too large
Load Diff
122
OpenSim/Region/Physics/ChOdePlugin/Tests/ODETestClass.cs
Normal file
122
OpenSim/Region/Physics/ChOdePlugin/Tests/ODETestClass.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using log4net;
|
||||
using System.Reflection;
|
||||
|
||||
namespace OpenSim.Region.Physics.OdePlugin
|
||||
{
|
||||
[TestFixture]
|
||||
public class ODETestClass
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private OdePlugin cbt;
|
||||
private PhysicsScene ps;
|
||||
private IMeshingPlugin imp;
|
||||
|
||||
[SetUp]
|
||||
public void Initialize()
|
||||
{
|
||||
// Loading ODEPlugin
|
||||
cbt = new OdePlugin();
|
||||
// Loading Zero Mesher
|
||||
imp = new ZeroMesherPlugin();
|
||||
// Getting Physics Scene
|
||||
ps = cbt.GetScene("test");
|
||||
// Initializing Physics Scene.
|
||||
ps.Initialise(imp.GetMesher(),null);
|
||||
float[] _heightmap = new float[(int)Constants.RegionSize * (int)Constants.RegionSize];
|
||||
for (int i = 0; i < ((int)Constants.RegionSize * (int)Constants.RegionSize); i++)
|
||||
{
|
||||
_heightmap[i] = 21f;
|
||||
}
|
||||
ps.SetTerrain(_heightmap);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void Terminate()
|
||||
{
|
||||
ps.DeleteTerrain();
|
||||
ps.Dispose();
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CreateAndDropPhysicalCube()
|
||||
{
|
||||
PrimitiveBaseShape newcube = PrimitiveBaseShape.CreateBox();
|
||||
Vector3 position = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), 128f);
|
||||
Vector3 size = new Vector3(0.5f, 0.5f, 0.5f);
|
||||
Quaternion rot = Quaternion.Identity;
|
||||
PhysicsActor prim = ps.AddPrimShape("CoolShape", newcube, position, size, rot, true);
|
||||
OdePrim oprim = (OdePrim)prim;
|
||||
OdeScene pscene = (OdeScene) ps;
|
||||
|
||||
Assert.That(oprim.m_taintadd);
|
||||
|
||||
prim.LocalID = 5;
|
||||
|
||||
for (int i = 0; i < 58; i++)
|
||||
{
|
||||
ps.Simulate(0.133f);
|
||||
|
||||
Assert.That(oprim.prim_geom != (IntPtr)0);
|
||||
|
||||
Assert.That(oprim.m_targetSpace != (IntPtr)0);
|
||||
|
||||
//Assert.That(oprim.m_targetSpace == pscene.space);
|
||||
m_log.Info("TargetSpace: " + oprim.m_targetSpace + " - SceneMainSpace: " + pscene.space);
|
||||
|
||||
Assert.That(!oprim.m_taintadd);
|
||||
m_log.Info("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString());
|
||||
|
||||
// Make sure we're above the ground
|
||||
//Assert.That(prim.Position.Z > 20f);
|
||||
//m_log.Info("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore);
|
||||
|
||||
// Make sure we've got a Body
|
||||
Assert.That(oprim.Body != (IntPtr)0);
|
||||
//m_log.Info(
|
||||
}
|
||||
|
||||
// Make sure we're not somewhere above the ground
|
||||
Assert.That(prim.Position.Z < 21.5f);
|
||||
|
||||
ps.RemovePrim(prim);
|
||||
Assert.That(oprim.m_taintremove);
|
||||
ps.Simulate(0.133f);
|
||||
Assert.That(oprim.Body == (IntPtr)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
98
OpenSim/Region/Physics/ChOdePlugin/drawstuff.cs
Normal file
98
OpenSim/Region/Physics/ChOdePlugin/drawstuff.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright ODE
|
||||
* Ode.NET - .NET bindings for ODE
|
||||
* Jason Perkins (starkos@industriousone.com)
|
||||
* Licensed under the New BSD
|
||||
* Part of the OpenDynamicsEngine
|
||||
Open Dynamics Engine
|
||||
Copyright (c) 2001-2007, Russell L. Smith.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
Neither the names of ODE's copyright owner nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Ode.NET;
|
||||
|
||||
namespace Drawstuff.NET
|
||||
{
|
||||
#if dDOUBLE
|
||||
using dReal = System.Double;
|
||||
#else
|
||||
using dReal = System.Single;
|
||||
#endif
|
||||
|
||||
public static class ds
|
||||
{
|
||||
public const int VERSION = 2;
|
||||
|
||||
public enum Texture
|
||||
{
|
||||
None,
|
||||
Wood
|
||||
}
|
||||
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public delegate void CallbackFunction(int arg);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Functions
|
||||
{
|
||||
public int version;
|
||||
public CallbackFunction start;
|
||||
public CallbackFunction step;
|
||||
public CallbackFunction command;
|
||||
public CallbackFunction stop;
|
||||
public string path_to_textures;
|
||||
}
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawBox")]
|
||||
public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawCapsule")]
|
||||
public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsDrawConvex")]
|
||||
public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetColor")]
|
||||
public static extern void SetColor(float red, float green, float blue);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetTexture")]
|
||||
public static extern void SetTexture(Texture texture);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSetViewpoint")]
|
||||
public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr);
|
||||
|
||||
[DllImport("drawstuff", EntryPoint = "dsSimulationLoop")]
|
||||
public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn);
|
||||
}
|
||||
}
|
||||
@@ -1210,7 +1210,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||
|
||||
public override float APIDDamping{ set { return; } }
|
||||
|
||||
|
||||
public override void SubscribeEvents(int ms)
|
||||
{
|
||||
m_requestedUpdateFrequency = ms;
|
||||
|
||||
@@ -2831,7 +2831,7 @@ Console.WriteLine(" JointCreateFixed");
|
||||
}
|
||||
public override bool PIDActive { set { m_usePID = value; } }
|
||||
public override float PIDTau { set { m_PIDTau = value; } }
|
||||
|
||||
|
||||
public override float PIDHoverHeight { set { m_PIDHoverHeight = value; ; } }
|
||||
public override bool PIDHoverActive { set { m_useHoverPID = value; } }
|
||||
public override PIDHoverType PIDHoverType { set { m_PIDHoverType = value; } }
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace OpenSim.Region.Physics.POSPlugin
|
||||
{
|
||||
set { return; }
|
||||
}
|
||||
|
||||
|
||||
public override Quaternion APIDTarget
|
||||
{
|
||||
set { return; }
|
||||
|
||||
@@ -88,89 +88,7 @@ namespace OpenSim.Region.RegionCombinerModule
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (enabledYN)
|
||||
{
|
||||
RegionLoadedDoWork(scene);
|
||||
|
||||
scene.EventManager.OnNewPresence += NewPresence;
|
||||
}
|
||||
}
|
||||
|
||||
private void NewPresence(ScenePresence presence)
|
||||
{
|
||||
if (presence.IsChildAgent)
|
||||
{
|
||||
byte[] throttleData;
|
||||
|
||||
try
|
||||
{
|
||||
throttleData = presence.ControllingClient.GetThrottlesPacked(1);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (throttleData == null)
|
||||
return;
|
||||
|
||||
if (throttleData.Length == 0)
|
||||
return;
|
||||
|
||||
if (throttleData.Length != 28)
|
||||
return;
|
||||
|
||||
byte[] adjData;
|
||||
int pos = 0;
|
||||
|
||||
if (!BitConverter.IsLittleEndian)
|
||||
{
|
||||
byte[] newData = new byte[7 * 4];
|
||||
Buffer.BlockCopy(throttleData, 0, newData, 0, 7 * 4);
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
Array.Reverse(newData, i * 4, 4);
|
||||
|
||||
adjData = newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
adjData = throttleData;
|
||||
}
|
||||
|
||||
// 0.125f converts from bits to bytes
|
||||
int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4;
|
||||
int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f);
|
||||
// State is a subcategory of task that we allocate a percentage to
|
||||
|
||||
|
||||
//int total = resend + land + wind + cloud + task + texture + asset;
|
||||
|
||||
byte[] data = new byte[7 * 4];
|
||||
int ii = 0;
|
||||
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(resend), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(land * 50), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(wind), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(cloud), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(task), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(texture), 0, data, ii, 4); ii += 4;
|
||||
Buffer.BlockCopy(Utils.FloatToBytes(asset), 0, data, ii, 4);
|
||||
|
||||
try
|
||||
{
|
||||
presence.ControllingClient.SetChildAgentThrottle(data);
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void RegionLoadedDoWork(Scene scene)
|
||||
|
||||
@@ -112,6 +112,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
wComm.DeliverMessage(ChatTypeEnum.Shout, ScriptBaseClass.DEBUG_CHANNEL, m_host.Name, m_host.UUID, message);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Like osGetAgents but returns enough info for a radar
|
||||
/// </summary>
|
||||
/// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
|
||||
public LSL_List cmGetAvatarList()
|
||||
{
|
||||
LSL_List result = new LSL_List();
|
||||
World.ForEachScenePresence(delegate (ScenePresence avatar)
|
||||
{
|
||||
if (avatar != null && avatar.UUID != m_host.OwnerID)
|
||||
{
|
||||
if (avatar.IsChildAgent == false)
|
||||
{
|
||||
if (avatar.PhysicsActor != null && avatar.PhysicsActor.Position != null)
|
||||
{
|
||||
result.Add(avatar.UUID);
|
||||
result.Add(avatar.PhysicsActor.Position);
|
||||
result.Add(avatar.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the current Windlight scene
|
||||
/// </summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -769,18 +769,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
if (animID == UUID.Zero)
|
||||
target.Animator.AddAnimation(animation, m_host.UUID);
|
||||
else
|
||||
@@ -802,18 +801,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
if (target != null)
|
||||
{
|
||||
UUID animID=UUID.Zero;
|
||||
lock (m_host.TaskInventory)
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Name == animation)
|
||||
{
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
if (inv.Value.Type == (int)AssetType.Animation)
|
||||
animID = inv.Value.AssetID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
|
||||
if (animID == UUID.Zero)
|
||||
target.Animator.RemoveAnimation(animation);
|
||||
@@ -1664,6 +1662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1671,6 +1670,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -1717,6 +1717,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1724,6 +1725,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -1774,6 +1776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
|
||||
if (!UUID.TryParse(name, out assetID))
|
||||
{
|
||||
m_host.TaskInventory.LockItemsForRead(true);
|
||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
||||
{
|
||||
if (item.Type == 7 && item.Name == name)
|
||||
@@ -1781,6 +1784,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
assetID = item.AssetID;
|
||||
}
|
||||
}
|
||||
m_host.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
if (assetID == UUID.Zero)
|
||||
@@ -2186,5 +2190,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules);
|
||||
}
|
||||
|
||||
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
m_LSL_Api.SetPrimitiveParamsEx(prim, rules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
// Is the sensor type is AGENT and not SCRIPTED then include agents
|
||||
if ((ts.type & AGENT) != 0 && (ts.type & SCRIPTED) == 0)
|
||||
{
|
||||
sensedEntities.AddRange(doAgentSensor(ts));
|
||||
sensedEntities.AddRange(doAgentSensor(ts));
|
||||
}
|
||||
|
||||
// If SCRIPTED or PASSIVE or ACTIVE check objects
|
||||
@@ -309,6 +309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
// in mouselook.
|
||||
|
||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
|
||||
fromRegionPos = avatar.AbsolutePosition;
|
||||
q = avatar.Rotation;
|
||||
}
|
||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||
@@ -422,6 +423,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
SceneObjectPart SensePoint = ts.host;
|
||||
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
|
||||
Quaternion q = SensePoint.RotationOffset;
|
||||
if (SensePoint.ParentGroup.RootPart.IsAttachment)
|
||||
{
|
||||
// In attachments, the sensor cone always orients with the
|
||||
// avatar rotation. This may include a nonzero elevation if
|
||||
// in mouselook.
|
||||
|
||||
ScenePresence avatar = m_CmdManager.m_ScriptEngine.World.GetScenePresence(SensePoint.ParentGroup.RootPart.AttachedAvatar);
|
||||
fromRegionPos = avatar.AbsolutePosition;
|
||||
q = avatar.Rotation;
|
||||
}
|
||||
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
|
||||
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
|
||||
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
|
||||
|
||||
@@ -109,25 +109,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
|
||||
if (Timers.Count == 0)
|
||||
return;
|
||||
|
||||
Dictionary<string, TimerClass>.ValueCollection tvals;
|
||||
lock (TimerListLock)
|
||||
{
|
||||
// Go through all timers
|
||||
Dictionary<string, TimerClass>.ValueCollection tvals = Timers.Values;
|
||||
foreach (TimerClass ts in tvals)
|
||||
{
|
||||
// Time has passed?
|
||||
if (ts.next < DateTime.Now.Ticks)
|
||||
{
|
||||
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
|
||||
// Add it to queue
|
||||
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
|
||||
new EventParams("timer", new Object[0],
|
||||
new DetectParams[0]));
|
||||
// set next interval
|
||||
tvals = Timers.Values;
|
||||
}
|
||||
|
||||
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
||||
ts.next = DateTime.Now.Ticks + ts.interval;
|
||||
}
|
||||
foreach (TimerClass ts in tvals)
|
||||
{
|
||||
// Time has passed?
|
||||
if (ts.next < DateTime.Now.Ticks)
|
||||
{
|
||||
//m_log.Debug("Time has passed: Now: " + DateTime.Now.Ticks + ", Passed: " + ts.next);
|
||||
// Add it to queue
|
||||
m_CmdManager.m_ScriptEngine.PostScriptEvent(ts.itemID,
|
||||
new EventParams("timer", new Object[0],
|
||||
new DetectParams[0]));
|
||||
// set next interval
|
||||
|
||||
//ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
|
||||
ts.next = DateTime.Now.Ticks + ts.interval;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_List cmGetWindlightScene(LSL_List rules);
|
||||
int cmSetWindlightScene(LSL_List rules);
|
||||
int cmSetWindlightSceneTargeted(LSL_List rules, key target);
|
||||
LSL_List cmGetAvatarList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,5 +395,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Vector llWind(LSL_Vector offset);
|
||||
LSL_String llXorBase64Strings(string str1, string str2);
|
||||
LSL_String llXorBase64StringsCorrect(string str1, string str2);
|
||||
|
||||
void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
|
||||
LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
|
||||
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||
using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
|
||||
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
|
||||
using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||
|
||||
namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
{
|
||||
@@ -80,7 +81,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
// Avatar Info Commands
|
||||
string osGetAgentIP(string agent);
|
||||
LSL_List osGetAgents();
|
||||
|
||||
|
||||
// Teleport commands
|
||||
void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
|
||||
@@ -173,5 +174,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
void osSetSpeed(string UUID, float SpeedModifier);
|
||||
void osCauseHealing(string avatar, double healing);
|
||||
void osCauseDamage(string avatar, double damage);
|
||||
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
|
||||
void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
|
||||
}
|
||||
public LSL_List cmGetAvatarList()
|
||||
{
|
||||
return m_CM_Functions.cmGetAvatarList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Reflection;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
@@ -132,6 +133,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return (eventFlags);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||
{
|
||||
// IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.
|
||||
|
||||
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int CHANGED_ALLOWED_DROP = 64;
|
||||
public const int CHANGED_OWNER = 128;
|
||||
public const int CHANGED_REGION_RESTART = 256;
|
||||
public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART
|
||||
public const int CHANGED_REGION = 512;
|
||||
public const int CHANGED_TELEPORT = 1024;
|
||||
public const int CHANGED_ANIMATION = 16384;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
@@ -309,6 +310,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void llDie()
|
||||
{
|
||||
m_LSL_Functions.llDie();
|
||||
|
||||
@@ -41,6 +41,7 @@ using rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
|
||||
using key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||
using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
|
||||
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||
using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||
using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
|
||||
using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
|
||||
|
||||
@@ -678,5 +679,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
{
|
||||
m_OSSL_Functions.osCauseHealing(avatar, healing);
|
||||
}
|
||||
public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
|
||||
{
|
||||
return m_OSSL_Functions.osGetPrimitiveParams(prim, rules);
|
||||
}
|
||||
public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
|
||||
{
|
||||
m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||
using OpenSim.Region.ScriptEngine.Shared;
|
||||
using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
|
||||
@@ -90,6 +91,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
return (int)m_Executor.GetStateEventFlags(state);
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ExecuteEvent(string state, string FunctionName, object[] args)
|
||||
{
|
||||
m_Executor.ExecuteEvent(state, FunctionName, args);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Runtime.Remoting;
|
||||
using System.Runtime.Remoting.Lifetime;
|
||||
using System.Threading;
|
||||
@@ -238,13 +239,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
|
||||
if (part != null)
|
||||
{
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
if (part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
if (part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
||||
}
|
||||
m_thisScriptTask = part.TaskInventory[m_ItemID];
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
|
||||
ApiManager am = new ApiManager();
|
||||
@@ -429,14 +429,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
{
|
||||
int permsMask;
|
||||
UUID permsGranter;
|
||||
lock (part.TaskInventory)
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
||||
{
|
||||
if (!part.TaskInventory.ContainsKey(m_ItemID))
|
||||
return;
|
||||
|
||||
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
||||
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
return;
|
||||
}
|
||||
permsGranter = part.TaskInventory[m_ItemID].PermsGranter;
|
||||
permsMask = part.TaskInventory[m_ItemID].PermsMask;
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
|
||||
if ((permsMask & ScriptBaseClass.PERMISSION_TAKE_CONTROLS) != 0)
|
||||
{
|
||||
@@ -545,6 +546,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
return true;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode] //Prevents the debugger from farting in this function
|
||||
public void SetState(string state)
|
||||
{
|
||||
if (state == State)
|
||||
@@ -556,7 +558,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
new DetectParams[0]));
|
||||
PostEvent(new EventParams("state_entry", new Object[0],
|
||||
new DetectParams[0]));
|
||||
|
||||
|
||||
throw new EventAbortException();
|
||||
}
|
||||
|
||||
@@ -639,14 +641,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
/// <returns></returns>
|
||||
public object EventProcessor()
|
||||
{
|
||||
if (m_Suspended)
|
||||
return 0;
|
||||
EventParams data = null;
|
||||
|
||||
lock (m_Script)
|
||||
lock (m_EventQueue)
|
||||
{
|
||||
EventParams data = null;
|
||||
if (m_Suspended)
|
||||
return 0;
|
||||
|
||||
lock (m_EventQueue)
|
||||
lock (m_Script)
|
||||
{
|
||||
data = (EventParams) m_EventQueue.Dequeue();
|
||||
if (data == null) // Shouldn't happen
|
||||
@@ -672,6 +674,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
if (data.EventName == "collision")
|
||||
m_CollisionInQueue = false;
|
||||
}
|
||||
}
|
||||
lock(m_Script)
|
||||
{
|
||||
|
||||
//m_log.DebugFormat("[XENGINE]: Processing event {0} for {1}", data.EventName, this);
|
||||
|
||||
@@ -828,6 +833,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||
new Object[0], new DetectParams[0]));
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode] //Stops the VS debugger from farting in this function
|
||||
public void ApiResetScript()
|
||||
{
|
||||
// bool running = Running;
|
||||
|
||||
@@ -30,6 +30,7 @@ using System.IO;
|
||||
using System.Threading;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics; //for [DebuggerNonUserCode]
|
||||
using System.Security;
|
||||
using System.Security.Policy;
|
||||
using System.Reflection;
|
||||
@@ -102,6 +103,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private Dictionary<UUID, IScriptInstance> m_Scripts =
|
||||
new Dictionary<UUID, IScriptInstance>();
|
||||
|
||||
private OpenMetaverse.ReaderWriterLockSlim m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
|
||||
// Maps the asset ID to the assembly
|
||||
|
||||
private Dictionary<UUID, string> m_Assemblies =
|
||||
@@ -123,6 +126,71 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private ScriptCompileQueue m_CompileQueue = new ScriptCompileQueue();
|
||||
IWorkItemResult m_CurrentCompile = null;
|
||||
|
||||
private void lockScriptsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_scriptsLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire READ lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_scriptsLock.IsWriteLockHeld)
|
||||
{
|
||||
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void lockScriptsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_scriptsLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_scriptsLock.ExitReadLock();
|
||||
}
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_scriptsLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
m_log.Error("[XEngine.m_Scripts] Thread lock detected while trying to aquire WRITE lock of m_scripts in XEngine. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_scriptsLock.IsWriteLockHeld)
|
||||
{
|
||||
m_scriptsLock = new OpenMetaverse.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_scriptsLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_scriptsLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string ScriptEngineName
|
||||
{
|
||||
get { return "XEngine"; }
|
||||
@@ -262,43 +330,45 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
// Force a final state save
|
||||
//
|
||||
if (m_Assemblies.ContainsKey(instance.AssetID))
|
||||
{
|
||||
// Force a final state save
|
||||
//
|
||||
if (m_Assemblies.ContainsKey(instance.AssetID))
|
||||
{
|
||||
string assembly = m_Assemblies[instance.AssetID];
|
||||
instance.SaveState(assembly);
|
||||
}
|
||||
|
||||
// Clear the event queue and abort the instance thread
|
||||
//
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// Release events, timer, etc
|
||||
//
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
// Unload scripts and app domains
|
||||
// Must be done explicitly because they have infinite
|
||||
// lifetime
|
||||
//
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
string assembly = m_Assemblies[instance.AssetID];
|
||||
instance.SaveState(assembly);
|
||||
}
|
||||
|
||||
// Clear the event queue and abort the instance thread
|
||||
//
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// Release events, timer, etc
|
||||
//
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
// Unload scripts and app domains
|
||||
// Must be done explicitly because they have infinite
|
||||
// lifetime
|
||||
//
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
m_Scripts.Clear();
|
||||
m_PrimObjects.Clear();
|
||||
m_Assemblies.Clear();
|
||||
m_DomainScripts.Clear();
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts.Clear();
|
||||
lockScriptsForWrite(false);
|
||||
m_PrimObjects.Clear();
|
||||
m_Assemblies.Clear();
|
||||
m_DomainScripts.Clear();
|
||||
|
||||
lock (m_ScriptEngines)
|
||||
{
|
||||
m_ScriptEngines.Remove(this);
|
||||
@@ -357,22 +427,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
|
||||
List<IScriptInstance> instances = new List<IScriptInstance>();
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
instances.Add(instance);
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
|
||||
foreach (IScriptInstance i in instances)
|
||||
{
|
||||
string assembly = String.Empty;
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
|
||||
if (!m_Assemblies.ContainsKey(i.AssetID))
|
||||
continue;
|
||||
assembly = m_Assemblies[i.AssetID];
|
||||
}
|
||||
|
||||
|
||||
i.SaveState(assembly);
|
||||
}
|
||||
@@ -684,170 +752,181 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
}
|
||||
}
|
||||
|
||||
lock (m_Scripts)
|
||||
|
||||
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
lockScriptsForRead(true);
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
(m_Scripts[itemID].AssetID != assetID))
|
||||
{
|
||||
ScriptInstance instance = null;
|
||||
// Create the object record
|
||||
lockScriptsForRead(false);
|
||||
|
||||
if ((!m_Scripts.ContainsKey(itemID)) ||
|
||||
(m_Scripts[itemID].AssetID != assetID))
|
||||
UUID appDomain = assetID;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
appDomain = part.ParentGroup.RootPart.UUID;
|
||||
|
||||
if (!m_AppDomains.ContainsKey(appDomain))
|
||||
{
|
||||
UUID appDomain = assetID;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
appDomain = part.ParentGroup.RootPart.UUID;
|
||||
|
||||
if (!m_AppDomains.ContainsKey(appDomain))
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
AppDomainSetup appSetup = new AppDomainSetup();
|
||||
// appSetup.ApplicationBase = Path.Combine(
|
||||
// "ScriptEngines",
|
||||
// m_Scene.RegionInfo.RegionID.ToString());
|
||||
AppDomainSetup appSetup = new AppDomainSetup();
|
||||
// appSetup.ApplicationBase = Path.Combine(
|
||||
// "ScriptEngines",
|
||||
// m_Scene.RegionInfo.RegionID.ToString());
|
||||
|
||||
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
|
||||
Evidence evidence = new Evidence(baseEvidence);
|
||||
Evidence baseEvidence = AppDomain.CurrentDomain.Evidence;
|
||||
Evidence evidence = new Evidence(baseEvidence);
|
||||
|
||||
AppDomain sandbox;
|
||||
if (m_AppDomainLoading)
|
||||
sandbox = AppDomain.CreateDomain(
|
||||
m_Scene.RegionInfo.RegionID.ToString(),
|
||||
evidence, appSetup);
|
||||
else
|
||||
sandbox = AppDomain.CurrentDomain;
|
||||
|
||||
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
||||
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
||||
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
|
||||
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
|
||||
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
|
||||
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
|
||||
//sandbox.SetAppDomainPolicy(sandboxPolicy);
|
||||
|
||||
m_AppDomains[appDomain] = sandbox;
|
||||
AppDomain sandbox;
|
||||
if (m_AppDomainLoading)
|
||||
sandbox = AppDomain.CreateDomain(
|
||||
m_Scene.RegionInfo.RegionID.ToString(),
|
||||
evidence, appSetup);
|
||||
else
|
||||
sandbox = AppDomain.CurrentDomain;
|
||||
|
||||
m_AppDomains[appDomain].AssemblyResolve +=
|
||||
new ResolveEventHandler(
|
||||
AssemblyResolver.OnAssemblyResolve);
|
||||
m_DomainScripts[appDomain] = new List<UUID>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
|
||||
m_ScriptErrorMessage += "Exception creating app domain:\n";
|
||||
m_ScriptFailCount++;
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//PolicyLevel sandboxPolicy = PolicyLevel.CreateAppDomainLevel();
|
||||
//AllMembershipCondition sandboxMembershipCondition = new AllMembershipCondition();
|
||||
//PermissionSet sandboxPermissionSet = sandboxPolicy.GetNamedPermissionSet("Internet");
|
||||
//PolicyStatement sandboxPolicyStatement = new PolicyStatement(sandboxPermissionSet);
|
||||
//CodeGroup sandboxCodeGroup = new UnionCodeGroup(sandboxMembershipCondition, sandboxPolicyStatement);
|
||||
//sandboxPolicy.RootCodeGroup = sandboxCodeGroup;
|
||||
//sandbox.SetAppDomainPolicy(sandboxPolicy);
|
||||
|
||||
m_AppDomains[appDomain] = sandbox;
|
||||
|
||||
m_AppDomains[appDomain].AssemblyResolve +=
|
||||
new ResolveEventHandler(
|
||||
AssemblyResolver.OnAssemblyResolve);
|
||||
m_DomainScripts[appDomain] = new List<UUID>();
|
||||
}
|
||||
m_DomainScripts[appDomain].Add(itemID);
|
||||
|
||||
instance = new ScriptInstance(this, part,
|
||||
itemID, assetID, assembly,
|
||||
m_AppDomains[appDomain],
|
||||
part.ParentGroup.RootPart.Name,
|
||||
item.Name, startParam, postOnRez,
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
|
||||
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
|
||||
|
||||
if (presence != null)
|
||||
catch (Exception e)
|
||||
{
|
||||
ShowScriptSaveResponse(item.OwnerID,
|
||||
assetID, "Compile successful", true);
|
||||
m_log.ErrorFormat("[XEngine] Exception creating app domain:\n {0}", e.ToString());
|
||||
m_ScriptErrorMessage += "Exception creating app domain:\n";
|
||||
m_ScriptFailCount++;
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
instance.AppDomain = appDomain;
|
||||
instance.LineMap = linemap;
|
||||
|
||||
m_Scripts[itemID] = instance;
|
||||
}
|
||||
m_DomainScripts[appDomain].Add(itemID);
|
||||
|
||||
lock (m_PrimObjects)
|
||||
instance = new ScriptInstance(this, part,
|
||||
itemID, assetID, assembly,
|
||||
m_AppDomains[appDomain],
|
||||
part.ParentGroup.RootPart.Name,
|
||||
item.Name, startParam, postOnRez,
|
||||
stateSource, m_MaxScriptQueue);
|
||||
|
||||
m_log.DebugFormat("[XEngine] Loaded script {0}.{1}, script UUID {2}, prim UUID {3} @ {4}",
|
||||
part.ParentGroup.RootPart.Name, item.Name, assetID, part.UUID, part.ParentGroup.RootPart.AbsolutePosition.ToString());
|
||||
|
||||
if (presence != null)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
ShowScriptSaveResponse(item.OwnerID,
|
||||
assetID, "Compile successful", true);
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
instance.AppDomain = appDomain;
|
||||
instance.LineMap = linemap;
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts[itemID] = instance;
|
||||
lockScriptsForWrite(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
lockScriptsForRead(false);
|
||||
}
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
if (!m_PrimObjects.ContainsKey(localID))
|
||||
m_PrimObjects[localID] = new List<UUID>();
|
||||
|
||||
if (!m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Add(itemID);
|
||||
|
||||
}
|
||||
|
||||
if (!m_Assemblies.ContainsKey(assetID))
|
||||
m_Assemblies[assetID] = assembly;
|
||||
|
||||
lock (m_AddingAssemblies)
|
||||
{
|
||||
m_AddingAssemblies[assembly]--;
|
||||
}
|
||||
|
||||
if (instance!=null)
|
||||
instance.Init();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void OnRemoveScript(uint localID, UUID itemID)
|
||||
{
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
// Do we even have it?
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
{
|
||||
// Do we even have it?
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
return;
|
||||
lockScriptsForRead(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
IScriptInstance instance=m_Scripts[itemID];
|
||||
m_Scripts.Remove(itemID);
|
||||
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
IScriptInstance instance=m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
lockScriptsForWrite(true);
|
||||
m_Scripts.Remove(itemID);
|
||||
lockScriptsForWrite(false);
|
||||
instance.ClearQueue();
|
||||
instance.Stop(0);
|
||||
|
||||
// bool objectRemoved = false;
|
||||
|
||||
lock (m_PrimObjects)
|
||||
lock (m_PrimObjects)
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove the script from it's prim
|
||||
if (m_PrimObjects.ContainsKey(localID))
|
||||
{
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
// Remove inventory item record
|
||||
if (m_PrimObjects[localID].Contains(itemID))
|
||||
m_PrimObjects[localID].Remove(itemID);
|
||||
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// If there are no more scripts, remove prim
|
||||
if (m_PrimObjects[localID].Count == 0)
|
||||
{
|
||||
m_PrimObjects.Remove(localID);
|
||||
// objectRemoved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
CleanAssemblies();
|
||||
}
|
||||
|
||||
instance.RemoveState();
|
||||
instance.DestroyScriptInstance();
|
||||
|
||||
m_DomainScripts[instance.AppDomain].Remove(instance.ItemID);
|
||||
if (m_DomainScripts[instance.AppDomain].Count == 0)
|
||||
{
|
||||
m_DomainScripts.Remove(instance.AppDomain);
|
||||
UnloadAppDomain(instance.AppDomain);
|
||||
}
|
||||
|
||||
instance = null;
|
||||
|
||||
ObjectRemoved handlerObjectRemoved = OnObjectRemoved;
|
||||
if (handlerObjectRemoved != null)
|
||||
{
|
||||
SceneObjectPart part = m_Scene.GetSceneObjectPart(localID);
|
||||
handlerObjectRemoved(part.UUID);
|
||||
}
|
||||
|
||||
CleanAssemblies();
|
||||
|
||||
|
||||
ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
|
||||
if (handlerScriptRemoved != null)
|
||||
handlerScriptRemoved(itemID);
|
||||
@@ -1099,12 +1178,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
private IScriptInstance GetInstance(UUID itemID)
|
||||
{
|
||||
IScriptInstance instance;
|
||||
lock (m_Scripts)
|
||||
lockScriptsForRead(true);
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
{
|
||||
if (!m_Scripts.ContainsKey(itemID))
|
||||
return null;
|
||||
instance = m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
return null;
|
||||
}
|
||||
instance = m_Scripts[itemID];
|
||||
lockScriptsForRead(false);
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -1128,6 +1209,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
return false;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void ApiResetScript(UUID itemID)
|
||||
{
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
@@ -1179,6 +1261,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
return UUID.Zero;
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
public void SetState(UUID itemID, string newState)
|
||||
{
|
||||
IScriptInstance instance = GetInstance(itemID);
|
||||
@@ -1199,11 +1282,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||
{
|
||||
List<IScriptInstance> instances = new List<IScriptInstance>();
|
||||
|
||||
lock (m_Scripts)
|
||||
{
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
lockScriptsForRead(true);
|
||||
foreach (IScriptInstance instance in m_Scripts.Values)
|
||||
instances.Add(instance);
|
||||
}
|
||||
lockScriptsForRead(false);
|
||||
|
||||
foreach (IScriptInstance i in instances)
|
||||
{
|
||||
|
||||
@@ -108,6 +108,11 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
DoAgentDelete(request, responsedata, agentID, action, regionID);
|
||||
return responsedata;
|
||||
}
|
||||
else if (method.Equals("DELETECHILD"))
|
||||
{
|
||||
DoChildAgentDelete(request, responsedata, agentID, action, regionID);
|
||||
return responsedata;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.InfoFormat("[AGENT HANDLER]: method {0} not supported in agent message", method);
|
||||
@@ -320,6 +325,24 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
}
|
||||
}
|
||||
|
||||
protected void DoChildAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
|
||||
{
|
||||
m_log.Debug(" >>> DoChildAgentDelete action:" + action + "; RegionID:" + regionID);
|
||||
|
||||
GridRegion destination = new GridRegion();
|
||||
destination.RegionID = regionID;
|
||||
|
||||
if (action.Equals("release"))
|
||||
ReleaseAgent(regionID, id);
|
||||
else
|
||||
m_SimulationService.CloseChildAgent(destination, id);
|
||||
|
||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||
responsedata["str_response_string"] = "OpenSim agent " + id.ToString();
|
||||
|
||||
m_log.Debug("[AGENT HANDLER]: Child Agent Released/Deleted.");
|
||||
}
|
||||
|
||||
protected void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, UUID regionID)
|
||||
{
|
||||
m_log.Debug(" >>> DoDelete action:" + action + "; RegionID:" + regionID);
|
||||
|
||||
@@ -87,7 +87,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
|
||||
string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
|
||||
IPEndPoint ext = info.ExternalEndPoint;
|
||||
string uri = "";
|
||||
if (ext != null)
|
||||
{
|
||||
uri = "http://" + ext.Address + ":" + info.HttpPort + "/";
|
||||
}
|
||||
//m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
|
||||
XmlRpcResponse response = null;
|
||||
try
|
||||
@@ -189,7 +194,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||
paramList.Add(hash);
|
||||
|
||||
XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
|
||||
string uri = "http://" + gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/";
|
||||
IPEndPoint ext = gatekeeper.ExternalEndPoint;
|
||||
string uri = "";
|
||||
if (ext != null)
|
||||
{
|
||||
uri = "http://" + ext.Address + ":" + gatekeeper.HttpPort + "/";
|
||||
}
|
||||
m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
|
||||
XmlRpcResponse response = null;
|
||||
try
|
||||
|
||||
@@ -83,6 +83,8 @@ namespace OpenSim.Services.Connectors
|
||||
if (info != null) // just to be sure
|
||||
{
|
||||
XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
|
||||
|
||||
//Possible nullref from info.externalendpoint will be caught here
|
||||
string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
|
||||
XmlRpcResponse response = request.Send(uri, 10000);
|
||||
if (response.IsFault)
|
||||
|
||||
@@ -87,7 +87,9 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
|
||||
{
|
||||
string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
|
||||
IPEndPoint ext = region.ExternalEndPoint;
|
||||
if (ext == null) return false;
|
||||
string uri = "http://" + ext.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
|
||||
//m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
|
||||
|
||||
WebRequest HelloNeighbourRequest = WebRequest.Create(uri);
|
||||
|
||||
@@ -300,6 +300,14 @@ namespace OpenSim.Services.Connectors
|
||||
{
|
||||
pinfo = new PresenceInfo((Dictionary<string, object>)replyData["result"]);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply (result not dictionary) received from presence server when querying for sessionID {0}", sessionID.ToString());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[PRESENCE CONNECTOR]: Invalid reply received from presence server when querying for sessionID {0}", sessionID.ToString());
|
||||
}
|
||||
|
||||
return pinfo;
|
||||
|
||||
@@ -104,6 +104,8 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
|
||||
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
IPEndPoint ext = regionInfo.ExternalEndPoint;
|
||||
if (ext == null) return "Region registration for " + regionInfo.RegionName + " failed: Could not resolve EndPoint";
|
||||
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
|
||||
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
|
||||
|
||||
@@ -114,7 +116,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||
{ "ServerURI", OSD.FromString(regionInfo.ServerURI) },
|
||||
{ "InternalAddress", OSD.FromString(regionInfo.InternalEndPoint.Address.ToString()) },
|
||||
{ "InternalPort", OSD.FromInteger(regionInfo.InternalEndPoint.Port) },
|
||||
{ "ExternalAddress", OSD.FromString(regionInfo.ExternalEndPoint.Address.ToString()) },
|
||||
{ "ExternalAddress", OSD.FromString(ext.Address.ToString()) },
|
||||
{ "ExternalPort", OSD.FromInteger(regionInfo.ExternalEndPoint.Port) },
|
||||
{ "MapTexture", OSD.FromUUID(regionInfo.TerrainImage) },
|
||||
{ "Access", OSD.FromInteger(regionInfo.Access) },
|
||||
|
||||
@@ -348,9 +348,11 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
|
||||
public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent)
|
||||
{
|
||||
IPEndPoint ext = destination.ExternalEndPoint;
|
||||
agent = null;
|
||||
if (ext == null) return false;
|
||||
// Eventually, we want to use a caps url instead of the agentID
|
||||
string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
|
||||
string uri = "http://" + ext.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
|
||||
//Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
|
||||
@@ -442,7 +444,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly)
|
||||
{
|
||||
string uri = string.Empty;
|
||||
try
|
||||
@@ -459,6 +461,8 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
|
||||
WebRequest request = WebRequest.Create(uri);
|
||||
request.Method = "DELETE";
|
||||
if (ChildOnly)
|
||||
request.Method += "CHILD";
|
||||
request.Timeout = 10000;
|
||||
|
||||
StreamReader sr = null;
|
||||
@@ -491,6 +495,16 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
return CloseAgent(destination, id, true);
|
||||
}
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
return CloseAgent(destination, id, false);
|
||||
}
|
||||
|
||||
#endregion Agents
|
||||
|
||||
#region Objects
|
||||
@@ -502,8 +516,10 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
|
||||
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
|
||||
{
|
||||
IPEndPoint ext = destination.ExternalEndPoint;
|
||||
if (ext == null) return false;
|
||||
string uri
|
||||
= "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
|
||||
= "http://" + ext.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
|
||||
//m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
|
||||
|
||||
WebRequest ObjectCreateRequest = WebRequest.Create(uri);
|
||||
|
||||
17
OpenSim/Services/Interfaces/IAttachmentsService.cs
Normal file
17
OpenSim/Services/Interfaces/IAttachmentsService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// (c) 2009, 2010 Careminster Limited and Melanie Thielker
|
||||
//
|
||||
// All rights reserved
|
||||
//
|
||||
using System;
|
||||
using Nini.Config;
|
||||
|
||||
namespace OpenSim.Services.Interfaces
|
||||
{
|
||||
public interface IAttachmentsService
|
||||
{
|
||||
string Get(string id);
|
||||
void Store(string id, string data);
|
||||
}
|
||||
}
|
||||
@@ -259,9 +259,13 @@ namespace OpenSim.Services.Interfaces
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
throw new Exception(
|
||||
/*throw new Exception(
|
||||
"Unable to resolve local hostname " + m_externalHostName + " innerException of type '" +
|
||||
e + "' attached to this exception", e);
|
||||
e + "' attached to this exception", e);*/
|
||||
// Don't throw a fatal exception here, instead, return Null and handle it in the caller.
|
||||
// Reason is, on systems such as OSgrid it has occured that known hostnames stop
|
||||
// resolving and thus make surrounding regions crash out with this exception.
|
||||
return null;
|
||||
}
|
||||
|
||||
return new IPEndPoint(ia, m_internalEndPoint.Port);
|
||||
|
||||
@@ -70,6 +70,14 @@ namespace OpenSim.Services.Interfaces
|
||||
/// <returns></returns>
|
||||
bool ReleaseAgent(UUID originRegion, UUID id, string uri);
|
||||
|
||||
/// <summary>
|
||||
/// Close child agent.
|
||||
/// </summary>
|
||||
/// <param name="regionHandle"></param>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
bool CloseChildAgent(GridRegion destination, UUID id);
|
||||
|
||||
/// <summary>
|
||||
/// Close agent.
|
||||
/// </summary>
|
||||
|
||||
@@ -57,6 +57,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
public static LLFailedLoginResponse InventoryProblem;
|
||||
public static LLFailedLoginResponse DeadRegionProblem;
|
||||
public static LLFailedLoginResponse LoginBlockedProblem;
|
||||
public static LLFailedLoginResponse UnverifiedAccountProblem;
|
||||
public static LLFailedLoginResponse AlreadyLoggedInProblem;
|
||||
public static LLFailedLoginResponse InternalError;
|
||||
|
||||
@@ -80,6 +81,10 @@ namespace OpenSim.Services.LLLoginService
|
||||
LoginBlockedProblem = new LLFailedLoginResponse("presence",
|
||||
"Logins are currently restricted. Please try again later.",
|
||||
"false");
|
||||
UnverifiedAccountProblem = new LLFailedLoginResponse("presence",
|
||||
"Your account has not yet been verified. Please check " +
|
||||
"your email and click the provided link.",
|
||||
"false");
|
||||
AlreadyLoggedInProblem = new LLFailedLoginResponse("presence",
|
||||
"You appear to be already logged in. " +
|
||||
"If this is not the case please wait for your session to timeout. " +
|
||||
@@ -322,6 +327,7 @@ namespace OpenSim.Services.LLLoginService
|
||||
private void FillOutRegionData(GridRegion destination)
|
||||
{
|
||||
IPEndPoint endPoint = destination.ExternalEndPoint;
|
||||
if (endPoint == null) return;
|
||||
SimAddress = endPoint.Address.ToString();
|
||||
SimPort = (uint)endPoint.Port;
|
||||
RegionX = (uint)destination.RegionLocX;
|
||||
|
||||
@@ -221,6 +221,12 @@ namespace OpenSim.Services.LLLoginService
|
||||
return LLFailedLoginResponse.UserProblem;
|
||||
}
|
||||
|
||||
if (account.UserLevel < 0)
|
||||
{
|
||||
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: Unverified account");
|
||||
return LLFailedLoginResponse.UnverifiedAccountProblem;
|
||||
}
|
||||
|
||||
if (account.UserLevel < m_MinLoginLevel)
|
||||
{
|
||||
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: login is blocked for user level {0}", account.UserLevel);
|
||||
|
||||
@@ -879,11 +879,19 @@ namespace OpenSim.Tests.Common.Mock
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessPendingPackets()
|
||||
{
|
||||
}
|
||||
|
||||
public void ProcessInPacket(Packet NewPack)
|
||||
{
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_scene.RemoveClient(AgentId);
|
||||
}
|
||||
|
||||
13
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
13
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
@@ -535,17 +535,10 @@ namespace Amib.Threading
|
||||
// Process until shutdown.
|
||||
while(!_shutdown)
|
||||
{
|
||||
// Update the last time this thread was seen alive.
|
||||
// It's good for debugging.
|
||||
_workerThreads[Thread.CurrentThread] = DateTime.Now;
|
||||
|
||||
|
||||
// Wait for a work item, shutdown, or timeout
|
||||
WorkItem workItem = Dequeue();
|
||||
|
||||
// Update the last time this thread was seen alive.
|
||||
// It's good for debugging.
|
||||
_workerThreads[Thread.CurrentThread] = DateTime.Now;
|
||||
|
||||
// On timeout or shut down.
|
||||
if (null == workItem)
|
||||
{
|
||||
@@ -554,6 +547,10 @@ namespace Amib.Threading
|
||||
{
|
||||
lock(_workerThreads.SyncRoot)
|
||||
{
|
||||
// Update the last time this thread was seen alive.
|
||||
// It's good for debugging.
|
||||
_workerThreads[Thread.CurrentThread] = DateTime.Now;
|
||||
|
||||
if (_workerThreads.Count > _stpStartInfo.MinWorkerThreads)
|
||||
{
|
||||
// Inform that the thread is quiting and then quit.
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||
</configSections>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="Neutral" />
|
||||
<bindingRedirect oldVersion="2.0.6.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.1.4.0" newVersion="2.4.6.0" />
|
||||
<bindingRedirect oldVersion="2.2.8.0" newVersion="2.4.6.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<log4net>
|
||||
<!-- A1 is set to be a ConsoleAppender -->
|
||||
<appender name="A1" type="log4net.Appender.ConsoleAppender">
|
||||
|
||||
<!-- A1 uses PatternLayout -->
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<!-- Print the date in ISO 8601 format -->
|
||||
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- Set root logger level to DEBUG and its only appender to A1 -->
|
||||
<root>
|
||||
<level value="DEBUG" />
|
||||
<appender-ref ref="A1" />
|
||||
</root>
|
||||
</log4net>
|
||||
</configuration>
|
||||
@@ -400,6 +400,9 @@
|
||||
|
||||
; Distance in meters that shouts should travel. Default is 100m
|
||||
shout_distance = 100
|
||||
|
||||
; Append a prefix to the god avatar names appearing in chat whilst in god mode
|
||||
; admin_prefix = "@"
|
||||
|
||||
|
||||
[Messaging]
|
||||
@@ -935,6 +938,9 @@
|
||||
|
||||
; Allow the use of os* functions (some are dangerous)
|
||||
AllowOSFunctions = false
|
||||
|
||||
; Allow the user of Careminster functions
|
||||
AllowCareminsterFunctions = false
|
||||
|
||||
; Threat level to allow, one of None, VeryLow, Low, Moderate, High, VeryHigh, Severe
|
||||
OSFunctionThreatLevel = VeryLow
|
||||
@@ -1191,7 +1197,6 @@
|
||||
|
||||
; Service connector to Groups Service [Select One] ServicesConnectorModule
|
||||
|
||||
|
||||
; Simian Grid Service for Groups
|
||||
;ServicesConnectorModule = SimianGroupsServicesConnector
|
||||
;GroupsServerURI = http://mygridserver.com:82/Grid/
|
||||
@@ -1235,6 +1240,9 @@
|
||||
; For example- http://127.0.0.1:9000/SStats/
|
||||
; enabled=false
|
||||
|
||||
[LandManagement]
|
||||
; DefaultAdministratorGroupUUID = "";
|
||||
; DefaultAdministratorParcelName = "";
|
||||
|
||||
;;
|
||||
;; These are defaults that are overwritten below in [Architecture].
|
||||
|
||||
30
prebuild.xml
30
prebuild.xml
@@ -544,6 +544,36 @@
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.ChOdePlugin" path="OpenSim/Region/Physics/ChOdePlugin" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
<OutputPath>../../../../bin/Physics/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
<Configuration name="Release">
|
||||
<Options>
|
||||
<OutputPath>../../../../bin/Physics/</OutputPath>
|
||||
</Options>
|
||||
</Configuration>
|
||||
|
||||
<ReferencePath>../../../../bin/</ReferencePath>
|
||||
<Reference name="System"/>
|
||||
<Reference name="System.Core"/>
|
||||
<Reference name="OpenMetaverseTypes.dll"/>
|
||||
<Reference name="Nini.dll" />
|
||||
<Reference name="OpenSim.Framework"/>
|
||||
<Reference name="OpenSim.Framework.Console"/>
|
||||
<Reference name="OpenSim.Region.Physics.Manager"/>
|
||||
<Reference name="Ode.NET.dll" />
|
||||
<Reference name="log4net.dll"/>
|
||||
|
||||
<Files>
|
||||
<Match pattern="*.cs" recurse="true">
|
||||
<Exclude name="Tests" pattern="Tests"/>
|
||||
</Match>
|
||||
</Files>
|
||||
</Project>
|
||||
|
||||
<Project frameworkVersion="v3_5" name="OpenSim.Region.Physics.BulletXPlugin" path="OpenSim/Region/Physics/BulletXPlugin" type="Library">
|
||||
<Configuration name="Debug">
|
||||
<Options>
|
||||
|
||||
Reference in New Issue
Block a user