aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-02-15 02:41:50 +0000
committerJustin Clark-Casey (justincc)2012-02-15 02:41:50 +0000
commit96843f2b17e60dfb275b6564facf7000e1451ea0 (patch)
tree23e28153e45d69480a7184484e89a35cd2e16856
parentMerge branch 'master' into 0.7.3-post-fixes (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-96843f2b17e60dfb275b6564facf7000e1451ea0.zip
opensim-SC_OLD-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.gz
opensim-SC_OLD-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.bz2
opensim-SC_OLD-96843f2b17e60dfb275b6564facf7000e1451ea0.tar.xz
Merge branch 'master' into 0.7.3-post-fixes
-rw-r--r--OpenSim/Data/MSSQL/Resources/GridStore.migrations9
-rw-r--r--OpenSim/Data/SQLite/Resources/RegionStore.migrations70
-rw-r--r--OpenSim/Data/SQLite/SQLiteFriendsData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs927
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs34
-rw-r--r--OpenSim/Framework/RegionInfo.cs1
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs19
-rw-r--r--OpenSim/Framework/Util.cs5
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs10
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs26
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs40
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs31
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs7
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs1
-rw-r--r--OpenSim/Region/Framework/Interfaces/INPCModule.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs30
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs26
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs9
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs12
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs41
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs26
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs71
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs30
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs43
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs11
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs8
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs96
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs23
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs11
-rw-r--r--OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs40
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs22
-rw-r--r--OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs9
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServiceConnector.cs72
-rw-r--r--OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs15
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs15
-rw-r--r--OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs5
-rw-r--r--OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs30
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs15
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs23
-rw-r--r--OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs12
-rw-r--r--OpenSim/Tests/Common/Mock/TestScene.cs6
-rw-r--r--OpenSim/Tests/Torture/NPCTortureTests.cs185
-rw-r--r--OpenSim/Tests/Torture/ObjectTortureTests.cs35
-rw-r--r--OpenSim/Tests/Torture/ScriptTortureTests.cs159
-rwxr-xr-xbin/OpenSim.ini.example14
-rw-r--r--bin/OpenSimDefaults.ini13
-rw-r--r--bin/config-include/GridCommon.ini.example2
-rw-r--r--prebuild.xml7
62 files changed, 1846 insertions, 586 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/GridStore.migrations b/OpenSim/Data/MSSQL/Resources/GridStore.migrations
index c6342fc..de0cea7 100644
--- a/OpenSim/Data/MSSQL/Resources/GridStore.migrations
+++ b/OpenSim/Data/MSSQL/Resources/GridStore.migrations
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
235 regionName 235 regionName
236 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 236 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
237 237
238COMMIT \ No newline at end of file 238COMMIT
239
240:VERSION 9
241
242BEGIN TRANSACTION
243ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
244
245COMMIT
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
index 31195af..0f40cdc 100644
--- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations
+++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations
@@ -472,3 +472,73 @@ COMMIT;
472BEGIN; 472BEGIN;
473ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0; 473ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
474COMMIT; 474COMMIT;
475
476:VERSION 23
477BEGIN;
478CREATE TABLE regionwindlight (
479 region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
480 water_color_r FLOAT NOT NULL DEFAULT '4.000000',
481 water_color_g FLOAT NOT NULL DEFAULT '38.000000',
482 water_color_b FLOAT NOT NULL DEFAULT '64.000000',
483 water_color_i FLOAT NOT NULL DEFAULT '1.000000',
484 water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
485 underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
486 reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
487 reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
488 reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
489 fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
490 fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
491 refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
492 refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
493 blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
494 big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
495 big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
496 little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
497 little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
498 normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
499 horizon_r FLOAT NOT NULL DEFAULT '0.25',
500 horizon_g FLOAT NOT NULL DEFAULT '0.25',
501 horizon_b FLOAT NOT NULL DEFAULT '0.32',
502 horizon_i FLOAT NOT NULL DEFAULT '0.32',
503 haze_horizon FLOAT NOT NULL DEFAULT '0.19',
504 blue_density_r FLOAT NOT NULL DEFAULT '0.12',
505 blue_density_g FLOAT NOT NULL DEFAULT '0.22',
506 blue_density_b FLOAT NOT NULL DEFAULT '0.38',
507 blue_density_i FLOAT NOT NULL DEFAULT '0.38',
508 haze_density FLOAT NOT NULL DEFAULT '0.70',
509 density_multiplier FLOAT NOT NULL DEFAULT '0.18',
510 distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
511 max_altitude INTEGER NOT NULL DEFAULT '1605',
512 sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
513 sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
514 sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
515 sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
516 sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
517 ambient_r FLOAT NOT NULL DEFAULT '0.35',
518 ambient_g FLOAT NOT NULL DEFAULT '0.35',
519 ambient_b FLOAT NOT NULL DEFAULT '0.35',
520 ambient_i FLOAT NOT NULL DEFAULT '0.35',
521 east_angle FLOAT NOT NULL DEFAULT '0.00',
522 sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
523 sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
524 scene_gamma FLOAT NOT NULL DEFAULT '1.00',
525 star_brightness FLOAT NOT NULL DEFAULT '0.00',
526 cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
527 cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
528 cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
529 cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
530 cloud_x FLOAT NOT NULL DEFAULT '1.00',
531 cloud_y FLOAT NOT NULL DEFAULT '0.53',
532 cloud_density FLOAT NOT NULL DEFAULT '1.00',
533 cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
534 cloud_scale FLOAT NOT NULL DEFAULT '0.42',
535 cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
536 cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
537 cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
538 cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
539 cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
540 cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
541 cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
542 draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
543
544COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
index b14c348..5f68977 100644
--- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs
+++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Data.SQLite
75 cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString()); 75 cmd.Parameters.AddWithValue(":PrincipalID", principalID.ToString());
76 cmd.Parameters.AddWithValue(":Friend", friend); 76 cmd.Parameters.AddWithValue(":Friend", friend);
77 77
78 ExecuteNonQuery(cmd, cmd.Connection); 78 ExecuteNonQuery(cmd, m_Connection);
79 79
80 return true; 80 return true;
81 } 81 }
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index a313c4f..ce1b7b4 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -35,7 +35,7 @@ using log4net;
35#if CSharpSqlite 35#if CSharpSqlite
36 using Community.CsharpSqlite.Sqlite; 36 using Community.CsharpSqlite.Sqlite;
37#else 37#else
38 using Mono.Data.Sqlite; 38using Mono.Data.Sqlite;
39#endif 39#endif
40using OpenMetaverse; 40using OpenMetaverse;
41using OpenMetaverse.StructuredData; 41using OpenMetaverse.StructuredData;
@@ -60,6 +60,7 @@ namespace OpenSim.Data.SQLite
60 private const string landAccessListSelect = "select distinct * from landaccesslist"; 60 private const string landAccessListSelect = "select distinct * from landaccesslist";
61 private const string regionbanListSelect = "select * from regionban"; 61 private const string regionbanListSelect = "select * from regionban";
62 private const string regionSettingsSelect = "select * from regionsettings"; 62 private const string regionSettingsSelect = "select * from regionsettings";
63 private const string regionWindlightSelect = "select * from regionwindlight";
63 64
64 private DataSet ds; 65 private DataSet ds;
65 private SqliteDataAdapter primDa; 66 private SqliteDataAdapter primDa;
@@ -69,9 +70,9 @@ namespace OpenSim.Data.SQLite
69 private SqliteDataAdapter landDa; 70 private SqliteDataAdapter landDa;
70 private SqliteDataAdapter landAccessListDa; 71 private SqliteDataAdapter landAccessListDa;
71 private SqliteDataAdapter regionSettingsDa; 72 private SqliteDataAdapter regionSettingsDa;
73 private SqliteDataAdapter regionWindlightDa;
72 74
73 private SqliteConnection m_conn; 75 private SqliteConnection m_conn;
74
75 private String m_connectionString; 76 private String m_connectionString;
76 77
77 protected virtual Assembly Assembly 78 protected virtual Assembly Assembly
@@ -136,6 +137,9 @@ namespace OpenSim.Data.SQLite
136 137
137 SqliteCommand regionSettingsSelectCmd = new SqliteCommand(regionSettingsSelect, m_conn); 138 SqliteCommand regionSettingsSelectCmd = new SqliteCommand(regionSettingsSelect, m_conn);
138 regionSettingsDa = new SqliteDataAdapter(regionSettingsSelectCmd); 139 regionSettingsDa = new SqliteDataAdapter(regionSettingsSelectCmd);
140
141 SqliteCommand regionWindlightSelectCmd = new SqliteCommand(regionWindlightSelect, m_conn);
142 regionWindlightDa = new SqliteDataAdapter(regionWindlightSelectCmd);
139 // This actually does the roll forward assembly stuff 143 // This actually does the roll forward assembly stuff
140 Migration m = new Migration(m_conn, Assembly, "RegionStore"); 144 Migration m = new Migration(m_conn, Assembly, "RegionStore");
141 m.Update(); 145 m.Update();
@@ -163,6 +167,9 @@ namespace OpenSim.Data.SQLite
163 ds.Tables.Add(createRegionSettingsTable()); 167 ds.Tables.Add(createRegionSettingsTable());
164 setupRegionSettingsCommands(regionSettingsDa, m_conn); 168 setupRegionSettingsCommands(regionSettingsDa, m_conn);
165 169
170 ds.Tables.Add(createRegionWindlightTable());
171 setupRegionWindlightCommands(regionWindlightDa, m_conn);
172
166 // WORKAROUND: This is a work around for sqlite on 173 // WORKAROUND: This is a work around for sqlite on
167 // windows, which gets really unhappy with blob columns 174 // windows, which gets really unhappy with blob columns
168 // that have no sample data in them. At some point we 175 // that have no sample data in them. At some point we
@@ -171,63 +178,72 @@ namespace OpenSim.Data.SQLite
171 { 178 {
172 primDa.Fill(ds.Tables["prims"]); 179 primDa.Fill(ds.Tables["prims"]);
173 } 180 }
174 catch (Exception) 181 catch (Exception e)
175 { 182 {
176 m_log.Info("[SQLITE REGION DB]: Caught fill error on prims table"); 183 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on prims table :{0}", e.Message);
177 } 184 }
178 185
179 try 186 try
180 { 187 {
181 shapeDa.Fill(ds.Tables["primshapes"]); 188 shapeDa.Fill(ds.Tables["primshapes"]);
182 } 189 }
183 catch (Exception) 190 catch (Exception e)
184 { 191 {
185 m_log.Info("[SQLITE REGION DB]: Caught fill error on primshapes table"); 192 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on primshapes table :{0}", e.Message);
186 } 193 }
187 194
188 try 195 try
189 { 196 {
190 itemsDa.Fill(ds.Tables["primitems"]); 197 itemsDa.Fill(ds.Tables["primitems"]);
191 } 198 }
192 catch (Exception) 199 catch (Exception e)
193 { 200 {
194 m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); 201 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on primitems table :{0}", e.Message);
195 } 202 }
196 203
197 try 204 try
198 { 205 {
199 terrainDa.Fill(ds.Tables["terrain"]); 206 terrainDa.Fill(ds.Tables["terrain"]);
200 } 207 }
201 catch (Exception) 208 catch (Exception e)
202 { 209 {
203 m_log.Info("[SQLITE REGION DB]: Caught fill error on terrain table"); 210 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on terrain table :{0}", e.Message);
204 } 211 }
205 212
206 try 213 try
207 { 214 {
208 landDa.Fill(ds.Tables["land"]); 215 landDa.Fill(ds.Tables["land"]);
209 } 216 }
210 catch (Exception) 217 catch (Exception e)
211 { 218 {
212 m_log.Info("[SQLITE REGION DB]: Caught fill error on land table"); 219 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on land table :{0}", e.Message);
213 } 220 }
214 221
215 try 222 try
216 { 223 {
217 landAccessListDa.Fill(ds.Tables["landaccesslist"]); 224 landAccessListDa.Fill(ds.Tables["landaccesslist"]);
218 } 225 }
219 catch (Exception) 226 catch (Exception e)
220 { 227 {
221 m_log.Info("[SQLITE REGION DB]: Caught fill error on landaccesslist table"); 228 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on landaccesslist table :{0}", e.Message);
222 } 229 }
223 230
224 try 231 try
225 { 232 {
226 regionSettingsDa.Fill(ds.Tables["regionsettings"]); 233 regionSettingsDa.Fill(ds.Tables["regionsettings"]);
227 } 234 }
228 catch (Exception) 235 catch (Exception e)
236 {
237 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionsettings table :{0}", e.Message);
238 }
239
240 try
241 {
242 regionWindlightDa.Fill(ds.Tables["regionwindlight"]);
243 }
244 catch (Exception e)
229 { 245 {
230 m_log.Info("[SQLITE REGION DB]: Caught fill error on regionsettings table"); 246 m_log.ErrorFormat("[SQLITE REGION DB]: Caught fill error on regionwindlight table :{0}", e.Message);
231 } 247 }
232 248
233 // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! 249 // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values!
@@ -240,14 +256,14 @@ namespace OpenSim.Data.SQLite
240 CreateDataSetMapping(landDa, "land"); 256 CreateDataSetMapping(landDa, "land");
241 CreateDataSetMapping(landAccessListDa, "landaccesslist"); 257 CreateDataSetMapping(landAccessListDa, "landaccesslist");
242 CreateDataSetMapping(regionSettingsDa, "regionsettings"); 258 CreateDataSetMapping(regionSettingsDa, "regionsettings");
259 CreateDataSetMapping(regionWindlightDa, "regionwindlight");
243 } 260 }
244 } 261 }
245 catch (Exception e) 262 catch (Exception e)
246 { 263 {
247 m_log.Error(e); 264 m_log.ErrorFormat("[SQLITE REGION DB]: ", e);
248 Environment.Exit(23); 265 Environment.Exit(23);
249 } 266 }
250
251 return; 267 return;
252 } 268 }
253 269
@@ -298,6 +314,11 @@ namespace OpenSim.Data.SQLite
298 regionSettingsDa.Dispose(); 314 regionSettingsDa.Dispose();
299 regionSettingsDa = null; 315 regionSettingsDa = null;
300 } 316 }
317 if (regionWindlightDa != null)
318 {
319 regionWindlightDa.Dispose();
320 regionWindlightDa = null;
321 }
301 } 322 }
302 323
303 public void StoreRegionSettings(RegionSettings rs) 324 public void StoreRegionSettings(RegionSettings rs)
@@ -321,19 +342,76 @@ namespace OpenSim.Data.SQLite
321 Commit(); 342 Commit();
322 } 343 }
323 } 344 }
345
346 /// <summary>
347 /// Load windlight settings from region storage
348 /// </summary>
349 /// <param name="regionUUID">RegionID</param>
324 public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID) 350 public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
325 { 351 {
326 //This connector doesn't support the windlight module yet 352 RegionLightShareData wl = null;
327 //Return default LL windlight settings 353
328 return new RegionLightShareData(); 354 lock (ds)
355 {
356 DataTable windlightTable = ds.Tables["regionwindlight"];
357 DataRow windlightRow = windlightTable.Rows.Find(regionUUID.ToString());
358 if (windlightRow == null)
359 {
360 wl = new RegionLightShareData();
361 wl.regionID = regionUUID;
362 StoreRegionWindlightSettings(wl);
363 return wl;
364 }
365 wl = buildRegionWindlight(windlightRow);
366 return wl;
367 }
329 } 368 }
369
370 /// <summary>
371 /// Remove windlight settings from region storage
372 /// </summary>
373 /// <param name="regionID">RegionID</param>
330 public void RemoveRegionWindlightSettings(UUID regionID) 374 public void RemoveRegionWindlightSettings(UUID regionID)
331 { 375 {
376 lock (ds)
377 {
378 DataTable windlightTable = ds.Tables["regionwindlight"];
379 DataRow windlightRow = windlightTable.Rows.Find(regionID.ToString());
380
381 if (windlightRow != null)
382 {
383 windlightRow.Delete();
384 }
385 }
386 Commit();
332 } 387 }
388
389 /// <summary>
390 /// Adds an windlight into region storage
391 /// </summary>
392 /// <param name="wl">RegionLightShareData</param>
333 public void StoreRegionWindlightSettings(RegionLightShareData wl) 393 public void StoreRegionWindlightSettings(RegionLightShareData wl)
334 { 394 {
335 //This connector doesn't support the windlight module yet 395 lock (ds)
396 {
397 DataTable windlightTable = ds.Tables["regionwindlight"];
398 DataRow windlightRow = windlightTable.Rows.Find(wl.regionID.ToString());
399
400 if (windlightRow == null)
401 {
402 windlightRow = windlightTable.NewRow();
403 fillRegionWindlightRow(windlightRow, wl);
404 windlightTable.Rows.Add(windlightRow);
405 }
406 else
407 {
408 fillRegionWindlightRow(windlightRow, wl);
409 }
410
411 Commit();
412 }
336 } 413 }
414
337 public RegionSettings LoadRegionSettings(UUID regionUUID) 415 public RegionSettings LoadRegionSettings(UUID regionUUID)
338 { 416 {
339 lock (ds) 417 lock (ds)
@@ -387,7 +465,7 @@ namespace OpenSim.Data.SQLite
387 } 465 }
388 466
389 Commit(); 467 Commit();
390 // m_log.Info("[Dump of prims]: " + ds.GetXml()); 468// m_log.Info("[Dump of prims]: " + ds.GetXml());
391 } 469 }
392 470
393 /// <summary> 471 /// <summary>
@@ -397,7 +475,7 @@ namespace OpenSim.Data.SQLite
397 /// <param name="regionUUID">the region UUID</param> 475 /// <param name="regionUUID">the region UUID</param>
398 public void RemoveObject(UUID obj, UUID regionUUID) 476 public void RemoveObject(UUID obj, UUID regionUUID)
399 { 477 {
400 // m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.Guid, regionUUID); 478// m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.Guid, regionUUID);
401 479
402 DataTable prims = ds.Tables["prims"]; 480 DataTable prims = ds.Tables["prims"];
403 DataTable shapes = ds.Tables["primshapes"]; 481 DataTable shapes = ds.Tables["primshapes"];
@@ -409,7 +487,7 @@ namespace OpenSim.Data.SQLite
409 foreach (DataRow row in primRows) 487 foreach (DataRow row in primRows)
410 { 488 {
411 // Remove shape rows 489 // Remove shape rows
412 UUID uuid = new UUID((string) row["UUID"]); 490 UUID uuid = new UUID((string)row["UUID"]);
413 DataRow shapeRow = shapes.Rows.Find(uuid.ToString()); 491 DataRow shapeRow = shapes.Rows.Find(uuid.ToString());
414 if (shapeRow != null) 492 if (shapeRow != null)
415 { 493 {
@@ -464,7 +542,7 @@ namespace OpenSim.Data.SQLite
464 { 542 {
465 DataRow[] primsForRegion = prims.Select(byRegion); 543 DataRow[] primsForRegion = prims.Select(byRegion);
466// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); 544// m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
467 545
468 // First, create all groups 546 // First, create all groups
469 foreach (DataRow primRow in primsForRegion) 547 foreach (DataRow primRow in primsForRegion)
470 { 548 {
@@ -472,9 +550,9 @@ namespace OpenSim.Data.SQLite
472 { 550 {
473 SceneObjectPart prim = null; 551 SceneObjectPart prim = null;
474 552
475 string uuid = (string) primRow["UUID"]; 553 string uuid = (string)primRow["UUID"];
476 string objID = (string) primRow["SceneGroupID"]; 554 string objID = (string)primRow["SceneGroupID"];
477 555
478 if (uuid == objID) //is new SceneObjectGroup ? 556 if (uuid == objID) //is new SceneObjectGroup ?
479 { 557 {
480 prim = buildPrim(primRow); 558 prim = buildPrim(primRow);
@@ -489,7 +567,7 @@ namespace OpenSim.Data.SQLite
489 "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); 567 "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape");
490 prim.Shape = PrimitiveBaseShape.Default; 568 prim.Shape = PrimitiveBaseShape.Default;
491 } 569 }
492 570
493 SceneObjectGroup group = new SceneObjectGroup(prim); 571 SceneObjectGroup group = new SceneObjectGroup(prim);
494 createdObjects.Add(group.UUID, group); 572 createdObjects.Add(group.UUID, group);
495 retvals.Add(group); 573 retvals.Add(group);
@@ -506,7 +584,7 @@ namespace OpenSim.Data.SQLite
506 } 584 }
507 } 585 }
508 } 586 }
509 587
510 // Now fill the groups with part data 588 // Now fill the groups with part data
511 foreach (DataRow primRow in primsForRegion) 589 foreach (DataRow primRow in primsForRegion)
512 { 590 {
@@ -514,8 +592,8 @@ namespace OpenSim.Data.SQLite
514 { 592 {
515 SceneObjectPart prim = null; 593 SceneObjectPart prim = null;
516 594
517 string uuid = (string) primRow["UUID"]; 595 string uuid = (string)primRow["UUID"];
518 string objID = (string) primRow["SceneGroupID"]; 596 string objID = (string)primRow["SceneGroupID"];
519 if (uuid != objID) //is new SceneObjectGroup ? 597 if (uuid != objID) //is new SceneObjectGroup ?
520 { 598 {
521 prim = buildPrim(primRow); 599 prim = buildPrim(primRow);
@@ -562,8 +640,7 @@ namespace OpenSim.Data.SQLite
562 DataRow[] dbItemRows = dbItems.Select(sql); 640 DataRow[] dbItemRows = dbItems.Select(sql);
563 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); 641 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
564 642
565// m_log.DebugFormat( 643// m_log.DebugFormat("[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID);
566// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID);
567 644
568 foreach (DataRow row in dbItemRows) 645 foreach (DataRow row in dbItemRows)
569 { 646 {
@@ -742,7 +819,7 @@ namespace OpenSim.Data.SQLite
742 // cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.LandData.GlobalID.ToString())); 819 // cmd.Parameters.Add(new SqliteParameter(":LandUUID", parcel.LandData.GlobalID.ToString()));
743 // cmd.ExecuteNonQuery(); 820 // cmd.ExecuteNonQuery();
744 821
745// } 822 // }
746 823
747 // This is the slower.. but more appropriate thing to do 824 // This is the slower.. but more appropriate thing to do
748 825
@@ -805,7 +882,7 @@ namespace OpenSim.Data.SQLite
805 /// </summary> 882 /// </summary>
806 public void Commit() 883 public void Commit()
807 { 884 {
808 //m_log.Debug("[SQLITE]: Starting commit"); 885// m_log.Debug("[SQLITE]: Starting commit");
809 lock (ds) 886 lock (ds)
810 { 887 {
811 primDa.Update(ds, "prims"); 888 primDa.Update(ds, "prims");
@@ -819,6 +896,7 @@ namespace OpenSim.Data.SQLite
819 try 896 try
820 { 897 {
821 regionSettingsDa.Update(ds, "regionsettings"); 898 regionSettingsDa.Update(ds, "regionsettings");
899 regionWindlightDa.Update(ds, "regionwindlight");
822 } 900 }
823 catch (SqliteException SqlEx) 901 catch (SqliteException SqlEx)
824 { 902 {
@@ -875,9 +953,9 @@ namespace OpenSim.Data.SQLite
875 { 953 {
876 DataTable terrain = new DataTable("terrain"); 954 DataTable terrain = new DataTable("terrain");
877 955
878 createCol(terrain, "RegionUUID", typeof (String)); 956 createCol(terrain, "RegionUUID", typeof(String));
879 createCol(terrain, "Revision", typeof (Int32)); 957 createCol(terrain, "Revision", typeof(Int32));
880 createCol(terrain, "Heightfield", typeof (Byte[])); 958 createCol(terrain, "Heightfield", typeof(Byte[]));
881 959
882 return terrain; 960 return terrain;
883 } 961 }
@@ -890,62 +968,62 @@ namespace OpenSim.Data.SQLite
890 { 968 {
891 DataTable prims = new DataTable("prims"); 969 DataTable prims = new DataTable("prims");
892 970
893 createCol(prims, "UUID", typeof (String)); 971 createCol(prims, "UUID", typeof(String));
894 createCol(prims, "RegionUUID", typeof (String)); 972 createCol(prims, "RegionUUID", typeof(String));
895 createCol(prims, "CreationDate", typeof (Int32)); 973 createCol(prims, "CreationDate", typeof(Int32));
896 createCol(prims, "Name", typeof (String)); 974 createCol(prims, "Name", typeof(String));
897 createCol(prims, "SceneGroupID", typeof (String)); 975 createCol(prims, "SceneGroupID", typeof(String));
898 // various text fields 976 // various text fields
899 createCol(prims, "Text", typeof (String)); 977 createCol(prims, "Text", typeof(String));
900 createCol(prims, "ColorR", typeof (Int32)); 978 createCol(prims, "ColorR", typeof(Int32));
901 createCol(prims, "ColorG", typeof (Int32)); 979 createCol(prims, "ColorG", typeof(Int32));
902 createCol(prims, "ColorB", typeof (Int32)); 980 createCol(prims, "ColorB", typeof(Int32));
903 createCol(prims, "ColorA", typeof (Int32)); 981 createCol(prims, "ColorA", typeof(Int32));
904 createCol(prims, "Description", typeof (String)); 982 createCol(prims, "Description", typeof(String));
905 createCol(prims, "SitName", typeof (String)); 983 createCol(prims, "SitName", typeof(String));
906 createCol(prims, "TouchName", typeof (String)); 984 createCol(prims, "TouchName", typeof(String));
907 // permissions 985 // permissions
908 createCol(prims, "ObjectFlags", typeof (Int32)); 986 createCol(prims, "ObjectFlags", typeof(Int32));
909 createCol(prims, "CreatorID", typeof (String)); 987 createCol(prims, "CreatorID", typeof(String));
910 createCol(prims, "OwnerID", typeof (String)); 988 createCol(prims, "OwnerID", typeof(String));
911 createCol(prims, "GroupID", typeof (String)); 989 createCol(prims, "GroupID", typeof(String));
912 createCol(prims, "LastOwnerID", typeof (String)); 990 createCol(prims, "LastOwnerID", typeof(String));
913 createCol(prims, "OwnerMask", typeof (Int32)); 991 createCol(prims, "OwnerMask", typeof(Int32));
914 createCol(prims, "NextOwnerMask", typeof (Int32)); 992 createCol(prims, "NextOwnerMask", typeof(Int32));
915 createCol(prims, "GroupMask", typeof (Int32)); 993 createCol(prims, "GroupMask", typeof(Int32));
916 createCol(prims, "EveryoneMask", typeof (Int32)); 994 createCol(prims, "EveryoneMask", typeof(Int32));
917 createCol(prims, "BaseMask", typeof (Int32)); 995 createCol(prims, "BaseMask", typeof(Int32));
918 // vectors 996 // vectors
919 createCol(prims, "PositionX", typeof (Double)); 997 createCol(prims, "PositionX", typeof(Double));
920 createCol(prims, "PositionY", typeof (Double)); 998 createCol(prims, "PositionY", typeof(Double));
921 createCol(prims, "PositionZ", typeof (Double)); 999 createCol(prims, "PositionZ", typeof(Double));
922 createCol(prims, "GroupPositionX", typeof (Double)); 1000 createCol(prims, "GroupPositionX", typeof(Double));
923 createCol(prims, "GroupPositionY", typeof (Double)); 1001 createCol(prims, "GroupPositionY", typeof(Double));
924 createCol(prims, "GroupPositionZ", typeof (Double)); 1002 createCol(prims, "GroupPositionZ", typeof(Double));
925 createCol(prims, "VelocityX", typeof (Double)); 1003 createCol(prims, "VelocityX", typeof(Double));
926 createCol(prims, "VelocityY", typeof (Double)); 1004 createCol(prims, "VelocityY", typeof(Double));
927 createCol(prims, "VelocityZ", typeof (Double)); 1005 createCol(prims, "VelocityZ", typeof(Double));
928 createCol(prims, "AngularVelocityX", typeof (Double)); 1006 createCol(prims, "AngularVelocityX", typeof(Double));
929 createCol(prims, "AngularVelocityY", typeof (Double)); 1007 createCol(prims, "AngularVelocityY", typeof(Double));
930 createCol(prims, "AngularVelocityZ", typeof (Double)); 1008 createCol(prims, "AngularVelocityZ", typeof(Double));
931 createCol(prims, "AccelerationX", typeof (Double)); 1009 createCol(prims, "AccelerationX", typeof(Double));
932 createCol(prims, "AccelerationY", typeof (Double)); 1010 createCol(prims, "AccelerationY", typeof(Double));
933 createCol(prims, "AccelerationZ", typeof (Double)); 1011 createCol(prims, "AccelerationZ", typeof(Double));
934 // quaternions 1012 // quaternions
935 createCol(prims, "RotationX", typeof (Double)); 1013 createCol(prims, "RotationX", typeof(Double));
936 createCol(prims, "RotationY", typeof (Double)); 1014 createCol(prims, "RotationY", typeof(Double));
937 createCol(prims, "RotationZ", typeof (Double)); 1015 createCol(prims, "RotationZ", typeof(Double));
938 createCol(prims, "RotationW", typeof (Double)); 1016 createCol(prims, "RotationW", typeof(Double));
939 1017
940 // sit target 1018 // sit target
941 createCol(prims, "SitTargetOffsetX", typeof (Double)); 1019 createCol(prims, "SitTargetOffsetX", typeof(Double));
942 createCol(prims, "SitTargetOffsetY", typeof (Double)); 1020 createCol(prims, "SitTargetOffsetY", typeof(Double));
943 createCol(prims, "SitTargetOffsetZ", typeof (Double)); 1021 createCol(prims, "SitTargetOffsetZ", typeof(Double));
944 1022
945 createCol(prims, "SitTargetOrientW", typeof (Double)); 1023 createCol(prims, "SitTargetOrientW", typeof(Double));
946 createCol(prims, "SitTargetOrientX", typeof (Double)); 1024 createCol(prims, "SitTargetOrientX", typeof(Double));
947 createCol(prims, "SitTargetOrientY", typeof (Double)); 1025 createCol(prims, "SitTargetOrientY", typeof(Double));
948 createCol(prims, "SitTargetOrientZ", typeof (Double)); 1026 createCol(prims, "SitTargetOrientZ", typeof(Double));
949 1027
950 createCol(prims, "PayPrice", typeof(Int32)); 1028 createCol(prims, "PayPrice", typeof(Int32));
951 createCol(prims, "PayButton1", typeof(Int32)); 1029 createCol(prims, "PayButton1", typeof(Int32));
@@ -981,7 +1059,7 @@ namespace OpenSim.Data.SQLite
981 createCol(prims, "SaleType", typeof(Int16)); 1059 createCol(prims, "SaleType", typeof(Int16));
982 1060
983 // click action 1061 // click action
984 createCol(prims, "ClickAction", typeof (Byte)); 1062 createCol(prims, "ClickAction", typeof(Byte));
985 1063
986 createCol(prims, "Material", typeof(Byte)); 1064 createCol(prims, "Material", typeof(Byte));
987 1065
@@ -993,7 +1071,7 @@ namespace OpenSim.Data.SQLite
993 createCol(prims, "MediaURL", typeof(String)); 1071 createCol(prims, "MediaURL", typeof(String));
994 1072
995 // Add in contraints 1073 // Add in contraints
996 prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]}; 1074 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
997 1075
998 return prims; 1076 return prims;
999 } 1077 }
@@ -1005,42 +1083,42 @@ namespace OpenSim.Data.SQLite
1005 private static DataTable createShapeTable() 1083 private static DataTable createShapeTable()
1006 { 1084 {
1007 DataTable shapes = new DataTable("primshapes"); 1085 DataTable shapes = new DataTable("primshapes");
1008 createCol(shapes, "UUID", typeof (String)); 1086 createCol(shapes, "UUID", typeof(String));
1009 // shape is an enum 1087 // shape is an enum
1010 createCol(shapes, "Shape", typeof (Int32)); 1088 createCol(shapes, "Shape", typeof(Int32));
1011 // vectors 1089 // vectors
1012 createCol(shapes, "ScaleX", typeof (Double)); 1090 createCol(shapes, "ScaleX", typeof(Double));
1013 createCol(shapes, "ScaleY", typeof (Double)); 1091 createCol(shapes, "ScaleY", typeof(Double));
1014 createCol(shapes, "ScaleZ", typeof (Double)); 1092 createCol(shapes, "ScaleZ", typeof(Double));
1015 // paths 1093 // paths
1016 createCol(shapes, "PCode", typeof (Int32)); 1094 createCol(shapes, "PCode", typeof(Int32));
1017 createCol(shapes, "PathBegin", typeof (Int32)); 1095 createCol(shapes, "PathBegin", typeof(Int32));
1018 createCol(shapes, "PathEnd", typeof (Int32)); 1096 createCol(shapes, "PathEnd", typeof(Int32));
1019 createCol(shapes, "PathScaleX", typeof (Int32)); 1097 createCol(shapes, "PathScaleX", typeof(Int32));
1020 createCol(shapes, "PathScaleY", typeof (Int32)); 1098 createCol(shapes, "PathScaleY", typeof(Int32));
1021 createCol(shapes, "PathShearX", typeof (Int32)); 1099 createCol(shapes, "PathShearX", typeof(Int32));
1022 createCol(shapes, "PathShearY", typeof (Int32)); 1100 createCol(shapes, "PathShearY", typeof(Int32));
1023 createCol(shapes, "PathSkew", typeof (Int32)); 1101 createCol(shapes, "PathSkew", typeof(Int32));
1024 createCol(shapes, "PathCurve", typeof (Int32)); 1102 createCol(shapes, "PathCurve", typeof(Int32));
1025 createCol(shapes, "PathRadiusOffset", typeof (Int32)); 1103 createCol(shapes, "PathRadiusOffset", typeof(Int32));
1026 createCol(shapes, "PathRevolutions", typeof (Int32)); 1104 createCol(shapes, "PathRevolutions", typeof(Int32));
1027 createCol(shapes, "PathTaperX", typeof (Int32)); 1105 createCol(shapes, "PathTaperX", typeof(Int32));
1028 createCol(shapes, "PathTaperY", typeof (Int32)); 1106 createCol(shapes, "PathTaperY", typeof(Int32));
1029 createCol(shapes, "PathTwist", typeof (Int32)); 1107 createCol(shapes, "PathTwist", typeof(Int32));
1030 createCol(shapes, "PathTwistBegin", typeof (Int32)); 1108 createCol(shapes, "PathTwistBegin", typeof(Int32));
1031 // profile 1109 // profile
1032 createCol(shapes, "ProfileBegin", typeof (Int32)); 1110 createCol(shapes, "ProfileBegin", typeof(Int32));
1033 createCol(shapes, "ProfileEnd", typeof (Int32)); 1111 createCol(shapes, "ProfileEnd", typeof(Int32));
1034 createCol(shapes, "ProfileCurve", typeof (Int32)); 1112 createCol(shapes, "ProfileCurve", typeof(Int32));
1035 createCol(shapes, "ProfileHollow", typeof (Int32)); 1113 createCol(shapes, "ProfileHollow", typeof(Int32));
1036 createCol(shapes, "State", typeof(Int32)); 1114 createCol(shapes, "State", typeof(Int32));
1037 // text TODO: this isn't right, but I'm not sure the right 1115 // text TODO: this isn't right, but I'm not sure the right
1038 // way to specify this as a blob atm 1116 // way to specify this as a blob atm
1039 createCol(shapes, "Texture", typeof (Byte[])); 1117 createCol(shapes, "Texture", typeof(Byte[]));
1040 createCol(shapes, "ExtraParams", typeof (Byte[])); 1118 createCol(shapes, "ExtraParams", typeof(Byte[]));
1041 createCol(shapes, "Media", typeof(String)); 1119 createCol(shapes, "Media", typeof(String));
1042 1120
1043 shapes.PrimaryKey = new DataColumn[] {shapes.Columns["UUID"]}; 1121 shapes.PrimaryKey = new DataColumn[] { shapes.Columns["UUID"] };
1044 1122
1045 return shapes; 1123 return shapes;
1046 } 1124 }
@@ -1053,29 +1131,29 @@ namespace OpenSim.Data.SQLite
1053 { 1131 {
1054 DataTable items = new DataTable("primitems"); 1132 DataTable items = new DataTable("primitems");
1055 1133
1056 createCol(items, "itemID", typeof (String)); 1134 createCol(items, "itemID", typeof(String));
1057 createCol(items, "primID", typeof (String)); 1135 createCol(items, "primID", typeof(String));
1058 createCol(items, "assetID", typeof (String)); 1136 createCol(items, "assetID", typeof(String));
1059 createCol(items, "parentFolderID", typeof (String)); 1137 createCol(items, "parentFolderID", typeof(String));
1060 1138
1061 createCol(items, "invType", typeof (Int32)); 1139 createCol(items, "invType", typeof(Int32));
1062 createCol(items, "assetType", typeof (Int32)); 1140 createCol(items, "assetType", typeof(Int32));
1063 1141
1064 createCol(items, "name", typeof (String)); 1142 createCol(items, "name", typeof(String));
1065 createCol(items, "description", typeof (String)); 1143 createCol(items, "description", typeof(String));
1066 1144
1067 createCol(items, "creationDate", typeof (Int64)); 1145 createCol(items, "creationDate", typeof(Int64));
1068 createCol(items, "creatorID", typeof (String)); 1146 createCol(items, "creatorID", typeof(String));
1069 createCol(items, "ownerID", typeof (String)); 1147 createCol(items, "ownerID", typeof(String));
1070 createCol(items, "lastOwnerID", typeof (String)); 1148 createCol(items, "lastOwnerID", typeof(String));
1071 createCol(items, "groupID", typeof (String)); 1149 createCol(items, "groupID", typeof(String));
1072 1150
1073 createCol(items, "nextPermissions", typeof (UInt32)); 1151 createCol(items, "nextPermissions", typeof(UInt32));
1074 createCol(items, "currentPermissions", typeof (UInt32)); 1152 createCol(items, "currentPermissions", typeof(UInt32));
1075 createCol(items, "basePermissions", typeof (UInt32)); 1153 createCol(items, "basePermissions", typeof(UInt32));
1076 createCol(items, "everyonePermissions", typeof (UInt32)); 1154 createCol(items, "everyonePermissions", typeof(UInt32));
1077 createCol(items, "groupPermissions", typeof (UInt32)); 1155 createCol(items, "groupPermissions", typeof(UInt32));
1078 createCol(items, "flags", typeof (UInt32)); 1156 createCol(items, "flags", typeof(UInt32));
1079 1157
1080 items.PrimaryKey = new DataColumn[] { items.Columns["itemID"] }; 1158 items.PrimaryKey = new DataColumn[] { items.Columns["itemID"] };
1081 1159
@@ -1089,44 +1167,44 @@ namespace OpenSim.Data.SQLite
1089 private static DataTable createLandTable() 1167 private static DataTable createLandTable()
1090 { 1168 {
1091 DataTable land = new DataTable("land"); 1169 DataTable land = new DataTable("land");
1092 createCol(land, "UUID", typeof (String)); 1170 createCol(land, "UUID", typeof(String));
1093 createCol(land, "RegionUUID", typeof (String)); 1171 createCol(land, "RegionUUID", typeof(String));
1094 createCol(land, "LocalLandID", typeof (UInt32)); 1172 createCol(land, "LocalLandID", typeof(UInt32));
1095 1173
1096 // Bitmap is a byte[512] 1174 // Bitmap is a byte[512]
1097 createCol(land, "Bitmap", typeof (Byte[])); 1175 createCol(land, "Bitmap", typeof(Byte[]));
1098 1176
1099 createCol(land, "Name", typeof (String)); 1177 createCol(land, "Name", typeof(String));
1100 createCol(land, "Desc", typeof (String)); 1178 createCol(land, "Desc", typeof(String));
1101 createCol(land, "OwnerUUID", typeof (String)); 1179 createCol(land, "OwnerUUID", typeof(String));
1102 createCol(land, "IsGroupOwned", typeof (Boolean)); 1180 createCol(land, "IsGroupOwned", typeof(Boolean));
1103 createCol(land, "Area", typeof (Int32)); 1181 createCol(land, "Area", typeof(Int32));
1104 createCol(land, "AuctionID", typeof (Int32)); //Unemplemented 1182 createCol(land, "AuctionID", typeof(Int32)); //Unemplemented
1105 createCol(land, "Category", typeof (Int32)); //Enum OpenMetaverse.Parcel.ParcelCategory 1183 createCol(land, "Category", typeof(Int32)); //Enum OpenMetaverse.Parcel.ParcelCategory
1106 createCol(land, "ClaimDate", typeof (Int32)); 1184 createCol(land, "ClaimDate", typeof(Int32));
1107 createCol(land, "ClaimPrice", typeof (Int32)); 1185 createCol(land, "ClaimPrice", typeof(Int32));
1108 createCol(land, "GroupUUID", typeof (string)); 1186 createCol(land, "GroupUUID", typeof(string));
1109 createCol(land, "SalePrice", typeof (Int32)); 1187 createCol(land, "SalePrice", typeof(Int32));
1110 createCol(land, "LandStatus", typeof (Int32)); //Enum. OpenMetaverse.Parcel.ParcelStatus 1188 createCol(land, "LandStatus", typeof(Int32)); //Enum. OpenMetaverse.Parcel.ParcelStatus
1111 createCol(land, "LandFlags", typeof (UInt32)); 1189 createCol(land, "LandFlags", typeof(UInt32));
1112 createCol(land, "LandingType", typeof (Byte)); 1190 createCol(land, "LandingType", typeof(Byte));
1113 createCol(land, "MediaAutoScale", typeof (Byte)); 1191 createCol(land, "MediaAutoScale", typeof(Byte));
1114 createCol(land, "MediaTextureUUID", typeof (String)); 1192 createCol(land, "MediaTextureUUID", typeof(String));
1115 createCol(land, "MediaURL", typeof (String)); 1193 createCol(land, "MediaURL", typeof(String));
1116 createCol(land, "MusicURL", typeof (String)); 1194 createCol(land, "MusicURL", typeof(String));
1117 createCol(land, "PassHours", typeof (Double)); 1195 createCol(land, "PassHours", typeof(Double));
1118 createCol(land, "PassPrice", typeof (UInt32)); 1196 createCol(land, "PassPrice", typeof(UInt32));
1119 createCol(land, "SnapshotUUID", typeof (String)); 1197 createCol(land, "SnapshotUUID", typeof(String));
1120 createCol(land, "UserLocationX", typeof (Double)); 1198 createCol(land, "UserLocationX", typeof(Double));
1121 createCol(land, "UserLocationY", typeof (Double)); 1199 createCol(land, "UserLocationY", typeof(Double));
1122 createCol(land, "UserLocationZ", typeof (Double)); 1200 createCol(land, "UserLocationZ", typeof(Double));
1123 createCol(land, "UserLookAtX", typeof (Double)); 1201 createCol(land, "UserLookAtX", typeof(Double));
1124 createCol(land, "UserLookAtY", typeof (Double)); 1202 createCol(land, "UserLookAtY", typeof(Double));
1125 createCol(land, "UserLookAtZ", typeof (Double)); 1203 createCol(land, "UserLookAtZ", typeof(Double));
1126 createCol(land, "AuthbuyerID", typeof(String)); 1204 createCol(land, "AuthbuyerID", typeof(String));
1127 createCol(land, "OtherCleanTime", typeof(Int32)); 1205 createCol(land, "OtherCleanTime", typeof(Int32));
1128 1206
1129 land.PrimaryKey = new DataColumn[] {land.Columns["UUID"]}; 1207 land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] };
1130 1208
1131 return land; 1209 return land;
1132 } 1210 }
@@ -1138,9 +1216,9 @@ namespace OpenSim.Data.SQLite
1138 private static DataTable createLandAccessListTable() 1216 private static DataTable createLandAccessListTable()
1139 { 1217 {
1140 DataTable landaccess = new DataTable("landaccesslist"); 1218 DataTable landaccess = new DataTable("landaccesslist");
1141 createCol(landaccess, "LandUUID", typeof (String)); 1219 createCol(landaccess, "LandUUID", typeof(String));
1142 createCol(landaccess, "AccessUUID", typeof (String)); 1220 createCol(landaccess, "AccessUUID", typeof(String));
1143 createCol(landaccess, "Flags", typeof (UInt32)); 1221 createCol(landaccess, "Flags", typeof(UInt32));
1144 1222
1145 return landaccess; 1223 return landaccess;
1146 } 1224 }
@@ -1149,41 +1227,41 @@ namespace OpenSim.Data.SQLite
1149 { 1227 {
1150 DataTable regionsettings = new DataTable("regionsettings"); 1228 DataTable regionsettings = new DataTable("regionsettings");
1151 createCol(regionsettings, "regionUUID", typeof(String)); 1229 createCol(regionsettings, "regionUUID", typeof(String));
1152 createCol(regionsettings, "block_terraform", typeof (Int32)); 1230 createCol(regionsettings, "block_terraform", typeof(Int32));
1153 createCol(regionsettings, "block_fly", typeof (Int32)); 1231 createCol(regionsettings, "block_fly", typeof(Int32));
1154 createCol(regionsettings, "allow_damage", typeof (Int32)); 1232 createCol(regionsettings, "allow_damage", typeof(Int32));
1155 createCol(regionsettings, "restrict_pushing", typeof (Int32)); 1233 createCol(regionsettings, "restrict_pushing", typeof(Int32));
1156 createCol(regionsettings, "allow_land_resell", typeof (Int32)); 1234 createCol(regionsettings, "allow_land_resell", typeof(Int32));
1157 createCol(regionsettings, "allow_land_join_divide", typeof (Int32)); 1235 createCol(regionsettings, "allow_land_join_divide", typeof(Int32));
1158 createCol(regionsettings, "block_show_in_search", typeof (Int32)); 1236 createCol(regionsettings, "block_show_in_search", typeof(Int32));
1159 createCol(regionsettings, "agent_limit", typeof (Int32)); 1237 createCol(regionsettings, "agent_limit", typeof(Int32));
1160 createCol(regionsettings, "object_bonus", typeof (Double)); 1238 createCol(regionsettings, "object_bonus", typeof(Double));
1161 createCol(regionsettings, "maturity", typeof (Int32)); 1239 createCol(regionsettings, "maturity", typeof(Int32));
1162 createCol(regionsettings, "disable_scripts", typeof (Int32)); 1240 createCol(regionsettings, "disable_scripts", typeof(Int32));
1163 createCol(regionsettings, "disable_collisions", typeof (Int32)); 1241 createCol(regionsettings, "disable_collisions", typeof(Int32));
1164 createCol(regionsettings, "disable_physics", typeof (Int32)); 1242 createCol(regionsettings, "disable_physics", typeof(Int32));
1165 createCol(regionsettings, "terrain_texture_1", typeof(String)); 1243 createCol(regionsettings, "terrain_texture_1", typeof(String));
1166 createCol(regionsettings, "terrain_texture_2", typeof(String)); 1244 createCol(regionsettings, "terrain_texture_2", typeof(String));
1167 createCol(regionsettings, "terrain_texture_3", typeof(String)); 1245 createCol(regionsettings, "terrain_texture_3", typeof(String));
1168 createCol(regionsettings, "terrain_texture_4", typeof(String)); 1246 createCol(regionsettings, "terrain_texture_4", typeof(String));
1169 createCol(regionsettings, "elevation_1_nw", typeof (Double)); 1247 createCol(regionsettings, "elevation_1_nw", typeof(Double));
1170 createCol(regionsettings, "elevation_2_nw", typeof (Double)); 1248 createCol(regionsettings, "elevation_2_nw", typeof(Double));
1171 createCol(regionsettings, "elevation_1_ne", typeof (Double)); 1249 createCol(regionsettings, "elevation_1_ne", typeof(Double));
1172 createCol(regionsettings, "elevation_2_ne", typeof (Double)); 1250 createCol(regionsettings, "elevation_2_ne", typeof(Double));
1173 createCol(regionsettings, "elevation_1_se", typeof (Double)); 1251 createCol(regionsettings, "elevation_1_se", typeof(Double));
1174 createCol(regionsettings, "elevation_2_se", typeof (Double)); 1252 createCol(regionsettings, "elevation_2_se", typeof(Double));
1175 createCol(regionsettings, "elevation_1_sw", typeof (Double)); 1253 createCol(regionsettings, "elevation_1_sw", typeof(Double));
1176 createCol(regionsettings, "elevation_2_sw", typeof (Double)); 1254 createCol(regionsettings, "elevation_2_sw", typeof(Double));
1177 createCol(regionsettings, "water_height", typeof (Double)); 1255 createCol(regionsettings, "water_height", typeof(Double));
1178 createCol(regionsettings, "terrain_raise_limit", typeof (Double)); 1256 createCol(regionsettings, "terrain_raise_limit", typeof(Double));
1179 createCol(regionsettings, "terrain_lower_limit", typeof (Double)); 1257 createCol(regionsettings, "terrain_lower_limit", typeof(Double));
1180 createCol(regionsettings, "use_estate_sun", typeof (Int32)); 1258 createCol(regionsettings, "use_estate_sun", typeof(Int32));
1181 createCol(regionsettings, "sandbox", typeof (Int32)); 1259 createCol(regionsettings, "sandbox", typeof(Int32));
1182 createCol(regionsettings, "sunvectorx",typeof (Double)); 1260 createCol(regionsettings, "sunvectorx", typeof(Double));
1183 createCol(regionsettings, "sunvectory",typeof (Double)); 1261 createCol(regionsettings, "sunvectory", typeof(Double));
1184 createCol(regionsettings, "sunvectorz",typeof (Double)); 1262 createCol(regionsettings, "sunvectorz", typeof(Double));
1185 createCol(regionsettings, "fixed_sun", typeof (Int32)); 1263 createCol(regionsettings, "fixed_sun", typeof(Int32));
1186 createCol(regionsettings, "sun_position", typeof (Double)); 1264 createCol(regionsettings, "sun_position", typeof(Double));
1187 createCol(regionsettings, "covenant", typeof(String)); 1265 createCol(regionsettings, "covenant", typeof(String));
1188 createCol(regionsettings, "covenant_datetime", typeof(Int32)); 1266 createCol(regionsettings, "covenant_datetime", typeof(Int32));
1189 createCol(regionsettings, "map_tile_ID", typeof(String)); 1267 createCol(regionsettings, "map_tile_ID", typeof(String));
@@ -1191,6 +1269,82 @@ namespace OpenSim.Data.SQLite
1191 return regionsettings; 1269 return regionsettings;
1192 } 1270 }
1193 1271
1272 /// <summary>
1273 /// create "regionwindlight" table
1274 /// </summary>
1275 /// <returns>RegionWindlight DataTable</returns>
1276 private static DataTable createRegionWindlightTable()
1277 {
1278 DataTable regionwindlight = new DataTable("regionwindlight");
1279 createCol(regionwindlight, "region_id", typeof(String));
1280 createCol(regionwindlight, "water_color_r", typeof(Double));
1281 createCol(regionwindlight, "water_color_g", typeof(Double));
1282 createCol(regionwindlight, "water_color_b", typeof(Double));
1283 createCol(regionwindlight, "water_color_i", typeof(Double));
1284 createCol(regionwindlight, "water_fog_density_exponent", typeof(Double));
1285 createCol(regionwindlight, "underwater_fog_modifier", typeof(Double));
1286 createCol(regionwindlight, "reflection_wavelet_scale_1", typeof(Double));
1287 createCol(regionwindlight, "reflection_wavelet_scale_2", typeof(Double));
1288 createCol(regionwindlight, "reflection_wavelet_scale_3", typeof(Double));
1289 createCol(regionwindlight, "fresnel_scale", typeof(Double));
1290 createCol(regionwindlight, "fresnel_offset", typeof(Double));
1291 createCol(regionwindlight, "refract_scale_above", typeof(Double));
1292 createCol(regionwindlight, "refract_scale_below", typeof(Double));
1293 createCol(regionwindlight, "blur_multiplier", typeof(Double));
1294 createCol(regionwindlight, "big_wave_direction_x", typeof(Double));
1295 createCol(regionwindlight, "big_wave_direction_y", typeof(Double));
1296 createCol(regionwindlight, "little_wave_direction_x", typeof(Double));
1297 createCol(regionwindlight, "little_wave_direction_y", typeof(Double));
1298 createCol(regionwindlight, "normal_map_texture", typeof(String));
1299 createCol(regionwindlight, "horizon_r", typeof(Double));
1300 createCol(regionwindlight, "horizon_g", typeof(Double));
1301 createCol(regionwindlight, "horizon_b", typeof(Double));
1302 createCol(regionwindlight, "horizon_i", typeof(Double));
1303 createCol(regionwindlight, "haze_horizon", typeof(Double));
1304 createCol(regionwindlight, "blue_density_r", typeof(Double));
1305 createCol(regionwindlight, "blue_density_g", typeof(Double));
1306 createCol(regionwindlight, "blue_density_b", typeof(Double));
1307 createCol(regionwindlight, "blue_density_i", typeof(Double));
1308 createCol(regionwindlight, "haze_density", typeof(Double));
1309 createCol(regionwindlight, "density_multiplier", typeof(Double));
1310 createCol(regionwindlight, "distance_multiplier", typeof(Double));
1311 createCol(regionwindlight, "max_altitude", typeof(Int32));
1312 createCol(regionwindlight, "sun_moon_color_r", typeof(Double));
1313 createCol(regionwindlight, "sun_moon_color_g", typeof(Double));
1314 createCol(regionwindlight, "sun_moon_color_b", typeof(Double));
1315 createCol(regionwindlight, "sun_moon_color_i", typeof(Double));
1316 createCol(regionwindlight, "sun_moon_position", typeof(Double));
1317 createCol(regionwindlight, "ambient_r", typeof(Double));
1318 createCol(regionwindlight, "ambient_g", typeof(Double));
1319 createCol(regionwindlight, "ambient_b", typeof(Double));
1320 createCol(regionwindlight, "ambient_i", typeof(Double));
1321 createCol(regionwindlight, "east_angle", typeof(Double));
1322 createCol(regionwindlight, "sun_glow_focus", typeof(Double));
1323 createCol(regionwindlight, "sun_glow_size", typeof(Double));
1324 createCol(regionwindlight, "scene_gamma", typeof(Double));
1325 createCol(regionwindlight, "star_brightness", typeof(Double));
1326 createCol(regionwindlight, "cloud_color_r", typeof(Double));
1327 createCol(regionwindlight, "cloud_color_g", typeof(Double));
1328 createCol(regionwindlight, "cloud_color_b", typeof(Double));
1329 createCol(regionwindlight, "cloud_color_i", typeof(Double));
1330 createCol(regionwindlight, "cloud_x", typeof(Double));
1331 createCol(regionwindlight, "cloud_y", typeof(Double));
1332 createCol(regionwindlight, "cloud_density", typeof(Double));
1333 createCol(regionwindlight, "cloud_coverage", typeof(Double));
1334 createCol(regionwindlight, "cloud_scale", typeof(Double));
1335 createCol(regionwindlight, "cloud_detail_x", typeof(Double));
1336 createCol(regionwindlight, "cloud_detail_y", typeof(Double));
1337 createCol(regionwindlight, "cloud_detail_density", typeof(Double));
1338 createCol(regionwindlight, "cloud_scroll_x", typeof(Double));
1339 createCol(regionwindlight, "cloud_scroll_x_lock", typeof(Int32));
1340 createCol(regionwindlight, "cloud_scroll_y", typeof(Double));
1341 createCol(regionwindlight, "cloud_scroll_y_lock", typeof(Int32));
1342 createCol(regionwindlight, "draw_classic_clouds", typeof(Int32));
1343
1344 regionwindlight.PrimaryKey = new DataColumn[] { regionwindlight.Columns["region_id"] };
1345 return regionwindlight;
1346 }
1347
1194 /*********************************************************************** 1348 /***********************************************************************
1195 * 1349 *
1196 * Convert between ADO.NET <=> OpenSim Objects 1350 * Convert between ADO.NET <=> OpenSim Objects
@@ -1229,26 +1383,26 @@ namespace OpenSim.Data.SQLite
1229 // back out. Not enough time to figure it out yet. 1383 // back out. Not enough time to figure it out yet.
1230 1384
1231 SceneObjectPart prim = new SceneObjectPart(); 1385 SceneObjectPart prim = new SceneObjectPart();
1232 prim.UUID = new UUID((String) row["UUID"]); 1386 prim.UUID = new UUID((String)row["UUID"]);
1233 // explicit conversion of integers is required, which sort 1387 // explicit conversion of integers is required, which sort
1234 // of sucks. No idea if there is a shortcut here or not. 1388 // of sucks. No idea if there is a shortcut here or not.
1235 prim.CreationDate = Convert.ToInt32(row["CreationDate"]); 1389 prim.CreationDate = Convert.ToInt32(row["CreationDate"]);
1236 prim.Name = row["Name"] == DBNull.Value ? string.Empty : (string)row["Name"]; 1390 prim.Name = row["Name"] == DBNull.Value ? string.Empty : (string)row["Name"];
1237 // various text fields 1391 // various text fields
1238 prim.Text = (String) row["Text"]; 1392 prim.Text = (String)row["Text"];
1239 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]), 1393 prim.Color = Color.FromArgb(Convert.ToInt32(row["ColorA"]),
1240 Convert.ToInt32(row["ColorR"]), 1394 Convert.ToInt32(row["ColorR"]),
1241 Convert.ToInt32(row["ColorG"]), 1395 Convert.ToInt32(row["ColorG"]),
1242 Convert.ToInt32(row["ColorB"])); 1396 Convert.ToInt32(row["ColorB"]));
1243 prim.Description = (String) row["Description"]; 1397 prim.Description = (String)row["Description"];
1244 prim.SitName = (String) row["SitName"]; 1398 prim.SitName = (String)row["SitName"];
1245 prim.TouchName = (String) row["TouchName"]; 1399 prim.TouchName = (String)row["TouchName"];
1246 // permissions 1400 // permissions
1247 prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); 1401 prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]);
1248 prim.CreatorIdentification = (String) row["CreatorID"]; 1402 prim.CreatorIdentification = (String)row["CreatorID"];
1249 prim.OwnerID = new UUID((String) row["OwnerID"]); 1403 prim.OwnerID = new UUID((String)row["OwnerID"]);
1250 prim.GroupID = new UUID((String) row["GroupID"]); 1404 prim.GroupID = new UUID((String)row["GroupID"]);
1251 prim.LastOwnerID = new UUID((String) row["LastOwnerID"]); 1405 prim.LastOwnerID = new UUID((String)row["LastOwnerID"]);
1252 prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]); 1406 prim.OwnerMask = Convert.ToUInt32(row["OwnerMask"]);
1253 prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]); 1407 prim.NextOwnerMask = Convert.ToUInt32(row["NextOwnerMask"]);
1254 prim.GroupMask = Convert.ToUInt32(row["GroupMask"]); 1408 prim.GroupMask = Convert.ToUInt32(row["GroupMask"]);
@@ -1360,7 +1514,7 @@ namespace OpenSim.Data.SQLite
1360 1514
1361 if (!(row["MediaURL"] is System.DBNull)) 1515 if (!(row["MediaURL"] is System.DBNull))
1362 { 1516 {
1363 //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); 1517// m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
1364 prim.MediaUrl = (string)row["MediaURL"]; 1518 prim.MediaUrl = (string)row["MediaURL"];
1365 } 1519 }
1366 1520
@@ -1376,28 +1530,28 @@ namespace OpenSim.Data.SQLite
1376 { 1530 {
1377 TaskInventoryItem taskItem = new TaskInventoryItem(); 1531 TaskInventoryItem taskItem = new TaskInventoryItem();
1378 1532
1379 taskItem.ItemID = new UUID((String)row["itemID"]); 1533 taskItem.ItemID = new UUID((String)row["itemID"]);
1380 taskItem.ParentPartID = new UUID((String)row["primID"]); 1534 taskItem.ParentPartID = new UUID((String)row["primID"]);
1381 taskItem.AssetID = new UUID((String)row["assetID"]); 1535 taskItem.AssetID = new UUID((String)row["assetID"]);
1382 taskItem.ParentID = new UUID((String)row["parentFolderID"]); 1536 taskItem.ParentID = new UUID((String)row["parentFolderID"]);
1383 1537
1384 taskItem.InvType = Convert.ToInt32(row["invType"]); 1538 taskItem.InvType = Convert.ToInt32(row["invType"]);
1385 taskItem.Type = Convert.ToInt32(row["assetType"]); 1539 taskItem.Type = Convert.ToInt32(row["assetType"]);
1386 1540
1387 taskItem.Name = (String)row["name"]; 1541 taskItem.Name = (String)row["name"];
1388 taskItem.Description = (String)row["description"]; 1542 taskItem.Description = (String)row["description"];
1389 taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); 1543 taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
1390 taskItem.CreatorIdentification = (String)row["creatorID"]; 1544 taskItem.CreatorIdentification = (String)row["creatorID"];
1391 taskItem.OwnerID = new UUID((String)row["ownerID"]); 1545 taskItem.OwnerID = new UUID((String)row["ownerID"]);
1392 taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]); 1546 taskItem.LastOwnerID = new UUID((String)row["lastOwnerID"]);
1393 taskItem.GroupID = new UUID((String)row["groupID"]); 1547 taskItem.GroupID = new UUID((String)row["groupID"]);
1394 1548
1395 taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]); 1549 taskItem.NextPermissions = Convert.ToUInt32(row["nextPermissions"]);
1396 taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]); 1550 taskItem.CurrentPermissions = Convert.ToUInt32(row["currentPermissions"]);
1397 taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]); 1551 taskItem.BasePermissions = Convert.ToUInt32(row["basePermissions"]);
1398 taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]); 1552 taskItem.EveryonePermissions = Convert.ToUInt32(row["everyonePermissions"]);
1399 taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]); 1553 taskItem.GroupPermissions = Convert.ToUInt32(row["groupPermissions"]);
1400 taskItem.Flags = Convert.ToUInt32(row["flags"]); 1554 taskItem.Flags = Convert.ToUInt32(row["flags"]);
1401 1555
1402 return taskItem; 1556 return taskItem;
1403 } 1557 }
@@ -1411,35 +1565,35 @@ namespace OpenSim.Data.SQLite
1411 { 1565 {
1412 LandData newData = new LandData(); 1566 LandData newData = new LandData();
1413 1567
1414 newData.GlobalID = new UUID((String) row["UUID"]); 1568 newData.GlobalID = new UUID((String)row["UUID"]);
1415 newData.LocalID = Convert.ToInt32(row["LocalLandID"]); 1569 newData.LocalID = Convert.ToInt32(row["LocalLandID"]);
1416 1570
1417 // Bitmap is a byte[512] 1571 // Bitmap is a byte[512]
1418 newData.Bitmap = (Byte[]) row["Bitmap"]; 1572 newData.Bitmap = (Byte[])row["Bitmap"];
1419 1573
1420 newData.Name = (String) row["Name"]; 1574 newData.Name = (String)row["Name"];
1421 newData.Description = (String) row["Desc"]; 1575 newData.Description = (String)row["Desc"];
1422 newData.OwnerID = (UUID)(String) row["OwnerUUID"]; 1576 newData.OwnerID = (UUID)(String)row["OwnerUUID"];
1423 newData.IsGroupOwned = (Boolean) row["IsGroupOwned"]; 1577 newData.IsGroupOwned = (Boolean)row["IsGroupOwned"];
1424 newData.Area = Convert.ToInt32(row["Area"]); 1578 newData.Area = Convert.ToInt32(row["Area"]);
1425 newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented 1579 newData.AuctionID = Convert.ToUInt32(row["AuctionID"]); //Unemplemented
1426 newData.Category = (ParcelCategory) Convert.ToInt32(row["Category"]); 1580 newData.Category = (ParcelCategory)Convert.ToInt32(row["Category"]);
1427 //Enum OpenMetaverse.Parcel.ParcelCategory 1581 //Enum OpenMetaverse.Parcel.ParcelCategory
1428 newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]); 1582 newData.ClaimDate = Convert.ToInt32(row["ClaimDate"]);
1429 newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]); 1583 newData.ClaimPrice = Convert.ToInt32(row["ClaimPrice"]);
1430 newData.GroupID = new UUID((String) row["GroupUUID"]); 1584 newData.GroupID = new UUID((String)row["GroupUUID"]);
1431 newData.SalePrice = Convert.ToInt32(row["SalePrice"]); 1585 newData.SalePrice = Convert.ToInt32(row["SalePrice"]);
1432 newData.Status = (ParcelStatus) Convert.ToInt32(row["LandStatus"]); 1586 newData.Status = (ParcelStatus)Convert.ToInt32(row["LandStatus"]);
1433 //Enum. OpenMetaverse.Parcel.ParcelStatus 1587 //Enum. OpenMetaverse.Parcel.ParcelStatus
1434 newData.Flags = Convert.ToUInt32(row["LandFlags"]); 1588 newData.Flags = Convert.ToUInt32(row["LandFlags"]);
1435 newData.LandingType = (Byte) row["LandingType"]; 1589 newData.LandingType = (Byte)row["LandingType"];
1436 newData.MediaAutoScale = (Byte) row["MediaAutoScale"]; 1590 newData.MediaAutoScale = (Byte)row["MediaAutoScale"];
1437 newData.MediaID = new UUID((String) row["MediaTextureUUID"]); 1591 newData.MediaID = new UUID((String)row["MediaTextureUUID"]);
1438 newData.MediaURL = (String) row["MediaURL"]; 1592 newData.MediaURL = (String)row["MediaURL"];
1439 newData.MusicURL = (String) row["MusicURL"]; 1593 newData.MusicURL = (String)row["MusicURL"];
1440 newData.PassHours = Convert.ToSingle(row["PassHours"]); 1594 newData.PassHours = Convert.ToSingle(row["PassHours"]);
1441 newData.PassPrice = Convert.ToInt32(row["PassPrice"]); 1595 newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
1442 newData.SnapshotID = (UUID)(String) row["SnapshotUUID"]; 1596 newData.SnapshotID = (UUID)(String)row["SnapshotUUID"];
1443 try 1597 try
1444 { 1598 {
1445 1599
@@ -1471,7 +1625,7 @@ namespace OpenSim.Data.SQLite
1471 { 1625 {
1472 RegionSettings newSettings = new RegionSettings(); 1626 RegionSettings newSettings = new RegionSettings();
1473 1627
1474 newSettings.RegionUUID = new UUID((string) row["regionUUID"]); 1628 newSettings.RegionUUID = new UUID((string)row["regionUUID"]);
1475 newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]); 1629 newSettings.BlockTerraform = Convert.ToBoolean(row["block_terraform"]);
1476 newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]); 1630 newSettings.AllowDamage = Convert.ToBoolean(row["allow_damage"]);
1477 newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]); 1631 newSettings.BlockFly = Convert.ToBoolean(row["block_fly"]);
@@ -1485,10 +1639,10 @@ namespace OpenSim.Data.SQLite
1485 newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]); 1639 newSettings.DisableScripts = Convert.ToBoolean(row["disable_scripts"]);
1486 newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]); 1640 newSettings.DisableCollisions = Convert.ToBoolean(row["disable_collisions"]);
1487 newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]); 1641 newSettings.DisablePhysics = Convert.ToBoolean(row["disable_physics"]);
1488 newSettings.TerrainTexture1 = new UUID((String) row["terrain_texture_1"]); 1642 newSettings.TerrainTexture1 = new UUID((String)row["terrain_texture_1"]);
1489 newSettings.TerrainTexture2 = new UUID((String) row["terrain_texture_2"]); 1643 newSettings.TerrainTexture2 = new UUID((String)row["terrain_texture_2"]);
1490 newSettings.TerrainTexture3 = new UUID((String) row["terrain_texture_3"]); 1644 newSettings.TerrainTexture3 = new UUID((String)row["terrain_texture_3"]);
1491 newSettings.TerrainTexture4 = new UUID((String) row["terrain_texture_4"]); 1645 newSettings.TerrainTexture4 = new UUID((String)row["terrain_texture_4"]);
1492 newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]); 1646 newSettings.Elevation1NW = Convert.ToDouble(row["elevation_1_nw"]);
1493 newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]); 1647 newSettings.Elevation2NW = Convert.ToDouble(row["elevation_2_nw"]);
1494 newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]); 1648 newSettings.Elevation1NE = Convert.ToDouble(row["elevation_1_ne"]);
@@ -1502,14 +1656,14 @@ namespace OpenSim.Data.SQLite
1502 newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]); 1656 newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
1503 newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]); 1657 newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
1504 newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]); 1658 newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
1505 newSettings.SunVector = new Vector3 ( 1659 newSettings.SunVector = new Vector3(
1506 Convert.ToSingle(row["sunvectorx"]), 1660 Convert.ToSingle(row["sunvectorx"]),
1507 Convert.ToSingle(row["sunvectory"]), 1661 Convert.ToSingle(row["sunvectory"]),
1508 Convert.ToSingle(row["sunvectorz"]) 1662 Convert.ToSingle(row["sunvectorz"])
1509 ); 1663 );
1510 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); 1664 newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
1511 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); 1665 newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
1512 newSettings.Covenant = new UUID((String) row["covenant"]); 1666 newSettings.Covenant = new UUID((String)row["covenant"]);
1513 newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]); 1667 newSettings.CovenantChangedDateTime = Convert.ToInt32(row["covenant_datetime"]);
1514 newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); 1668 newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]);
1515 1669
@@ -1517,6 +1671,83 @@ namespace OpenSim.Data.SQLite
1517 } 1671 }
1518 1672
1519 /// <summary> 1673 /// <summary>
1674 /// Build a windlight entry from the persisted data.
1675 /// </summary>
1676 /// <param name="row"></param>
1677 /// <returns>RegionLightShareData</returns>
1678 private RegionLightShareData buildRegionWindlight(DataRow row)
1679 {
1680 RegionLightShareData windlight = new RegionLightShareData();
1681
1682 windlight.regionID = new UUID((string)row["region_id"]);
1683 windlight.waterColor.X = Convert.ToSingle(row["water_color_r"]);
1684 windlight.waterColor.Y = Convert.ToSingle(row["water_color_g"]);
1685 windlight.waterColor.Z = Convert.ToSingle(row["water_color_b"]);
1686 //windlight.waterColor.W = Convert.ToSingle(row["water_color_i"]); //not implemented
1687 windlight.waterFogDensityExponent = Convert.ToSingle(row["water_fog_density_exponent"]);
1688 windlight.underwaterFogModifier = Convert.ToSingle(row["underwater_fog_modifier"]);
1689 windlight.reflectionWaveletScale.X = Convert.ToSingle(row["reflection_wavelet_scale_1"]);
1690 windlight.reflectionWaveletScale.Y = Convert.ToSingle(row["reflection_wavelet_scale_2"]);
1691 windlight.reflectionWaveletScale.Z = Convert.ToSingle(row["reflection_wavelet_scale_3"]);
1692 windlight.fresnelScale = Convert.ToSingle(row["fresnel_scale"]);
1693 windlight.fresnelOffset = Convert.ToSingle(row["fresnel_offset"]);
1694 windlight.refractScaleAbove = Convert.ToSingle(row["refract_scale_above"]);
1695 windlight.refractScaleBelow = Convert.ToSingle(row["refract_scale_below"]);
1696 windlight.blurMultiplier = Convert.ToSingle(row["blur_multiplier"]);
1697 windlight.bigWaveDirection.X = Convert.ToSingle(row["big_wave_direction_x"]);
1698 windlight.bigWaveDirection.Y = Convert.ToSingle(row["big_wave_direction_y"]);
1699 windlight.littleWaveDirection.X = Convert.ToSingle(row["little_wave_direction_x"]);
1700 windlight.littleWaveDirection.Y = Convert.ToSingle(row["little_wave_direction_y"]);
1701 windlight.normalMapTexture = new UUID((string)row["normal_map_texture"]);
1702 windlight.horizon.X = Convert.ToSingle(row["horizon_r"]);
1703 windlight.horizon.Y = Convert.ToSingle(row["horizon_g"]);
1704 windlight.horizon.Z = Convert.ToSingle(row["horizon_b"]);
1705 windlight.horizon.W = Convert.ToSingle(row["horizon_i"]);
1706 windlight.hazeHorizon = Convert.ToSingle(row["haze_horizon"]);
1707 windlight.blueDensity.X = Convert.ToSingle(row["blue_density_r"]);
1708 windlight.blueDensity.Y = Convert.ToSingle(row["blue_density_g"]);
1709 windlight.blueDensity.Z = Convert.ToSingle(row["blue_density_b"]);
1710 windlight.blueDensity.W = Convert.ToSingle(row["blue_density_i"]);
1711 windlight.hazeDensity = Convert.ToSingle(row["haze_density"]);
1712 windlight.densityMultiplier = Convert.ToSingle(row["density_multiplier"]);
1713 windlight.distanceMultiplier = Convert.ToSingle(row["distance_multiplier"]);
1714 windlight.maxAltitude = Convert.ToUInt16(row["max_altitude"]);
1715 windlight.sunMoonColor.X = Convert.ToSingle(row["sun_moon_color_r"]);
1716 windlight.sunMoonColor.Y = Convert.ToSingle(row["sun_moon_color_g"]);
1717 windlight.sunMoonColor.Z = Convert.ToSingle(row["sun_moon_color_b"]);
1718 windlight.sunMoonColor.W = Convert.ToSingle(row["sun_moon_color_i"]);
1719 windlight.sunMoonPosition = Convert.ToSingle(row["sun_moon_position"]);
1720 windlight.ambient.X = Convert.ToSingle(row["ambient_r"]);
1721 windlight.ambient.Y = Convert.ToSingle(row["ambient_g"]);
1722 windlight.ambient.Z = Convert.ToSingle(row["ambient_b"]);
1723 windlight.ambient.W = Convert.ToSingle(row["ambient_i"]);
1724 windlight.eastAngle = Convert.ToSingle(row["east_angle"]);
1725 windlight.sunGlowFocus = Convert.ToSingle(row["sun_glow_focus"]);
1726 windlight.sunGlowSize = Convert.ToSingle(row["sun_glow_size"]);
1727 windlight.sceneGamma = Convert.ToSingle(row["scene_gamma"]);
1728 windlight.starBrightness = Convert.ToSingle(row["star_brightness"]);
1729 windlight.cloudColor.X = Convert.ToSingle(row["cloud_color_r"]);
1730 windlight.cloudColor.Y = Convert.ToSingle(row["cloud_color_g"]);
1731 windlight.cloudColor.Z = Convert.ToSingle(row["cloud_color_b"]);
1732 windlight.cloudColor.W = Convert.ToSingle(row["cloud_color_i"]);
1733 windlight.cloudXYDensity.X = Convert.ToSingle(row["cloud_x"]);
1734 windlight.cloudXYDensity.Y = Convert.ToSingle(row["cloud_y"]);
1735 windlight.cloudXYDensity.Z = Convert.ToSingle(row["cloud_density"]);
1736 windlight.cloudCoverage = Convert.ToSingle(row["cloud_coverage"]);
1737 windlight.cloudScale = Convert.ToSingle(row["cloud_scale"]);
1738 windlight.cloudDetailXYDensity.X = Convert.ToSingle(row["cloud_detail_x"]);
1739 windlight.cloudDetailXYDensity.Y = Convert.ToSingle(row["cloud_detail_y"]);
1740 windlight.cloudDetailXYDensity.Z = Convert.ToSingle(row["cloud_detail_density"]);
1741 windlight.cloudScrollX = Convert.ToSingle(row["cloud_scroll_x"]);
1742 windlight.cloudScrollXLock = Convert.ToBoolean(row["cloud_scroll_x_lock"]);
1743 windlight.cloudScrollY = Convert.ToSingle(row["cloud_scroll_y"]);
1744 windlight.cloudScrollYLock = Convert.ToBoolean(row["cloud_scroll_y_lock"]);
1745 windlight.drawClassicClouds = Convert.ToBoolean(row["draw_classic_clouds"]);
1746
1747 return windlight;
1748 }
1749
1750 /// <summary>
1520 /// Build a land access entry from the persisted data. 1751 /// Build a land access entry from the persisted data.
1521 /// </summary> 1752 /// </summary>
1522 /// <param name="row"></param> 1753 /// <param name="row"></param>
@@ -1524,8 +1755,8 @@ namespace OpenSim.Data.SQLite
1524 private static LandAccessEntry buildLandAccessData(DataRow row) 1755 private static LandAccessEntry buildLandAccessData(DataRow row)
1525 { 1756 {
1526 LandAccessEntry entry = new LandAccessEntry(); 1757 LandAccessEntry entry = new LandAccessEntry();
1527 entry.AgentID = new UUID((string) row["AccessUUID"]); 1758 entry.AgentID = new UUID((string)row["AccessUUID"]);
1528 entry.Flags = (AccessList) row["Flags"]; 1759 entry.Flags = (AccessList)row["Flags"];
1529 entry.Expires = 0; 1760 entry.Expires = 0;
1530 return entry; 1761 return entry;
1531 } 1762 }
@@ -1537,7 +1768,7 @@ namespace OpenSim.Data.SQLite
1537 /// <returns></returns> 1768 /// <returns></returns>
1538 private static Array serializeTerrain(double[,] val) 1769 private static Array serializeTerrain(double[,] val)
1539 { 1770 {
1540 MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double)); 1771 MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) * sizeof(double));
1541 BinaryWriter bw = new BinaryWriter(str); 1772 BinaryWriter bw = new BinaryWriter(str);
1542 1773
1543 // TODO: COMPATIBILITY - Add byte-order conversions 1774 // TODO: COMPATIBILITY - Add byte-order conversions
@@ -1548,21 +1779,21 @@ namespace OpenSim.Data.SQLite
1548 return str.ToArray(); 1779 return str.ToArray();
1549 } 1780 }
1550 1781
1551// private void fillTerrainRow(DataRow row, UUID regionUUID, int rev, double[,] val) 1782 // private void fillTerrainRow(DataRow row, UUID regionUUID, int rev, double[,] val)
1552// { 1783 // {
1553// row["RegionUUID"] = regionUUID; 1784 // row["RegionUUID"] = regionUUID;
1554// row["Revision"] = rev; 1785 // row["Revision"] = rev;
1555 1786
1556 // MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize)*sizeof (double)); 1787 // MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize)*sizeof (double));
1557// BinaryWriter bw = new BinaryWriter(str); 1788 // BinaryWriter bw = new BinaryWriter(str);
1558 1789
1559// // TODO: COMPATIBILITY - Add byte-order conversions 1790 // // TODO: COMPATIBILITY - Add byte-order conversions
1560 // for (int x = 0; x < (int)Constants.RegionSize; x++) 1791 // for (int x = 0; x < (int)Constants.RegionSize; x++)
1561 // for (int y = 0; y < (int)Constants.RegionSize; y++) 1792 // for (int y = 0; y < (int)Constants.RegionSize; y++)
1562// bw.Write(val[x, y]); 1793 // bw.Write(val[x, y]);
1563 1794
1564// row["Heightfield"] = str.ToArray(); 1795 // row["Heightfield"] = str.ToArray();
1565// } 1796 // }
1566 1797
1567 /// <summary> 1798 /// <summary>
1568 /// 1799 ///
@@ -1843,6 +2074,79 @@ namespace OpenSim.Data.SQLite
1843 /// 2074 ///
1844 /// </summary> 2075 /// </summary>
1845 /// <param name="row"></param> 2076 /// <param name="row"></param>
2077 /// <param name="windlight"></param>
2078 private static void fillRegionWindlightRow(DataRow row, RegionLightShareData windlight)
2079 {
2080 row["region_id"] = windlight.regionID.ToString();
2081 row["water_color_r"] = windlight.waterColor.X;
2082 row["water_color_g"] = windlight.waterColor.Y;
2083 row["water_color_b"] = windlight.waterColor.Z;
2084 row["water_color_i"] = 1; //windlight.waterColor.W; //not implemented
2085 row["water_fog_density_exponent"] = windlight.waterFogDensityExponent;
2086 row["underwater_fog_modifier"] = windlight.underwaterFogModifier;
2087 row["reflection_wavelet_scale_1"] = windlight.reflectionWaveletScale.X;
2088 row["reflection_wavelet_scale_2"] = windlight.reflectionWaveletScale.Y;
2089 row["reflection_wavelet_scale_3"] = windlight.reflectionWaveletScale.Z;
2090 row["fresnel_scale"] = windlight.fresnelScale;
2091 row["fresnel_offset"] = windlight.fresnelOffset;
2092 row["refract_scale_above"] = windlight.refractScaleAbove;
2093 row["refract_scale_below"] = windlight.refractScaleBelow;
2094 row["blur_multiplier"] = windlight.blurMultiplier;
2095 row["big_wave_direction_x"] = windlight.bigWaveDirection.X;
2096 row["big_wave_direction_y"] = windlight.bigWaveDirection.Y;
2097 row["little_wave_direction_x"] = windlight.littleWaveDirection.X;
2098 row["little_wave_direction_y"] = windlight.littleWaveDirection.Y;
2099 row["normal_map_texture"] = windlight.normalMapTexture.ToString();
2100 row["horizon_r"] = windlight.horizon.X;
2101 row["horizon_g"] = windlight.horizon.Y;
2102 row["horizon_b"] = windlight.horizon.Z;
2103 row["horizon_i"] = windlight.horizon.W;
2104 row["haze_horizon"] = windlight.hazeHorizon;
2105 row["blue_density_r"] = windlight.blueDensity.X;
2106 row["blue_density_g"] = windlight.blueDensity.Y;
2107 row["blue_density_b"] = windlight.blueDensity.Z;
2108 row["blue_density_i"] = windlight.blueDensity.W;
2109 row["haze_density"] = windlight.hazeDensity;
2110 row["density_multiplier"] = windlight.densityMultiplier;
2111 row["distance_multiplier"] = windlight.distanceMultiplier;
2112 row["max_altitude"] = windlight.maxAltitude;
2113 row["sun_moon_color_r"] = windlight.sunMoonColor.X;
2114 row["sun_moon_color_g"] = windlight.sunMoonColor.Y;
2115 row["sun_moon_color_b"] = windlight.sunMoonColor.Z;
2116 row["sun_moon_color_i"] = windlight.sunMoonColor.W;
2117 row["sun_moon_position"] = windlight.sunMoonPosition;
2118 row["ambient_r"] = windlight.ambient.X;
2119 row["ambient_g"] = windlight.ambient.Y;
2120 row["ambient_b"] = windlight.ambient.Z;
2121 row["ambient_i"] = windlight.ambient.W;
2122 row["east_angle"] = windlight.eastAngle;
2123 row["sun_glow_focus"] = windlight.sunGlowFocus;
2124 row["sun_glow_size"] = windlight.sunGlowSize;
2125 row["scene_gamma"] = windlight.sceneGamma;
2126 row["star_brightness"] = windlight.starBrightness;
2127 row["cloud_color_r"] = windlight.cloudColor.X;
2128 row["cloud_color_g"] = windlight.cloudColor.Y;
2129 row["cloud_color_b"] = windlight.cloudColor.Z;
2130 row["cloud_color_i"] = windlight.cloudColor.W;
2131 row["cloud_x"] = windlight.cloudXYDensity.X;
2132 row["cloud_y"] = windlight.cloudXYDensity.Y;
2133 row["cloud_density"] = windlight.cloudXYDensity.Z;
2134 row["cloud_coverage"] = windlight.cloudCoverage;
2135 row["cloud_scale"] = windlight.cloudScale;
2136 row["cloud_detail_x"] = windlight.cloudDetailXYDensity.X;
2137 row["cloud_detail_y"] = windlight.cloudDetailXYDensity.Y;
2138 row["cloud_detail_density"] = windlight.cloudDetailXYDensity.Z;
2139 row["cloud_scroll_x"] = windlight.cloudScrollX;
2140 row["cloud_scroll_x_lock"] = windlight.cloudScrollXLock;
2141 row["cloud_scroll_y"] = windlight.cloudScrollY;
2142 row["cloud_scroll_y_lock"] = windlight.cloudScrollYLock;
2143 row["draw_classic_clouds"] = windlight.drawClassicClouds;
2144 }
2145
2146 /// <summary>
2147 ///
2148 /// </summary>
2149 /// <param name="row"></param>
1846 /// <returns></returns> 2150 /// <returns></returns>
1847 private PrimitiveBaseShape buildShape(DataRow row) 2151 private PrimitiveBaseShape buildShape(DataRow row)
1848 { 2152 {
@@ -1878,7 +2182,7 @@ namespace OpenSim.Data.SQLite
1878 byte[] textureEntry = (byte[])row["Texture"]; 2182 byte[] textureEntry = (byte[])row["Texture"];
1879 s.TextureEntry = textureEntry; 2183 s.TextureEntry = textureEntry;
1880 2184
1881 s.ExtraParams = (byte[]) row["ExtraParams"]; 2185 s.ExtraParams = (byte[])row["ExtraParams"];
1882 2186
1883 if (!(row["Media"] is System.DBNull)) 2187 if (!(row["Media"] is System.DBNull))
1884 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); 2188 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
@@ -1986,10 +2290,10 @@ namespace OpenSim.Data.SQLite
1986 // repalce with current inventory details 2290 // repalce with current inventory details
1987 foreach (TaskInventoryItem newItem in items) 2291 foreach (TaskInventoryItem newItem in items)
1988 { 2292 {
1989// m_log.InfoFormat( 2293 // m_log.InfoFormat(
1990// "[DATASTORE]: ", 2294 // "[DATASTORE]: ",
1991// "Adding item {0}, {1} to prim ID {2}", 2295 // "Adding item {0}, {1} to prim ID {2}",
1992// newItem.Name, newItem.ItemID, newItem.ParentPartID); 2296 // newItem.Name, newItem.ItemID, newItem.ParentPartID);
1993 2297
1994 DataRow newItemRow = dbItems.NewRow(); 2298 DataRow newItemRow = dbItems.NewRow();
1995 fillItemRow(newItemRow, newItem); 2299 fillItemRow(newItemRow, newItem);
@@ -2040,7 +2344,7 @@ namespace OpenSim.Data.SQLite
2040 sql += ") values (:"; 2344 sql += ") values (:";
2041 sql += String.Join(", :", cols); 2345 sql += String.Join(", :", cols);
2042 sql += ")"; 2346 sql += ")";
2043 //m_log.DebugFormat("[SQLITE]: Created insert command {0}", sql); 2347// m_log.DebugFormat("[SQLITE]: Created insert command {0}", sql);
2044 SqliteCommand cmd = new SqliteCommand(sql); 2348 SqliteCommand cmd = new SqliteCommand(sql);
2045 2349
2046 // this provides the binding for all our parameters, so 2350 // this provides the binding for all our parameters, so
@@ -2192,7 +2496,7 @@ namespace OpenSim.Data.SQLite
2192 da.UpdateCommand.Connection = conn; 2496 da.UpdateCommand.Connection = conn;
2193 2497
2194 SqliteCommand delete = new SqliteCommand("delete from prims where UUID = :UUID"); 2498 SqliteCommand delete = new SqliteCommand("delete from prims where UUID = :UUID");
2195 delete.Parameters.Add(createSqliteParameter("UUID", typeof (String))); 2499 delete.Parameters.Add(createSqliteParameter("UUID", typeof(String)));
2196 delete.Connection = conn; 2500 delete.Connection = conn;
2197 da.DeleteCommand = delete; 2501 da.DeleteCommand = delete;
2198 } 2502 }
@@ -2211,7 +2515,7 @@ namespace OpenSim.Data.SQLite
2211 da.UpdateCommand.Connection = conn; 2515 da.UpdateCommand.Connection = conn;
2212 2516
2213 SqliteCommand delete = new SqliteCommand("delete from primitems where itemID = :itemID"); 2517 SqliteCommand delete = new SqliteCommand("delete from primitems where itemID = :itemID");
2214 delete.Parameters.Add(createSqliteParameter("itemID", typeof (String))); 2518 delete.Parameters.Add(createSqliteParameter("itemID", typeof(String)));
2215 delete.Connection = conn; 2519 delete.Connection = conn;
2216 da.DeleteCommand = delete; 2520 da.DeleteCommand = delete;
2217 } 2521 }
@@ -2279,6 +2583,19 @@ namespace OpenSim.Data.SQLite
2279 /// </summary> 2583 /// </summary>
2280 /// <param name="da"></param> 2584 /// <param name="da"></param>
2281 /// <param name="conn"></param> 2585 /// <param name="conn"></param>
2586 private void setupRegionWindlightCommands(SqliteDataAdapter da, SqliteConnection conn)
2587 {
2588 da.InsertCommand = createInsertCommand("regionwindlight", ds.Tables["regionwindlight"]);
2589 da.InsertCommand.Connection = conn;
2590 da.UpdateCommand = createUpdateCommand("regionwindlight", "region_id=:region_id", ds.Tables["regionwindlight"]);
2591 da.UpdateCommand.Connection = conn;
2592 }
2593
2594 /// <summary>
2595 ///
2596 /// </summary>
2597 /// <param name="da"></param>
2598 /// <param name="conn"></param>
2282 private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn) 2599 private void setupShapeCommands(SqliteDataAdapter da, SqliteConnection conn)
2283 { 2600 {
2284 da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]); 2601 da.InsertCommand = createInsertCommand("primshapes", ds.Tables["primshapes"]);
@@ -2288,7 +2605,7 @@ namespace OpenSim.Data.SQLite
2288 da.UpdateCommand.Connection = conn; 2605 da.UpdateCommand.Connection = conn;
2289 2606
2290 SqliteCommand delete = new SqliteCommand("delete from primshapes where UUID = :UUID"); 2607 SqliteCommand delete = new SqliteCommand("delete from primshapes where UUID = :UUID");
2291 delete.Parameters.Add(createSqliteParameter("UUID", typeof (String))); 2608 delete.Parameters.Add(createSqliteParameter("UUID", typeof(String)));
2292 delete.Connection = conn; 2609 delete.Connection = conn;
2293 da.DeleteCommand = delete; 2610 da.DeleteCommand = delete;
2294 } 2611 }
@@ -2306,27 +2623,27 @@ namespace OpenSim.Data.SQLite
2306 /// <returns></returns> 2623 /// <returns></returns>
2307 private static DbType dbtypeFromType(Type type) 2624 private static DbType dbtypeFromType(Type type)
2308 { 2625 {
2309 if (type == typeof (String)) 2626 if (type == typeof(String))
2310 { 2627 {
2311 return DbType.String; 2628 return DbType.String;
2312 } 2629 }
2313 else if (type == typeof (Int32)) 2630 else if (type == typeof(Int32))
2314 { 2631 {
2315 return DbType.Int32; 2632 return DbType.Int32;
2316 } 2633 }
2317 else if (type == typeof (Double)) 2634 else if (type == typeof(Double))
2318 { 2635 {
2319 return DbType.Double; 2636 return DbType.Double;
2320 } 2637 }
2321 else if (type == typeof (Byte)) 2638 else if (type == typeof(Byte))
2322 { 2639 {
2323 return DbType.Byte; 2640 return DbType.Byte;
2324 } 2641 }
2325 else if (type == typeof (Double)) 2642 else if (type == typeof(Double))
2326 { 2643 {
2327 return DbType.Double; 2644 return DbType.Double;
2328 } 2645 }
2329 else if (type == typeof (Byte[])) 2646 else if (type == typeof(Byte[]))
2330 { 2647 {
2331 return DbType.Binary; 2648 return DbType.Binary;
2332 } 2649 }
@@ -2338,32 +2655,32 @@ namespace OpenSim.Data.SQLite
2338 2655
2339 static void PrintDataSet(DataSet ds) 2656 static void PrintDataSet(DataSet ds)
2340 { 2657 {
2341 // Print out any name and extended properties. 2658 // Print out any name and extended properties.
2342 Console.WriteLine("DataSet is named: {0}", ds.DataSetName); 2659 Console.WriteLine("DataSet is named: {0}", ds.DataSetName);
2343 foreach (System.Collections.DictionaryEntry de in ds.ExtendedProperties) 2660 foreach (System.Collections.DictionaryEntry de in ds.ExtendedProperties)
2344 {
2345 Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
2346 }
2347 Console.WriteLine();
2348 foreach (DataTable dt in ds.Tables)
2349 {
2350 Console.WriteLine("=> {0} Table:", dt.TableName);
2351 // Print out the column names.
2352 for (int curCol = 0; curCol < dt.Columns.Count; curCol++)
2353 { 2661 {
2354 Console.Write(dt.Columns[curCol].ColumnName + "\t"); 2662 Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
2355 } 2663 }
2356 Console.WriteLine("\n----------------------------------"); 2664 Console.WriteLine();
2357 // Print the DataTable. 2665 foreach (DataTable dt in ds.Tables)
2358 for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
2359 { 2666 {
2360 for (int curCol = 0; curCol < dt.Columns.Count; curCol++) 2667 Console.WriteLine("=> {0} Table:", dt.TableName);
2361 { 2668 // Print out the column names.
2362 Console.Write(dt.Rows[curRow][curCol].ToString() + "\t"); 2669 for (int curCol = 0; curCol < dt.Columns.Count; curCol++)
2363 } 2670 {
2364 Console.WriteLine(); 2671 Console.Write(dt.Columns[curCol].ColumnName + "\t");
2672 }
2673 Console.WriteLine("\n----------------------------------");
2674 // Print the DataTable.
2675 for (int curRow = 0; curRow < dt.Rows.Count; curRow++)
2676 {
2677 for (int curCol = 0; curCol < dt.Columns.Count; curCol++)
2678 {
2679 Console.Write(dt.Rows[curRow][curCol].ToString() + "\t");
2680 }
2681 Console.WriteLine();
2682 }
2365 } 2683 }
2366 }
2367 } 2684 }
2368 2685
2369 } 2686 }
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index a0d3541..0d6288b 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
31using System.Diagnostics; 31using System.Diagnostics;
32using System.Reflection; 32using System.Reflection;
33using System.Text; 33using System.Text;
34using System.Text.RegularExpressions;
34using System.Threading; 35using System.Threading;
35using log4net; 36using log4net;
36using OpenSim.Framework; 37using OpenSim.Framework;
@@ -531,6 +532,11 @@ namespace OpenSim.Framework.Console
531 532
532 public class Parser 533 public class Parser
533 { 534 {
535 // If an unquoted portion ends with an element matching this regex
536 // and the next element contains a space, then we have stripped
537 // embedded quotes that should not have been stripped
538 private static Regex optionRegex = new Regex("^--[a-zA-Z0-9-]+=$");
539
534 public static string[] Parse(string text) 540 public static string[] Parse(string text)
535 { 541 {
536 List<string> result = new List<string>(); 542 List<string> result = new List<string>();
@@ -544,10 +550,38 @@ namespace OpenSim.Framework.Console
544 if (index % 2 == 0) 550 if (index % 2 == 0)
545 { 551 {
546 string[] words = unquoted[index].Split(new char[] {' '}); 552 string[] words = unquoted[index].Split(new char[] {' '});
553
554 bool option = false;
547 foreach (string w in words) 555 foreach (string w in words)
548 { 556 {
549 if (w != String.Empty) 557 if (w != String.Empty)
558 {
559 if (optionRegex.Match(w) == Match.Empty)
560 option = false;
561 else
562 option = true;
550 result.Add(w); 563 result.Add(w);
564 }
565 }
566 // The last item matched the regex, put the quotes back
567 if (option)
568 {
569 // If the line ended with it, don't do anything
570 if (index < (unquoted.Length - 1))
571 {
572 // Get and remove the option name
573 string optionText = result[result.Count - 1];
574 result.RemoveAt(result.Count - 1);
575
576 // Add the quoted value back
577 optionText += "\"" + unquoted[index + 1] + "\"";
578
579 // Push the result into our return array
580 result.Add(optionText);
581
582 // Skip the already used value
583 index++;
584 }
551 } 585 }
552 } 586 }
553 else 587 else
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 661b457..5ba3863 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -625,7 +625,6 @@ namespace OpenSim.Framework
625 625
626 foreach (String s in allKeys) 626 foreach (String s in allKeys)
627 { 627 {
628 string val = config.GetString(s);
629 SetOtherSetting(s, config.GetString(s)); 628 SetOtherSetting(s, config.GetString(s));
630 } 629 }
631 } 630 }
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
index a392af6..c56f213 100644
--- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
+++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
49 /// <param name="nodeToFill"></param> 49 /// <param name="nodeToFill"></param>
50 /// <param name="processors">/param> 50 /// <param name="processors">/param>
51 /// <param name="xtr"></param> 51 /// <param name="xtr"></param>
52 public static void ExecuteReadProcessors<NodeType>( 52 /// <returns>true on successful, false if there were any processing failures</returns>
53 public static bool ExecuteReadProcessors<NodeType>(
53 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) 54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
54 { 55 {
55 ExecuteReadProcessors( 56 return ExecuteReadProcessors(
56 nodeToFill, 57 nodeToFill,
57 processors, 58 processors,
58 xtr, 59 xtr,
59 (o, name, e) 60 (o, name, e)
60 => m_log.ErrorFormat( 61 => m_log.DebugFormat(
61 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}", 62 "[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
62 name, e.Message, e.StackTrace)); 63 name, e.Message, e.StackTrace));
63 } 64 }
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
71 /// <param name="parseExceptionAction"> 72 /// <param name="parseExceptionAction">
72 /// Action to take if there is a parsing problem. This will usually just be to log the exception 73 /// Action to take if there is a parsing problem. This will usually just be to log the exception
73 /// </param> 74 /// </param>
74 public static void ExecuteReadProcessors<NodeType>( 75 /// <returns>true on successful, false if there were any processing failures</returns>
76 public static bool ExecuteReadProcessors<NodeType>(
75 NodeType nodeToFill, 77 NodeType nodeToFill,
76 Dictionary<string, Action<NodeType, XmlTextReader>> processors, 78 Dictionary<string, Action<NodeType, XmlTextReader>> processors,
77 XmlTextReader xtr, 79 XmlTextReader xtr,
78 Action<NodeType, string, Exception> parseExceptionAction) 80 Action<NodeType, string, Exception> parseExceptionAction)
79 { 81 {
82 bool errors = false;
83
80 string nodeName = string.Empty; 84 string nodeName = string.Empty;
81 while (xtr.NodeType != XmlNodeType.EndElement) 85 while (xtr.NodeType != XmlNodeType.EndElement)
82 { 86 {
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
95 } 99 }
96 catch (Exception e) 100 catch (Exception e)
97 { 101 {
102 errors = true;
98 parseExceptionAction(nodeToFill, nodeName, e); 103 parseExceptionAction(nodeToFill, nodeName, e);
99 104
100 if (xtr.NodeType == XmlNodeType.EndElement) 105 if (xtr.NodeType == XmlNodeType.EndElement)
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
107 xtr.ReadOuterXml(); // ignore 112 xtr.ReadOuterXml(); // ignore
108 } 113 }
109 } 114 }
115
116 return errors;
110 } 117 }
111 118
112 /// <summary> 119 /// <summary>
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
140 UUID.TryParse(node.InnerText, out uuid); 147 UUID.TryParse(node.InnerText, out uuid);
141 creator = userService.GetUserAccount(scopeID, uuid); 148 creator = userService.GetUserAccount(scopeID, uuid);
142 } 149 }
150
143 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty) 151 if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
144 hasCreatorData = true; 152 hasCreatorData = true;
145 153
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
163 doc.Save(wr); 171 doc.Save(wr);
164 return wr.ToString(); 172 return wr.ToString();
165 } 173 }
166
167 } 174 }
168 } 175 }
169} 176} \ No newline at end of file
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index ed92b2d..4b0b13c 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1664,13 +1664,14 @@ namespace OpenSim.Framework
1664 /// </summary> 1664 /// </summary>
1665 public static void PrintCallStack() 1665 public static void PrintCallStack()
1666 { 1666 {
1667 StackTrace stackTrace = new StackTrace(); // get call stack 1667 StackTrace stackTrace = new StackTrace(true); // get call stack
1668 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames) 1668 StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
1669 1669
1670 // write call stack method names 1670 // write call stack method names
1671 foreach (StackFrame stackFrame in stackFrames) 1671 foreach (StackFrame stackFrame in stackFrames)
1672 { 1672 {
1673 m_log.Debug(stackFrame.GetMethod().DeclaringType + "." + stackFrame.GetMethod().Name); // write method name 1673 MethodBase mb = stackFrame.GetMethod();
1674 m_log.DebugFormat("{0}.{1}:{2}", mb.DeclaringType, mb.Name, stackFrame.GetFileLineNumber()); // write method name
1674 } 1675 }
1675 } 1676 }
1676 1677
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index cf0c28b..be699db 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -422,7 +422,7 @@ namespace OpenSim.Region.ClientStack.Linden
422 string assetType) 422 string assetType)
423 { 423 {
424 m_log.DebugFormat( 424 m_log.DebugFormat(
425 "Uploaded asset {0} for inventory item {1}, inv type {2}, asset type {3}", 425 "[BUNCH OF CAPS]: Uploaded asset {0} for inventory item {1}, inv type {2}, asset type {3}",
426 assetID, inventoryItem, inventoryType, assetType); 426 assetID, inventoryItem, inventoryType, assetType);
427 427
428 sbyte assType = 0; 428 sbyte assType = 0;
@@ -625,7 +625,12 @@ namespace OpenSim.Region.ClientStack.Linden
625 item.AssetType = assType; 625 item.AssetType = assType;
626 item.InvType = inType; 626 item.InvType = inType;
627 item.Folder = parentFolder; 627 item.Folder = parentFolder;
628 item.CurrentPermissions = (uint)PermissionMask.All; 628
629 // If we set PermissionMask.All then when we rez the item the next permissions will replace the current
630 // (owner) permissions. This becomes a problem if next permissions are changed.
631 item.CurrentPermissions
632 = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
633
629 item.BasePermissions = (uint)PermissionMask.All; 634 item.BasePermissions = (uint)PermissionMask.All;
630 item.EveryOnePermissions = 0; 635 item.EveryOnePermissions = 0;
631 item.NextPermissions = (uint)PermissionMask.All; 636 item.NextPermissions = (uint)PermissionMask.All;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
index aed03b3..1117f2a 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
@@ -50,8 +50,7 @@ namespace OpenSim.Region.ClientStack.Linden
50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
51 public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule 51 public class NewFileAgentInventoryVariablePriceModule : INonSharedRegionModule
52 { 52 {
53// private static readonly ILog m_log = 53// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
54// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 54
56 private Scene m_scene; 55 private Scene m_scene;
57// private IAssetService m_assetService; 56// private IAssetService m_assetService;
@@ -210,6 +209,9 @@ namespace OpenSim.Region.ClientStack.Linden
210 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, 209 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
211 string assetType,UUID AgentID) 210 string assetType,UUID AgentID)
212 { 211 {
212// m_log.DebugFormat(
213// "[NEW FILE AGENT INVENTORY VARIABLE PRICE MODULE]: Upload complete for {0}", inventoryItem);
214
213 sbyte assType = 0; 215 sbyte assType = 0;
214 sbyte inType = 0; 216 sbyte inType = 0;
215 217
@@ -259,13 +261,13 @@ namespace OpenSim.Region.ClientStack.Linden
259 item.AssetType = assType; 261 item.AssetType = assType;
260 item.InvType = inType; 262 item.InvType = inType;
261 item.Folder = parentFolder; 263 item.Folder = parentFolder;
262 item.CurrentPermissions = (uint)PermissionMask.All; 264 item.CurrentPermissions
265 = (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
263 item.BasePermissions = (uint)PermissionMask.All; 266 item.BasePermissions = (uint)PermissionMask.All;
264 item.EveryOnePermissions = 0; 267 item.EveryOnePermissions = 0;
265 item.NextPermissions = (uint)PermissionMask.All; 268 item.NextPermissions = (uint)PermissionMask.All;
266 item.CreationDate = Util.UnixTimeSinceEpoch(); 269 item.CreationDate = Util.UnixTimeSinceEpoch();
267 m_scene.AddInventoryItem(item); 270 m_scene.AddInventoryItem(item);
268
269 } 271 }
270 } 272 }
271} 273}
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index e4bacd4..7a3d97e 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -339,7 +339,7 @@ namespace OpenSim.Region.ClientStack.Linden
339 m_scene.AddSceneObject(grp); 339 m_scene.AddSceneObject(grp);
340 grp.AbsolutePosition = obj.Position; 340 grp.AbsolutePosition = obj.Position;
341 } 341 }
342 342
343 allparts[i] = grp; 343 allparts[i] = grp;
344 } 344 }
345 345
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 8273c6f..d98ff68 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5107,7 +5107,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5107 AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage, false); 5107 AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage, false);
5108 AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); 5108 AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship);
5109 AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship); 5109 AddLocalPacketHandler(PacketType.DeclineFriendship, HandlerDeclineFriendship);
5110 AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFrendship); 5110 AddLocalPacketHandler(PacketType.TerminateFriendship, HandlerTerminateFriendship);
5111 AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject); 5111 AddLocalPacketHandler(PacketType.RezObject, HandlerRezObject);
5112 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject); 5112 AddLocalPacketHandler(PacketType.DeRezObject, HandlerDeRezObject);
5113 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand); 5113 AddLocalPacketHandler(PacketType.ModifyLand, HandlerModifyLand);
@@ -5827,7 +5827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5827 return true; 5827 return true;
5828 } 5828 }
5829 5829
5830 private bool HandlerTerminateFrendship(IClientAPI sender, Packet Pack) 5830 private bool HandlerTerminateFriendship(IClientAPI sender, Packet Pack)
5831 { 5831 {
5832 TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack; 5832 TerminateFriendshipPacket tfriendpack = (TerminateFriendshipPacket)Pack;
5833 5833
@@ -5842,13 +5842,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5842 5842
5843 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID; 5843 UUID listOwnerAgentID = tfriendpack.AgentData.AgentID;
5844 UUID exFriendID = tfriendpack.ExBlock.OtherID; 5844 UUID exFriendID = tfriendpack.ExBlock.OtherID;
5845 5845 FriendshipTermination TerminateFriendshipHandler = OnTerminateFriendship;
5846 FriendshipTermination handlerTerminateFriendship = OnTerminateFriendship; 5846 if (TerminateFriendshipHandler != null)
5847 if (handlerTerminateFriendship != null)
5848 { 5847 {
5849 handlerTerminateFriendship(this, listOwnerAgentID, exFriendID); 5848 TerminateFriendshipHandler(this, listOwnerAgentID, exFriendID);
5849 return true;
5850 } 5850 }
5851 return true; 5851 return false;
5852 } 5852 }
5853 5853
5854 private bool HandleFindAgent(IClientAPI client, Packet Packet) 5854 private bool HandleFindAgent(IClientAPI client, Packet Packet)
@@ -7625,6 +7625,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7625 } 7625 }
7626 } 7626 }
7627 } 7627 }
7628 else
7629 if (transfer.TransferInfo.SourceType == (int)SourceType.SimEstate)
7630 {
7631 //TransferRequestPacket does not include covenant uuid?
7632 //get scene covenant uuid
7633 taskID = m_scene.RegionInfo.RegionSettings.Covenant;
7634 }
7628 7635
7629 MakeAssetRequest(transfer, taskID); 7636 MakeAssetRequest(transfer, taskID);
7630 7637
@@ -11985,6 +11992,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11985 { 11992 {
11986 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 11993 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
11987 } 11994 }
11995 else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimEstate)
11996 {
11997 requestID = taskID;
11998 }
11999
11988 12000
11989// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); 12001// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
11990 12002
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 8d503bd..c7f4c20 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
111 111
112 #region IAvatarFactoryModule 112 #region IAvatarFactoryModule
113 113
114 /// </summary>
115 /// <param name="sp"></param>
116 /// <param name="texture"></param>
117 /// <param name="visualParam"></param>
118 public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
119 {
120 SetAppearance(sp, appearance.Texture, appearance.VisualParams);
121 }
122
114 /// <summary> 123 /// <summary>
115 /// Set appearance data (texture asset IDs and slider settings) 124 /// Set appearance data (texture asset IDs and slider settings)
116 /// </summary> 125 /// </summary>
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
156 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed; 165 changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
157 166
158// WriteBakedTexturesReport(sp, m_log.DebugFormat); 167// WriteBakedTexturesReport(sp, m_log.DebugFormat);
159 if (!ValidateBakedTextureCache(sp)) 168
169 // If bake textures are missing and this is not an NPC, request a rebake from client
170 if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
160 RequestRebake(sp, true); 171 RequestRebake(sp, true);
161 172
162 // This appears to be set only in the final stage of the appearance 173 // This appears to be set only in the final stage of the appearance
163 // update transaction. In theory, we should be able to do an immediate 174 // update transaction. In theory, we should be able to do an immediate
164 // appearance send and save here. 175 // appearance send and save here.
165 } 176 }
166 177
178 // NPC should send to clients immediately and skip saving appearance
179 if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
180 {
181 SendAppearance((ScenePresence)sp);
182 return;
183 }
184
167 // save only if there were changes, send no matter what (doesn't hurt to send twice) 185 // save only if there were changes, send no matter what (doesn't hurt to send twice)
168 if (changed) 186 if (changed)
169 QueueAppearanceSave(sp.ControllingClient.AgentId); 187 QueueAppearanceSave(sp.ControllingClient.AgentId);
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
174 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString()); 192 // m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
175 } 193 }
176 194
195 private void SendAppearance(ScenePresence sp)
196 {
197 // Send the appearance to everyone in the scene
198 sp.SendAppearanceToAllOtherAgents();
199
200 // Send animations back to the avatar as well
201 sp.Animator.SendAnimPack();
202 }
203
177 public bool SendAppearance(UUID agentId) 204 public bool SendAppearance(UUID agentId)
178 { 205 {
179// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId); 206// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
185 return false; 212 return false;
186 } 213 }
187 214
188 // Send the appearance to everyone in the scene 215 SendAppearance(sp);
189 sp.SendAppearanceToAllOtherAgents();
190
191 // Send animations back to the avatar as well
192 sp.Animator.SendAnimPack();
193
194 return true; 216 return true;
195 } 217 }
196 218
@@ -626,4 +648,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
626 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt"); 648 outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
627 } 649 }
628 } 650 }
629} \ No newline at end of file 651}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 54b422b..63ba3d3 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -546,12 +546,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
546 return null; 546 return null;
547 547
548 userID = remoteClient.AgentId; 548 userID = remoteClient.AgentId;
549
550// m_log.DebugFormat(
551// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
552// action, remoteClient.Name, userID);
549 } 553 }
550 else 554 else
551 { 555 {
552 // All returns / deletes go to the object owner 556 // All returns / deletes go to the object owner
553 // 557 //
554 userID = so.RootPart.OwnerID; 558 userID = so.RootPart.OwnerID;
559
560// m_log.DebugFormat(
561// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is object owner {1}",
562// action, userID);
555 } 563 }
556 564
557 if (userID == UUID.Zero) // Can't proceed 565 if (userID == UUID.Zero) // Can't proceed
@@ -637,11 +645,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
637 } 645 }
638 646
639 // Override and put into where it came from, if it came 647 // Override and put into where it came from, if it came
640 // from anywhere in inventory 648 // from anywhere in inventory and the owner is taking it back.
641 // 649 //
642 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy) 650 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy)
643 { 651 {
644 if (so.RootPart.FromFolderID != UUID.Zero) 652 if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
645 { 653 {
646 InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID); 654 InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID);
647 folder = m_Scene.InventoryService.GetFolder(f); 655 folder = m_Scene.InventoryService.GetFolder(f);
@@ -789,6 +797,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
789 { 797 {
790 group = objlist[i]; 798 group = objlist[i];
791 799
800// m_log.DebugFormat(
801// "[InventoryAccessModule]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
802// group.Name, group.LocalId, group.UUID,
803// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
804// remoteClient.Name);
805
792// Vector3 storedPosition = group.AbsolutePosition; 806// Vector3 storedPosition = group.AbsolutePosition;
793 if (group.UUID == UUID.Zero) 807 if (group.UUID == UUID.Zero)
794 { 808 {
@@ -854,9 +868,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
854 rootPart.ScheduleFullUpdate(); 868 rootPart.ScheduleFullUpdate();
855 } 869 }
856 870
857// m_log.DebugFormat( 871// m_log.DebugFormat(
858// "[InventoryAccessModule]: Rezzed {0} {1} {2} for {3}", 872// "[InventoryAccessModule]: Rezzed {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
859// group.Name, group.LocalId, group.UUID, remoteClient.Name); 873// group.Name, group.LocalId, group.UUID,
874// group.RootPart.OwnerMask, group.RootPart.NextOwnerMask, group.RootPart.GroupMask, group.RootPart.EveryoneMask,
875// remoteClient.Name);
860 } 876 }
861 877
862 if (item != null) 878 if (item != null)
@@ -937,7 +953,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
937 } 953 }
938 954
939 rootPart.FromFolderID = item.Folder; 955 rootPart.FromFolderID = item.Folder;
940 956
957// Console.WriteLine("rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}",
958// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
959
941 if ((rootPart.OwnerID != item.Owner) || 960 if ((rootPart.OwnerID != item.Owner) ||
942 (item.CurrentPermissions & 16) != 0) 961 (item.CurrentPermissions & 16) != 0)
943 { 962 {
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index cdecd2f..f3c6a30 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -707,7 +707,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
707 // Object owners should be able to edit their own content 707 // Object owners should be able to edit their own content
708 if (currentUser == objectOwner) 708 if (currentUser == objectOwner)
709 { 709 {
710 permission = true; 710 // there is no way that later code can change this back to false
711 // so just return true immediately and short circuit the more
712 // expensive group checks
713 return true;
714
715 //permission = true;
711 } 716 }
712 else if (group.IsAttachment) 717 else if (group.IsAttachment)
713 { 718 {
diff --git a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
index 39a760c..34aca33 100644
--- a/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAvatarFactoryModule.cs
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
35 35
36 public interface IAvatarFactoryModule 36 public interface IAvatarFactoryModule
37 { 37 {
38 void SetAppearance(IScenePresence sp, AvatarAppearance appearance);
38 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams); 39 void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
39 40
40 /// <summary> 41 /// <summary>
diff --git a/OpenSim/Region/Framework/Interfaces/INPCModule.cs b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
index 2731291..dc3ff89 100644
--- a/OpenSim/Region/Framework/Interfaces/INPCModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/INPCModule.cs
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Interfaces
58 /// </param> 58 /// </param>
59 /// <param name="scene"></param> 59 /// <param name="scene"></param>
60 /// <param name="appearance">The avatar appearance to use for the new NPC.</param> 60 /// <param name="appearance">The avatar appearance to use for the new NPC.</param>
61 /// <returns>The UUID of the ScenePresence created.</returns> 61 /// <returns>The UUID of the ScenePresence created. UUID.Zero if there was a failure.</returns>
62 UUID CreateNPC( 62 UUID CreateNPC(
63 string firstname, 63 string firstname,
64 string lastname, 64 string lastname,
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
index 5dfd3e0..f678d07 100644
--- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
+++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs
@@ -148,7 +148,8 @@ namespace OpenSim.Region.Framework.Scenes
148 x = m_inventoryDeletes.Dequeue(); 148 x = m_inventoryDeletes.Dequeue();
149 149
150 m_log.DebugFormat( 150 m_log.DebugFormat(
151 "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.", left, x.action, x.objectGroups.Count); 151 "[ASYNC DELETER]: Sending object to user's inventory, action {1}, count {2}, {0} item(s) remaining.",
152 left, x.action, x.objectGroups.Count);
152 153
153 try 154 try
154 { 155 {
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 6d7559e..5a5307c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -347,6 +347,12 @@ namespace OpenSim.Region.Framework.Scenes
347 { 347 {
348 item.Name = itemUpd.Name; 348 item.Name = itemUpd.Name;
349 item.Description = itemUpd.Description; 349 item.Description = itemUpd.Description;
350
351// m_log.DebugFormat(
352// "[USER INVENTORY]: itemUpd {0} {1} {2} {3}, item {4} {5} {6} {7}",
353// itemUpd.NextPermissions, itemUpd.GroupPermissions, itemUpd.EveryOnePermissions, item.Flags,
354// item.NextPermissions, item.GroupPermissions, item.EveryOnePermissions, item.CurrentPermissions);
355
350 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions)) 356 if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
351 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner; 357 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
352 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; 358 item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
@@ -355,6 +361,9 @@ namespace OpenSim.Region.Framework.Scenes
355 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; 361 item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
356 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions)) 362 if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
357 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup; 363 item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
364
365// m_log.DebugFormat("[USER INVENTORY]: item.Flags {0}", item.Flags);
366
358 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; 367 item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
359 item.GroupID = itemUpd.GroupID; 368 item.GroupID = itemUpd.GroupID;
360 item.GroupOwned = itemUpd.GroupOwned; 369 item.GroupOwned = itemUpd.GroupOwned;
@@ -2170,8 +2179,25 @@ namespace OpenSim.Region.Framework.Scenes
2170 m_sceneGraph.DelinkObjects(parts); 2179 m_sceneGraph.DelinkObjects(parts);
2171 } 2180 }
2172 2181
2182 /// <summary>
2183 /// Link the scene objects containing the indicated parts to a root object.
2184 /// </summary>
2185 /// <param name="client"></param>
2186 /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param>
2187 /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param>
2173 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds) 2188 public void LinkObjects(IClientAPI client, uint parentPrimId, List<uint> childPrimIds)
2174 { 2189 {
2190 LinkObjects(client.AgentId, parentPrimId, childPrimIds);
2191 }
2192
2193 /// <summary>
2194 /// Link the scene objects containing the indicated parts to a root object.
2195 /// </summary>
2196 /// <param name="agentId">The ID of the user linking.</param>
2197 /// <param name="parentPrimId">A root prim id of the object which will be the root prim of the resulting linkset.</param>
2198 /// <param name="childPrimIds">A list of child prims for the objects that should be linked in.</param>
2199 public void LinkObjects(UUID agentId, uint parentPrimId, List<uint> childPrimIds)
2200 {
2175 List<UUID> owners = new List<UUID>(); 2201 List<UUID> owners = new List<UUID>();
2176 2202
2177 List<SceneObjectPart> children = new List<SceneObjectPart>(); 2203 List<SceneObjectPart> children = new List<SceneObjectPart>();
@@ -2183,7 +2209,7 @@ namespace OpenSim.Region.Framework.Scenes
2183 return; 2209 return;
2184 } 2210 }
2185 2211
2186 if (!Permissions.CanLinkObject(client.AgentId, root.ParentGroup.RootPart.UUID)) 2212 if (!Permissions.CanLinkObject(agentId, root.ParentGroup.RootPart.UUID))
2187 { 2213 {
2188 m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim"); 2214 m_log.DebugFormat("[LINK]: Refusing link. No permissions on root prim");
2189 return; 2215 return;
@@ -2199,7 +2225,7 @@ namespace OpenSim.Region.Framework.Scenes
2199 if (!owners.Contains(part.OwnerID)) 2225 if (!owners.Contains(part.OwnerID))
2200 owners.Add(part.OwnerID); 2226 owners.Add(part.OwnerID);
2201 2227
2202 if (Permissions.CanLinkObject(client.AgentId, part.ParentGroup.RootPart.UUID)) 2228 if (Permissions.CanLinkObject(agentId, part.ParentGroup.RootPart.UUID))
2203 children.Add(part); 2229 children.Add(part);
2204 } 2230 }
2205 2231
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3347822..4c8e2d2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3272,9 +3272,9 @@ namespace OpenSim.Region.Framework.Scenes
3272 3272
3273 // Don't disable this log message - it's too helpful 3273 // Don't disable this log message - it's too helpful
3274 m_log.DebugFormat( 3274 m_log.DebugFormat(
3275 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})", 3275 "[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags {8}, position {9})",
3276 RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, 3276 RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname,
3277 agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos); 3277 agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, teleportFlags, agent.startpos);
3278 3278
3279 if (LoginsDisabled) 3279 if (LoginsDisabled)
3280 { 3280 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 7d801b5..e66678a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -359,7 +359,7 @@ namespace OpenSim.Region.Framework.Scenes
359 m_log.ErrorFormat( 359 m_log.ErrorFormat(
360 "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}", 360 "[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
361 sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero); 361 sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
362 362
363 return false; 363 return false;
364 } 364 }
365 365
@@ -368,12 +368,12 @@ namespace OpenSim.Region.Framework.Scenes
368// m_log.DebugFormat( 368// m_log.DebugFormat(
369// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()", 369// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
370// m_parentScene.RegionInfo.RegionName, sceneObject.UUID); 370// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
371 371
372 return false; 372 return false;
373 } 373 }
374 374
375// m_log.DebugFormat( 375// m_log.DebugFormat(
376// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}", 376// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
377// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName); 377// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
378 378
379 SceneObjectPart[] parts = sceneObject.Parts; 379 SceneObjectPart[] parts = sceneObject.Parts;
@@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes
409 409
410 lock (SceneObjectGroupsByFullID) 410 lock (SceneObjectGroupsByFullID)
411 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 411 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
412 412
413 lock (SceneObjectGroupsByFullPartID) 413 lock (SceneObjectGroupsByFullPartID)
414 { 414 {
415 foreach (SceneObjectPart part in parts) 415 foreach (SceneObjectPart part in parts)
@@ -1662,6 +1662,10 @@ namespace OpenSim.Region.Framework.Scenes
1662 { 1662 {
1663 SceneObjectGroup child = children[i].ParentGroup; 1663 SceneObjectGroup child = children[i].ParentGroup;
1664 1664
1665 // Don't try and add a group to itself - this will only cause severe problems later on.
1666 if (child == parentGroup)
1667 continue;
1668
1665 // Make sure no child prim is set for sale 1669 // Make sure no child prim is set for sale
1666 // So that, on delink, no prims are unwittingly 1670 // So that, on delink, no prims are unwittingly
1667 // left for sale and sold off 1671 // left for sale and sold off
@@ -1684,11 +1688,13 @@ namespace OpenSim.Region.Framework.Scenes
1684 1688
1685 // We need to explicitly resend the newly link prim's object properties since no other actions 1689 // We need to explicitly resend the newly link prim's object properties since no other actions
1686 // occur on link to invoke this elsewhere (such as object selection) 1690 // occur on link to invoke this elsewhere (such as object selection)
1687 parentGroup.RootPart.CreateSelected = true; 1691 if (childGroups.Count > 0)
1688 parentGroup.TriggerScriptChangedEvent(Changed.LINK); 1692 {
1689 parentGroup.HasGroupChanged = true; 1693 parentGroup.RootPart.CreateSelected = true;
1690 parentGroup.ScheduleGroupForFullUpdate(); 1694 parentGroup.TriggerScriptChangedEvent(Changed.LINK);
1691 1695 parentGroup.HasGroupChanged = true;
1696 parentGroup.ScheduleGroupForFullUpdate();
1697 }
1692 } 1698 }
1693 finally 1699 finally
1694 { 1700 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index f173c95..a73d9b6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -265,6 +265,8 @@ namespace OpenSim.Region.Framework.Scenes
265 265
266 public void ApplyNextOwnerPermissions() 266 public void ApplyNextOwnerPermissions()
267 { 267 {
268// m_log.DebugFormat("[PRIM INVENTORY]: Applying next owner permissions to {0} {1}", Name, UUID);
269
268 SceneObjectPart[] parts = m_parts.GetArray(); 270 SceneObjectPart[] parts = m_parts.GetArray();
269 for (int i = 0; i < parts.Length; i++) 271 for (int i = 0; i < parts.Length; i++)
270 parts[i].ApplyNextOwnerPermissions(); 272 parts[i].ApplyNextOwnerPermissions();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8939342..5b838f8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -567,7 +567,8 @@ namespace OpenSim.Region.Framework.Scenes
567 567
568// ~SceneObjectGroup() 568// ~SceneObjectGroup()
569// { 569// {
570// m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId); 570// //m_log.DebugFormat("[SCENE OBJECT GROUP]: Destructor called for {0}, local id {1}", Name, LocalId);
571// Console.WriteLine("Destructor called for {0}, local id {1}", Name, LocalId);
571// } 572// }
572 573
573 #region Constructors 574 #region Constructors
@@ -1960,6 +1961,10 @@ namespace OpenSim.Region.Framework.Scenes
1960// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}", 1961// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
1961// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID); 1962// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
1962 1963
1964 // Linking to ourselves is not a valid operation.
1965 if (objectGroup == this)
1966 return;
1967
1963 SceneObjectPart linkPart = objectGroup.m_rootPart; 1968 SceneObjectPart linkPart = objectGroup.m_rootPart;
1964 1969
1965 Vector3 oldGroupPosition = linkPart.GroupPosition; 1970 Vector3 oldGroupPosition = linkPart.GroupPosition;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0e899ca..b130bf7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes
303 303
304// ~SceneObjectPart() 304// ~SceneObjectPart()
305// { 305// {
306// Console.WriteLine(
307// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
308// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
306// m_log.DebugFormat( 309// m_log.DebugFormat(
307// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}", 310// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
308// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId); 311// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
@@ -1501,7 +1504,7 @@ namespace OpenSim.Region.Framework.Scenes
1501 PhysActor = null; 1504 PhysActor = null;
1502 } 1505 }
1503 1506
1504 // Basic Physics returns null.. joy joy joy. 1507 // Basic Physics can also return null as well as an exception catch.
1505 if (PhysActor != null) 1508 if (PhysActor != null)
1506 { 1509 {
1507 PhysActor.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info 1510 PhysActor.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info
@@ -1509,10 +1512,6 @@ namespace OpenSim.Region.Framework.Scenes
1509 DoPhysicsPropertyUpdate(RigidBody, true); 1512 DoPhysicsPropertyUpdate(RigidBody, true);
1510 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); 1513 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
1511 } 1514 }
1512 else
1513 {
1514 m_log.DebugFormat("[SOP]: physics actor is null for {0} with parent {1}", UUID, this.ParentGroup.UUID);
1515 }
1516 } 1515 }
1517 } 1516 }
1518 } 1517 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 0c36dcd..f2d1915 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -267,10 +267,8 @@ namespace OpenSim.Region.Framework.Scenes
267 /// <returns></returns> 267 /// <returns></returns>
268 public void CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource) 268 public void CreateScriptInstance(TaskInventoryItem item, int startParam, bool postOnRez, string engine, int stateSource)
269 { 269 {
270 // m_log.InfoFormat( 270// m_log.DebugFormat("[PRIM INVENTORY]: Starting script {0} {1} in prim {2} {3} in {4}",
271 // "[PRIM INVENTORY]: " + 271// item.Name, item.ItemID, m_part.Name, m_part.UUID, m_part.ParentGroup.Scene.RegionInfo.RegionName);
272 // "Starting script {0}, {1} in prim {2}, {3}",
273 // item.Name, item.ItemID, Name, UUID);
274 272
275 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID)) 273 if (!m_part.ParentGroup.Scene.Permissions.CanRunScript(item.ItemID, m_part.UUID, item.OwnerID))
276 return; 274 return;
@@ -299,8 +297,7 @@ namespace OpenSim.Region.Framework.Scenes
299 if (null == asset) 297 if (null == asset)
300 { 298 {
301 m_log.ErrorFormat( 299 m_log.ErrorFormat(
302 "[PRIM INVENTORY]: " + 300 "[PRIM INVENTORY]: Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
303 "Couldn't start script {0}, {1} at {2} in {3} since asset ID {4} could not be found",
304 item.Name, item.ItemID, m_part.AbsolutePosition, 301 item.Name, item.ItemID, m_part.AbsolutePosition,
305 m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID); 302 m_part.ParentGroup.Scene.RegionInfo.RegionName, item.AssetID);
306 } 303 }
@@ -400,8 +397,7 @@ namespace OpenSim.Region.Framework.Scenes
400 CreateScriptInstance(item, startParam, postOnRez, engine, stateSource); 397 CreateScriptInstance(item, startParam, postOnRez, engine, stateSource);
401 else 398 else
402 m_log.ErrorFormat( 399 m_log.ErrorFormat(
403 "[PRIM INVENTORY]: " + 400 "[PRIM INVENTORY]: Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
404 "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
405 itemId, m_part.Name, m_part.UUID, 401 itemId, m_part.Name, m_part.UUID,
406 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName); 402 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
407 } 403 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 5c56150..77f7b32 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -291,13 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
291 /// </summary> 291 /// </summary>
292 public PhysicsActor PhysicsActor { get; private set; } 292 public PhysicsActor PhysicsActor { get; private set; }
293 293
294 private byte m_movementflag; 294 /// <summary>
295 295 /// Record user movement inputs.
296 public byte MovementFlag 296 /// </summary>
297 { 297 public byte MovementFlag { get; private set; }
298 set { m_movementflag = value; }
299 get { return m_movementflag; }
300 }
301 298
302 private bool m_updateflag; 299 private bool m_updateflag;
303 300
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index ab02f92..0a32214 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1470,7 +1470,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1470 m_SOPXmlProcessors, 1470 m_SOPXmlProcessors,
1471 reader, 1471 reader,
1472 (o, nodeName, e) 1472 (o, nodeName, e)
1473 => m_log.ErrorFormat( 1473 => m_log.DebugFormat(
1474 "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}", 1474 "[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}",
1475 ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace)); 1475 ((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace));
1476 1476
@@ -1535,14 +1535,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1535 1535
1536 reader.ReadStartElement(name, String.Empty); // Shape 1536 reader.ReadStartElement(name, String.Empty); // Shape
1537 1537
1538 ExternalRepresentationUtils.ExecuteReadProcessors( 1538 errors = ExternalRepresentationUtils.ExecuteReadProcessors(
1539 shape, 1539 shape,
1540 m_ShapeXmlProcessors, 1540 m_ShapeXmlProcessors,
1541 reader, 1541 reader,
1542 (o, nodeName, e) 1542 (o, nodeName, e)
1543 => m_log.ErrorFormat( 1543 =>
1544 "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", 1544 {
1545 nodeName, e.Message, e.StackTrace)); 1545 m_log.DebugFormat(
1546 "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
1547 nodeName, e.Message, e.StackTrace);
1548 }
1549 );
1546 1550
1547 reader.ReadEndElement(); // Shape 1551 reader.ReadEndElement(); // Shape
1548 1552
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
index 80f198d..7737d8e 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Reflection; 29using System.Reflection;
30using System.Threading;
30using NUnit.Framework; 31using NUnit.Framework;
31using OpenMetaverse; 32using OpenMetaverse;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
43 [TestFixture] 44 [TestFixture]
44 public class SceneObjectBasicTests 45 public class SceneObjectBasicTests
45 { 46 {
47// [TearDown]
48// public void TearDown()
49// {
50// Console.WriteLine("TearDown");
51// GC.Collect();
52// Thread.Sleep(3000);
53// }
54
55// public class GcNotify
56// {
57// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
58// private static bool _initialized = false;
59//
60// public static void Initialize()
61// {
62// if (!_initialized)
63// {
64// _initialized = true;
65// new GcNotify();
66// }
67// }
68//
69// private GcNotify(){}
70//
71// ~GcNotify()
72// {
73// if (!Environment.HasShutdownStarted &&
74// !AppDomain.CurrentDomain.IsFinalizingForUnload())
75// {
76// Console.WriteLine("GcNotify called");
77// gcEvent.Set();
78// new GcNotify();
79// }
80// }
81// }
82
46 /// <summary> 83 /// <summary>
47 /// Test adding an object to a scene. 84 /// Test adding an object to a scene.
48 /// </summary> 85 /// </summary>
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
147 public void TestDeleteSceneObject() 184 public void TestDeleteSceneObject()
148 { 185 {
149 TestHelpers.InMethod(); 186 TestHelpers.InMethod();
150 187
151 TestScene scene = SceneHelpers.SetupScene(); 188 TestScene scene = SceneHelpers.SetupScene();
152 SceneObjectPart part = SceneHelpers.AddSceneObject(scene); 189 SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
153 scene.DeleteSceneObject(part.ParentGroup, false); 190 scene.DeleteSceneObject(part.ParentGroup, false);
154 191
155 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); 192 SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
156 Assert.That(retrievedPart, Is.Null); 193 Assert.That(retrievedPart, Is.Null);
157 } 194 }
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
index a2332bb..be5b4a8 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs
@@ -39,14 +39,31 @@ using log4net;
39 39
40namespace OpenSim.Region.Framework.Scenes.Tests 40namespace OpenSim.Region.Framework.Scenes.Tests
41{ 41{
42 /// <summary>
43 /// Linking tests
44 /// </summary>
45 [TestFixture] 42 [TestFixture]
46 public class SceneObjectLinkingTests 43 public class SceneObjectLinkingTests
47 { 44 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 46
47 /// <summary>
48 /// Links to self should be ignored.
49 /// </summary>
50 [Test]
51 public void TestLinkToSelf()
52 {
53 TestHelpers.InMethod();
54
55 UUID ownerId = TestHelpers.ParseTail(0x1);
56 int nParts = 3;
57
58 TestScene scene = SceneHelpers.SetupScene();
59 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(nParts, ownerId, "TestLinkToSelf_", 0x10);
60 scene.AddSceneObject(sog1);
61 scene.LinkObjects(ownerId, sog1.LocalId, new List<uint>() { sog1.Parts[1].LocalId });
62// sog1.LinkToGroup(sog1);
63
64 Assert.That(sog1.Parts.Length, Is.EqualTo(nParts));
65 }
66
50 [Test] 67 [Test]
51 public void TestLinkDelink2SceneObjects() 68 public void TestLinkDelink2SceneObjects()
52 { 69 {
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index 1abef8d..e4b607d 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -53,6 +53,30 @@ namespace OpenSim.Region.Framework.Tests
53 public class TaskInventoryTests 53 public class TaskInventoryTests
54 { 54 {
55 [Test] 55 [Test]
56 public void TestAddTaskInventoryItem()
57 {
58 TestHelpers.InMethod();
59// log4net.Config.XmlConfigurator.Configure();
60
61 Scene scene = SceneHelpers.SetupScene();
62 UserAccount user1 = UserAccountHelpers.CreateUserWithInventory(scene);
63 SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, user1.PrincipalID);
64 SceneObjectPart sop1 = sog1.RootPart;
65
66 // Create an object embedded inside the first
67 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
68 TaskInventoryItem taskSceneObjectItem
69 = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
70
71 TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
72 Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
73 Assert.That(addedItem.OwnerID, Is.EqualTo(user1.PrincipalID));
74 Assert.That(addedItem.ParentID, Is.EqualTo(sop1.UUID));
75 Assert.That(addedItem.InvType, Is.EqualTo((int)InventoryType.Object));
76 Assert.That(addedItem.Type, Is.EqualTo((int)AssetType.Object));
77 }
78
79 [Test]
56 public void TestRezObjectFromInventoryItem() 80 public void TestRezObjectFromInventoryItem()
57 { 81 {
58 TestHelpers.InMethod(); 82 TestHelpers.InMethod();
@@ -66,7 +90,7 @@ namespace OpenSim.Region.Framework.Tests
66 // Create an object embedded inside the first 90 // Create an object embedded inside the first
67 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000"); 91 UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
68 TaskInventoryItem taskSceneObjectItem 92 TaskInventoryItem taskSceneObjectItem
69 = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId); 93 = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
70 94
71 scene.AddSceneObject(sog1); 95 scene.AddSceneObject(sog1);
72 96
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 5323a95..05678c0 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -63,9 +63,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 63 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
64 64
65 // Capability string prefixes 65 // Capability string prefixes
66 private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; 66 private static readonly string m_parcelVoiceInfoRequestPath = "0207/";
67 private static readonly string m_provisionVoiceAccountRequestPath = "0008/"; 67 private static readonly string m_provisionVoiceAccountRequestPath = "0208/";
68 private static readonly string m_chatSessionRequestPath = "0009/"; 68 private static readonly string m_chatSessionRequestPath = "0209/";
69 69
70 // Control info 70 // Control info
71 private static bool m_Enabled = false; 71 private static bool m_Enabled = false;
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs
index 42008da..130513d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs
@@ -30,6 +30,7 @@ using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Collections.Specialized; 31using System.Collections.Specialized;
32using System.Reflection; 32using System.Reflection;
33using System.Threading;
33 34
34using Nwc.XmlRpc; 35using Nwc.XmlRpc;
35 36
@@ -167,6 +168,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
167 168
168 private bool m_debugEnabled = false; 169 private bool m_debugEnabled = false;
169 170
171 private Dictionary<string, bool> m_pendingRequests = new Dictionary<string,bool>();
172
170 private ExpiringCache<string, OSDMap> m_memoryCache; 173 private ExpiringCache<string, OSDMap> m_memoryCache;
171 private int m_cacheTimeout = 30; 174 private int m_cacheTimeout = 30;
172 175
@@ -1348,6 +1351,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1348 // Immediately forward the request if the cache is disabled. 1351 // Immediately forward the request if the cache is disabled.
1349 if (m_cacheTimeout == 0) 1352 if (m_cacheTimeout == 0)
1350 { 1353 {
1354 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: cache is disabled");
1351 return WebUtil.PostToService(m_groupsServerURI, requestArgs); 1355 return WebUtil.PostToService(m_groupsServerURI, requestArgs);
1352 } 1356 }
1353 1357
@@ -1355,6 +1359,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1355 if (requestArgs["RequestMethod"] == "RemoveGeneric" 1359 if (requestArgs["RequestMethod"] == "RemoveGeneric"
1356 || requestArgs["RequestMethod"] == "AddGeneric") 1360 || requestArgs["RequestMethod"] == "AddGeneric")
1357 { 1361 {
1362 m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: clearing generics cache");
1363
1358 // Any and all updates cause the cache to clear 1364 // Any and all updates cause the cache to clear
1359 m_memoryCache.Clear(); 1365 m_memoryCache.Clear();
1360 1366
@@ -1366,18 +1372,67 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1366 1372
1367 // Create the cache key for the request and see if we have it cached 1373 // Create the cache key for the request and see if we have it cached
1368 string CacheKey = WebUtil.BuildQueryString(requestArgs); 1374 string CacheKey = WebUtil.BuildQueryString(requestArgs);
1369 OSDMap response = null; 1375
1370 if (!m_memoryCache.TryGetValue(CacheKey, out response)) 1376 // This code uses a leader/follower pattern. On a cache miss, the request is added
1377 // to a queue; the first thread to add it to the queue completes the request while
1378 // follow on threads busy wait for the results, this situation seems to happen
1379 // often when checking permissions
1380 while (true)
1371 { 1381 {
1372 // if it wasn't in the cache, pass the request to the Simian Grid Services 1382 OSDMap response = null;
1373 response = WebUtil.PostToService(m_groupsServerURI, requestArgs); 1383 bool firstRequest = false;
1374 1384
1375 // and cache the response 1385 lock (m_memoryCache)
1376 m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout)); 1386 {
1387 if (m_memoryCache.TryGetValue(CacheKey, out response))
1388 return response;
1389
1390 if (! m_pendingRequests.ContainsKey(CacheKey))
1391 {
1392 m_pendingRequests.Add(CacheKey,true);
1393 firstRequest = true;
1394 }
1395 }
1396
1397 if (firstRequest)
1398 {
1399 // if it wasn't in the cache, pass the request to the Simian Grid Services
1400 try
1401 {
1402 response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
1403 }
1404 catch (Exception e)
1405 {
1406 m_log.InfoFormat("[SIMIAN GROUPS CONNECTOR] request failed {0}",CacheKey);
1407 }
1408
1409 // and cache the response
1410 lock (m_memoryCache)
1411 {
1412 m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
1413 m_pendingRequests.Remove(CacheKey);
1414 }
1415
1416 return response;
1417 }
1418
1419 Thread.Sleep(50); // waiting for a web request to complete, 50msecs is reasonable
1377 } 1420 }
1378 1421
1379 // return cached response 1422 // if (!m_memoryCache.TryGetValue(CacheKey, out response))
1380 return response; 1423 // {
1424 // m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: query not in the cache");
1425 // Util.PrintCallStack();
1426
1427 // // if it wasn't in the cache, pass the request to the Simian Grid Services
1428 // response = WebUtil.PostToService(m_groupsServerURI, requestArgs);
1429
1430 // // and cache the response
1431 // m_memoryCache.AddOrUpdate(CacheKey, response, TimeSpan.FromSeconds(m_cacheTimeout));
1432 // }
1433
1434 // // return cached response
1435 // return response;
1381 } 1436 }
1382 #endregion 1437 #endregion
1383 1438
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 6a48b89..5359354 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -96,15 +96,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
96 if (!m_avatars.ContainsKey(agentId)) 96 if (!m_avatars.ContainsKey(agentId))
97 return false; 97 return false;
98 98
99 // Delete existing sp attachments
99 scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false); 100 scene.AttachmentsModule.DeleteAttachmentsFromScene(sp, false);
100 101
101 AvatarAppearance npcAppearance = new AvatarAppearance(appearance, true); 102 // Set new sp appearance. Also sends to clients.
102 sp.Appearance = npcAppearance; 103 scene.RequestModuleInterface<IAvatarFactoryModule>().SetAppearance(sp, new AvatarAppearance(appearance, true));
104
105 // Rez needed sp attachments
103 scene.AttachmentsModule.RezAttachments(sp); 106 scene.AttachmentsModule.RezAttachments(sp);
104 107
105 IAvatarFactoryModule module = scene.RequestModuleInterface<IAvatarFactoryModule>();
106 module.SendAppearance(sp.UUID);
107
108 return true; 108 return true;
109 } 109 }
110 110
@@ -148,22 +148,21 @@ namespace OpenSim.Region.OptionalModules.World.NPC
148 ScenePresence sp; 148 ScenePresence sp;
149 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) 149 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
150 { 150 {
151 m_log.DebugFormat( 151// m_log.DebugFormat(
152 "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID); 152// "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", sp.Name, sp.UUID);
153 153
154 sp.CompleteMovement(npcAvatar, false); 154 sp.CompleteMovement(npcAvatar, false);
155 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
156 m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
157
158 return npcAvatar.AgentId;
155 } 159 }
156 else 160 else
157 { 161 {
158 m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID); 162 m_log.WarnFormat("[NPC MODULE]: Could not find scene presence for NPC {0} {1}", sp.Name, sp.UUID);
163 return UUID.Zero;
159 } 164 }
160
161 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
162 } 165 }
163
164 m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
165
166 return npcAvatar.AgentId;
167 } 166 }
168 167
169 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget) 168 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, bool noFly, bool landAtTarget)
@@ -292,13 +291,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
292 NPCAvatar av; 291 NPCAvatar av;
293 if (m_avatars.TryGetValue(agentID, out av)) 292 if (m_avatars.TryGetValue(agentID, out av))
294 { 293 {
294// m_log.DebugFormat("[NPC MODULE]: Found {0} {1} to remove", agentID, av.Name);
295 scene.RemoveClient(agentID, false); 295 scene.RemoveClient(agentID, false);
296 m_avatars.Remove(agentID); 296 m_avatars.Remove(agentID);
297 297
298// m_log.DebugFormat("[NPC MODULE]: Removed {0} {1}", agentID, av.Name);
298 return true; 299 return true;
299 } 300 }
300 } 301 }
301 302
303// m_log.DebugFormat("[NPC MODULE]: Could not find {0} to remove", agentID);
302 return false; 304 return false;
303 } 305 }
304 306
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 7c1c046..6d1f41d 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -156,6 +156,22 @@ namespace OpenSim.Region.Physics.OdePlugin
156 internal UUID m_uuid { get; private set; } 156 internal UUID m_uuid { get; private set; }
157 internal bool bad = false; 157 internal bool bad = false;
158 158
159 /// <summary>
160 /// ODE Avatar.
161 /// </summary>
162 /// <param name="avName"></param>
163 /// <param name="parent_scene"></param>
164 /// <param name="pos"></param>
165 /// <param name="size"></param>
166 /// <param name="pid_d"></param>
167 /// <param name="pid_p"></param>
168 /// <param name="capsule_radius"></param>
169 /// <param name="tensor"></param>
170 /// <param name="density">
171 /// Only used right now to return information to LSL. Not actually used to set mass in ODE!
172 /// </param>
173 /// <param name="walk_divisor"></param>
174 /// <param name="rundivisor"></param>
159 public OdeCharacter( 175 public OdeCharacter(
160 String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, 176 String avName, OdeScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p,
161 float capsule_radius, float tensor, float density, 177 float capsule_radius, float tensor, float density,
@@ -786,6 +802,10 @@ namespace OpenSim.Region.Physics.OdePlugin
786 Vector3 vec = Vector3.Zero; 802 Vector3 vec = Vector3.Zero;
787 d.Vector3 vel = d.BodyGetLinearVel(Body); 803 d.Vector3 vel = d.BodyGetLinearVel(Body);
788 804
805// m_log.DebugFormat(
806// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}",
807// vel.X, vel.Y, vel.Z, _target_velocity, Name);
808
789 float movementdivisor = 1f; 809 float movementdivisor = 1f;
790 810
791 if (!m_alwaysRun) 811 if (!m_alwaysRun)
@@ -884,18 +904,20 @@ namespace OpenSim.Region.Physics.OdePlugin
884 904
885 if (flying) 905 if (flying)
886 { 906 {
907 // This also acts as anti-gravity so that we hover when flying rather than fall.
887 vec.Z = (_target_velocity.Z - vel.Z) * (PID_D); 908 vec.Z = (_target_velocity.Z - vel.Z) * (PID_D);
888 } 909 }
889 } 910 }
890 911
891 if (flying) 912 if (flying)
892 { 913 {
914 // Anti-gravity so that we hover when flying rather than fall.
893 vec.Z += ((-1 * _parent_scene.gravityz) * m_mass); 915 vec.Z += ((-1 * _parent_scene.gravityz) * m_mass);
894 916
895 //Added for auto fly height. Kitto Flora 917 //Added for auto fly height. Kitto Flora
896 //d.Vector3 pos = d.BodyGetPosition(Body); 918 //d.Vector3 pos = d.BodyGetPosition(Body);
897 float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset; 919 float target_altitude = _parent_scene.GetTerrainHeightAtXY(_position.X, _position.Y) + MinimumGroundFlightOffset;
898 920
899 if (_position.Z < target_altitude) 921 if (_position.Z < target_altitude)
900 { 922 {
901 vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f; 923 vec.Z += (target_altitude - _position.Z) * PID_P * 5.0f;
@@ -921,6 +943,25 @@ namespace OpenSim.Region.Physics.OdePlugin
921 943
922 return; 944 return;
923 } 945 }
946
947 d.Vector3 newVel = d.BodyGetLinearVel(Body);
948 if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256)
949 {
950// m_log.DebugFormat(
951// "[ODE CHARACTER]: Limiting falling velocity from {0} to {1} for {2}", newVel.Z, -9.8, Name);
952
953 newVel.X = Util.Clamp<float>(newVel.X, -255f, 255f);
954 newVel.Y = Util.Clamp<float>(newVel.Y, -255f, 255f);
955
956 if (!flying)
957 newVel.Z
958 = Util.Clamp<float>(
959 newVel.Z, -_parent_scene.AvatarTerminalVelocity, _parent_scene.AvatarTerminalVelocity);
960 else
961 newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f);
962
963 d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
964 }
924 } 965 }
925 966
926 /// <summary> 967 /// <summary>
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index 4530c09..598530c 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -144,6 +144,8 @@ namespace OpenSim.Region.Physics.OdePlugin
144 public float gravityy = 0f; 144 public float gravityy = 0f;
145 public float gravityz = -9.8f; 145 public float gravityz = -9.8f;
146 146
147 public float AvatarTerminalVelocity { get; set; }
148
147 private float contactsurfacelayer = 0.001f; 149 private float contactsurfacelayer = 0.001f;
148 150
149 private int worldHashspaceLow = -4; 151 private int worldHashspaceLow = -4;
@@ -459,6 +461,15 @@ namespace OpenSim.Region.Physics.OdePlugin
459 gravityy = physicsconfig.GetFloat("world_gravityy", 0f); 461 gravityy = physicsconfig.GetFloat("world_gravityy", 0f);
460 gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f); 462 gravityz = physicsconfig.GetFloat("world_gravityz", -9.8f);
461 463
464 float avatarTerminalVelocity = physicsconfig.GetFloat("avatar_terminal_velocity", 54f);
465 AvatarTerminalVelocity = Util.Clamp<float>(avatarTerminalVelocity, 0, 255f);
466 if (AvatarTerminalVelocity != avatarTerminalVelocity)
467 {
468 m_log.WarnFormat(
469 "[ODE SCENE]: avatar_terminal_velocity of {0} is invalid. Clamping to {1}",
470 avatarTerminalVelocity, AvatarTerminalVelocity);
471 }
472
462 worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4); 473 worldHashspaceLow = physicsconfig.GetInt("world_hashspace_size_low", -4);
463 worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128); 474 worldHashspaceHigh = physicsconfig.GetInt("world_hashspace_size_high", 128);
464 475
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 3e0e452..850f50b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -445,17 +445,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
445 Vector3 toRegionPos; 445 Vector3 toRegionPos;
446 double dis; 446 double dis;
447 447
448 Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) 448 Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence =>
449 { 449 {
450 if ((ts.type & NPC) == 0 450 if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
451 && presence.PresenceType == PresenceType.Npc 451 {
452 && !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent) 452 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
453 return; 453 if (npcData == null || !npcData.SenseAsAgent)
454 return;
455 }
454 456
455 if ((ts.type & AGENT) == 0 457 if ((ts.type & AGENT) == 0)
456 && (presence.PresenceType == PresenceType.User 458 {
457 || npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)) 459 if (presence.PresenceType == PresenceType.User)
458 return; 460 {
461 return;
462 }
463 else
464 {
465 INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene);
466 if (npcData != null && npcData.SenseAsAgent)
467 return;
468 }
469 }
459 470
460 if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) 471 if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)
461 return; 472 return;
diff --git a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs
index 130e197..e35f79f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/AssemblyResolver.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
44 string dirName = myDomain.FriendlyName; 44 string dirName = myDomain.FriendlyName;
45 string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath; 45 string ScriptEnginesPath = myDomain.SetupInformation.PrivateBinPath;
46 46
47 string[] pathList = new string[] {"bin", ScriptEnginesPath, 47 string[] pathList = new string[] {"", "bin", ScriptEnginesPath,
48 Path.Combine(ScriptEnginesPath, dirName)}; 48 Path.Combine(ScriptEnginesPath, dirName)};
49 49
50 string assemblyName = args.Name; 50 string assemblyName = args.Name;
@@ -56,6 +56,8 @@ namespace OpenSim.Region.ScriptEngine.Shared
56 string path = Path.Combine(Directory.GetCurrentDirectory(), 56 string path = Path.Combine(Directory.GetCurrentDirectory(),
57 Path.Combine(s, assemblyName))+".dll"; 57 Path.Combine(s, assemblyName))+".dll";
58 58
59// Console.WriteLine("Trying to resolve {0}", path);
60
59 if (File.Exists(path)) 61 if (File.Exists(path))
60 return Assembly.LoadFrom(path); 62 return Assembly.LoadFrom(path);
61 } 63 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
index b1fb6c2..8b88588 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/CSCodeGenerator.cs
@@ -28,12 +28,16 @@
28using System; 28using System;
29using System.IO; 29using System.IO;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection;
32using log4net;
31using Tools; 33using Tools;
32 34
33namespace OpenSim.Region.ScriptEngine.Shared.CodeTools 35namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
34{ 36{
35 public class CSCodeGenerator : ICodeConverter 37 public class CSCodeGenerator : ICodeConverter
36 { 38 {
39// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
40
37 private SYMBOL m_astRoot = null; 41 private SYMBOL m_astRoot = null;
38 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; 42 private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
39 private int m_indentWidth = 4; // for indentation 43 private int m_indentWidth = 4; // for indentation
@@ -87,6 +91,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
87 /// <returns>String containing the generated C# code.</returns> 91 /// <returns>String containing the generated C# code.</returns>
88 public string Convert(string script) 92 public string Convert(string script)
89 { 93 {
94// m_log.DebugFormat("[CS CODE GENERATOR]: Converting to C#\n{0}", script);
95
90 m_warnings.Clear(); 96 m_warnings.Clear();
91 ResetCounters(); 97 ResetCounters();
92 Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true)); 98 Parser p = new LSLSyntax(new yyLSLSyntax(), new ErrorHandler(true));
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 734d4d5..c10143b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -291,6 +291,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
291 public void PerformScriptCompile(string Script, string asset, UUID ownerUUID, 291 public void PerformScriptCompile(string Script, string asset, UUID ownerUUID,
292 out string assembly, out Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap) 292 out string assembly, out Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap)
293 { 293 {
294// m_log.DebugFormat("[Compiler]: Compiling script\n{0}", Script);
295
294 linemap = null; 296 linemap = null;
295 m_warnings.Clear(); 297 m_warnings.Clear();
296 298
@@ -357,6 +359,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
357 if (Script.StartsWith("//yp", true, CultureInfo.InvariantCulture)) 359 if (Script.StartsWith("//yp", true, CultureInfo.InvariantCulture))
358 language = enumCompileType.yp; 360 language = enumCompileType.yp;
359 361
362// m_log.DebugFormat("[Compiler]: Compile language is {0}", language);
363
360 if (!AllowedCompilers.ContainsKey(language.ToString())) 364 if (!AllowedCompilers.ContainsKey(language.ToString()))
361 { 365 {
362 // Not allowed to compile to this language! 366 // Not allowed to compile to this language!
@@ -417,7 +421,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
417 } 421 }
418 422
419 assembly = CompileFromDotNetText(compileScript, language, asset, assembly); 423 assembly = CompileFromDotNetText(compileScript, language, asset, assembly);
420 return;
421 } 424 }
422 425
423 public string[] GetWarnings() 426 public string[] GetWarnings()
@@ -491,6 +494,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
491 /// <returns>Filename to .dll assembly</returns> 494 /// <returns>Filename to .dll assembly</returns>
492 internal string CompileFromDotNetText(string Script, enumCompileType lang, string asset, string assembly) 495 internal string CompileFromDotNetText(string Script, enumCompileType lang, string asset, string assembly)
493 { 496 {
497// m_log.DebugFormat("[Compiler]: Compiling to assembly\n{0}", Script);
498
494 string ext = "." + lang.ToString(); 499 string ext = "." + lang.ToString();
495 500
496 // Output assembly name 501 // Output assembly name
@@ -531,8 +536,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
531 536
532 parameters.IncludeDebugInformation = true; 537 parameters.IncludeDebugInformation = true;
533 538
534 string rootPath = 539 string rootPath = AppDomain.CurrentDomain.BaseDirectory;
535 Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory);
536 540
537 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, 541 parameters.ReferencedAssemblies.Add(Path.Combine(rootPath,
538 "OpenSim.Region.ScriptEngine.Shared.dll")); 542 "OpenSim.Region.ScriptEngine.Shared.dll"));
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 9b93135..bc1902b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -537,6 +537,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
537 537
538 public bool Stop(int timeout) 538 public bool Stop(int timeout)
539 { 539 {
540// m_log.DebugFormat(
541// "[SCRIPT INSTANCE]: Stopping script {0} {1} with timeout {2}", ScriptName, ItemID, timeout);
542
540 IScriptWorkItem result; 543 IScriptWorkItem result;
541 544
542 lock (m_EventQueue) 545 lock (m_EventQueue)
@@ -769,7 +772,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
769 } 772 }
770 catch (Exception e) 773 catch (Exception e)
771 { 774 {
772 // m_log.DebugFormat("[SCRIPT] Exception: {0}", e.Message); 775// m_log.DebugFormat(
776// "[SCRIPT] Exception in script {0} {1}: {2}{3}",
777// ScriptName, ItemID, e.Message, e.StackTrace);
778
773 m_InEvent = false; 779 m_InEvent = false;
774 m_CurrentEvent = String.Empty; 780 m_CurrentEvent = String.Empty;
775 781
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
index b635d5c..7d7bd82 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Tests/XEngineTest.cs
@@ -27,44 +27,100 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Threading;
30using Nini.Config; 31using Nini.Config;
31using NUnit.Framework; 32using NUnit.Framework;
32using OpenSim.Tests.Common.Mock;
33using OpenSim.Region.Framework.Scenes;
34using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Framework;
35using OpenSim.Region.CoreModules.Scripting.WorldComm;
36using OpenSim.Region.Framework.Scenes;
35using OpenSim.Region.Framework.Interfaces; 37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Tests.Common;
39using OpenSim.Tests.Common.Mock;
36 40
37namespace OpenSim.Region.ScriptEngine.XEngine.Tests 41namespace OpenSim.Region.ScriptEngine.XEngine.Tests
38{ 42{
39 /// <summary> 43 /// <summary>
40 /// Scene presence tests 44 /// XEngine tests.
41 /// </summary> 45 /// </summary>
42 /// Commented out XEngineTests that don't do anything
43 /*
44 [TestFixture] 46 [TestFixture]
45 public class XEngineTest 47 public class XEngineTest
46 { 48 {
47 public Scene scene; 49 private TestScene m_scene;
48 50 private XEngine m_xEngine;
49 public static Random random; 51 private AutoResetEvent m_chatEvent = new AutoResetEvent(false);
50 public TestClient testclient; 52 private OSChatMessage m_osChatMessageReceived;
51 //TestCommunicationsManager cm;
52 53
53 [TestFixtureSetUp] 54 [TestFixtureSetUp]
54 public void Init() 55 public void Init()
55 { 56 {
56 TestCommunicationsManager cm = new TestCommunicationsManager(); 57 //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
57 scene = SceneSetupHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, cm); 58// Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
58 random = new Random(); 59 m_xEngine = new XEngine();
60
61 // Necessary to stop serialization complaining
62 WorldCommModule wcModule = new WorldCommModule();
63
64 IniConfigSource configSource = new IniConfigSource();
65
66 IConfig startupConfig = configSource.AddConfig("Startup");
67 startupConfig.Set("DefaultScriptEngine", "XEngine");
68
69 IConfig xEngineConfig = configSource.AddConfig("XEngine");
70 xEngineConfig.Set("Enabled", "true");
71
72 // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call
73 // to AssemblyResolver.OnAssemblyResolve fails.
74 xEngineConfig.Set("AppDomainLoading", "false");
75
76 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource);
77 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
78 m_scene.StartScripts();
59 } 79 }
60 80
81 /// <summary>
82 /// Test compilation and starting of a script.
83 /// </summary>
84 /// <remarks>
85 /// This is a less than ideal regression test since it involves an asynchronous operation (in this case,
86 /// compilation of the script).
87 /// </remarks>
61 [Test] 88 [Test]
62 public void T001_XStart() 89 public void TestCompileAndStartScript()
63 { 90 {
64 INonSharedRegionModule xengine = new XEngine(); 91 TestHelpers.InMethod();
65 SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), xengine); 92// log4net.Config.XmlConfigurator.Configure();
66 xengine.RegionLoaded(scene); 93
94 UUID userId = TestHelpers.ParseTail(0x1);
95// UUID objectId = TestHelpers.ParseTail(0x2);
96// UUID itemId = TestHelpers.ParseTail(0x3);
97 string itemName = "TestStartScript() Item";
98
99 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, "TestStartScriptPart_", 0x100);
100 m_scene.AddNewSceneObject(so, true);
101
102 InventoryItemBase itemTemplate = new InventoryItemBase();
103// itemTemplate.ID = itemId;
104 itemTemplate.Name = itemName;
105 itemTemplate.Folder = so.UUID;
106 itemTemplate.InvType = (int)InventoryType.LSL;
107
108 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;
109
110 m_scene.RezNewScript(userId, itemTemplate);
111
112 m_chatEvent.WaitOne(60000);
113
114 Assert.That(m_osChatMessageReceived, Is.Not.Null, "No chat message received in TestStartScript()");
115 Assert.That(m_osChatMessageReceived.Message, Is.EqualTo("Script running"));
116 }
117
118 private void OnChatFromWorld(object sender, OSChatMessage oscm)
119 {
120// Console.WriteLine("Got chat [{0}]", oscm.Message);
121
122 m_osChatMessageReceived = oscm;
123 m_chatEvent.Set();
67 } 124 }
68 } 125 }
69 */ 126} \ No newline at end of file
70}
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index f11987e..c68f03f 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -680,6 +680,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
680 680
681 public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) 681 public void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
682 { 682 {
683// m_log.DebugFormat(
684// "[XEngine]: OnRezScript event triggered for script {0}, startParam {1}, postOnRez {2}, engine {3}, stateSource {4}, script\n{5}",
685// itemID, startParam, postOnRez, engine, stateSource, script);
686
683 if (script.StartsWith("//MRM:")) 687 if (script.StartsWith("//MRM:"))
684 return; 688 return;
685 689
@@ -761,6 +765,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
761 m_CompileDict[itemID] = 0; 765 m_CompileDict[itemID] = 0;
762 } 766 }
763 767
768// m_log.DebugFormat("[XEngine]: Added script {0} to compile queue", itemID);
769
764 if (m_CurrentCompile == null) 770 if (m_CurrentCompile == null)
765 { 771 {
766 // NOTE: Although we use a lockless queue, the lock here 772 // NOTE: Although we use a lockless queue, the lock here
@@ -822,6 +828,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
822 bool postOnRez = (bool)p[4]; 828 bool postOnRez = (bool)p[4];
823 StateSource stateSource = (StateSource)p[5]; 829 StateSource stateSource = (StateSource)p[5];
824 830
831// m_log.DebugFormat("[XEngine]: DoOnRezScript called for script {0}", itemID);
832
825 lock (m_CompileDict) 833 lock (m_CompileDict)
826 { 834 {
827 if (!m_CompileDict.ContainsKey(itemID)) 835 if (!m_CompileDict.ContainsKey(itemID))
@@ -870,7 +878,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
870 { 878 {
871 try 879 try
872 { 880 {
873 lock (m_AddingAssemblies) 881 lock (m_AddingAssemblies)
874 { 882 {
875 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assembly, out linemap); 883 m_Compiler.PerformScriptCompile(script, assetID.ToString(), item.OwnerID, out assembly, out linemap);
876 if (!m_AddingAssemblies.ContainsKey(assembly)) { 884 if (!m_AddingAssemblies.ContainsKey(assembly)) {
@@ -922,6 +930,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
922 } 930 }
923 catch (Exception e) 931 catch (Exception e)
924 { 932 {
933// m_log.ErrorFormat("[XEngine]: Exception when rezzing script {0}{1}", e.Message, e.StackTrace);
934
925 // try 935 // try
926 // { 936 // {
927 if (!m_ScriptErrors.ContainsKey(itemID)) 937 if (!m_ScriptErrors.ContainsKey(itemID))
@@ -1132,7 +1142,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1132 handlerObjectRemoved(part.UUID); 1142 handlerObjectRemoved(part.UUID);
1133 } 1143 }
1134 1144
1135
1136 ScriptRemoved handlerScriptRemoved = OnScriptRemoved; 1145 ScriptRemoved handlerScriptRemoved = OnScriptRemoved;
1137 if (handlerScriptRemoved != null) 1146 if (handlerScriptRemoved != null)
1138 handlerScriptRemoved(itemID); 1147 handlerScriptRemoved(itemID);
@@ -1381,6 +1390,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1381 string path = Path.Combine(Directory.GetCurrentDirectory(), 1390 string path = Path.Combine(Directory.GetCurrentDirectory(),
1382 Path.Combine(s, assemblyName))+".dll"; 1391 Path.Combine(s, assemblyName))+".dll";
1383 1392
1393// Console.WriteLine("[XEngine]: Trying to resolve {0}", path);
1394
1384 if (File.Exists(path)) 1395 if (File.Exists(path))
1385 return Assembly.LoadFrom(path); 1396 return Assembly.LoadFrom(path);
1386 } 1397 }
@@ -1863,16 +1874,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1863 1874
1864 public void SuspendScript(UUID itemID) 1875 public void SuspendScript(UUID itemID)
1865 { 1876 {
1877// m_log.DebugFormat("[XEngine]: Received request to suspend script with ID {0}", itemID);
1878
1866 IScriptInstance instance = GetInstance(itemID); 1879 IScriptInstance instance = GetInstance(itemID);
1867 if (instance != null) 1880 if (instance != null)
1868 instance.Suspend(); 1881 instance.Suspend();
1882// else
1883// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
1869 } 1884 }
1870 1885
1871 public void ResumeScript(UUID itemID) 1886 public void ResumeScript(UUID itemID)
1872 { 1887 {
1888// m_log.DebugFormat("[XEngine]: Received request to resume script with ID {0}", itemID);
1889
1873 IScriptInstance instance = GetInstance(itemID); 1890 IScriptInstance instance = GetInstance(itemID);
1874 if (instance != null) 1891 if (instance != null)
1875 instance.Resume(); 1892 instance.Resume();
1893// else
1894// m_log.DebugFormat("[XEngine]: Could not find script with ID {0} to resume", itemID);
1876 } 1895 }
1877 } 1896 }
1878} \ No newline at end of file 1897} \ No newline at end of file
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index 24a9418..f627e37 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -301,7 +301,7 @@ namespace OpenSim.Region.UserStatistics
301 301
302 public void OnRegisterCaps(UUID agentID, Caps caps) 302 public void OnRegisterCaps(UUID agentID, Caps caps)
303 { 303 {
304 m_log.DebugFormat("[VC]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps); 304 m_log.DebugFormat("[WEB STATS MODULE]: OnRegisterCaps: agentID {0} caps {1}", agentID, caps);
305 string capsPath = "/CAPS/VS/" + UUID.Random(); 305 string capsPath = "/CAPS/VS/" + UUID.Random();
306 caps.RegisterHandler("ViewerStats", 306 caps.RegisterHandler("ViewerStats",
307 new RestStreamHandler("POST", capsPath, 307 new RestStreamHandler("POST", capsPath,
@@ -462,7 +462,7 @@ namespace OpenSim.Region.UserStatistics
462 462
463 if (!m_sessions.ContainsKey(agentID)) 463 if (!m_sessions.ContainsKey(agentID))
464 { 464 {
465 m_log.Warn("[VS]: no session for stat disclosure"); 465 m_log.Warn("[WEB STATS MODULE]: no session for stat disclosure");
466 return new UserSessionID(); 466 return new UserSessionID();
467 } 467 }
468 uid = m_sessions[agentID]; 468 uid = m_sessions[agentID];
@@ -667,14 +667,13 @@ namespace OpenSim.Region.UserStatistics
667 { 667 {
668 updatecmd.ExecuteNonQuery(); 668 updatecmd.ExecuteNonQuery();
669 } 669 }
670 catch 670 catch (SqliteExecutionException)
671 (SqliteExecutionException)
672 { 671 {
673 m_log.Warn("[WEBSTATS]: failed to write stats to storage Execution Exception"); 672 m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage Execution Exception");
674 } 673 }
675 catch (SqliteSyntaxException) 674 catch (SqliteSyntaxException)
676 { 675 {
677 m_log.Warn("[WEBSTATS]: failed to write stats to storage SQL Syntax Exception"); 676 m_log.Warn("[WEB STATS MODULE]: failed to write stats to storage SQL Syntax Exception");
678 } 677 }
679 678
680 } 679 }
diff --git a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
index 8fdb4d0..ddfca57 100644
--- a/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Avatar/AvatarServiceConnector.cs
@@ -110,12 +110,11 @@ namespace OpenSim.Services.Connectors
110 110
111 string reply = string.Empty; 111 string reply = string.Empty;
112 string reqString = ServerUtils.BuildQueryString(sendData); 112 string reqString = ServerUtils.BuildQueryString(sendData);
113 string uri = m_ServerURI + "/avatar";
113 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); 114 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
114 try 115 try
115 { 116 {
116 reply = SynchronousRestFormsRequester.MakeRequest("POST", 117 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
117 m_ServerURI + "/avatar",
118 reqString);
119 if (reply == null || (reply != null && reply == string.Empty)) 118 if (reply == null || (reply != null && reply == string.Empty))
120 { 119 {
121 m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply"); 120 m_log.DebugFormat("[AVATAR CONNECTOR]: GetAgent received null or empty reply");
@@ -124,7 +123,7 @@ namespace OpenSim.Services.Connectors
124 } 123 }
125 catch (Exception e) 124 catch (Exception e)
126 { 125 {
127 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 126 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
128 } 127 }
129 128
130 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 129 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -159,12 +158,11 @@ namespace OpenSim.Services.Connectors
159 158
160 159
161 string reqString = ServerUtils.BuildQueryString(sendData); 160 string reqString = ServerUtils.BuildQueryString(sendData);
161 string uri = m_ServerURI + "/avatar";
162 //m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); 162 //m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
163 try 163 try
164 { 164 {
165 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 165 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
166 m_ServerURI + "/avatar",
167 reqString);
168 if (reply != string.Empty) 166 if (reply != string.Empty)
169 { 167 {
170 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 168 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -177,15 +175,18 @@ namespace OpenSim.Services.Connectors
177 return false; 175 return false;
178 } 176 }
179 else 177 else
178 {
180 m_log.DebugFormat("[AVATAR CONNECTOR]: SetAvatar reply data does not contain result field"); 179 m_log.DebugFormat("[AVATAR CONNECTOR]: SetAvatar reply data does not contain result field");
181 180 }
182 } 181 }
183 else 182 else
183 {
184 m_log.DebugFormat("[AVATAR CONNECTOR]: SetAvatar received empty reply"); 184 m_log.DebugFormat("[AVATAR CONNECTOR]: SetAvatar received empty reply");
185 }
185 } 186 }
186 catch (Exception e) 187 catch (Exception e)
187 { 188 {
188 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting avatar server: {0}", e.Message); 189 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
189 } 190 }
190 191
191 return false; 192 return false;
@@ -202,12 +203,11 @@ namespace OpenSim.Services.Connectors
202 sendData["UserID"] = userID.ToString(); 203 sendData["UserID"] = userID.ToString();
203 204
204 string reqString = ServerUtils.BuildQueryString(sendData); 205 string reqString = ServerUtils.BuildQueryString(sendData);
206 string uri = m_ServerURI + "/avatar";
205 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); 207 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
206 try 208 try
207 { 209 {
208 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 210 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
209 m_ServerURI + "/avatar",
210 reqString);
211 if (reply != string.Empty) 211 if (reply != string.Empty)
212 { 212 {
213 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 213 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -228,7 +228,7 @@ namespace OpenSim.Services.Connectors
228 } 228 }
229 catch (Exception e) 229 catch (Exception e)
230 { 230 {
231 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting avatar server: {0}", e.Message); 231 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
232 } 232 }
233 233
234 return false; 234 return false;
@@ -246,12 +246,11 @@ namespace OpenSim.Services.Connectors
246 sendData["Values"] = new List<string>(values); 246 sendData["Values"] = new List<string>(values);
247 247
248 string reqString = ServerUtils.BuildQueryString(sendData); 248 string reqString = ServerUtils.BuildQueryString(sendData);
249 string uri = m_ServerURI + "/avatar";
249 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); 250 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
250 try 251 try
251 { 252 {
252 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 253 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
253 m_ServerURI + "/avatar",
254 reqString);
255 if (reply != string.Empty) 254 if (reply != string.Empty)
256 { 255 {
257 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 256 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -272,7 +271,7 @@ namespace OpenSim.Services.Connectors
272 } 271 }
273 catch (Exception e) 272 catch (Exception e)
274 { 273 {
275 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting avatar server: {0}", e.Message); 274 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
276 } 275 }
277 276
278 return false; 277 return false;
@@ -290,12 +289,11 @@ namespace OpenSim.Services.Connectors
290 sendData["Names"] = new List<string>(names); 289 sendData["Names"] = new List<string>(names);
291 290
292 string reqString = ServerUtils.BuildQueryString(sendData); 291 string reqString = ServerUtils.BuildQueryString(sendData);
292 string uri = m_ServerURI + "/avatar";
293 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString); 293 // m_log.DebugFormat("[AVATAR CONNECTOR]: queryString = {0}", reqString);
294 try 294 try
295 { 295 {
296 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 296 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
297 m_ServerURI + "/avatar",
298 reqString);
299 if (reply != string.Empty) 297 if (reply != string.Empty)
300 { 298 {
301 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 299 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -316,7 +314,7 @@ namespace OpenSim.Services.Connectors
316 } 314 }
317 catch (Exception e) 315 catch (Exception e)
318 { 316 {
319 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting avatar server: {0}", e.Message); 317 m_log.DebugFormat("[AVATAR CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
320 } 318 }
321 319
322 return false; 320 return false;
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
index 41361ab..44138c9 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs
@@ -108,12 +108,11 @@ namespace OpenSim.Services.Connectors.Friends
108 protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID) 108 protected FriendInfo[] GetFriends(Dictionary<string, object> sendData, string PrincipalID)
109 { 109 {
110 string reqString = ServerUtils.BuildQueryString(sendData); 110 string reqString = ServerUtils.BuildQueryString(sendData);
111 string uri = m_ServerURI + "/friends";
111 112
112 try 113 try
113 { 114 {
114 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 115 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
115 m_ServerURI + "/friends",
116 reqString);
117 if (reply != string.Empty) 116 if (reply != string.Empty)
118 { 117 {
119 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 118 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -143,7 +142,6 @@ namespace OpenSim.Services.Connectors.Friends
143 // Success 142 // Success
144 return finfos.ToArray(); 143 return finfos.ToArray();
145 } 144 }
146
147 else 145 else
148 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response", 146 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: GetFriends {0} received null response",
149 PrincipalID); 147 PrincipalID);
@@ -152,7 +150,7 @@ namespace OpenSim.Services.Connectors.Friends
152 } 150 }
153 catch (Exception e) 151 catch (Exception e)
154 { 152 {
155 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 153 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
156 } 154 }
157 155
158 return new FriendInfo[0]; 156 return new FriendInfo[0];
@@ -167,15 +165,14 @@ namespace OpenSim.Services.Connectors.Friends
167 sendData["METHOD"] = "storefriend"; 165 sendData["METHOD"] = "storefriend";
168 166
169 string reply = string.Empty; 167 string reply = string.Empty;
168 string uri = m_ServerURI + "/friends";
170 try 169 try
171 { 170 {
172 reply = SynchronousRestFormsRequester.MakeRequest("POST", 171 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
173 m_ServerURI + "/friends",
174 ServerUtils.BuildQueryString(sendData));
175 } 172 }
176 catch (Exception e) 173 catch (Exception e)
177 { 174 {
178 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 175 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
179 return false; 176 return false;
180 } 177 }
181 178
@@ -223,15 +220,14 @@ namespace OpenSim.Services.Connectors.Friends
223 public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend) 220 public bool Delete(Dictionary<string, object> sendData, string PrincipalID, string Friend)
224 { 221 {
225 string reply = string.Empty; 222 string reply = string.Empty;
223 string uri = m_ServerURI = "/friends";
226 try 224 try
227 { 225 {
228 reply = SynchronousRestFormsRequester.MakeRequest("POST", 226 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
229 m_ServerURI + "/friends",
230 ServerUtils.BuildQueryString(sendData));
231 } 227 }
232 catch (Exception e) 228 catch (Exception e)
233 { 229 {
234 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 230 m_log.DebugFormat("[FRIENDS SERVICE CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
235 return false; 231 return false;
236 } 232 }
237 233
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
index d0a20fc..eea9853 100644
--- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
+++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs
@@ -139,12 +139,11 @@ namespace OpenSim.Services.Connectors.Friends
139 return false; 139 return false;
140 140
141 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: region: {0}", region.ExternalHostName + ":" + region.HttpPort); 141 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: region: {0}", region.ExternalHostName + ":" + region.HttpPort);
142 string uri = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/friends";
143
142 try 144 try
143 { 145 {
144 string url = "http://" + region.ExternalHostName + ":" + region.HttpPort; 146 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
145 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
146 url + "/friends",
147 reqString);
148 if (reply != string.Empty) 147 if (reply != string.Empty)
149 { 148 {
150 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 149 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -165,7 +164,7 @@ namespace OpenSim.Services.Connectors.Friends
165 } 164 }
166 catch (Exception e) 165 catch (Exception e)
167 { 166 {
168 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim: {0}", e.ToString()); 167 m_log.DebugFormat("[FRIENDS SIM CONNECTOR]: Exception when contacting remote sim at {0}: {1}", uri, e.Message);
169 } 168 }
170 169
171 return false; 170 return false;
diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
index e57f28b..1599a56 100644
--- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs
@@ -98,12 +98,11 @@ namespace OpenSim.Services.Connectors
98 sendData["METHOD"] = "register"; 98 sendData["METHOD"] = "register";
99 99
100 string reqString = ServerUtils.BuildQueryString(sendData); 100 string reqString = ServerUtils.BuildQueryString(sendData);
101 string uri = m_ServerURI + "/grid";
101 // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString); 102 // m_log.DebugFormat("[GRID CONNECTOR]: queryString = {0}", reqString);
102 try 103 try
103 { 104 {
104 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 105 string reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
105 m_ServerURI + "/grid",
106 reqString);
107 if (reply != string.Empty) 106 if (reply != string.Empty)
108 { 107 {
109 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 108 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -133,7 +132,7 @@ namespace OpenSim.Services.Connectors
133 } 132 }
134 catch (Exception e) 133 catch (Exception e)
135 { 134 {
136 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 135 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
137 } 136 }
138 137
139 return "Error communicating with grid service"; 138 return "Error communicating with grid service";
@@ -147,11 +146,12 @@ namespace OpenSim.Services.Connectors
147 146
148 sendData["METHOD"] = "deregister"; 147 sendData["METHOD"] = "deregister";
149 148
149 string uri = m_ServerURI + "/grid";
150
150 try 151 try
151 { 152 {
152 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 153 string reply
153 m_ServerURI + "/grid", 154 = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
154 ServerUtils.BuildQueryString(sendData));
155 155
156 if (reply != string.Empty) 156 if (reply != string.Empty)
157 { 157 {
@@ -165,7 +165,7 @@ namespace OpenSim.Services.Connectors
165 } 165 }
166 catch (Exception e) 166 catch (Exception e)
167 { 167 {
168 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 168 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
169 } 169 }
170 170
171 return false; 171 return false;
@@ -184,15 +184,15 @@ namespace OpenSim.Services.Connectors
184 184
185 string reqString = ServerUtils.BuildQueryString(sendData); 185 string reqString = ServerUtils.BuildQueryString(sendData);
186 string reply = string.Empty; 186 string reply = string.Empty;
187 string uri = m_ServerURI + "/grid";
188
187 try 189 try
188 { 190 {
189 reply = SynchronousRestFormsRequester.MakeRequest("POST", 191 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, reqString);
190 m_ServerURI + "/grid",
191 reqString);
192 } 192 }
193 catch (Exception e) 193 catch (Exception e)
194 { 194 {
195 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 195 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
196 return rinfos; 196 return rinfos;
197 } 197 }
198 198
@@ -228,15 +228,14 @@ namespace OpenSim.Services.Connectors
228 sendData["METHOD"] = "get_region_by_uuid"; 228 sendData["METHOD"] = "get_region_by_uuid";
229 229
230 string reply = string.Empty; 230 string reply = string.Empty;
231 string uri = m_ServerURI + "/grid";
231 try 232 try
232 { 233 {
233 reply = SynchronousRestFormsRequester.MakeRequest("POST", 234 reply = SynchronousRestFormsRequester.MakeRequest("POST", uri, ServerUtils.BuildQueryString(sendData));
234 m_ServerURI + "/grid",
235 ServerUtils.BuildQueryString(sendData));
236 } 235 }
237 catch (Exception e) 236 catch (Exception e)
238 { 237 {
239 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 238 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
240 return null; 239 return null;
241 } 240 }
242 241
@@ -274,15 +273,16 @@ namespace OpenSim.Services.Connectors
274 273
275 sendData["METHOD"] = "get_region_by_position"; 274 sendData["METHOD"] = "get_region_by_position";
276 string reply = string.Empty; 275 string reply = string.Empty;
276 string uri = m_ServerURI + "/grid";
277 try 277 try
278 { 278 {
279 reply = SynchronousRestFormsRequester.MakeRequest("POST", 279 reply = SynchronousRestFormsRequester.MakeRequest("POST",
280 m_ServerURI + "/grid", 280 uri,
281 ServerUtils.BuildQueryString(sendData)); 281 ServerUtils.BuildQueryString(sendData));
282 } 282 }
283 catch (Exception e) 283 catch (Exception e)
284 { 284 {
285 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 285 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
286 return null; 286 return null;
287 } 287 }
288 288
@@ -318,15 +318,16 @@ namespace OpenSim.Services.Connectors
318 318
319 sendData["METHOD"] = "get_region_by_name"; 319 sendData["METHOD"] = "get_region_by_name";
320 string reply = string.Empty; 320 string reply = string.Empty;
321 string uri = m_ServerURI + "/grid";
321 try 322 try
322 { 323 {
323 reply = SynchronousRestFormsRequester.MakeRequest("POST", 324 reply = SynchronousRestFormsRequester.MakeRequest("POST",
324 m_ServerURI + "/grid", 325 uri,
325 ServerUtils.BuildQueryString(sendData)); 326 ServerUtils.BuildQueryString(sendData));
326 } 327 }
327 catch (Exception e) 328 catch (Exception e)
328 { 329 {
329 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 330 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
330 return null; 331 return null;
331 } 332 }
332 333
@@ -361,15 +362,16 @@ namespace OpenSim.Services.Connectors
361 sendData["METHOD"] = "get_regions_by_name"; 362 sendData["METHOD"] = "get_regions_by_name";
362 List<GridRegion> rinfos = new List<GridRegion>(); 363 List<GridRegion> rinfos = new List<GridRegion>();
363 string reply = string.Empty; 364 string reply = string.Empty;
365 string uri = m_ServerURI + "/grid";
364 try 366 try
365 { 367 {
366 reply = SynchronousRestFormsRequester.MakeRequest("POST", 368 reply = SynchronousRestFormsRequester.MakeRequest("POST",
367 m_ServerURI + "/grid", 369 uri,
368 ServerUtils.BuildQueryString(sendData)); 370 ServerUtils.BuildQueryString(sendData));
369 } 371 }
370 catch (Exception e) 372 catch (Exception e)
371 { 373 {
372 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 374 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
373 return rinfos; 375 return rinfos;
374 } 376 }
375 377
@@ -413,17 +415,19 @@ namespace OpenSim.Services.Connectors
413 415
414 List<GridRegion> rinfos = new List<GridRegion>(); 416 List<GridRegion> rinfos = new List<GridRegion>();
415 string reply = string.Empty; 417 string reply = string.Empty;
418 string uri = m_ServerURI + "/grid";
419
416 try 420 try
417 { 421 {
418 reply = SynchronousRestFormsRequester.MakeRequest("POST", 422 reply = SynchronousRestFormsRequester.MakeRequest("POST",
419 m_ServerURI + "/grid", 423 uri,
420 ServerUtils.BuildQueryString(sendData)); 424 ServerUtils.BuildQueryString(sendData));
421 425
422 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 426 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
423 } 427 }
424 catch (Exception e) 428 catch (Exception e)
425 { 429 {
426 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 430 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
427 return rinfos; 431 return rinfos;
428 } 432 }
429 433
@@ -463,17 +467,18 @@ namespace OpenSim.Services.Connectors
463 467
464 List<GridRegion> rinfos = new List<GridRegion>(); 468 List<GridRegion> rinfos = new List<GridRegion>();
465 string reply = string.Empty; 469 string reply = string.Empty;
470 string uri = m_ServerURI + "/grid";
466 try 471 try
467 { 472 {
468 reply = SynchronousRestFormsRequester.MakeRequest("POST", 473 reply = SynchronousRestFormsRequester.MakeRequest("POST",
469 m_ServerURI + "/grid", 474 uri,
470 ServerUtils.BuildQueryString(sendData)); 475 ServerUtils.BuildQueryString(sendData));
471 476
472 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 477 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
473 } 478 }
474 catch (Exception e) 479 catch (Exception e)
475 { 480 {
476 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 481 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
477 return rinfos; 482 return rinfos;
478 } 483 }
479 484
@@ -515,17 +520,18 @@ namespace OpenSim.Services.Connectors
515 520
516 List<GridRegion> rinfos = new List<GridRegion>(); 521 List<GridRegion> rinfos = new List<GridRegion>();
517 string reply = string.Empty; 522 string reply = string.Empty;
523 string uri = m_ServerURI + "/grid";
518 try 524 try
519 { 525 {
520 reply = SynchronousRestFormsRequester.MakeRequest("POST", 526 reply = SynchronousRestFormsRequester.MakeRequest("POST",
521 m_ServerURI + "/grid", 527 uri,
522 ServerUtils.BuildQueryString(sendData)); 528 ServerUtils.BuildQueryString(sendData));
523 529
524 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 530 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
525 } 531 }
526 catch (Exception e) 532 catch (Exception e)
527 { 533 {
528 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 534 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
529 return rinfos; 535 return rinfos;
530 } 536 }
531 537
@@ -565,17 +571,18 @@ namespace OpenSim.Services.Connectors
565 571
566 List<GridRegion> rinfos = new List<GridRegion>(); 572 List<GridRegion> rinfos = new List<GridRegion>();
567 string reply = string.Empty; 573 string reply = string.Empty;
574 string uri = m_ServerURI + "/grid";
568 try 575 try
569 { 576 {
570 reply = SynchronousRestFormsRequester.MakeRequest("POST", 577 reply = SynchronousRestFormsRequester.MakeRequest("POST",
571 m_ServerURI + "/grid", 578 uri,
572 ServerUtils.BuildQueryString(sendData)); 579 ServerUtils.BuildQueryString(sendData));
573 580
574 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply); 581 //m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
575 } 582 }
576 catch (Exception e) 583 catch (Exception e)
577 { 584 {
578 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 585 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
579 return rinfos; 586 return rinfos;
580 } 587 }
581 588
@@ -615,15 +622,16 @@ namespace OpenSim.Services.Connectors
615 sendData["METHOD"] = "get_region_flags"; 622 sendData["METHOD"] = "get_region_flags";
616 623
617 string reply = string.Empty; 624 string reply = string.Empty;
625 string uri = m_ServerURI + "/grid";
618 try 626 try
619 { 627 {
620 reply = SynchronousRestFormsRequester.MakeRequest("POST", 628 reply = SynchronousRestFormsRequester.MakeRequest("POST",
621 m_ServerURI + "/grid", 629 uri,
622 ServerUtils.BuildQueryString(sendData)); 630 ServerUtils.BuildQueryString(sendData));
623 } 631 }
624 catch (Exception e) 632 catch (Exception e)
625 { 633 {
626 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 634 m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server at {0}: {1}", uri, e.Message);
627 return -1; 635 return -1;
628 } 636 }
629 637
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
index aa98b5d..20d7eaf 100644
--- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
+++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs
@@ -156,11 +156,12 @@ namespace OpenSim.Services.Connectors
156 sendData["LookAt"] = lookAt.ToString(); 156 sendData["LookAt"] = lookAt.ToString();
157 157
158 string reqString = ServerUtils.BuildQueryString(sendData); 158 string reqString = ServerUtils.BuildQueryString(sendData);
159 string uri = m_ServerURI + "/griduser";
159 // m_log.DebugFormat("[GRID USER CONNECTOR]: queryString = {0}", reqString); 160 // m_log.DebugFormat("[GRID USER CONNECTOR]: queryString = {0}", reqString);
160 try 161 try
161 { 162 {
162 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 163 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
163 m_ServerURI + "/griduser", 164 uri,
164 reqString); 165 reqString);
165 if (reply != string.Empty) 166 if (reply != string.Empty)
166 { 167 {
@@ -182,7 +183,7 @@ namespace OpenSim.Services.Connectors
182 } 183 }
183 catch (Exception e) 184 catch (Exception e)
184 { 185 {
185 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server: {0}", e.Message); 186 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server at {0}: {1}", uri, e.Message);
186 } 187 }
187 188
188 return false; 189 return false;
@@ -191,11 +192,12 @@ namespace OpenSim.Services.Connectors
191 protected GridUserInfo Get(Dictionary<string, object> sendData) 192 protected GridUserInfo Get(Dictionary<string, object> sendData)
192 { 193 {
193 string reqString = ServerUtils.BuildQueryString(sendData); 194 string reqString = ServerUtils.BuildQueryString(sendData);
195 string uri = m_ServerURI + "/griduser";
194 // m_log.DebugFormat("[GRID USER CONNECTOR]: queryString = {0}", reqString); 196 // m_log.DebugFormat("[GRID USER CONNECTOR]: queryString = {0}", reqString);
195 try 197 try
196 { 198 {
197 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 199 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
198 m_ServerURI + "/griduser", 200 uri,
199 reqString); 201 reqString);
200 if (reply != string.Empty) 202 if (reply != string.Empty)
201 { 203 {
@@ -216,7 +218,7 @@ namespace OpenSim.Services.Connectors
216 } 218 }
217 catch (Exception e) 219 catch (Exception e)
218 { 220 {
219 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server: {0}", e.Message); 221 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server at {0}: {1}", uri, e.Message);
220 } 222 }
221 223
222 return null; 224 return null;
@@ -235,11 +237,12 @@ namespace OpenSim.Services.Connectors
235 237
236 string reply = string.Empty; 238 string reply = string.Empty;
237 string reqString = ServerUtils.BuildQueryString(sendData); 239 string reqString = ServerUtils.BuildQueryString(sendData);
240 string uri = m_ServerURI + "/griduser";
238 //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 241 //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
239 try 242 try
240 { 243 {
241 reply = SynchronousRestFormsRequester.MakeRequest("POST", 244 reply = SynchronousRestFormsRequester.MakeRequest("POST",
242 m_ServerURI + "/griduser", 245 uri,
243 reqString); 246 reqString);
244 if (reply == null || (reply != null && reply == string.Empty)) 247 if (reply == null || (reply != null && reply == string.Empty))
245 { 248 {
@@ -249,7 +252,7 @@ namespace OpenSim.Services.Connectors
249 } 252 }
250 catch (Exception e) 253 catch (Exception e)
251 { 254 {
252 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server: {0}", e.Message); 255 m_log.DebugFormat("[GRID USER CONNECTOR]: Exception when contacting grid user server at {0}: {1}", uri, e.Message);
253 } 256 }
254 257
255 List<GridUserInfo> rinfos = new List<GridUserInfo>(); 258 List<GridUserInfo> rinfos = new List<GridUserInfo>();
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
index d699f59..af4b0da 100644
--- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs
@@ -79,11 +79,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
79 sendData["SESSIONID"] = m_SessionID.ToString(); 79 sendData["SESSIONID"] = m_SessionID.ToString();
80 80
81 string reqString = ServerUtils.BuildQueryString(sendData); 81 string reqString = ServerUtils.BuildQueryString(sendData);
82 string uri = m_ServerURI + "/hgfriends";
82 83
83 try 84 try
84 { 85 {
85 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 86 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
86 m_ServerURI + "/hgfriends", 87 uri,
87 reqString); 88 reqString);
88 if (reply != string.Empty) 89 if (reply != string.Empty)
89 { 90 {
@@ -103,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
103 } 104 }
104 catch (Exception e) 105 catch (Exception e)
105 { 106 {
106 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 107 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
107 } 108 }
108 109
109 return 0; 110 return 0;
@@ -123,15 +124,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
123 sendData["SESSIONID"] = m_SessionID.ToString(); 124 sendData["SESSIONID"] = m_SessionID.ToString();
124 125
125 string reply = string.Empty; 126 string reply = string.Empty;
127 string uri = m_ServerURI + "/hgfriends";
126 try 128 try
127 { 129 {
128 reply = SynchronousRestFormsRequester.MakeRequest("POST", 130 reply = SynchronousRestFormsRequester.MakeRequest("POST",
129 m_ServerURI + "/hgfriends", 131 uri,
130 ServerUtils.BuildQueryString(sendData)); 132 ServerUtils.BuildQueryString(sendData));
131 } 133 }
132 catch (Exception e) 134 catch (Exception e)
133 { 135 {
134 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 136 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
135 return false; 137 return false;
136 } 138 }
137 139
@@ -168,15 +170,16 @@ namespace OpenSim.Services.Connectors.Hypergrid
168 sendData["SECRET"] = secret; 170 sendData["SECRET"] = secret;
169 171
170 string reply = string.Empty; 172 string reply = string.Empty;
173 string uri = m_ServerURI + "/hgfriends";
171 try 174 try
172 { 175 {
173 reply = SynchronousRestFormsRequester.MakeRequest("POST", 176 reply = SynchronousRestFormsRequester.MakeRequest("POST",
174 m_ServerURI + "/hgfriends", 177 uri,
175 ServerUtils.BuildQueryString(sendData)); 178 ServerUtils.BuildQueryString(sendData));
176 } 179 }
177 catch (Exception e) 180 catch (Exception e)
178 { 181 {
179 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server: {0}", e.Message); 182 m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message);
180 return false; 183 return false;
181 } 184 }
182 185
diff --git a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
index e46714e..30bfb70 100644
--- a/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
+++ b/OpenSim/Services/Connectors/MapImage/MapImageServiceConnector.cs
@@ -97,11 +97,12 @@ namespace OpenSim.Services.Connectors
97 sendData["DATA"] = Convert.ToBase64String(jpgData); 97 sendData["DATA"] = Convert.ToBase64String(jpgData);
98 98
99 string reqString = ServerUtils.BuildQueryString(sendData); 99 string reqString = ServerUtils.BuildQueryString(sendData);
100 string uri = m_ServerURI + "/map";
100 101
101 try 102 try
102 { 103 {
103 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 104 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
104 m_ServerURI + "/map", 105 uri,
105 reqString); 106 reqString);
106 if (reply != string.Empty) 107 if (reply != string.Empty)
107 { 108 {
@@ -135,7 +136,7 @@ namespace OpenSim.Services.Connectors
135 } 136 }
136 catch (Exception e) 137 catch (Exception e)
137 { 138 {
138 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting grid server: {0}", e.Message); 139 m_log.DebugFormat("[MAP IMAGE CONNECTOR]: Exception when contacting map server at {0}: {1}", uri, e.Message);
139 } 140 }
140 finally 141 finally
141 { 142 {
diff --git a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
index 7238afc..f7d8c53 100644
--- a/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Presence/PresenceServiceConnector.cs
@@ -98,11 +98,12 @@ namespace OpenSim.Services.Connectors
98 sendData["SecureSessionID"] = secureSessionID.ToString(); 98 sendData["SecureSessionID"] = secureSessionID.ToString();
99 99
100 string reqString = ServerUtils.BuildQueryString(sendData); 100 string reqString = ServerUtils.BuildQueryString(sendData);
101 string uri = m_ServerURI + "/presence";
101 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 102 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
102 try 103 try
103 { 104 {
104 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 105 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
105 m_ServerURI + "/presence", 106 uri,
106 reqString); 107 reqString);
107 if (reply != string.Empty) 108 if (reply != string.Empty)
108 { 109 {
@@ -124,7 +125,7 @@ namespace OpenSim.Services.Connectors
124 } 125 }
125 catch (Exception e) 126 catch (Exception e)
126 { 127 {
127 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 128 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
128 } 129 }
129 130
130 return false; 131 return false;
@@ -142,11 +143,12 @@ namespace OpenSim.Services.Connectors
142 sendData["SessionID"] = sessionID.ToString(); 143 sendData["SessionID"] = sessionID.ToString();
143 144
144 string reqString = ServerUtils.BuildQueryString(sendData); 145 string reqString = ServerUtils.BuildQueryString(sendData);
146 string uri = m_ServerURI + "/presence";
145 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 147 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
146 try 148 try
147 { 149 {
148 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 150 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
149 m_ServerURI + "/presence", 151 uri,
150 reqString); 152 reqString);
151 if (reply != string.Empty) 153 if (reply != string.Empty)
152 { 154 {
@@ -168,7 +170,7 @@ namespace OpenSim.Services.Connectors
168 } 170 }
169 catch (Exception e) 171 catch (Exception e)
170 { 172 {
171 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 173 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
172 } 174 }
173 175
174 return false; 176 return false;
@@ -185,11 +187,12 @@ namespace OpenSim.Services.Connectors
185 sendData["RegionID"] = regionID.ToString(); 187 sendData["RegionID"] = regionID.ToString();
186 188
187 string reqString = ServerUtils.BuildQueryString(sendData); 189 string reqString = ServerUtils.BuildQueryString(sendData);
190 string uri = m_ServerURI + "/presence";
188 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 191 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
189 try 192 try
190 { 193 {
191 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 194 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
192 m_ServerURI + "/presence", 195 uri,
193 reqString); 196 reqString);
194 if (reply != string.Empty) 197 if (reply != string.Empty)
195 { 198 {
@@ -211,7 +214,7 @@ namespace OpenSim.Services.Connectors
211 } 214 }
212 catch (Exception e) 215 catch (Exception e)
213 { 216 {
214 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 217 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
215 } 218 }
216 219
217 return false; 220 return false;
@@ -229,11 +232,12 @@ namespace OpenSim.Services.Connectors
229 sendData["RegionID"] = regionID.ToString(); 232 sendData["RegionID"] = regionID.ToString();
230 233
231 string reqString = ServerUtils.BuildQueryString(sendData); 234 string reqString = ServerUtils.BuildQueryString(sendData);
235 string uri = m_ServerURI + "/presence";
232 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 236 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
233 try 237 try
234 { 238 {
235 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 239 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
236 m_ServerURI + "/presence", 240 uri,
237 reqString); 241 reqString);
238 if (reply != string.Empty) 242 if (reply != string.Empty)
239 { 243 {
@@ -255,7 +259,7 @@ namespace OpenSim.Services.Connectors
255 } 259 }
256 catch (Exception e) 260 catch (Exception e)
257 { 261 {
258 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 262 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
259 } 263 }
260 264
261 return false; 265 return false;
@@ -273,11 +277,12 @@ namespace OpenSim.Services.Connectors
273 277
274 string reply = string.Empty; 278 string reply = string.Empty;
275 string reqString = ServerUtils.BuildQueryString(sendData); 279 string reqString = ServerUtils.BuildQueryString(sendData);
280 string uri = m_ServerURI + "/presence";
276 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 281 // m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
277 try 282 try
278 { 283 {
279 reply = SynchronousRestFormsRequester.MakeRequest("POST", 284 reply = SynchronousRestFormsRequester.MakeRequest("POST",
280 m_ServerURI + "/presence", 285 uri,
281 reqString); 286 reqString);
282 if (reply == null || (reply != null && reply == string.Empty)) 287 if (reply == null || (reply != null && reply == string.Empty))
283 { 288 {
@@ -287,7 +292,7 @@ namespace OpenSim.Services.Connectors
287 } 292 }
288 catch (Exception e) 293 catch (Exception e)
289 { 294 {
290 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 295 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
291 } 296 }
292 297
293 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 298 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -316,11 +321,12 @@ namespace OpenSim.Services.Connectors
316 321
317 string reply = string.Empty; 322 string reply = string.Empty;
318 string reqString = ServerUtils.BuildQueryString(sendData); 323 string reqString = ServerUtils.BuildQueryString(sendData);
324 string uri = m_ServerURI + "/presence";
319 //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString); 325 //m_log.DebugFormat("[PRESENCE CONNECTOR]: queryString = {0}", reqString);
320 try 326 try
321 { 327 {
322 reply = SynchronousRestFormsRequester.MakeRequest("POST", 328 reply = SynchronousRestFormsRequester.MakeRequest("POST",
323 m_ServerURI + "/presence", 329 uri,
324 reqString); 330 reqString);
325 if (reply == null || (reply != null && reply == string.Empty)) 331 if (reply == null || (reply != null && reply == string.Empty))
326 { 332 {
@@ -330,7 +336,7 @@ namespace OpenSim.Services.Connectors
330 } 336 }
331 catch (Exception e) 337 catch (Exception e)
332 { 338 {
333 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server: {0}", e.Message); 339 m_log.DebugFormat("[PRESENCE CONNECTOR]: Exception when contacting presence server at {0}: {1}", uri, e.Message);
334 } 340 }
335 341
336 List<PresenceInfo> rinfos = new List<PresenceInfo>(); 342 List<PresenceInfo> rinfos = new List<PresenceInfo>();
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
index f6835b9..609dafe 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
@@ -138,11 +138,12 @@ namespace OpenSim.Services.Connectors
138 138
139 string reply = string.Empty; 139 string reply = string.Empty;
140 string reqString = ServerUtils.BuildQueryString(sendData); 140 string reqString = ServerUtils.BuildQueryString(sendData);
141 string uri = m_ServerURI + "/accounts";
141 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString); 142 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
142 try 143 try
143 { 144 {
144 reply = SynchronousRestFormsRequester.MakeRequest("POST", 145 reply = SynchronousRestFormsRequester.MakeRequest("POST",
145 m_ServerURI + "/accounts", 146 uri,
146 reqString); 147 reqString);
147 if (reply == null || (reply != null && reply == string.Empty)) 148 if (reply == null || (reply != null && reply == string.Empty))
148 { 149 {
@@ -152,7 +153,7 @@ namespace OpenSim.Services.Connectors
152 } 153 }
153 catch (Exception e) 154 catch (Exception e)
154 { 155 {
155 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting accounts server: {0}", e.Message); 156 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user accounts server at {0}: {1}", uri, e.Message);
156 } 157 }
157 158
158 List<UserAccount> accounts = new List<UserAccount>(); 159 List<UserAccount> accounts = new List<UserAccount>();
@@ -206,11 +207,12 @@ namespace OpenSim.Services.Connectors
206 { 207 {
207 string reply = string.Empty; 208 string reply = string.Empty;
208 string reqString = ServerUtils.BuildQueryString(sendData); 209 string reqString = ServerUtils.BuildQueryString(sendData);
210 string uri = m_ServerURI + "/accounts";
209 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString); 211 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
210 try 212 try
211 { 213 {
212 reply = SynchronousRestFormsRequester.MakeRequest("POST", 214 reply = SynchronousRestFormsRequester.MakeRequest("POST",
213 m_ServerURI + "/accounts", 215 uri,
214 reqString); 216 reqString);
215 if (reply == null || (reply != null && reply == string.Empty)) 217 if (reply == null || (reply != null && reply == string.Empty))
216 { 218 {
@@ -220,7 +222,7 @@ namespace OpenSim.Services.Connectors
220 } 222 }
221 catch (Exception e) 223 catch (Exception e)
222 { 224 {
223 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user account server: {0}", e.Message); 225 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user accounts server at {0}: {1}", uri, e.Message);
224 } 226 }
225 227
226 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); 228 Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
@@ -241,11 +243,12 @@ namespace OpenSim.Services.Connectors
241 private bool SendAndGetBoolReply(Dictionary<string, object> sendData) 243 private bool SendAndGetBoolReply(Dictionary<string, object> sendData)
242 { 244 {
243 string reqString = ServerUtils.BuildQueryString(sendData); 245 string reqString = ServerUtils.BuildQueryString(sendData);
246 string uri = m_ServerURI + "/accounts";
244 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString); 247 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: queryString = {0}", reqString);
245 try 248 try
246 { 249 {
247 string reply = SynchronousRestFormsRequester.MakeRequest("POST", 250 string reply = SynchronousRestFormsRequester.MakeRequest("POST",
248 m_ServerURI + "/accounts", 251 uri,
249 reqString); 252 reqString);
250 if (reply != string.Empty) 253 if (reply != string.Empty)
251 { 254 {
@@ -267,7 +270,7 @@ namespace OpenSim.Services.Connectors
267 } 270 }
268 catch (Exception e) 271 catch (Exception e)
269 { 272 {
270 m_log.DebugFormat("[ACCOUNTS CONNECTOR]: Exception when contacting user account server: {0}", e.Message); 273 m_log.DebugFormat("[ACCOUNT CONNECTOR]: Exception when contacting user accounts server at {0}: {1}", uri, e.Message);
271 } 274 }
272 275
273 return false; 276 return false;
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index a25eb66..aa904aa 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -88,9 +88,27 @@ namespace OpenSim.Tests.Common
88 /// <param name="id">ID of the region</param> 88 /// <param name="id">ID of the region</param>
89 /// <param name="x">X co-ordinate of the region</param> 89 /// <param name="x">X co-ordinate of the region</param>
90 /// <param name="y">Y co-ordinate of the region</param> 90 /// <param name="y">Y co-ordinate of the region</param>
91 /// <param name="cm">This should be the same if simulating two scenes within a standalone</param> 91 /// <param name="cache"></param>
92 /// <returns></returns> 92 /// <returns></returns>
93 public static TestScene SetupScene(string name, UUID id, uint x, uint y, CoreAssetCache cache) 93 public static TestScene SetupScene(
94 string name, UUID id, uint x, uint y, CoreAssetCache cache)
95 {
96 return SetupScene(name, id, x, y, cache, new IniConfigSource());
97 }
98
99 /// <summary>
100 /// Set up a scene. If it's more then one scene, use the same CommunicationsManager to link regions
101 /// or a different, to get a brand new scene with new shared region modules.
102 /// </summary>
103 /// <param name="name">Name of the region</param>
104 /// <param name="id">ID of the region</param>
105 /// <param name="x">X co-ordinate of the region</param>
106 /// <param name="y">Y co-ordinate of the region</param>
107 /// <param name="cache"></param>
108 /// <param name="configSource"></param>
109 /// <returns></returns>
110 public static TestScene SetupScene(
111 string name, UUID id, uint x, uint y, CoreAssetCache cache, IConfigSource configSource)
94 { 112 {
95 Console.WriteLine("Setting up test scene {0}", name); 113 Console.WriteLine("Setting up test scene {0}", name);
96 114
@@ -106,7 +124,6 @@ namespace OpenSim.Tests.Common
106 124
107 ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null); 125 ISimulationDataService simDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
108 IEstateDataService estateDataService = null; 126 IEstateDataService estateDataService = null;
109 IConfigSource configSource = new IniConfigSource();
110 127
111 TestScene testScene = new TestScene( 128 TestScene testScene = new TestScene(
112 regInfo, acm, scs, simDataService, estateDataService, null, false, configSource, null); 129 regInfo, acm, scs, simDataService, estateDataService, null, false, configSource, null);
diff --git a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
index a8f0d59..7058d1e 100644
--- a/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/TaskInventoryHelpers.cs
@@ -72,15 +72,21 @@ namespace OpenSim.Tests.Common
72 /// <param name="sop"></param> 72 /// <param name="sop"></param>
73 /// <param name="itemName"></param> 73 /// <param name="itemName"></param>
74 /// <param name="id"></param> 74 /// <param name="id"></param>
75 public static TaskInventoryItem AddSceneObject(Scene scene, SceneObjectPart sop, string itemName, UUID id) 75 /// <param name="userId"></param>
76 public static TaskInventoryItem AddSceneObject(
77 Scene scene, SceneObjectPart sop, string itemName, UUID id, UUID userId)
76 { 78 {
77 SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero); 79 SceneObjectGroup taskSceneObject = SceneHelpers.CreateSceneObject(1, UUID.Zero);
78 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject); 80 AssetBase taskSceneObjectAsset = AssetHelpers.CreateAsset(0x10, taskSceneObject);
79 scene.AssetService.Store(taskSceneObjectAsset); 81 scene.AssetService.Store(taskSceneObjectAsset);
80 TaskInventoryItem taskSceneObjectItem 82 TaskInventoryItem taskSceneObjectItem
81 = new TaskInventoryItem 83 = new TaskInventoryItem
82 { Name = itemName, AssetID = taskSceneObjectAsset.FullID, ItemID = id, 84 { Name = itemName,
83 Type = (int)AssetType.Object, InvType = (int)InventoryType.Object }; 85 AssetID = taskSceneObjectAsset.FullID,
86 ItemID = id,
87 OwnerID = userId,
88 Type = (int)AssetType.Object,
89 InvType = (int)InventoryType.Object };
84 sop.Inventory.AddInventoryItem(taskSceneObjectItem, true); 90 sop.Inventory.AddInventoryItem(taskSceneObjectItem, true);
85 91
86 return taskSceneObjectItem; 92 return taskSceneObjectItem;
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs
index 07bcdce..eea68c3 100644
--- a/OpenSim/Tests/Common/Mock/TestScene.cs
+++ b/OpenSim/Tests/Common/Mock/TestScene.cs
@@ -47,6 +47,12 @@ namespace OpenSim.Tests.Common.Mock
47 dumpAssetsToFile, config, simulatorVersion) 47 dumpAssetsToFile, config, simulatorVersion)
48 { 48 {
49 } 49 }
50
51 ~TestScene()
52 {
53 //Console.WriteLine("TestScene destructor called for {0}", RegionInfo.RegionName);
54 Console.WriteLine("TestScene destructor called");
55 }
50 56
51 /// <summary> 57 /// <summary>
52 /// Temporarily override session authentication for tests (namely teleport). 58 /// Temporarily override session authentication for tests (namely teleport).
diff --git a/OpenSim/Tests/Torture/NPCTortureTests.cs b/OpenSim/Tests/Torture/NPCTortureTests.cs
new file mode 100644
index 0000000..8078d9d
--- /dev/null
+++ b/OpenSim/Tests/Torture/NPCTortureTests.cs
@@ -0,0 +1,185 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Diagnostics;
31using System.Reflection;
32using log4net;
33using Nini.Config;
34using NUnit.Framework;
35using OpenMetaverse;
36using OpenSim.Framework;
37using OpenSim.Framework.Communications;
38using OpenSim.Region.CoreModules.Avatar.Attachments;
39using OpenSim.Region.CoreModules.Avatar.AvatarFactory;
40using OpenSim.Region.CoreModules.Framework.InventoryAccess;
41using OpenSim.Region.CoreModules.Framework.UserManagement;
42using OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar;
43using OpenSim.Region.Framework.Interfaces;
44using OpenSim.Region.Framework.Scenes;
45using OpenSim.Region.OptionalModules.World.NPC;
46using OpenSim.Services.AvatarService;
47using OpenSim.Tests.Common;
48using OpenSim.Tests.Common.Mock;
49
50namespace OpenSim.Tests.Torture
51{
52 /// <summary>
53 /// NPC torture tests
54 /// </summary>
55 /// <remarks>
56 /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached,
57 /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller
58 /// earlier tests.
59 /// </remarks>
60 [TestFixture]
61 public class NPCTortureTests
62 {
63 private TestScene scene;
64 private AvatarFactoryModule afm;
65 private UserManagementModule umm;
66 private AttachmentsModule am;
67
68 [TestFixtureSetUp]
69 public void FixtureInit()
70 {
71 // Don't allow tests to be bamboozled by asynchronous events. Execute everything on the same thread.
72 Util.FireAndForgetMethod = FireAndForgetMethod.None;
73 }
74
75 [TestFixtureTearDown]
76 public void TearDown()
77 {
78 // We must set this back afterwards, otherwise later tests will fail since they're expecting multiple
79 // threads. Possibly, later tests should be rewritten not to worry about such things.
80 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
81 }
82
83 [SetUp]
84 public void Init()
85 {
86 IConfigSource config = new IniConfigSource();
87 config.AddConfig("NPC");
88 config.Configs["NPC"].Set("Enabled", "true");
89 config.AddConfig("Modules");
90 config.Configs["Modules"].Set("InventoryAccessModule", "BasicInventoryAccessModule");
91
92 afm = new AvatarFactoryModule();
93 umm = new UserManagementModule();
94 am = new AttachmentsModule();
95
96 scene = SceneHelpers.SetupScene();
97 SceneHelpers.SetupSceneModules(scene, config, afm, umm, am, new BasicInventoryAccessModule(), new NPCModule());
98 }
99
100 [Test]
101 public void TestAddRemove100NPCs()
102 {
103 TestHelpers.InMethod();
104// log4net.Config.XmlConfigurator.Configure();
105
106 TestAddRemoveNPCs(100);
107 }
108
109 [Test]
110 public void TestAddRemove1000NPCs()
111 {
112 TestHelpers.InMethod();
113// log4net.Config.XmlConfigurator.Configure();
114
115 TestAddRemoveNPCs(1000);
116 }
117
118 [Test]
119 public void TestAddRemove2000NPCs()
120 {
121 TestHelpers.InMethod();
122// log4net.Config.XmlConfigurator.Configure();
123
124 TestAddRemoveNPCs(2000);
125 }
126
127 private void TestAddRemoveNPCs(int numberOfNpcs)
128 {
129 ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
130// ScenePresence originalAvatar = scene.GetScenePresence(originalClient.AgentId);
131
132 // 8 is the index of the first baked texture in AvatarAppearance
133 UUID originalFace8TextureId = TestHelpers.ParseTail(0x10);
134 Primitive.TextureEntry originalTe = new Primitive.TextureEntry(UUID.Zero);
135 Primitive.TextureEntryFace originalTef = originalTe.CreateFace(8);
136 originalTef.TextureID = originalFace8TextureId;
137
138 // We also need to add the texture to the asset service, otherwise the AvatarFactoryModule will tell
139 // ScenePresence.SendInitialData() to reset our entire appearance.
140 scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId));
141
142 afm.SetAppearance(sp, originalTe, null);
143
144 INPCModule npcModule = scene.RequestModuleInterface<INPCModule>();
145
146 List<UUID> npcs = new List<UUID>();
147
148 long startGcMemory = GC.GetTotalMemory(true);
149 Stopwatch sw = new Stopwatch();
150 sw.Start();
151
152 for (int i = 0; i < numberOfNpcs; i++)
153 {
154 npcs.Add(
155 npcModule.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, scene, sp.Appearance));
156 }
157
158 for (int i = 0; i < numberOfNpcs; i++)
159 {
160 Assert.That(npcs[i], Is.Not.Null);
161
162 ScenePresence npc = scene.GetScenePresence(npcs[i]);
163 Assert.That(npc, Is.Not.Null);
164 }
165
166 for (int i = 0; i < numberOfNpcs; i++)
167 {
168 Assert.That(npcModule.DeleteNPC(npcs[i], scene), Is.True);
169 ScenePresence npc = scene.GetScenePresence(npcs[i]);
170 Assert.That(npc, Is.Null);
171 }
172
173 sw.Stop();
174
175 long endGcMemory = GC.GetTotalMemory(true);
176
177 Console.WriteLine("Took {0} ms", sw.ElapsedMilliseconds);
178 Console.WriteLine(
179 "End {0} MB, Start {1} MB, Diff {2} MB",
180 endGcMemory / 1024 / 1024,
181 startGcMemory / 1024 / 1024,
182 (endGcMemory - startGcMemory) / 1024 / 1024);
183 }
184 }
185} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/ObjectTortureTests.cs b/OpenSim/Tests/Torture/ObjectTortureTests.cs
index b9764d7..e83186a 100644
--- a/OpenSim/Tests/Torture/ObjectTortureTests.cs
+++ b/OpenSim/Tests/Torture/ObjectTortureTests.cs
@@ -49,6 +49,13 @@ namespace OpenSim.Tests.Torture
49 [TestFixture] 49 [TestFixture]
50 public class ObjectTortureTests 50 public class ObjectTortureTests
51 { 51 {
52 [TearDown]
53 public void TearDown()
54 {
55 GC.Collect();
56 GC.WaitForPendingFinalizers();
57 }
58
52// [Test] 59// [Test]
53// public void Test0000Clean() 60// public void Test0000Clean()
54// { 61// {
@@ -118,7 +125,7 @@ namespace OpenSim.Tests.Torture
118 125
119 TestScene scene = SceneHelpers.SetupScene(); 126 TestScene scene = SceneHelpers.SetupScene();
120 127
121 Process process = Process.GetCurrentProcess(); 128// Process process = Process.GetCurrentProcess();
122// long startProcessMemory = process.PrivateMemorySize64; 129// long startProcessMemory = process.PrivateMemorySize64;
123 long startGcMemory = GC.GetTotalMemory(true); 130 long startGcMemory = GC.GetTotalMemory(true);
124 DateTime start = DateTime.Now; 131 DateTime start = DateTime.Now;
@@ -131,7 +138,7 @@ namespace OpenSim.Tests.Torture
131 138
132 TimeSpan elapsed = DateTime.Now - start; 139 TimeSpan elapsed = DateTime.Now - start;
133// long processMemoryAlloc = process.PrivateMemorySize64 - startProcessMemory; 140// long processMemoryAlloc = process.PrivateMemorySize64 - startProcessMemory;
134 long processGcAlloc = GC.GetTotalMemory(false) - startGcMemory; 141 long endGcMemory = GC.GetTotalMemory(false);
135 142
136 for (int i = 1; i <= objectsToAdd; i++) 143 for (int i = 1; i <= objectsToAdd; i++)
137 { 144 {
@@ -141,9 +148,29 @@ namespace OpenSim.Tests.Torture
141 string.Format("Object {0} could not be retrieved", i)); 148 string.Format("Object {0} could not be retrieved", i));
142 } 149 }
143 150
151 // When a scene object is added to a scene, it is placed in the update list for sending to viewers
152 // (though in this case we have none). When it is deleted, it is not removed from the update which is
153 // fine since it will later be ignored.
154 //
155 // However, that means that we need to manually run an update here to clear out that list so that deleted
156 // objects will be clean up by the garbage collector before the next stress test is run.
157 scene.Update();
158
159 // Currently, we need to do this in order to garbage collect the scene objects ready for the next test run.
160 // However, what we really need to do is find out why the entire scene is not garbage collected in
161 // teardown.
162 scene.DeleteAllSceneObjects();
163
144 Console.WriteLine( 164 Console.WriteLine(
145 "Took {0}ms, {1}MB to create {2} objects each containing {3} prim(s)", 165 "Took {0}ms, {1}MB ({2} - {3}) to create {4} objects each containing {5} prim(s)",
146 Math.Round(elapsed.TotalMilliseconds), processGcAlloc / 1024 / 1024, objectsToAdd, primsInEachObject); 166 Math.Round(elapsed.TotalMilliseconds),
167 (endGcMemory - startGcMemory) / 1024 / 1024,
168 endGcMemory / 1024 / 1024,
169 startGcMemory / 1024 / 1024,
170 objectsToAdd,
171 primsInEachObject);
172
173 scene = null;
147 } 174 }
148 } 175 }
149} \ No newline at end of file 176} \ No newline at end of file
diff --git a/OpenSim/Tests/Torture/ScriptTortureTests.cs b/OpenSim/Tests/Torture/ScriptTortureTests.cs
new file mode 100644
index 0000000..d94bbde
--- /dev/null
+++ b/OpenSim/Tests/Torture/ScriptTortureTests.cs
@@ -0,0 +1,159 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Diagnostics;
31using System.Reflection;
32using System.Threading;
33using log4net;
34using Nini.Config;
35using NUnit.Framework;
36using OpenMetaverse;
37using OpenSim.Framework;
38using OpenSim.Region.CoreModules.Scripting.WorldComm;
39using OpenSim.Region.Framework.Interfaces;
40using OpenSim.Region.Framework.Scenes;
41using OpenSim.Region.ScriptEngine.XEngine;
42using OpenSim.Tests.Common;
43using OpenSim.Tests.Common.Mock;
44
45namespace OpenSim.Tests.Torture
46{
47 /// <summary>
48 /// Script torture tests
49 /// </summary>
50 /// <remarks>
51 /// Don't rely on the numbers given by these tests - they will vary a lot depending on what is already cached,
52 /// how much memory is free, etc. In some cases, later larger tests will apparently take less time than smaller
53 /// earlier tests.
54 /// </remarks>
55 [TestFixture]
56 public class ScriptTortureTests
57 {
58 private TestScene m_scene;
59 private XEngine m_xEngine;
60 private AutoResetEvent m_chatEvent = new AutoResetEvent(false);
61
62 private int m_expectedChatMessages;
63 private List<OSChatMessage> m_osChatMessagesReceived = new List<OSChatMessage>();
64
65 [SetUp]
66 public void Init()
67 {
68 //AppDomain.CurrentDomain.SetData("APPBASE", Environment.CurrentDirectory + "/bin");
69// Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory);
70 m_xEngine = new XEngine();
71
72 // Necessary to stop serialization complaining
73 WorldCommModule wcModule = new WorldCommModule();
74
75 IniConfigSource configSource = new IniConfigSource();
76
77 IConfig startupConfig = configSource.AddConfig("Startup");
78 startupConfig.Set("DefaultScriptEngine", "XEngine");
79
80 IConfig xEngineConfig = configSource.AddConfig("XEngine");
81 xEngineConfig.Set("Enabled", "true");
82
83 // These tests will not run with AppDomainLoading = true, at least on mono. For unknown reasons, the call
84 // to AssemblyResolver.OnAssemblyResolve fails.
85 xEngineConfig.Set("AppDomainLoading", "false");
86
87 m_scene = SceneHelpers.SetupScene("My Test", UUID.Random(), 1000, 1000, null, configSource);
88 SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine, wcModule);
89
90 m_scene.EventManager.OnChatFromWorld += OnChatFromWorld;
91 m_scene.StartScripts();
92 }
93
94 [Test]
95 public void TestCompileAndStart100Scripts()
96 {
97 TestHelpers.InMethod();
98 log4net.Config.XmlConfigurator.Configure();
99
100 TestCompileAndStartScripts(100);
101 }
102
103 private void TestCompileAndStartScripts(int scriptsToCreate)
104 {
105 UUID userId = TestHelpers.ParseTail(0x1);
106
107 m_expectedChatMessages = scriptsToCreate;
108 int startingObjectIdTail = 0x100;
109
110 GC.Collect();
111
112 for (int idTail = startingObjectIdTail;idTail < startingObjectIdTail + scriptsToCreate; idTail++)
113 {
114 AddObjectAndScript(idTail, userId);
115 }
116
117 m_chatEvent.WaitOne(40000 + scriptsToCreate * 1000);
118
119 Assert.That(m_osChatMessagesReceived.Count, Is.EqualTo(m_expectedChatMessages));
120
121 foreach (OSChatMessage msg in m_osChatMessagesReceived)
122 Assert.That(
123 msg.Message,
124 Is.EqualTo("Script running"),
125 string.Format(
126 "Message from {0} was {1} rather than {2}", msg.SenderUUID, msg.Message, "Script running"));
127 }
128
129 private void AddObjectAndScript(int objectIdTail, UUID userId)
130 {
131// UUID itemId = TestHelpers.ParseTail(0x3);
132 string itemName = string.Format("AddObjectAndScript() Item for object {0}", objectIdTail);
133
134 SceneObjectGroup so = SceneHelpers.CreateSceneObject(1, userId, "AddObjectAndScriptPart_", objectIdTail);
135 m_scene.AddNewSceneObject(so, true);
136
137 InventoryItemBase itemTemplate = new InventoryItemBase();
138// itemTemplate.ID = itemId;
139 itemTemplate.Name = itemName;
140 itemTemplate.Folder = so.UUID;
141 itemTemplate.InvType = (int)InventoryType.LSL;
142
143 m_scene.RezNewScript(userId, itemTemplate);
144 }
145
146 private void OnChatFromWorld(object sender, OSChatMessage oscm)
147 {
148// Console.WriteLine("Got chat [{0}]", oscm.Message);
149
150 lock (m_osChatMessagesReceived)
151 {
152 m_osChatMessagesReceived.Add(oscm);
153
154 if (m_osChatMessagesReceived.Count == m_expectedChatMessages)
155 m_chatEvent.Set();
156 }
157 }
158 }
159} \ No newline at end of file
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index d45f72b..a820ddf 100755
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -484,7 +484,6 @@
484 ;; such as the Meta7 viewer. 484 ;; such as the Meta7 viewer.
485 ;; It has no ill effect on viewers which do not support server-side 485 ;; It has no ill effect on viewers which do not support server-side
486 ;; windlight settings. 486 ;; windlight settings.
487 ;; Currently we only have support for MySQL databases.
488 ; enable_windlight = false 487 ; enable_windlight = false
489 488
490 489
@@ -573,10 +572,15 @@
573 ; DeleteScriptsOnStartup = true 572 ; DeleteScriptsOnStartup = true
574 573
575 ;; Set this to true (the default) to load each script into a separate 574 ;; Set this to true (the default) to load each script into a separate
576 ;; AppDomain. Setting this to false will load all script assemblies into the 575 ;; AppDomain.
577 ;; current AppDomain, which will reduce the per-script overhead at the 576 ;;
578 ;; expense of reduced security and the inability to garbage collect the 577 ;; Setting this to false will load all script assemblies into the
579 ;; script assemblies 578 ;; current AppDomain, which will significantly improve script loading times.
579 ;; It will also reduce initial per-script memory overhead.
580 ;;
581 ;; However, setting this to false will also prevent script DLLs from being unloaded from memory if the script is deleted.
582 ;; This may cause an OutOfMemory problem over time when avatars with scripted attachments move in and out of the region.
583 ;; Some Windows users have also reported script loading problems when AppDomainLoading = false
580 ; AppDomainLoading = true 584 ; AppDomainLoading = true
581 585
582 ;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl 586 ;# {DefaultCompileLanguage} {Enabled:true} {Default script language?} {lsl vb cs} lsl
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 01cf791..fab2c47 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -637,13 +637,12 @@
637[Mesh] 637[Mesh]
638 ; enable / disable Collada mesh support 638 ; enable / disable Collada mesh support
639 ; default is true 639 ; default is true
640 ; AllowMeshUpload = true 640 AllowMeshUpload = true
641 641
642 ; if you use Meshmerizer and want collisions for meshies, setting this to true 642 ; if you use Meshmerizer and want collisions for meshies, setting this to true
643 ; will cause OpenSim to attempt to decode meshies assets, extract the physics 643 ; will cause OpenSim to attempt to decode meshies assets, extract the physics
644 ; mesh, and use it for collisions. This is currently experimental code and enabling 644 ; mesh, and use it for collisions.
645 ; it may cause unexpected physics problems. 645 UseMeshiesPhysicsMesh = true
646 ;UseMeshiesPhysicsMesh = false
647 646
648 647
649[ODEPhysicsSettings] 648[ODEPhysicsSettings]
@@ -656,6 +655,11 @@
656 world_gravityy = 0 655 world_gravityy = 0
657 world_gravityz = -9.8 656 world_gravityz = -9.8
658 657
658 ; Terminal velocity of a falling avatar
659 ; This is the same http://en.wikipedia.org/wiki/Terminal_velocity#Examples
660 ; Max value is 255, min value is 0
661 avatar_terminal_velocity = 54
662
659 ; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically) 663 ; World Step size. (warning these are dangerous. Changing these will probably cause your scene to explode dramatically)
660 ; reference: fps = (0.089/ODE_STEPSIZE) * 1000; 664 ; reference: fps = (0.089/ODE_STEPSIZE) * 1000;
661 world_stepsize = 0.0178 665 world_stepsize = 0.0178
@@ -1066,7 +1070,6 @@
1066[LightShare] 1070[LightShare]
1067 ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer. 1071 ; This enables the transmission of Windlight scenes to supporting clients, such as the Meta7 viewer.
1068 ; It has no ill effect on viewers which do not support server-side windlight settings. 1072 ; It has no ill effect on viewers which do not support server-side windlight settings.
1069 ; Currently we only have support for MySQL databases.
1070 enable_windlight = false 1073 enable_windlight = false
1071 1074
1072 1075
diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example
index 4195bce..712481d 100644
--- a/bin/config-include/GridCommon.ini.example
+++ b/bin/config-include/GridCommon.ini.example
@@ -14,6 +14,8 @@
14 ;StorageProvider = "OpenSim.Data.MySQL.dll" 14 ;StorageProvider = "OpenSim.Data.MySQL.dll"
15 ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" 15 ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
16 ; Uncomment this line if you are using MySQL and want to use a different database for estates 16 ; Uncomment this line if you are using MySQL and want to use a different database for estates
17 ; The usual application for this is to allow estates to be spread out across multiple simulators by share the same database.
18 ; Most people won't need to do this so only uncomment if you know what you're doing.
17 ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" 19 ;EstateConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
18 20
19 ; MSSQL 21 ; MSSQL
diff --git a/prebuild.xml b/prebuild.xml
index 94d86d1..54f42f4 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -3284,9 +3284,16 @@
3284 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/> 3284 <Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
3285 <Reference name="XMLRPC" path="../../../bin/"/> 3285 <Reference name="XMLRPC" path="../../../bin/"/>
3286 <Reference name="OpenSim.Framework"/> 3286 <Reference name="OpenSim.Framework"/>
3287 <Reference name="OpenSim.Framework.Communications"/>
3287 <Reference name="OpenSim.Framework.Console"/> 3288 <Reference name="OpenSim.Framework.Console"/>
3288 <Reference name="OpenSim.Framework.Servers.HttpServer"/> 3289 <Reference name="OpenSim.Framework.Servers.HttpServer"/>
3290 <Reference name="OpenSim.Region.CoreModules"/>
3289 <Reference name="OpenSim.Region.Framework"/> 3291 <Reference name="OpenSim.Region.Framework"/>
3292 <Reference name="OpenSim.Region.OptionalModules"/>
3293 <Reference name="OpenSim.Region.ScriptEngine.Shared"/>
3294 <Reference name="OpenSim.Region.ScriptEngine.XEngine"/>
3295 <Reference name="OpenSim.Services.Interfaces"/>
3296 <Reference name="OpenSim.Services.AvatarService"/>
3290 <Reference name="OpenSim.Tests.Common"/> 3297 <Reference name="OpenSim.Tests.Common"/>
3291 <Files> 3298 <Files>
3292 <Match pattern="*.cs" recurse="false"/> 3299 <Match pattern="*.cs" recurse="false"/>