diff options
Diffstat (limited to 'OpenSim')
26 files changed, 372 insertions, 459 deletions
diff --git a/OpenSim/Data/Null/NullAuthenticationData.cs b/OpenSim/Data/Null/NullAuthenticationData.cs index 3fb3105..620deb9 100644 --- a/OpenSim/Data/Null/NullAuthenticationData.cs +++ b/OpenSim/Data/Null/NullAuthenticationData.cs | |||
@@ -76,6 +76,5 @@ namespace OpenSim.Data.Null | |||
76 | 76 | ||
77 | return false; | 77 | return false; |
78 | } | 78 | } |
79 | |||
80 | } | 79 | } |
81 | } | 80 | } \ No newline at end of file |
diff --git a/OpenSim/Data/Null/NullUserAccountData.cs b/OpenSim/Data/Null/NullUserAccountData.cs index 9eb94e6..ede23fb 100644 --- a/OpenSim/Data/Null/NullUserAccountData.cs +++ b/OpenSim/Data/Null/NullUserAccountData.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Data.Null | |||
88 | 88 | ||
89 | m_DataByUUID[data.PrincipalID] = data; | 89 | m_DataByUUID[data.PrincipalID] = data; |
90 | m_DataByName[data.FirstName + " " + data.LastName] = data; | 90 | m_DataByName[data.FirstName + " " + data.LastName] = data; |
91 | if (data.Data.ContainsKey("Email") && data.Data["Email"] != string.Empty) | 91 | if (data.Data.ContainsKey("Email") && data.Data["Email"] != null && data.Data["Email"] != string.Empty) |
92 | m_DataByEmail[data.Data["Email"]] = data; | 92 | m_DataByEmail[data.Data["Email"]] = data; |
93 | 93 | ||
94 | return true; | 94 | return true; |
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index c47a85d..c461bf0 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations | |||
@@ -1,4 +1,4 @@ | |||
1 | :VERSION 1 | 1 | :VERSION 1 |
2 | 2 | ||
3 | BEGIN TRANSACTION; | 3 | BEGIN TRANSACTION; |
4 | 4 | ||
@@ -219,59 +219,6 @@ COMMIT; | |||
219 | 219 | ||
220 | BEGIN TRANSACTION; | 220 | BEGIN TRANSACTION; |
221 | 221 | ||
222 | CREATE TABLE estate_groups ( | ||
223 | EstateID int(10) NOT NULL, | ||
224 | uuid char(36) NOT NULL | ||
225 | ); | ||
226 | |||
227 | CREATE TABLE estate_managers ( | ||
228 | EstateID int(10) NOT NULL, | ||
229 | uuid char(36) NOT NULL | ||
230 | ); | ||
231 | |||
232 | CREATE TABLE estate_map ( | ||
233 | RegionID char(36) NOT NULL default '00000000-0000-0000-0000-000000000000', | ||
234 | EstateID int(11) NOT NULL | ||
235 | ); | ||
236 | |||
237 | CREATE TABLE estate_settings ( | ||
238 | EstateID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
239 | EstateName varchar(64) default NULL, | ||
240 | AbuseEmailToEstateOwner tinyint(4) NOT NULL, | ||
241 | DenyAnonymous tinyint(4) NOT NULL, | ||
242 | ResetHomeOnTeleport tinyint(4) NOT NULL, | ||
243 | FixedSun tinyint(4) NOT NULL, | ||
244 | DenyTransacted tinyint(4) NOT NULL, | ||
245 | BlockDwell tinyint(4) NOT NULL, | ||
246 | DenyIdentified tinyint(4) NOT NULL, | ||
247 | AllowVoice tinyint(4) NOT NULL, | ||
248 | UseGlobalTime tinyint(4) NOT NULL, | ||
249 | PricePerMeter int(11) NOT NULL, | ||
250 | TaxFree tinyint(4) NOT NULL, | ||
251 | AllowDirectTeleport tinyint(4) NOT NULL, | ||
252 | RedirectGridX int(11) NOT NULL, | ||
253 | RedirectGridY int(11) NOT NULL, | ||
254 | ParentEstateID int(10) NOT NULL, | ||
255 | SunPosition double NOT NULL, | ||
256 | EstateSkipScripts tinyint(4) NOT NULL, | ||
257 | BillableFactor float NOT NULL, | ||
258 | PublicAccess tinyint(4) NOT NULL | ||
259 | ); | ||
260 | insert into estate_settings (EstateID,EstateName,AbuseEmailToEstateOwner,DenyAnonymous,ResetHomeOnTeleport,FixedSun,DenyTransacted,BlockDwell,DenyIdentified,AllowVoice,UseGlobalTime,PricePerMeter,TaxFree,AllowDirectTeleport,RedirectGridX,RedirectGridY,ParentEstateID,SunPosition,PublicAccess,EstateSkipScripts,BillableFactor) values ( 99, '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); | ||
261 | delete from estate_settings; | ||
262 | CREATE TABLE estate_users ( | ||
263 | EstateID int(10) NOT NULL, | ||
264 | uuid char(36) NOT NULL | ||
265 | ); | ||
266 | |||
267 | CREATE TABLE estateban ( | ||
268 | EstateID int(10) NOT NULL, | ||
269 | bannedUUID varchar(36) NOT NULL, | ||
270 | bannedIp varchar(16) NOT NULL, | ||
271 | bannedIpHostMask varchar(16) NOT NULL, | ||
272 | bannedNameMask varchar(64) default NULL | ||
273 | ); | ||
274 | |||
275 | drop table regionsettings; | 222 | drop table regionsettings; |
276 | CREATE TABLE regionsettings ( | 223 | CREATE TABLE regionsettings ( |
277 | regionUUID char(36) NOT NULL, | 224 | regionUUID char(36) NOT NULL, |
@@ -307,7 +254,7 @@ CREATE TABLE regionsettings ( | |||
307 | fixed_sun int(11) NOT NULL, | 254 | fixed_sun int(11) NOT NULL, |
308 | sun_position float NOT NULL, | 255 | sun_position float NOT NULL, |
309 | covenant char(36) default NULL, | 256 | covenant char(36) default NULL, |
310 | Sandbox tinyint(4) NOT NULL, | 257 | sandbox tinyint(4) NOT NULL, |
311 | PRIMARY KEY (regionUUID) | 258 | PRIMARY KEY (regionUUID) |
312 | ); | 259 | ); |
313 | 260 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 85703dc..81d0ac4 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -93,7 +93,7 @@ namespace OpenSim.Data.SQLite | |||
93 | 93 | ||
94 | ds = new DataSet("Region"); | 94 | ds = new DataSet("Region"); |
95 | 95 | ||
96 | m_log.Info("[REGION DB]: Sqlite - connecting: " + connectionString); | 96 | m_log.Info("[SQLITE REGION DB]: Sqlite - connecting: " + connectionString); |
97 | m_conn = new SqliteConnection(m_connectionString); | 97 | m_conn = new SqliteConnection(m_connectionString); |
98 | m_conn.Open(); | 98 | m_conn.Open(); |
99 | 99 | ||
@@ -156,7 +156,7 @@ namespace OpenSim.Data.SQLite | |||
156 | } | 156 | } |
157 | catch (Exception) | 157 | catch (Exception) |
158 | { | 158 | { |
159 | m_log.Info("[REGION DB]: Caught fill error on prims table"); | 159 | m_log.Info("[SQLITE REGION DB]: Caught fill error on prims table"); |
160 | } | 160 | } |
161 | 161 | ||
162 | try | 162 | try |
@@ -165,16 +165,25 @@ namespace OpenSim.Data.SQLite | |||
165 | } | 165 | } |
166 | catch (Exception) | 166 | catch (Exception) |
167 | { | 167 | { |
168 | m_log.Info("[REGION DB]: Caught fill error on primshapes table"); | 168 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primshapes table"); |
169 | } | 169 | } |
170 | 170 | ||
171 | try | 171 | try |
172 | { | 172 | { |
173 | itemsDa.Fill(ds.Tables["primitems"]); | ||
174 | } | ||
175 | catch (Exception) | ||
176 | { | ||
177 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); | ||
178 | } | ||
179 | |||
180 | try | ||
181 | { | ||
173 | terrainDa.Fill(ds.Tables["terrain"]); | 182 | terrainDa.Fill(ds.Tables["terrain"]); |
174 | } | 183 | } |
175 | catch (Exception) | 184 | catch (Exception) |
176 | { | 185 | { |
177 | m_log.Info("[REGION DB]: Caught fill error on terrain table"); | 186 | m_log.Info("[SQLITE REGION DB]: Caught fill error on terrain table"); |
178 | } | 187 | } |
179 | 188 | ||
180 | try | 189 | try |
@@ -183,7 +192,7 @@ namespace OpenSim.Data.SQLite | |||
183 | } | 192 | } |
184 | catch (Exception) | 193 | catch (Exception) |
185 | { | 194 | { |
186 | m_log.Info("[REGION DB]: Caught fill error on land table"); | 195 | m_log.Info("[SQLITE REGION DB]: Caught fill error on land table"); |
187 | } | 196 | } |
188 | 197 | ||
189 | try | 198 | try |
@@ -192,7 +201,7 @@ namespace OpenSim.Data.SQLite | |||
192 | } | 201 | } |
193 | catch (Exception) | 202 | catch (Exception) |
194 | { | 203 | { |
195 | m_log.Info("[REGION DB]: Caught fill error on landaccesslist table"); | 204 | m_log.Info("[SQLITE REGION DB]: Caught fill error on landaccesslist table"); |
196 | } | 205 | } |
197 | 206 | ||
198 | try | 207 | try |
@@ -201,7 +210,7 @@ namespace OpenSim.Data.SQLite | |||
201 | } | 210 | } |
202 | catch (Exception) | 211 | catch (Exception) |
203 | { | 212 | { |
204 | m_log.Info("[REGION DB]: Caught fill error on regionsettings table"); | 213 | m_log.Info("[SQLITE REGION DB]: Caught fill error on regionsettings table"); |
205 | } | 214 | } |
206 | 215 | ||
207 | // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! | 216 | // We have to create a data set mapping for every table, otherwise the IDataAdaptor.Update() will not populate rows with values! |
@@ -434,7 +443,7 @@ namespace OpenSim.Data.SQLite | |||
434 | lock (ds) | 443 | lock (ds) |
435 | { | 444 | { |
436 | DataRow[] primsForRegion = prims.Select(byRegion); | 445 | DataRow[] primsForRegion = prims.Select(byRegion); |
437 | m_log.Info("[REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); | 446 | // m_log.Info("[SQLITE REGION DB]: Loaded " + primsForRegion.Length + " prims for region: " + regionUUID); |
438 | 447 | ||
439 | // First, create all groups | 448 | // First, create all groups |
440 | foreach (DataRow primRow in primsForRegion) | 449 | foreach (DataRow primRow in primsForRegion) |
@@ -456,8 +465,8 @@ namespace OpenSim.Data.SQLite | |||
456 | } | 465 | } |
457 | else | 466 | else |
458 | { | 467 | { |
459 | m_log.Info( | 468 | m_log.Warn( |
460 | "[REGION DB]: No shape found for prim in storage, so setting default box shape"); | 469 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); |
461 | prim.Shape = PrimitiveBaseShape.Default; | 470 | prim.Shape = PrimitiveBaseShape.Default; |
462 | } | 471 | } |
463 | 472 | ||
@@ -469,11 +478,11 @@ namespace OpenSim.Data.SQLite | |||
469 | } | 478 | } |
470 | catch (Exception e) | 479 | catch (Exception e) |
471 | { | 480 | { |
472 | m_log.Error("[REGION DB]: Failed create prim object in new group, exception and data follows"); | 481 | m_log.Error("[SQLITE REGION DB]: Failed create prim object in new group, exception and data follows"); |
473 | m_log.Info("[REGION DB]: " + e.ToString()); | 482 | m_log.Error("[SQLITE REGION DB]: ", e); |
474 | foreach (DataColumn col in prims.Columns) | 483 | foreach (DataColumn col in prims.Columns) |
475 | { | 484 | { |
476 | m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); | 485 | m_log.Error("[SQLITE REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); |
477 | } | 486 | } |
478 | } | 487 | } |
479 | } | 488 | } |
@@ -498,7 +507,7 @@ namespace OpenSim.Data.SQLite | |||
498 | else | 507 | else |
499 | { | 508 | { |
500 | m_log.Warn( | 509 | m_log.Warn( |
501 | "[REGION DB]: No shape found for prim in storage, so setting default box shape"); | 510 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); |
502 | prim.Shape = PrimitiveBaseShape.Default; | 511 | prim.Shape = PrimitiveBaseShape.Default; |
503 | } | 512 | } |
504 | 513 | ||
@@ -508,11 +517,11 @@ namespace OpenSim.Data.SQLite | |||
508 | } | 517 | } |
509 | catch (Exception e) | 518 | catch (Exception e) |
510 | { | 519 | { |
511 | m_log.Error("[REGION DB]: Failed create prim object in group, exception and data follows"); | 520 | m_log.Error("[SQLITE REGION DB]: Failed create prim object in group, exception and data follows"); |
512 | m_log.Info("[REGION DB]: " + e.ToString()); | 521 | m_log.Error("[SQLITE REGION DB]: ", e); |
513 | foreach (DataColumn col in prims.Columns) | 522 | foreach (DataColumn col in prims.Columns) |
514 | { | 523 | { |
515 | m_log.Info("[REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); | 524 | m_log.Error("[SQLITE REGION DB]: Col: " + col.ColumnName + " => " + primRow[col]); |
516 | } | 525 | } |
517 | } | 526 | } |
518 | } | 527 | } |
@@ -525,20 +534,23 @@ namespace OpenSim.Data.SQLite | |||
525 | /// </summary> | 534 | /// </summary> |
526 | /// <param name="prim">the prim</param> | 535 | /// <param name="prim">the prim</param> |
527 | private void LoadItems(SceneObjectPart prim) | 536 | private void LoadItems(SceneObjectPart prim) |
528 | { | 537 | { |
529 | //m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); | 538 | // m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); |
530 | 539 | ||
531 | DataTable dbItems = ds.Tables["primitems"]; | 540 | DataTable dbItems = ds.Tables["primitems"]; |
532 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 541 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
533 | DataRow[] dbItemRows = dbItems.Select(sql); | 542 | DataRow[] dbItemRows = dbItems.Select(sql); |
534 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 543 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
535 | 544 | ||
545 | // m_log.DebugFormat( | ||
546 | // "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); | ||
547 | |||
536 | foreach (DataRow row in dbItemRows) | 548 | foreach (DataRow row in dbItemRows) |
537 | { | 549 | { |
538 | TaskInventoryItem item = buildItem(row); | 550 | TaskInventoryItem item = buildItem(row); |
539 | inventory.Add(item); | 551 | inventory.Add(item); |
540 | 552 | ||
541 | //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); | 553 | // m_log.DebugFormat("[SQLITE REGION DB]: Restored item {0} {1}", item.Name, item.ItemID); |
542 | } | 554 | } |
543 | 555 | ||
544 | prim.Inventory.RestoreInventoryItems(inventory); | 556 | prim.Inventory.RestoreInventoryItems(inventory); |
@@ -574,7 +586,7 @@ namespace OpenSim.Data.SQLite | |||
574 | 586 | ||
575 | // the following is an work around for .NET. The perf | 587 | // the following is an work around for .NET. The perf |
576 | // issues associated with it aren't as bad as you think. | 588 | // issues associated with it aren't as bad as you think. |
577 | m_log.Info("[REGION DB]: Storing terrain revision r" + revision.ToString()); | 589 | m_log.Debug("[SQLITE REGION DB]: Storing terrain revision r" + revision.ToString()); |
578 | String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" + | 590 | String sql = "insert into terrain(RegionUUID, Revision, Heightfield)" + |
579 | " values(:RegionUUID, :Revision, :Heightfield)"; | 591 | " values(:RegionUUID, :Revision, :Heightfield)"; |
580 | 592 | ||
@@ -630,11 +642,11 @@ namespace OpenSim.Data.SQLite | |||
630 | } | 642 | } |
631 | else | 643 | else |
632 | { | 644 | { |
633 | m_log.Info("[REGION DB]: No terrain found for region"); | 645 | m_log.Warn("[SQLITE REGION DB]: No terrain found for region"); |
634 | return null; | 646 | return null; |
635 | } | 647 | } |
636 | 648 | ||
637 | m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString()); | 649 | m_log.Debug("[SQLITE REGION DB]: Loaded terrain revision r" + rev.ToString()); |
638 | } | 650 | } |
639 | } | 651 | } |
640 | return terret; | 652 | return terret; |
@@ -1417,7 +1429,7 @@ namespace OpenSim.Data.SQLite | |||
1417 | } | 1429 | } |
1418 | catch (InvalidCastException) | 1430 | catch (InvalidCastException) |
1419 | { | 1431 | { |
1420 | m_log.ErrorFormat("[PARCEL]: unable to get parcel telehub settings for {1}", newData.Name); | 1432 | m_log.ErrorFormat("[SQLITE REGION DB]: unable to get parcel telehub settings for {1}", newData.Name); |
1421 | newData.UserLocation = Vector3.Zero; | 1433 | newData.UserLocation = Vector3.Zero; |
1422 | newData.UserLookAt = Vector3.Zero; | 1434 | newData.UserLookAt = Vector3.Zero; |
1423 | } | 1435 | } |
@@ -1926,7 +1938,7 @@ namespace OpenSim.Data.SQLite | |||
1926 | /// <param name="items"></param> | 1938 | /// <param name="items"></param> |
1927 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) | 1939 | public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) |
1928 | { | 1940 | { |
1929 | //m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID); | 1941 | // m_log.DebugFormat("[SQLITE REGION DB]: Entered StorePrimInventory with prim ID {0}", primID); |
1930 | 1942 | ||
1931 | DataTable dbItems = ds.Tables["primitems"]; | 1943 | DataTable dbItems = ds.Tables["primitems"]; |
1932 | 1944 | ||
diff --git a/OpenSim/Data/Tests/Resources/TestDataConnections.ini b/OpenSim/Data/Tests/Resources/TestDataConnections.ini index 5e68ab0..7b55467 100644 --- a/OpenSim/Data/Tests/Resources/TestDataConnections.ini +++ b/OpenSim/Data/Tests/Resources/TestDataConnections.ini | |||
@@ -21,4 +21,4 @@ | |||
21 | [TestConnections] | 21 | [TestConnections] |
22 | MySqlConnection="Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;" | 22 | MySqlConnection="Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;" |
23 | SqlConnection="Server=.\SQL2008;Database=opensim-nunit;Trusted_Connection=True;" | 23 | SqlConnection="Server=.\SQL2008;Database=opensim-nunit;Trusted_Connection=True;" |
24 | SqliteConnection="" \ No newline at end of file | 24 | SqliteConnection="URI=file:opensim-nunit.db,version=3" \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 30eb9b8..b255415 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -111,10 +111,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
111 | 111 | ||
112 | protected IGridService GridService | 112 | protected IGridService GridService |
113 | { | 113 | { |
114 | get | 114 | get { return m_Scenes[0].GridService; } |
115 | { | 115 | } |
116 | return m_Scenes[0].GridService; | 116 | |
117 | } | 117 | public IUserAccountService UserAccountService |
118 | { | ||
119 | get { return m_Scenes[0].UserAccountService; } | ||
118 | } | 120 | } |
119 | 121 | ||
120 | public IScene Scene | 122 | public IScene Scene |
@@ -221,33 +223,37 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
221 | 223 | ||
222 | client.OnLogout += OnLogout; | 224 | client.OnLogout += OnLogout; |
223 | 225 | ||
224 | if (m_Friends.ContainsKey(client.AgentId)) | 226 | lock (m_Friends) |
225 | { | 227 | { |
226 | m_Friends[client.AgentId].Refcount++; | 228 | if (m_Friends.ContainsKey(client.AgentId)) |
227 | return; | 229 | { |
228 | } | 230 | m_Friends[client.AgentId].Refcount++; |
229 | 231 | return; | |
230 | UserFriendData newFriends = new UserFriendData(); | 232 | } |
231 | 233 | ||
232 | newFriends.PrincipalID = client.AgentId; | 234 | UserFriendData newFriends = new UserFriendData(); |
233 | newFriends.Friends = m_FriendsService.GetFriends(client.AgentId); | ||
234 | newFriends.Refcount = 1; | ||
235 | newFriends.RegionID = UUID.Zero; | ||
236 | 235 | ||
237 | m_Friends.Add(client.AgentId, newFriends); | 236 | newFriends.PrincipalID = client.AgentId; |
237 | newFriends.Friends = m_FriendsService.GetFriends(client.AgentId); | ||
238 | newFriends.Refcount = 1; | ||
239 | newFriends.RegionID = UUID.Zero; | ||
238 | 240 | ||
241 | m_Friends.Add(client.AgentId, newFriends); | ||
242 | } | ||
243 | |||
239 | //StatusChange(client.AgentId, true); | 244 | //StatusChange(client.AgentId, true); |
240 | } | 245 | } |
241 | 246 | ||
242 | private void OnClientClosed(UUID agentID, Scene scene) | 247 | private void OnClientClosed(UUID agentID, Scene scene) |
243 | { | 248 | { |
244 | if (m_Friends.ContainsKey(agentID)) | 249 | lock (m_Friends) |
245 | { | 250 | if (m_Friends.ContainsKey(agentID)) |
246 | if (m_Friends[agentID].Refcount == 1) | 251 | { |
247 | m_Friends.Remove(agentID); | 252 | if (m_Friends[agentID].Refcount == 1) |
248 | else | 253 | m_Friends.Remove(agentID); |
249 | m_Friends[agentID].Refcount--; | 254 | else |
250 | } | 255 | m_Friends[agentID].Refcount--; |
256 | } | ||
251 | } | 257 | } |
252 | 258 | ||
253 | private void OnLogout(IClientAPI client) | 259 | private void OnLogout(IClientAPI client) |
@@ -555,12 +561,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
555 | 561 | ||
556 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) | 562 | private void OnApproveFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) |
557 | { | 563 | { |
564 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID); | ||
565 | |||
558 | FriendsService.StoreFriend(agentID, friendID.ToString(), 1); | 566 | FriendsService.StoreFriend(agentID, friendID.ToString(), 1); |
559 | FriendsService.StoreFriend(friendID, agentID.ToString(), 1); | 567 | FriendsService.StoreFriend(friendID, agentID.ToString(), 1); |
560 | // update the local cache | 568 | // update the local cache |
561 | m_Friends[agentID].Friends = FriendsService.GetFriends(agentID); | 569 | m_Friends[agentID].Friends = FriendsService.GetFriends(agentID); |
562 | 570 | ||
563 | m_log.DebugFormat("[FRIENDS]: {0} accepted friendship from {1}", agentID, friendID); | ||
564 | 571 | ||
565 | // | 572 | // |
566 | // Notify the friend | 573 | // Notify the friend |
@@ -609,7 +616,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
609 | if (friendSession != null) | 616 | if (friendSession != null) |
610 | { | 617 | { |
611 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 618 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
612 | m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID); | 619 | if (region != null) |
620 | m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID); | ||
621 | else | ||
622 | m_log.WarnFormat("[FRIENDS]: Could not find region {0} in locating {1}", friendSession.RegionID, friendID); | ||
613 | } | 623 | } |
614 | } | 624 | } |
615 | } | 625 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 0883c5b..496f2ab 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -35,6 +35,7 @@ using OpenSim.Framework; | |||
35 | using OpenSim.Server.Base; | 35 | using OpenSim.Server.Base; |
36 | using OpenSim.Framework.Servers.HttpServer; | 36 | using OpenSim.Framework.Servers.HttpServer; |
37 | using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; | 37 | using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; |
38 | using OpenSim.Services.Interfaces; | ||
38 | 39 | ||
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | using log4net; | 41 | using log4net; |
@@ -61,7 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
61 | sr.Close(); | 62 | sr.Close(); |
62 | body = body.Trim(); | 63 | body = body.Trim(); |
63 | 64 | ||
64 | m_log.DebugFormat("[XXX]: query String: {0}", body); | 65 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
65 | 66 | ||
66 | try | 67 | try |
67 | { | 68 | { |
@@ -115,9 +116,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
115 | if (!UUID.TryParse(request["ToID"].ToString(), out toID)) | 116 | if (!UUID.TryParse(request["ToID"].ToString(), out toID)) |
116 | return FailureResult(); | 117 | return FailureResult(); |
117 | 118 | ||
118 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, "", toID, | 119 | UserAccount account = m_FriendsModule.UserAccountService.GetUserAccount(m_FriendsModule.Scene.RegionInfo.ScopeID, fromID); |
120 | string name = (account == null) ? "Unknown" : account.FirstName + " " + account.LastName; | ||
121 | |||
122 | GridInstantMessage im = new GridInstantMessage(m_FriendsModule.Scene, fromID, name, toID, | ||
119 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); | 123 | (byte)InstantMessageDialog.FriendshipOffered, message, false, Vector3.Zero); |
120 | 124 | ||
125 | // !! HACK | ||
126 | im.imSessionID = im.fromAgentID; | ||
127 | |||
121 | if (m_FriendsModule.LocalFriendshipOffered(toID, im)) | 128 | if (m_FriendsModule.LocalFriendshipOffered(toID, im)) |
122 | return SuccessResult(); | 129 | return SuccessResult(); |
123 | 130 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index 307db97..ab5f485 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -390,7 +390,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
390 | /// <returns></returns> | 390 | /// <returns></returns> |
391 | protected UserAccount GetUserInfo(string firstName, string lastName, string pass) | 391 | protected UserAccount GetUserInfo(string firstName, string lastName, string pass) |
392 | { | 392 | { |
393 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName); | 393 | UserAccount account |
394 | = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, firstName, lastName); | ||
395 | |||
394 | if (null == account) | 396 | if (null == account) |
395 | { | 397 | { |
396 | m_log.ErrorFormat( | 398 | m_log.ErrorFormat( |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index c81f295..507662f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -55,14 +55,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
55 | { | 55 | { |
56 | protected ManualResetEvent mre = new ManualResetEvent(false); | 56 | protected ManualResetEvent mre = new ManualResetEvent(false); |
57 | 57 | ||
58 | private void InventoryReceived(UUID userId) | ||
59 | { | ||
60 | lock (this) | ||
61 | { | ||
62 | Monitor.PulseAll(this); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | private void SaveCompleted( | 58 | private void SaveCompleted( |
67 | Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, | 59 | Guid id, bool succeeded, UserAccount userInfo, string invPath, Stream saveStream, |
68 | Exception reportedException) | 60 | Exception reportedException) |
@@ -76,11 +68,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
76 | // Commenting for now! The mock inventory service needs more beef, at least for | 68 | // Commenting for now! The mock inventory service needs more beef, at least for |
77 | // GetFolderForType | 69 | // GetFolderForType |
78 | // REFACTORING PROBLEM. This needs to be rewritten. | 70 | // REFACTORING PROBLEM. This needs to be rewritten. |
79 | //[Test] | 71 | [Test] |
80 | public void TestSaveIarV0_1() | 72 | public void TestSaveIarV0_1() |
81 | { | 73 | { |
82 | TestHelper.InMethod(); | 74 | TestHelper.InMethod(); |
83 | log4net.Config.XmlConfigurator.Configure(); | 75 | // log4net.Config.XmlConfigurator.Configure(); |
84 | 76 | ||
85 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 77 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
86 | 78 | ||
@@ -195,189 +187,175 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
195 | /// </summary> | 187 | /// </summary> |
196 | /// | 188 | /// |
197 | /// This test also does some deeper probing of loading into nested inventory structures | 189 | /// This test also does some deeper probing of loading into nested inventory structures |
198 | /// REFACTORING PROBLEM. This needs to be rewritten. | 190 | [Test] |
199 | // [Test] | 191 | public void TestLoadIarV0_1ExistingUsers() |
200 | // public void TestLoadIarV0_1ExistingUsers() | 192 | { |
201 | // { | 193 | TestHelper.InMethod(); |
202 | // TestHelper.InMethod(); | 194 | //log4net.Config.XmlConfigurator.Configure(); |
203 | 195 | ||
204 | // //log4net.Config.XmlConfigurator.Configure(); | 196 | string userFirstName = "Mr"; |
205 | 197 | string userLastName = "Tiddles"; | |
206 | // string userFirstName = "Mr"; | 198 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); |
207 | // string userLastName = "Tiddles"; | 199 | string userItemCreatorFirstName = "Lord"; |
208 | // UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); | 200 | string userItemCreatorLastName = "Lucan"; |
209 | // string userItemCreatorFirstName = "Lord"; | 201 | UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); |
210 | // string userItemCreatorLastName = "Lucan"; | 202 | |
211 | // UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); | 203 | string item1Name = "b.lsl"; |
212 | 204 | string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random()); | |
213 | // string item1Name = "b.lsl"; | 205 | |
214 | // string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(item1Name, UUID.Random()); | 206 | MemoryStream archiveWriteStream = new MemoryStream(); |
215 | 207 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | |
216 | // MemoryStream archiveWriteStream = new MemoryStream(); | 208 | |
217 | // TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 209 | InventoryItemBase item1 = new InventoryItemBase(); |
218 | 210 | item1.Name = item1Name; | |
219 | // InventoryItemBase item1 = new InventoryItemBase(); | 211 | item1.AssetID = UUID.Random(); |
220 | // item1.Name = item1Name; | 212 | item1.GroupID = UUID.Random(); |
221 | // item1.AssetID = UUID.Random(); | 213 | item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); |
222 | // item1.GroupID = UUID.Random(); | 214 | //item1.CreatorId = userUuid.ToString(); |
223 | // item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); | 215 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; |
224 | // //item1.CreatorId = userUuid.ToString(); | 216 | item1.Owner = UUID.Zero; |
225 | // //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | 217 | |
226 | // item1.Owner = UUID.Zero; | 218 | string item1FileName |
227 | 219 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); | |
228 | // string item1FileName | 220 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
229 | // = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); | 221 | tar.Close(); |
230 | // tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 222 | |
231 | // tar.Close(); | 223 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
232 | 224 | SerialiserModule serialiserModule = new SerialiserModule(); | |
233 | // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 225 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
234 | // SerialiserModule serialiserModule = new SerialiserModule(); | 226 | |
235 | // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 227 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene |
236 | 228 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | |
237 | // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 229 | |
238 | // Scene scene = SceneSetupHelpers.SetupScene("inventory"); | 230 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
239 | // IUserAdminService userAdminService = scene.CommsManager.UserAdminService; | 231 | |
240 | 232 | UserProfileTestUtils.CreateUserWithInventory( | |
241 | // SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 233 | scene, userFirstName, userLastName, userUuid, "meowfood"); |
242 | // userAdminService.AddUser( | 234 | UserProfileTestUtils.CreateUserWithInventory( |
243 | // userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | 235 | scene, userItemCreatorFirstName, userItemCreatorLastName, userItemCreatorUuid, "hampshire"); |
244 | // userAdminService.AddUser( | 236 | |
245 | // userItemCreatorFirstName, userItemCreatorLastName, "hampshire", | 237 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); |
246 | // String.Empty, 1000, 1000, userItemCreatorUuid); | 238 | |
247 | 239 | InventoryItemBase foundItem1 | |
248 | // archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); | 240 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, item1Name); |
249 | 241 | ||
250 | // CachedUserInfo userInfo | 242 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
251 | // = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | 243 | |
252 | 244 | // We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the | |
253 | // InventoryItemBase foundItem1 | 245 | // UUID, not the OSPA itself. |
254 | // = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name); | ||
255 | |||
256 | // Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | ||
257 | |||
258 | //// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the | ||
259 | //// UUID, not the OSPA itself. | ||
260 | //// Assert.That( | ||
261 | //// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), | ||
262 | //// "Loaded item non-uuid creator doesn't match original"); | ||
263 | // Assert.That( | 246 | // Assert.That( |
264 | // foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()), | 247 | // foundItem1.CreatorId, Is.EqualTo(item1.CreatorId), |
265 | // "Loaded item non-uuid creator doesn't match original"); | 248 | // "Loaded item non-uuid creator doesn't match original"); |
249 | Assert.That( | ||
250 | foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()), | ||
251 | "Loaded item non-uuid creator doesn't match original"); | ||
252 | |||
253 | Assert.That( | ||
254 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), | ||
255 | "Loaded item uuid creator doesn't match original"); | ||
256 | Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), | ||
257 | "Loaded item owner doesn't match inventory reciever"); | ||
258 | |||
259 | // Now try loading to a root child folder | ||
260 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xA"); | ||
261 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | ||
262 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); | ||
263 | |||
264 | InventoryItemBase foundItem2 | ||
265 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xA/" + item1Name); | ||
266 | Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); | ||
267 | |||
268 | // Now try loading to a more deeply nested folder | ||
269 | UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userUuid, "xB/xC"); | ||
270 | archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | ||
271 | archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); | ||
272 | |||
273 | InventoryItemBase foundItem3 | ||
274 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, "xB/xC/" + item1Name); | ||
275 | Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | ||
276 | } | ||
277 | |||
278 | [Test] | ||
279 | public void TestIarV0_1WithEscapedChars() | ||
280 | { | ||
281 | TestHelper.InMethod(); | ||
282 | // log4net.Config.XmlConfigurator.Configure(); | ||
283 | |||
284 | string itemName = "You & you are a mean/man/"; | ||
285 | string humanEscapedItemName = @"You & you are a mean\/man\/"; | ||
286 | string userPassword = "meowfood"; | ||
287 | |||
288 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | ||
289 | |||
290 | Scene scene = SceneSetupHelpers.SetupScene("Inventory"); | ||
291 | SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | ||
292 | |||
293 | // Create user | ||
294 | string userFirstName = "Jock"; | ||
295 | string userLastName = "Stirrup"; | ||
296 | UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | ||
297 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userId, "meowfood"); | ||
266 | 298 | ||
267 | // Assert.That( | 299 | // Create asset |
268 | // foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), | 300 | SceneObjectGroup object1; |
269 | // "Loaded item uuid creator doesn't match original"); | 301 | SceneObjectPart part1; |
270 | // Assert.That(foundItem1.Owner, Is.EqualTo(userUuid), | 302 | { |
271 | // "Loaded item owner doesn't match inventory reciever"); | 303 | string partName = "part name"; |
272 | 304 | UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | |
273 | // // Now try loading to a root child folder | 305 | PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); |
274 | // UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xA"); | 306 | Vector3 groupPosition = new Vector3(10, 20, 30); |
275 | // archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | 307 | Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); |
276 | // archiverModule.DearchiveInventory(userFirstName, userLastName, "xA", "meowfood", archiveReadStream); | 308 | Vector3 offsetPosition = new Vector3(5, 10, 15); |
277 | |||
278 | // InventoryItemBase foundItem2 | ||
279 | // = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xA/" + item1Name); | ||
280 | // Assert.That(foundItem2, Is.Not.Null, "Didn't find loaded item 2"); | ||
281 | |||
282 | // // Now try loading to a more deeply nested folder | ||
283 | // UserInventoryTestUtils.CreateInventoryFolder(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC"); | ||
284 | // archiveReadStream = new MemoryStream(archiveReadStream.ToArray()); | ||
285 | // archiverModule.DearchiveInventory(userFirstName, userLastName, "xB/xC", "meowfood", archiveReadStream); | ||
286 | |||
287 | // InventoryItemBase foundItem3 | ||
288 | // = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, "xB/xC/" + item1Name); | ||
289 | // Assert.That(foundItem3, Is.Not.Null, "Didn't find loaded item 3"); | ||
290 | //} | ||
291 | 309 | ||
292 | // REFACTORING PROBLEM. Needs rewrite. | 310 | part1 |
293 | // [Test] | 311 | = new SceneObjectPart( |
294 | // public void TestIarV0_1WithEscapedChars() | 312 | ownerId, shape, groupPosition, rotationOffset, offsetPosition); |
295 | // { | 313 | part1.Name = partName; |
296 | // TestHelper.InMethod(); | 314 | |
297 | //// log4net.Config.XmlConfigurator.Configure(); | 315 | object1 = new SceneObjectGroup(part1); |
298 | 316 | scene.AddNewSceneObject(object1, false); | |
299 | // string itemName = "You & you are a mean/man/"; | 317 | } |
300 | // string humanEscapedItemName = @"You & you are a mean\/man\/"; | 318 | |
301 | // string userPassword = "meowfood"; | 319 | UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); |
302 | 320 | AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | |
303 | // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 321 | scene.AssetService.Store(asset1); |
304 | 322 | ||
305 | // Scene scene = SceneSetupHelpers.SetupScene("Inventory"); | 323 | // Create item |
306 | // SceneSetupHelpers.SetupSceneModules(scene, archiverModule); | 324 | UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080"); |
307 | // CommunicationsManager cm = scene.CommsManager; | 325 | InventoryItemBase item1 = new InventoryItemBase(); |
308 | 326 | item1.Name = itemName; | |
309 | // // Create user | 327 | item1.AssetID = asset1.FullID; |
310 | // string userFirstName = "Jock"; | 328 | item1.ID = item1Id; |
311 | // string userLastName = "Stirrup"; | 329 | InventoryFolderBase objsFolder |
312 | // UUID userId = UUID.Parse("00000000-0000-0000-0000-000000000020"); | 330 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects"); |
313 | 331 | item1.Folder = objsFolder.ID; | |
314 | // lock (this) | 332 | scene.AddInventoryItem(userId, item1); |
315 | // { | 333 | |
316 | // UserProfileTestUtils.CreateUserWithInventory( | 334 | MemoryStream archiveWriteStream = new MemoryStream(); |
317 | // cm, userFirstName, userLastName, userPassword, userId, InventoryReceived); | 335 | archiverModule.OnInventoryArchiveSaved += SaveCompleted; |
318 | // Monitor.Wait(this, 60000); | 336 | |
319 | // } | 337 | mre.Reset(); |
320 | 338 | archiverModule.ArchiveInventory( | |
321 | // // Create asset | 339 | Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); |
322 | // SceneObjectGroup object1; | 340 | mre.WaitOne(60000, false); |
323 | // SceneObjectPart part1; | 341 | |
324 | // { | 342 | // LOAD ITEM |
325 | // string partName = "part name"; | 343 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); |
326 | // UUID ownerId = UUID.Parse("00000000-0000-0000-0000-000000000040"); | 344 | |
327 | // PrimitiveBaseShape shape = PrimitiveBaseShape.CreateSphere(); | 345 | archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream); |
328 | // Vector3 groupPosition = new Vector3(10, 20, 30); | 346 | |
329 | // Quaternion rotationOffset = new Quaternion(20, 30, 40, 50); | 347 | InventoryItemBase foundItem1 |
330 | // Vector3 offsetPosition = new Vector3(5, 10, 15); | 348 | = InventoryArchiveUtils.FindItemByPath( |
331 | 349 | scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); | |
332 | // part1 | 350 | |
333 | // = new SceneObjectPart( | 351 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
334 | // ownerId, shape, groupPosition, rotationOffset, offsetPosition); | ||
335 | // part1.Name = partName; | ||
336 | |||
337 | // object1 = new SceneObjectGroup(part1); | ||
338 | // scene.AddNewSceneObject(object1, false); | ||
339 | // } | ||
340 | |||
341 | // UUID asset1Id = UUID.Parse("00000000-0000-0000-0000-000000000060"); | ||
342 | // AssetBase asset1 = AssetHelpers.CreateAsset(asset1Id, object1); | ||
343 | // scene.AssetService.Store(asset1); | ||
344 | |||
345 | // // Create item | ||
346 | // UUID item1Id = UUID.Parse("00000000-0000-0000-0000-000000000080"); | ||
347 | // InventoryItemBase item1 = new InventoryItemBase(); | ||
348 | // item1.Name = itemName; | ||
349 | // item1.AssetID = asset1.FullID; | ||
350 | // item1.ID = item1Id; | ||
351 | // InventoryFolderBase objsFolder | ||
352 | // = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, userId, "Objects"); | ||
353 | // item1.Folder = objsFolder.ID; | ||
354 | // scene.AddInventoryItem(userId, item1); | ||
355 | |||
356 | // MemoryStream archiveWriteStream = new MemoryStream(); | ||
357 | // archiverModule.OnInventoryArchiveSaved += SaveCompleted; | ||
358 | |||
359 | // mre.Reset(); | ||
360 | // archiverModule.ArchiveInventory( | ||
361 | // Guid.NewGuid(), userFirstName, userLastName, "Objects", userPassword, archiveWriteStream); | ||
362 | // mre.WaitOne(60000, false); | ||
363 | |||
364 | // // LOAD ITEM | ||
365 | // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | ||
366 | |||
367 | // archiverModule.DearchiveInventory(userFirstName, userLastName, "Scripts", userPassword, archiveReadStream); | ||
368 | |||
369 | // InventoryItemBase foundItem1 | ||
370 | // = InventoryArchiveUtils.FindItemByPath( | ||
371 | // scene.InventoryService, userId, "Scripts/Objects/" + humanEscapedItemName); | ||
372 | |||
373 | // Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | ||
374 | //// Assert.That( | ||
375 | //// foundItem1.CreatorId, Is.EqualTo(userUuid), | ||
376 | //// "Loaded item non-uuid creator doesn't match that of the loading user"); | ||
377 | // Assert.That( | 352 | // Assert.That( |
378 | // foundItem1.Name, Is.EqualTo(itemName), | 353 | // foundItem1.CreatorId, Is.EqualTo(userUuid), |
379 | // "Loaded item name doesn't match saved name"); | 354 | // "Loaded item non-uuid creator doesn't match that of the loading user"); |
380 | // } | 355 | Assert.That( |
356 | foundItem1.Name, Is.EqualTo(itemName), | ||
357 | "Loaded item name doesn't match saved name"); | ||
358 | } | ||
381 | 359 | ||
382 | /// <summary> | 360 | /// <summary> |
383 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 361 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
@@ -386,76 +364,69 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
386 | /// | 364 | /// |
387 | /// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature | 365 | /// This may possibly one day get overtaken by the as yet incomplete temporary profiles feature |
388 | /// (as tested in the a later commented out test) | 366 | /// (as tested in the a later commented out test) |
389 | /// REFACTORING PROBLEM. Needs rewrite. | 367 | /// This test is currently disabled |
390 | // [Test] | 368 | [Test] |
391 | // public void TestLoadIarV0_1AbsentUsers() | 369 | public void TestLoadIarV0_1AbsentUsers() |
392 | // { | 370 | { |
393 | // TestHelper.InMethod(); | 371 | TestHelper.InMethod(); |
394 | 372 | //log4net.Config.XmlConfigurator.Configure(); | |
395 | // //log4net.Config.XmlConfigurator.Configure(); | 373 | |
396 | 374 | string userFirstName = "Charlie"; | |
397 | // string userFirstName = "Charlie"; | 375 | string userLastName = "Chan"; |
398 | // string userLastName = "Chan"; | 376 | UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000999"); |
399 | // UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000999"); | 377 | string userItemCreatorFirstName = "Bat"; |
400 | // string userItemCreatorFirstName = "Bat"; | 378 | string userItemCreatorLastName = "Man"; |
401 | // string userItemCreatorLastName = "Man"; | 379 | //UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000008888"); |
402 | // //UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000008888"); | 380 | |
403 | 381 | string itemName = "b.lsl"; | |
404 | // string itemName = "b.lsl"; | 382 | string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); |
405 | // string archiveItemName = InventoryArchiveWriteRequest.CreateArchiveItemName(itemName, UUID.Random()); | 383 | |
406 | 384 | MemoryStream archiveWriteStream = new MemoryStream(); | |
407 | // MemoryStream archiveWriteStream = new MemoryStream(); | 385 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); |
408 | // TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | 386 | |
409 | 387 | InventoryItemBase item1 = new InventoryItemBase(); | |
410 | // InventoryItemBase item1 = new InventoryItemBase(); | 388 | item1.Name = itemName; |
411 | // item1.Name = itemName; | 389 | item1.AssetID = UUID.Random(); |
412 | // item1.AssetID = UUID.Random(); | 390 | item1.GroupID = UUID.Random(); |
413 | // item1.GroupID = UUID.Random(); | 391 | item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); |
414 | // item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); | 392 | //item1.CreatorId = userUuid.ToString(); |
415 | // //item1.CreatorId = userUuid.ToString(); | 393 | //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; |
416 | // //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; | 394 | item1.Owner = UUID.Zero; |
417 | // item1.Owner = UUID.Zero; | 395 | |
418 | 396 | string item1FileName | |
419 | // string item1FileName | 397 | = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); |
420 | // = string.Format("{0}{1}", ArchiveConstants.INVENTORY_PATH, archiveItemName); | 398 | tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); |
421 | // tar.WriteFile(item1FileName, UserInventoryItemSerializer.Serialize(item1)); | 399 | tar.Close(); |
422 | // tar.Close(); | 400 | |
423 | 401 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | |
424 | // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | 402 | SerialiserModule serialiserModule = new SerialiserModule(); |
425 | // SerialiserModule serialiserModule = new SerialiserModule(); | 403 | InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); |
426 | // InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); | 404 | |
427 | 405 | // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | |
428 | // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene | 406 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); |
429 | // Scene scene = SceneSetupHelpers.SetupScene("inventory"); | 407 | |
430 | // IUserAdminService userAdminService = scene.CommsManager.UserAdminService; | 408 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); |
431 | 409 | UserProfileTestUtils.CreateUserWithInventory(scene, userFirstName, userLastName, userUuid, "meowfood"); | |
432 | // SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | 410 | |
433 | // userAdminService.AddUser( | 411 | archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); |
434 | // userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); | 412 | |
435 | 413 | InventoryItemBase foundItem1 | |
436 | // archiverModule.DearchiveInventory(userFirstName, userLastName, "/", "meowfood", archiveReadStream); | 414 | = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userUuid, itemName); |
437 | 415 | ||
438 | // CachedUserInfo userInfo | 416 | Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); |
439 | // = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); | ||
440 | |||
441 | // InventoryItemBase foundItem1 | ||
442 | // = InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, itemName); | ||
443 | |||
444 | // Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1"); | ||
445 | //// Assert.That( | ||
446 | //// foundItem1.CreatorId, Is.EqualTo(userUuid), | ||
447 | //// "Loaded item non-uuid creator doesn't match that of the loading user"); | ||
448 | // Assert.That( | 417 | // Assert.That( |
449 | // foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), | 418 | // foundItem1.CreatorId, Is.EqualTo(userUuid), |
450 | // "Loaded item uuid creator doesn't match that of the loading user"); | 419 | // "Loaded item non-uuid creator doesn't match that of the loading user"); |
451 | // } | 420 | Assert.That( |
421 | foundItem1.CreatorIdAsUuid, Is.EqualTo(userUuid), | ||
422 | "Loaded item uuid creator doesn't match that of the loading user"); | ||
423 | } | ||
452 | 424 | ||
453 | /// <summary> | 425 | /// <summary> |
454 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where | 426 | /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where |
455 | /// no account exists with the creator name | 427 | /// no account exists with the creator name |
456 | /// </summary> | 428 | /// </summary> |
457 | /// Disabled since temporary profiles have not yet been implemented. | 429 | /// Disabled since temporary profiles have not yet been implemented. |
458 | /// REFACTORING PROBLEM. Needs rewrite. | ||
459 | /// | 430 | /// |
460 | //[Test] | 431 | //[Test] |
461 | //public void TestLoadIarV0_1TempProfiles() | 432 | //public void TestLoadIarV0_1TempProfiles() |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index a355661..e1bc243 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -44,10 +44,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
44 | 44 | ||
45 | public UserAccountCache() | 45 | public UserAccountCache() |
46 | { | 46 | { |
47 | // Warning: the size values are a bit fuzzy. What matters | ||
48 | // most for this cache is the count value (128 entries). | ||
49 | m_UUIDCache = new ExpiringCache<UUID, UserAccount>(); | 47 | m_UUIDCache = new ExpiringCache<UUID, UserAccount>(); |
50 | m_NameCache = new ExpiringCache<string, UUID>(); // this one is unbound | 48 | m_NameCache = new ExpiringCache<string, UUID>(); |
51 | } | 49 | } |
52 | 50 | ||
53 | public void Cache(UUID userID, UserAccount account) | 51 | public void Cache(UUID userID, UserAccount account) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index 4d04af1..58698ee 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -69,7 +69,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
69 | SerialiserModule serialiserModule = new SerialiserModule(); | 69 | SerialiserModule serialiserModule = new SerialiserModule(); |
70 | TerrainModule terrainModule = new TerrainModule(); | 70 | TerrainModule terrainModule = new TerrainModule(); |
71 | 71 | ||
72 | m_scene = SceneSetupHelpers.SetupScene("useraccounts"); | 72 | m_scene = SceneSetupHelpers.SetupScene(); |
73 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); | 73 | SceneSetupHelpers.SetupSceneModules(m_scene, m_archiverModule, serialiserModule, terrainModule); |
74 | } | 74 | } |
75 | 75 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index ee17fbf..f8591ba 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -267,7 +267,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
267 | } | 267 | } |
268 | catch (Exception e) | 268 | catch (Exception e) |
269 | { | 269 | { |
270 | m_log.Error("[SCENE]: SceneBase.cs: Close() - Failed with exception " + e.ToString()); | 270 | m_log.Error(string.Format("[SCENE]: SceneBase.cs: Close() - Failed with exception ", e)); |
271 | } | 271 | } |
272 | } | 272 | } |
273 | 273 | ||
@@ -376,7 +376,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
376 | /// <param name="mod"></param> | 376 | /// <param name="mod"></param> |
377 | public void RegisterModuleInterface<M>(M mod) | 377 | public void RegisterModuleInterface<M>(M mod) |
378 | { | 378 | { |
379 | m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M)); | 379 | // m_log.DebugFormat("[SCENE BASE]: Registering interface {0}", typeof(M)); |
380 | 380 | ||
381 | List<Object> l = null; | 381 | List<Object> l = null; |
382 | if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) | 382 | if (!ModuleInterfaces.TryGetValue(typeof(M), out l)) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index f719683..cd8c67e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -32,7 +32,7 @@ using System.Globalization; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.IO; | 33 | using System.IO; |
34 | using Microsoft.CSharp; | 34 | using Microsoft.CSharp; |
35 | using Microsoft.JScript; | 35 | //using Microsoft.JScript; |
36 | using Microsoft.VisualBasic; | 36 | using Microsoft.VisualBasic; |
37 | using log4net; | 37 | using log4net; |
38 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
82 | 82 | ||
83 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); | 83 | private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); |
84 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); | 84 | private static VBCodeProvider VBcodeProvider = new VBCodeProvider(); |
85 | private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); | 85 | // private static JScriptCodeProvider JScodeProvider = new JScriptCodeProvider(); |
86 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp | 86 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp |
87 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); | 87 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); |
88 | 88 | ||
@@ -398,9 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
398 | case enumCompileType.vb: | 398 | case enumCompileType.vb: |
399 | compileScript = CreateVBCompilerScript(compileScript); | 399 | compileScript = CreateVBCompilerScript(compileScript); |
400 | break; | 400 | break; |
401 | case enumCompileType.js: | 401 | // case enumCompileType.js: |
402 | compileScript = CreateJSCompilerScript(compileScript); | 402 | // compileScript = CreateJSCompilerScript(compileScript); |
403 | break; | 403 | // break; |
404 | case enumCompileType.yp: | 404 | case enumCompileType.yp: |
405 | compileScript = CreateYPCompilerScript(compileScript); | 405 | compileScript = CreateYPCompilerScript(compileScript); |
406 | break; | 406 | break; |
@@ -423,16 +423,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
423 | } | 423 | } |
424 | } | 424 | } |
425 | 425 | ||
426 | private static string CreateJSCompilerScript(string compileScript) | 426 | // private static string CreateJSCompilerScript(string compileScript) |
427 | { | 427 | // { |
428 | compileScript = String.Empty + | 428 | // compileScript = String.Empty + |
429 | "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + | 429 | // "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + |
430 | "package SecondLife {\r\n" + | 430 | // "package SecondLife {\r\n" + |
431 | "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + | 431 | // "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + |
432 | compileScript + | 432 | // compileScript + |
433 | "} }\r\n"; | 433 | // "} }\r\n"; |
434 | return compileScript; | 434 | // return compileScript; |
435 | } | 435 | // } |
436 | 436 | ||
437 | private static string CreateCSCompilerScript(string compileScript) | 437 | private static string CreateCSCompilerScript(string compileScript) |
438 | { | 438 | { |
@@ -583,10 +583,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
583 | } | 583 | } |
584 | } while (!complete); | 584 | } while (!complete); |
585 | break; | 585 | break; |
586 | case enumCompileType.js: | 586 | // case enumCompileType.js: |
587 | results = JScodeProvider.CompileAssemblyFromSource( | 587 | // results = JScodeProvider.CompileAssemblyFromSource( |
588 | parameters, Script); | 588 | // parameters, Script); |
589 | break; | 589 | // break; |
590 | case enumCompileType.yp: | 590 | case enumCompileType.yp: |
591 | results = YPcodeProvider.CompileAssemblyFromSource( | 591 | results = YPcodeProvider.CompileAssemblyFromSource( |
592 | parameters, Script); | 592 | parameters, Script); |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index b0fee6d..6e580f1 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -149,7 +149,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
149 | } | 149 | } |
150 | catch (Exception e) | 150 | catch (Exception e) |
151 | { | 151 | { |
152 | m_log.Debug("[XINVENTORY HANDLER]: Exception {0}" + e); | 152 | m_log.Debug("[XINVENTORY HANDLER]: Exception {0}", e); |
153 | } | 153 | } |
154 | 154 | ||
155 | return FailureResult(); | 155 | return FailureResult(); |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index c9bf996..5bb529c 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -83,7 +83,7 @@ namespace OpenSim.Server.Handlers.Login | |||
83 | clientVersion = requestData["version"].ToString(); | 83 | clientVersion = requestData["version"].ToString(); |
84 | // We should do something interesting with the client version... | 84 | // We should do something interesting with the client version... |
85 | 85 | ||
86 | m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); | 86 | //m_log.InfoFormat("[LOGIN]: XMLRPC Login Requested for {0} {1}, starting in {2}, using {3}", first, last, startLocation, clientVersion); |
87 | 87 | ||
88 | LoginResponse reply = null; | 88 | LoginResponse reply = null; |
89 | reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient); | 89 | reply = m_LocalService.Login(first, last, passwd, startLocation, scopeID, clientVersion, remoteClient); |
diff --git a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs index 9af61a9..edc1097 100644 --- a/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs +++ b/OpenSim/Services/AuthenticationService/AuthenticationServiceBase.cs | |||
@@ -88,7 +88,7 @@ namespace OpenSim.Services.AuthenticationService | |||
88 | m_Database = LoadPlugin<IAuthenticationData>(dllName, | 88 | m_Database = LoadPlugin<IAuthenticationData>(dllName, |
89 | new Object[] {connString, realm}); | 89 | new Object[] {connString, realm}); |
90 | if (m_Database == null) | 90 | if (m_Database == null) |
91 | throw new Exception("Could not find a storage interface in the given module"); | 91 | throw new Exception(string.Format("Could not find a storage interface in module {0}", dllName)); |
92 | } | 92 | } |
93 | 93 | ||
94 | public bool Verify(UUID principalID, string token, int lifetime) | 94 | public bool Verify(UUID principalID, string token, int lifetime) |
diff --git a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs index 2fc9248..17619ff 100644 --- a/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs +++ b/OpenSim/Services/AuthenticationService/PasswordAuthenticationService.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.AuthenticationService | |||
71 | string hashed = Util.Md5Hash(password + ":" + | 71 | string hashed = Util.Md5Hash(password + ":" + |
72 | data.Data["passwordSalt"].ToString()); | 72 | data.Data["passwordSalt"].ToString()); |
73 | 73 | ||
74 | //m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); | 74 | m_log.DebugFormat("[PASS AUTH]: got {0}; hashed = {1}; stored = {2}", password, hashed, data.Data["passwordHash"].ToString()); |
75 | 75 | ||
76 | if (data.Data["passwordHash"].ToString() == hashed) | 76 | if (data.Data["passwordHash"].ToString() == hashed) |
77 | { | 77 | { |
diff --git a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs index baefebd..d7a5731 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsServiceConnector.cs | |||
@@ -196,7 +196,7 @@ namespace OpenSim.Services.Connectors | |||
196 | { | 196 | { |
197 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 197 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
198 | sendData["PRINCIPALID"] = PrincipalID.ToString(); | 198 | sendData["PRINCIPALID"] = PrincipalID.ToString(); |
199 | sendData["FRIENDS"] = Friend; | 199 | sendData["FRIEND"] = Friend; |
200 | sendData["METHOD"] = "deletefriend"; | 200 | sendData["METHOD"] = "deletefriend"; |
201 | 201 | ||
202 | string reqString = ServerUtils.BuildQueryString(sendData); | 202 | string reqString = ServerUtils.BuildQueryString(sendData); |
diff --git a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs index d7cb015..0a7b277 100644 --- a/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs +++ b/OpenSim/Services/Connectors/Friends/FriendsSimConnector.cs | |||
@@ -74,6 +74,9 @@ namespace OpenSim.Services.Connectors.Friends | |||
74 | 74 | ||
75 | public bool FriendshipDenied(GridRegion region, UUID userID, string userName, UUID friendID) | 75 | public bool FriendshipDenied(GridRegion region, UUID userID, string userName, UUID friendID) |
76 | { | 76 | { |
77 | if (region == null) | ||
78 | return false; | ||
79 | |||
77 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 80 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
78 | //sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); | 81 | //sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); |
79 | //sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); | 82 | //sendData["VERSIONMAX"] = ProtocolVersions.ClientProtocolVersionMax.ToString(); |
@@ -131,7 +134,11 @@ namespace OpenSim.Services.Connectors.Friends | |||
131 | private bool Call(GridRegion region, Dictionary<string, object> sendData) | 134 | private bool Call(GridRegion region, Dictionary<string, object> sendData) |
132 | { | 135 | { |
133 | string reqString = ServerUtils.BuildQueryString(sendData); | 136 | string reqString = ServerUtils.BuildQueryString(sendData); |
134 | // m_log.DebugFormat("[FRIENDS CONNECTOR]: queryString = {0}", reqString); | 137 | //m_log.DebugFormat("[FRIENDS CONNECTOR]: queryString = {0}", reqString); |
138 | if (region == null) | ||
139 | return false; | ||
140 | |||
141 | m_log.DebugFormat("[FRIENDS CONNECTOR]: region: {0}", region.ExternalHostName + ":" + region.HttpPort); | ||
135 | try | 142 | try |
136 | { | 143 | { |
137 | string url = "http://" + region.ExternalHostName + ":" + region.HttpPort; | 144 | string url = "http://" + region.ExternalHostName + ":" + region.HttpPort; |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index b19135e..de3ee4e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -116,7 +116,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
116 | { | 116 | { |
117 | string credential = identity["Credential"].AsString(); | 117 | string credential = identity["Credential"].AsString(); |
118 | 118 | ||
119 | if (password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) | 119 | if (password == credential || "$1$" + password == credential || "$1$" + Utils.MD5String(password) == credential || Utils.MD5String(password) == credential) |
120 | return Authorize(principalID); | 120 | return Authorize(principalID); |
121 | 121 | ||
122 | md5hashFound = true; | 122 | md5hashFound = true; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 83f9ade..5c12a54 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -209,6 +209,8 @@ namespace OpenSim.Services.LLLoginService | |||
209 | bool success = false; | 209 | bool success = false; |
210 | UUID session = UUID.Random(); | 210 | UUID session = UUID.Random(); |
211 | 211 | ||
212 | m_log.InfoFormat("[LLOGIN SERVICE]: Login request for {0} {1} from {2} with user agent {3} starting in {4}", | ||
213 | firstName, lastName, clientIP.Address.ToString(), clientVersion, startLocation); | ||
212 | try | 214 | try |
213 | { | 215 | { |
214 | // | 216 | // |
diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 601a69f..976153f 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Services.PresenceService | |||
55 | UUID secureSessionID) | 55 | UUID secureSessionID) |
56 | { | 56 | { |
57 | //PresenceData[] d = m_Database.Get("UserID", userID); | 57 | //PresenceData[] d = m_Database.Get("UserID", userID); |
58 | m_Database.Get("UserID", userID); | 58 | //m_Database.Get("UserID", userID); |
59 | 59 | ||
60 | PresenceData data = new PresenceData(); | 60 | PresenceData data = new PresenceData(); |
61 | 61 | ||
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index eb588f0..063251a 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -97,6 +97,10 @@ namespace OpenSim.Services.UserAccountService | |||
97 | public UserAccount GetUserAccount(UUID scopeID, string firstName, | 97 | public UserAccount GetUserAccount(UUID scopeID, string firstName, |
98 | string lastName) | 98 | string lastName) |
99 | { | 99 | { |
100 | // m_log.DebugFormat( | ||
101 | // "[USER ACCOUNT SERVICE]: Retrieving account by username for {0} {1}, scope {2}", | ||
102 | // firstName, lastName, scopeID); | ||
103 | |||
100 | UserAccountData[] d; | 104 | UserAccountData[] d; |
101 | 105 | ||
102 | if (scopeID != UUID.Zero) | 106 | if (scopeID != UUID.Zero) |
@@ -231,6 +235,10 @@ namespace OpenSim.Services.UserAccountService | |||
231 | 235 | ||
232 | public bool StoreUserAccount(UserAccount data) | 236 | public bool StoreUserAccount(UserAccount data) |
233 | { | 237 | { |
238 | // m_log.DebugFormat( | ||
239 | // "[USER ACCOUNT SERVICE]: Storing user account for {0} {1} {2}, scope {3}", | ||
240 | // data.FirstName, data.LastName, data.PrincipalID, data.ScopeID); | ||
241 | |||
234 | UserAccountData d = new UserAccountData(); | 242 | UserAccountData d = new UserAccountData(); |
235 | 243 | ||
236 | d.FirstName = data.FirstName; | 244 | d.FirstName = data.FirstName; |
diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs deleted file mode 100644 index 0769c7a..0000000 --- a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
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 | |||
28 | using System.Collections.Generic; | ||
29 | using Nini.Config; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Services.Interfaces; | ||
32 | |||
33 | namespace OpenSim.Tests.Common.Mock | ||
34 | { | ||
35 | public class MockUserAccountService : IUserAccountService | ||
36 | { | ||
37 | |||
38 | public MockUserAccountService(IConfigSource config) {} | ||
39 | |||
40 | public UserAccount GetUserAccount(UUID scopeID, UUID userID) { return new UserAccount(); } | ||
41 | public UserAccount GetUserAccount(UUID scopeID, string FirstName, string LastName) { return new UserAccount(); } | ||
42 | public UserAccount GetUserAccount(UUID scopeID, string Email) { return new UserAccount(); } | ||
43 | public List<UserAccount> GetUserAccounts(UUID scopeID, string query) { return new List<UserAccount>(); } | ||
44 | public bool StoreUserAccount(UserAccount data) { return true; } | ||
45 | } | ||
46 | } \ No newline at end of file | ||
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index 2756324..4a356e2 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | |||
@@ -191,7 +191,7 @@ namespace OpenSim.Tests.Common.Setup | |||
191 | if (realServices.Contains("grid")) | 191 | if (realServices.Contains("grid")) |
192 | StartGridService(testScene, true); | 192 | StartGridService(testScene, true); |
193 | 193 | ||
194 | StartUserAccountService(testScene, realServices.Contains("useraccounts")); | 194 | StartUserAccountService(testScene); |
195 | } | 195 | } |
196 | // If not, make sure the shared module gets references to this new scene | 196 | // If not, make sure the shared module gets references to this new scene |
197 | else | 197 | else |
@@ -260,7 +260,7 @@ namespace OpenSim.Tests.Common.Setup | |||
260 | "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); | 260 | "LocalServiceModule", "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"); |
261 | else | 261 | else |
262 | config.Configs["AuthenticationService"].Set( | 262 | config.Configs["AuthenticationService"].Set( |
263 | "LocalServiceModule", "OpenSim.Tests.Common.dll:MockuthenticationService"); | 263 | "LocalServiceModule", "OpenSim.Tests.Common.dll:MockAuthenticationService"); |
264 | config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | 264 | config.Configs["AuthenticationService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
265 | service.Initialise(config); | 265 | service.Initialise(config); |
266 | service.AddRegion(testScene); | 266 | service.AddRegion(testScene); |
@@ -311,24 +311,18 @@ namespace OpenSim.Tests.Common.Setup | |||
311 | } | 311 | } |
312 | 312 | ||
313 | /// <summary> | 313 | /// <summary> |
314 | /// Start a user account service, whether real or mock | 314 | /// Start a user account service |
315 | /// </summary> | 315 | /// </summary> |
316 | /// <param name="testScene"></param> | 316 | /// <param name="testScene"></param> |
317 | /// <param name="real">Starts a real service if true, a mock service if not</param> | 317 | private static void StartUserAccountService(Scene testScene) |
318 | private static void StartUserAccountService(Scene testScene, bool real) | ||
319 | { | 318 | { |
320 | IConfigSource config = new IniConfigSource(); | 319 | IConfigSource config = new IniConfigSource(); |
321 | config.AddConfig("Modules"); | 320 | config.AddConfig("Modules"); |
322 | config.AddConfig("UserAccountService"); | 321 | config.AddConfig("UserAccountService"); |
323 | config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); | 322 | config.Configs["Modules"].Set("UserAccountServices", "LocalUserAccountServicesConnector"); |
324 | config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | 323 | config.Configs["UserAccountService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
325 | 324 | config.Configs["UserAccountService"].Set( | |
326 | if (real) | 325 | "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); |
327 | config.Configs["UserAccountService"].Set( | ||
328 | "LocalServiceModule", "OpenSim.Services.UserAccountService.dll:UserAccountService"); | ||
329 | else | ||
330 | config.Configs["UserAccountService"].Set( | ||
331 | "LocalServiceModule", "OpenSim.Tests.Common.dll:MockUserAccountService"); | ||
332 | 326 | ||
333 | if (m_userAccountService == null) | 327 | if (m_userAccountService == null) |
334 | { | 328 | { |
@@ -336,8 +330,7 @@ namespace OpenSim.Tests.Common.Setup | |||
336 | userAccountService.Initialise(config); | 330 | userAccountService.Initialise(config); |
337 | m_userAccountService = userAccountService; | 331 | m_userAccountService = userAccountService; |
338 | } | 332 | } |
339 | //else | 333 | |
340 | // config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Tests.Common.dll:TestGridService"); | ||
341 | m_userAccountService.AddRegion(testScene); | 334 | m_userAccountService.AddRegion(testScene); |
342 | m_userAccountService.RegionLoaded(testScene); | 335 | m_userAccountService.RegionLoaded(testScene); |
343 | testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); | 336 | testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); |
diff --git a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs index e6a7818..380f258 100644 --- a/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs +++ b/OpenSim/Tests/Common/Setup/UserProfileTestUtils.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | ||
28 | using OpenMetaverse; | 29 | using OpenMetaverse; |
29 | using OpenSim.Framework.Communications; | 30 | using OpenSim.Framework.Communications; |
30 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
@@ -124,7 +125,9 @@ namespace OpenSim.Tests.Common.Setup | |||
124 | public static UserAccount CreateUserWithInventory( | 125 | public static UserAccount CreateUserWithInventory( |
125 | Scene scene, string firstName, string lastName, UUID userId, string pw) | 126 | Scene scene, string firstName, string lastName, UUID userId, string pw) |
126 | { | 127 | { |
127 | UserAccount ua = new UserAccount(userId) { FirstName = firstName, LastName = lastName }; | 128 | UserAccount ua |
129 | = new UserAccount(userId) | ||
130 | { FirstName = firstName, LastName = lastName, ServiceURLs = new Dictionary<string, object>() }; | ||
128 | scene.UserAccountService.StoreUserAccount(ua); | 131 | scene.UserAccountService.StoreUserAccount(ua); |
129 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); | 132 | scene.InventoryService.CreateUserInventory(ua.PrincipalID); |
130 | scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); | 133 | scene.AuthenticationService.SetPassword(ua.PrincipalID, pw); |