aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs116
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs7
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs72
-rw-r--r--OpenSim/Framework/Communications/IAvatarService.cs21
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs4
-rw-r--r--OpenSim/Framework/Communications/IUserService.cs8
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs5
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs2
-rw-r--r--OpenSim/Region/Communications/Local/CommunicationsLocal.cs3
-rw-r--r--OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs11
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs1
-rw-r--r--OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs1
13 files changed, 220 insertions, 38 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 3127bd6..524f314 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -87,6 +87,24 @@ namespace OpenSim.Framework.Communications.Cache
87 private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders 87 private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders
88 = new Dictionary<LLUUID, IList<InventoryFolderImpl>>(); 88 = new Dictionary<LLUUID, IList<InventoryFolderImpl>>();
89 89
90 private string m_inventoryHost
91 {
92 get
93 {
94 if (m_userProfile != null)
95 {
96 if (m_userProfile.UserInventoryURI != String.Empty)
97 {
98 Uri uri = new Uri(m_userProfile.UserInventoryURI);
99 return uri.Host;
100 }
101 }
102
103 return "";
104 }
105
106 }
107
90 /// <summary> 108 /// <summary>
91 /// Constructor 109 /// Constructor
92 /// </summary> 110 /// </summary>
@@ -325,9 +343,15 @@ namespace OpenSim.Framework.Communications.Cache
325 createdBaseFolder.Type = createdFolder.Type; 343 createdBaseFolder.Type = createdFolder.Type;
326 createdBaseFolder.Version = createdFolder.Version; 344 createdBaseFolder.Version = createdFolder.Version;
327 345
328 m_commsManager.InventoryService.AddFolder(createdBaseFolder); 346 IInventoryServices invService = GetInventoryService();
347 if (invService != null)
348 {
349 //m_commsManager.InventoryService
350 invService.AddFolder(createdBaseFolder);
351 return true;
352 }
329 353
330 return true; 354 return false;
331 } 355 }
332 else 356 else
333 { 357 {
@@ -379,14 +403,19 @@ namespace OpenSim.Framework.Communications.Cache
379 baseFolder.Type = (short) type; 403 baseFolder.Type = (short) type;
380 baseFolder.Version = RootFolder.Version; 404 baseFolder.Version = RootFolder.Version;
381 405
382 m_commsManager.InventoryService.UpdateFolder(baseFolder); 406 IInventoryServices invService = GetInventoryService();
383 407 if (invService != null)
384 InventoryFolderImpl folder=RootFolder.FindFolder(folderID); 408 {
385 if(folder != null) 409 //m_commsManager.InventoryService.
386 { 410 invService.UpdateFolder(baseFolder);
387 folder.Name = name; 411
388 folder.ParentID = parentID; 412 InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
389 } 413 if (folder != null)
414 {
415 folder.Name = name;
416 folder.ParentID = parentID;
417 }
418 }
390 } 419 }
391 else 420 else
392 { 421 {
@@ -421,13 +450,24 @@ namespace OpenSim.Framework.Communications.Cache
421 baseFolder.ID = folderID; 450 baseFolder.ID = folderID;
422 baseFolder.ParentID = parentID; 451 baseFolder.ParentID = parentID;
423 452
424 m_commsManager.InventoryService.MoveFolder(baseFolder); 453 IInventoryServices invService = GetInventoryService();
425 454 if (invService != null)
426 InventoryFolderImpl folder=RootFolder.FindFolder(folderID); 455 {
427 if(folder != null) 456 // m_commsManager.InventoryService
428 folder.ParentID = parentID; 457 invService.MoveFolder(baseFolder);
429 458
430 return true; 459 InventoryFolderImpl folder = RootFolder.FindFolder(folderID);
460 if (folder != null)
461 {
462 folder.ParentID = parentID;
463 }
464
465 return true;
466 }
467 else
468 {
469 return false;
470 }
431 } 471 }
432 else 472 else
433 { 473 {
@@ -468,11 +508,16 @@ namespace OpenSim.Framework.Communications.Cache
468 purgedBaseFolder.Type = purgedFolder.Type; 508 purgedBaseFolder.Type = purgedFolder.Type;
469 purgedBaseFolder.Version = purgedFolder.Version; 509 purgedBaseFolder.Version = purgedFolder.Version;
470 510
471 m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder); 511 IInventoryServices invService = GetInventoryService();
512 if (invService != null)
513 {
514 //m_commsManager.InventoryService
515 invService.PurgeFolder(purgedBaseFolder);
472 516
473 purgedFolder.Purge(); 517 purgedFolder.Purge();
474 518
475 return true; 519 return true;
520 }
476 } 521 }
477 } 522 }
478 else 523 else
@@ -505,7 +550,13 @@ namespace OpenSim.Framework.Communications.Cache
505 item.Folder=RootFolder.ID; 550 item.Folder=RootFolder.ID;
506 } 551 }
507 ItemReceive(item); 552 ItemReceive(item);
508 m_commsManager.InventoryService.AddItem(item); 553
554 IInventoryServices invService = GetInventoryService();
555 if (invService != null)
556 {
557 //m_commsManager.InventoryService
558 invService.AddItem(item);
559 }
509 } 560 }
510 else 561 else
511 { 562 {
@@ -525,7 +576,12 @@ namespace OpenSim.Framework.Communications.Cache
525 { 576 {
526 if (HasInventory) 577 if (HasInventory)
527 { 578 {
528 m_commsManager.InventoryService.UpdateItem(item); 579 IInventoryServices invService = GetInventoryService();
580 if (invService != null)
581 {
582 //m_commsManager.InventoryService
583 invService.UpdateItem(item);
584 }
529 } 585 }
530 else 586 else
531 { 587 {
@@ -564,7 +620,14 @@ namespace OpenSim.Framework.Communications.Cache
564 620
565 if (RootFolder.DeleteItem(item.ID)) 621 if (RootFolder.DeleteItem(item.ID))
566 { 622 {
567 return m_commsManager.InventoryService.DeleteItem(item); 623 IInventoryServices invService = GetInventoryService();
624 if (invService != null)
625 {
626 //return m_commsManager.InventoryService
627 return invService.DeleteItem(item);
628 }
629
630 return false;
568 } 631 }
569 } 632 }
570 else 633 else
@@ -641,6 +704,13 @@ namespace OpenSim.Framework.Communications.Cache
641 } 704 }
642 return null; 705 return null;
643 } 706 }
707
708 public IInventoryServices GetInventoryService()
709 {
710 IInventoryServices invService;
711 m_commsManager.TryGetInventoryService(m_inventoryHost, out invService);
712 return invService;
713 }
644 } 714 }
645 715
646 /// <summary> 716 /// <summary>
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index fe61406..37451ab 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -119,7 +119,12 @@ namespace OpenSim.Framework.Communications.Cache
119 CachedUserInfo userInfo = GetUserDetails(userID); 119 CachedUserInfo userInfo = GetUserDetails(userID);
120 if (userInfo != null) 120 if (userInfo != null)
121 { 121 {
122 m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive); 122 //m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
123 IInventoryServices invService = userInfo.GetInventoryService();
124 if (invService != null)
125 {
126 invService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
127 }
123 } 128 }
124 else 129 else
125 { 130 {
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index 5de0c71..0410f0e 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -55,12 +55,6 @@ namespace OpenSim.Framework.Communications
55 get { return m_gridService; } 55 get { return m_gridService; }
56 } 56 }
57 57
58 protected IInventoryServices m_inventoryService;
59
60 public IInventoryServices InventoryService
61 {
62 get { return m_inventoryService; }
63 }
64 58
65 protected IInterRegionCommunications m_interRegion; 59 protected IInterRegionCommunications m_interRegion;
66 60
@@ -106,6 +100,70 @@ namespace OpenSim.Framework.Communications
106 // m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile); 100 // m_transactionsManager = new AgentAssetTransactionsManager(this, dumpAssetsToFile);
107 } 101 }
108 102
103 #region Inventory
104 protected string m_defaultInventoryHost = "default";
105
106 protected List<IInventoryServices> m_inventoryServices = new List<IInventoryServices>();
107 // protected IInventoryServices m_inventoryService;
108
109 public IInventoryServices InventoryService
110 {
111 get
112 {
113 if (m_inventoryServices.Count > 0)
114 {
115 // return m_inventoryServices[0];
116 IInventoryServices invService;
117 if (TryGetInventoryService(m_defaultInventoryHost, out invService))
118 {
119 return invService;
120 }
121
122 }
123
124 return null;
125 }
126 }
127
128 public bool TryGetInventoryService(string host, out IInventoryServices inventoryService)
129 {
130 if ((host == string.Empty) | (host == "default"))
131 {
132 host = m_defaultInventoryHost;
133 }
134
135
136 lock (m_inventoryServices)
137 {
138 foreach (IInventoryServices service in m_inventoryServices)
139 {
140 if (service.Host == host)
141 {
142 inventoryService = service;
143 return true;
144 }
145 }
146 }
147
148 inventoryService = null;
149 return false;
150 }
151
152 public virtual void AddInventoryService(string hostUrl)
153 {
154
155 }
156
157 public virtual void AddInventoryService(IInventoryServices service)
158 {
159 lock (m_inventoryServices)
160 {
161 m_inventoryServices.Add(service);
162 }
163 }
164
165 #endregion
166
109 public void doCreate(string[] cmmdParams) 167 public void doCreate(string[] cmmdParams)
110 { 168 {
111 switch (cmmdParams[0]) 169 switch (cmmdParams[0])
@@ -167,7 +225,7 @@ namespace OpenSim.Framework.Communications
167 } 225 }
168 else 226 else
169 { 227 {
170 m_inventoryService.CreateNewUserInventory(userProf.ID); 228 InventoryService.CreateNewUserInventory(userProf.ID);
171 m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); 229 m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName);
172 return userProf.ID; 230 return userProf.ID;
173 } 231 }
diff --git a/OpenSim/Framework/Communications/IAvatarService.cs b/OpenSim/Framework/Communications/IAvatarService.cs
new file mode 100644
index 0000000..fdac53f
--- /dev/null
+++ b/OpenSim/Framework/Communications/IAvatarService.cs
@@ -0,0 +1,21 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5
6namespace OpenSim.Framework.Communications
7{
8 public interface IAvatarService
9 {
10 /// Get's the User Appearance
11 AvatarAppearance GetUserAppearance(LLUUID user);
12
13 void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);
14
15 void AddAttachment(LLUUID user, LLUUID attach);
16
17 void RemoveAttachment(LLUUID user, LLUUID attach);
18
19 List<LLUUID> GetAttachments(LLUUID user);
20 }
21}
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index 8dc09bc..3929a4e 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -42,6 +42,10 @@ namespace OpenSim.Framework.Communications
42 /// </summary> 42 /// </summary>
43 public interface IInventoryServices 43 public interface IInventoryServices
44 { 44 {
45 string Host
46 {
47 get;
48 }
45 /// <summary> 49 /// <summary>
46 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the 50 /// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
47 /// inventory has been received 51 /// inventory has been received
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index a7f19e7..f8ef358 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -112,16 +112,16 @@ namespace OpenSim.Framework.Communications
112 List<FriendListItem> GetUserFriendList(LLUUID friendlistowner); 112 List<FriendListItem> GetUserFriendList(LLUUID friendlistowner);
113 113
114 /// <summary> 114 /// <summary>
115 /// Get's the User Appearance
116 AvatarAppearance GetUserAppearance(LLUUID user);
117
118 /// <summary>
119 /// Updates the current region the User is in 115 /// Updates the current region the User is in
120 /// </summary> 116 /// </summary>
121 /// <param name="avatarid">User Region the Avatar is IN</param> 117 /// <param name="avatarid">User Region the Avatar is IN</param>
122 /// <param name="retionuuid">User Region the Avatar is IN</param> 118 /// <param name="retionuuid">User Region the Avatar is IN</param>
123 void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle); 119 void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle);
124 120
121 /// <summary>
122 /// Get's the User Appearance
123 AvatarAppearance GetUserAppearance(LLUUID user);
124
125 void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); 125 void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);
126 126
127 void AddAttachment(LLUUID user, LLUUID attach); 127 void AddAttachment(LLUUID user, LLUUID attach);
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index 89ccf93..d26a3bb 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -81,6 +81,11 @@ namespace OpenSim.Framework.Communications
81 81
82 #region IInventoryServices methods 82 #region IInventoryServices methods
83 83
84 public string Host
85 {
86 get { return "default"; }
87 }
88
84 // See IInventoryServices 89 // See IInventoryServices
85 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId) 90 public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
86 { 91 {
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index aecf2df..06b4de7 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -173,7 +173,7 @@ namespace OpenSim
173 { 173 {
174 if (File.Exists("OpenSim.xml")) 174 if (File.Exists("OpenSim.xml"))
175 { 175 {
176 //chech for a xml config file 176 //check for a xml config file
177 Application.iniFilePath = "OpenSim.xml"; 177 Application.iniFilePath = "OpenSim.xml";
178 m_config.Source = new XmlConfigSource(); 178 m_config.Source = new XmlConfigSource();
179 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath)); 179 m_config.Source.Merge(new XmlConfigSource(Application.iniFilePath));
diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
index fb5b17b..2065006 100644
--- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
+++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs
@@ -44,7 +44,8 @@ namespace OpenSim.Region.Communications.Local
44 IGridServices gridService, bool dumpAssetsToFile) 44 IGridServices gridService, bool dumpAssetsToFile)
45 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile) 45 : base(serversInfo, httpServer, assetCache, dumpAssetsToFile)
46 { 46 {
47 m_inventoryService = inventoryService; 47 AddInventoryService( inventoryService);
48 m_defaultInventoryHost = inventoryService.Host;
48 m_userService = userService; 49 m_userService = userService;
49 m_gridService = gridService; 50 m_gridService = gridService;
50 m_interRegion = interRegionService; 51 m_interRegion = interRegionService;
diff --git a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
index d622b7e..b85654d 100644
--- a/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
+++ b/OpenSim/Region/Communications/OGS1/CommunicationsOGS1.cs
@@ -41,8 +41,17 @@ namespace OpenSim.Region.Communications.OGS1
41 m_gridService = gridInterComms; 41 m_gridService = gridInterComms;
42 m_interRegion = gridInterComms; 42 m_interRegion = gridInterComms;
43 43
44 m_inventoryService = new OGS1InventoryService(serversInfo.InventoryURL); 44 OGS1InventoryService invService = new OGS1InventoryService(serversInfo.InventoryURL);
45 AddInventoryService(invService);
46 m_defaultInventoryHost = invService.Host;
47
45 m_userService = new OGS1UserServices(this); 48 m_userService = new OGS1UserServices(this);
46 } 49 }
50
51 public override void AddInventoryService(string hostUrl)
52 {
53 OGS1InventoryService invService = new OGS1InventoryService(hostUrl);
54 AddInventoryService(invService);
55 }
47 } 56 }
48} 57}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index dfc741a..4e4bfe8 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -45,16 +45,23 @@ namespace OpenSim.Region.Communications.OGS1
45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private string _inventoryServerUrl; 47 private string _inventoryServerUrl;
48 private Uri m_Uri;
48 private Dictionary<LLUUID, InventoryReceiptCallback> m_RequestingInventory 49 private Dictionary<LLUUID, InventoryReceiptCallback> m_RequestingInventory
49 = new Dictionary<LLUUID, InventoryReceiptCallback>(); 50 = new Dictionary<LLUUID, InventoryReceiptCallback>();
50 51
51 public OGS1InventoryService(string inventoryServerUrl) 52 public OGS1InventoryService(string inventoryServerUrl)
52 { 53 {
53 _inventoryServerUrl = inventoryServerUrl; 54 _inventoryServerUrl = inventoryServerUrl;
55 m_Uri = new Uri(_inventoryServerUrl);
54 } 56 }
55 57
56 #region IInventoryServices Members 58 #region IInventoryServices Members
57 59
60 public string Host
61 {
62 get { return m_Uri.Host; }
63 }
64
58 /// <summary> 65 /// <summary>
59 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see> 66 /// <see cref="OpenSim.Framework.Communications.IInventoryServices"></see>
60 /// </summary> 67 /// </summary>
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index cdd138b..da93890 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -696,5 +696,6 @@ namespace OpenSim.Region.Environment.Scenes
696 { 696 {
697 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query); 697 return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
698 } 698 }
699
699 } 700 }
700} 701}
diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
index 9c70a04..43b492a 100644
--- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.Modules.AvatarFactory
66 appearance = CreateDefault(avatarId); 66 appearance = CreateDefault(avatarId);
67 m_log.InfoFormat("[APPEARANCE] appearance not found for {0}, creating default", avatarId.ToString()); 67 m_log.InfoFormat("[APPEARANCE] appearance not found for {0}, creating default", avatarId.ToString());
68 return false; 68 return false;
69
69 } 70 }
70 71
71 private AvatarAppearance CreateDefault(LLUUID avatarId) 72 private AvatarAppearance CreateDefault(LLUUID avatarId)