aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-04-23 18:57:39 +0000
committerJustin Clarke Casey2009-04-23 18:57:39 +0000
commit0d51c22620315f125ddbd3fe501eb93f318038d8 (patch)
tree31cf4ba3cc962497c0589dc12eb5642240670d13 /OpenSim/Framework/Communications
parent* Add user data plugin to store temporary profiles (which are distinct from c... (diff)
downloadopensim-SC-0d51c22620315f125ddbd3fe501eb93f318038d8.zip
opensim-SC-0d51c22620315f125ddbd3fe501eb93f318038d8.tar.gz
opensim-SC-0d51c22620315f125ddbd3fe501eb93f318038d8.tar.bz2
opensim-SC-0d51c22620315f125ddbd3fe501eb93f318038d8.tar.xz
* Allow interested user data plugins to store temporary user profiles
* Database and the OGS1 plugins are not interested and hence ignore these calls
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/IUserService.cs7
-rw-r--r--OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs8
-rw-r--r--OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs5
-rw-r--r--OpenSim/Framework/Communications/Tests/LoginServiceTests.cs6
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs13
5 files changed, 33 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs
index fb24c15..9a3e211 100644
--- a/OpenSim/Framework/Communications/IUserService.cs
+++ b/OpenSim/Framework/Communications/IUserService.cs
@@ -34,6 +34,13 @@ namespace OpenSim.Framework.Communications
34 public interface IUserService 34 public interface IUserService
35 { 35 {
36 /// <summary> 36 /// <summary>
37 /// Add a temporary user profile.
38 /// </summary>
39 /// A temporary user profile is one that should exist only for the lifetime of the process.
40 /// <param name="userProfile"></param>
41 void AddTemporaryUserProfile(UserProfileData userProfile);
42
43 /// <summary>
37 /// Loads a user profile by name 44 /// Loads a user profile by name
38 /// </summary> 45 /// </summary>
39 /// <param name="firstName">First name</param> 46 /// <param name="firstName">First name</param>
diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
index 1cfeaf1..3b78c99 100644
--- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
+++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
@@ -64,6 +64,14 @@ namespace OpenSim.Framework.Communications
64 return null; 64 return null;
65 } 65 }
66 66
67 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
68 {
69 lock (m_profiles)
70 {
71 m_profiles[userProfile.ID] = userProfile;
72 }
73 }
74
67 public UserProfileData GetUserByUri(Uri uri) { return null; } 75 public UserProfileData GetUserByUri(Uri uri) { return null; }
68 public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query) { return null; } 76 public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query) { return null; }
69 public UserAgentData GetAgentByUUID(UUID user) { return null; } 77 public UserAgentData GetAgentByUUID(UUID user) { return null; }
diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
index 178c356..a5ee549 100644
--- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
+++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs
@@ -90,6 +90,11 @@ namespace OpenSim.Framework.Communications.Tests
90 90
91 private class FakeUserService : IUserService 91 private class FakeUserService : IUserService
92 { 92 {
93 public void AddTemporaryUserProfile(UserProfileData userProfile)
94 {
95 throw new NotImplementedException();
96 }
97
93 public UserProfileData GetUserProfile(string firstName, string lastName) 98 public UserProfileData GetUserProfile(string firstName, string lastName)
94 { 99 {
95 throw new NotImplementedException(); 100 throw new NotImplementedException();
diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
index 42fdea5..d0c1b3b 100644
--- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
+++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs
@@ -280,8 +280,8 @@ namespace OpenSim.Framework.Communications.Tests
280 [Test] 280 [Test]
281 public void T023_TestAuthenticatedLoginAlreadyLoggedIn() 281 public void T023_TestAuthenticatedLoginAlreadyLoggedIn()
282 { 282 {
283 Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()"); 283 //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()");
284 log4net.Config.XmlConfigurator.Configure(); 284 //log4net.Config.XmlConfigurator.Configure();
285 285
286 string error_already_logged = "You appear to be already logged in. " + 286 string error_already_logged = "You appear to be already logged in. " +
287 "If this is not the case please wait for your session to timeout. " + 287 "If this is not the case please wait for your session to timeout. " +
@@ -317,7 +317,7 @@ namespace OpenSim.Framework.Communications.Tests
317 responseData = (Hashtable)response.Value; 317 responseData = (Hashtable)response.Value;
318 Assert.That(responseData["message"], Is.EqualTo("Hello folks")); 318 Assert.That(responseData["message"], Is.EqualTo("Hello folks"));
319 319
320 Console.WriteLine("Finished T023_TestAuthenticatedLoginAlreadyLoggedIn()"); 320 //Console.WriteLine("Finished T023_TestAuthenticatedLoginAlreadyLoggedIn()");
321 } 321 }
322 322
323 public class TestLoginToRegionConnector : ILoginServiceToRegionsConnector 323 public class TestLoginToRegionConnector : ILoginServiceToRegionsConnector
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index b6a7362..133f810 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -88,9 +88,16 @@ namespace OpenSim.Framework.Communications
88 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect)); 88 m_plugins.AddRange(DataPluginFactory.LoadDataPlugins<IUserDataPlugin>(provider, connect));
89 } 89 }
90 90
91 #region Get UserProfile 91 #region UserProfile
92 92
93 // see IUserService 93 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
94 {
95 foreach (IUserDataPlugin plugin in m_plugins)
96 {
97 plugin.AddTemporaryUserProfile(userProfile);
98 }
99 }
100
94 public virtual UserProfileData GetUserProfile(string fname, string lname) 101 public virtual UserProfileData GetUserProfile(string fname, string lname)
95 { 102 {
96 foreach (IUserDataPlugin plugin in m_plugins) 103 foreach (IUserDataPlugin plugin in m_plugins)