aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-08-01 18:49:48 +0000
committerJustin Clarke Casey2008-08-01 18:49:48 +0000
commit43b2ff1d112174c36bb18caf353945afc6390840 (patch)
tree2da70a8856c417dcfb66f75fb38a4bde2b73c57f /OpenSim/Framework
parent* minor: eliminate some unused variables in InventoryFolderImpl (diff)
downloadopensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.zip
opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.gz
opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.bz2
opensim-SC-43b2ff1d112174c36bb18caf353945afc6390840.tar.xz
* Drop cached inventory from the local region when a user crosses out into a remote region
* May resolves inventory problems that occur when the user moves between two regions` * e.g. if the user moves to a second region, adds an inventory item, moves back to the original region then tries to manipulate that item * Not yet implemented for teleport
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs17
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs12
-rw-r--r--OpenSim/Framework/RegionInfo.cs42
-rw-r--r--OpenSim/Framework/Servers/BaseHttpServer.cs2
4 files changed, 44 insertions, 29 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
index 025b934..d85eda0 100644
--- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
+++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Framework.Communications.Cache
75 private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>(); 75 private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>();
76 76
77 /// <summary> 77 /// <summary>
78 /// The root folder of this user's inventory. Returns null if the inventory has not yet been received. 78 /// The root folder of this user's inventory. Returns null if the root folder has not yet been received.
79 /// </summary> 79 /// </summary>
80 public InventoryFolderImpl RootFolder { get { return m_rootFolder; } } 80 public InventoryFolderImpl RootFolder { get { return m_rootFolder; } }
81 private InventoryFolderImpl m_rootFolder; 81 private InventoryFolderImpl m_rootFolder;
@@ -183,6 +183,21 @@ namespace OpenSim.Framework.Communications.Cache
183 } 183 }
184 } 184 }
185 } 185 }
186
187 /// <summary>
188 /// Drop all cached inventory.
189 /// </summary>
190 public void DropInventory()
191 {
192 // Make sure there aren't pending requests around when we do this
193 // FIXME: There is still a race condition where an inventory operation can be requested (since these aren't being locked).
194 // Will have to extend locking to exclude this very soon.
195 lock (m_pendingRequests)
196 {
197 m_hasReceivedInventory = false;
198 m_rootFolder = null;
199 }
200 }
186 201
187 /// <summary> 202 /// <summary>
188 /// Callback invoked when the inventory is received from an async request to the inventory service 203 /// Callback invoked when the inventory is received from an async request to the inventory service
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index ac52535..5045c97 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -118,21 +118,19 @@ namespace OpenSim.Framework.Communications.Cache
118 /// </summary> 118 /// </summary>
119 /// <param name="userID"></param> 119 /// <param name="userID"></param>
120 /// <returns>true if the user was successfully removed, false otherwise</returns> 120 /// <returns>true if the user was successfully removed, false otherwise</returns>
121 public bool RemoveUser(LLUUID userID) 121 public bool RemoveUser(LLUUID userId)
122 { 122 {
123 lock (m_userProfiles) 123 lock (m_userProfiles)
124 { 124 {
125 if (m_userProfiles.ContainsKey(userID)) 125 if (m_userProfiles.ContainsKey(userId))
126 { 126 {
127 m_userProfiles.Remove(userID); 127 m_log.DebugFormat("[USER CACHE]: Removing user {0}", userId);
128 m_userProfiles.Remove(userId);
128 return true; 129 return true;
129 } 130 }
130 else
131 {
132 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID);
133 }
134 } 131 }
135 132
133 m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userId);
136 return false; 134 return false;
137 } 135 }
138 136
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ee64bf2..1d9d9ec 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -41,20 +41,34 @@ namespace OpenSim.Framework
41 // private static readonly log4net.ILog m_log 41 // private static readonly log4net.ILog m_log
42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 42 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
43 43
44 protected bool Allow_Alternate_Ports; 44 /// <summary>
45 public bool m_allow_alternate_ports;
46 protected string m_externalHostName;
47
48 /// <value>
49 /// The port by which http communication occurs with the region (most noticeably, CAPS communication) 45 /// The port by which http communication occurs with the region (most noticeably, CAPS communication)
50 /// </value> 46 /// </summary>
47 public uint HttpPort
48 {
49 get { return m_httpPort; }
50 set { m_httpPort = value; }
51 }
51 protected uint m_httpPort; 52 protected uint m_httpPort;
53
54 /// <summary>
55 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
56 /// </summary>
57 public string ServerURI
58 {
59 get { return m_serverURI; }
60 set { m_serverURI = value; }
61 }
62 protected string m_serverURI;
52 63
64 protected bool Allow_Alternate_Ports;
65 public bool m_allow_alternate_ports;
66 protected string m_externalHostName;
67
53 protected IPEndPoint m_internalEndPoint; 68 protected IPEndPoint m_internalEndPoint;
54 protected uint? m_regionLocX; 69 protected uint? m_regionLocX;
55 protected uint? m_regionLocY; 70 protected uint? m_regionLocY;
56 protected uint m_remotingPort; 71 protected uint m_remotingPort;
57 protected string m_serverURI;
58 public LLUUID RegionID = LLUUID.Zero; 72 public LLUUID RegionID = LLUUID.Zero;
59 public string RemotingAddress; 73 public string RemotingAddress;
60 74
@@ -101,18 +115,6 @@ namespace OpenSim.Framework
101 set { m_remotingPort = value; } 115 set { m_remotingPort = value; }
102 } 116 }
103 117
104 public uint HttpPort
105 {
106 get { return m_httpPort; }
107 set { m_httpPort = value; }
108 }
109
110 public string ServerURI
111 {
112 get { return m_serverURI; }
113 set { m_serverURI = value; }
114 }
115
116 /// <value> 118 /// <value>
117 /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw. 119 /// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
118 /// 120 ///
diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs
index f8b4ccb..eba49e4 100644
--- a/OpenSim/Framework/Servers/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/BaseHttpServer.cs
@@ -195,7 +195,7 @@ namespace OpenSim.Framework.Servers
195 string path = request.RawUrl; 195 string path = request.RawUrl;
196 string handlerKey = GetHandlerKey(request.HttpMethod, path); 196 string handlerKey = GetHandlerKey(request.HttpMethod, path);
197 197
198 // m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); 198 //m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
199 199
200 if (TryGetStreamHandler(handlerKey, out requestHandler)) 200 if (TryGetStreamHandler(handlerKey, out requestHandler))
201 { 201 {