aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Mock
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs (renamed from OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs)53
-rw-r--r--OpenSim/Tests/Common/Mock/MockUserAccountService.cs46
-rw-r--r--OpenSim/Tests/Common/Mock/MockUserService.cs149
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs21
-rw-r--r--OpenSim/Tests/Common/Mock/TestScene.cs12
-rw-r--r--OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs216
6 files changed, 91 insertions, 406 deletions
diff --git a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
index 013462e..f17a8de 100644
--- a/OpenSim/Tests/Common/Mock/TestCommunicationsManager.cs
+++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerConnector.cs
@@ -25,46 +25,37 @@
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
28using OpenSim.Framework; 28using System;
29using OpenSim.Framework.Communications; 29using Nini.Config;
30using OpenSim.Framework.Communications.Cache; 30using OpenSim.Server.Base;
31using OpenSim.Framework.Servers; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Region.Communications.Local; 33using OpenSim.Server.Handlers.Base;
34using OpenSim.Data;
35 34
36namespace OpenSim.Tests.Common.Mock 35namespace OpenSim.Server.Handlers.UserAccounts
37{ 36{
38 public class TestCommunicationsManager : CommunicationsManager 37 public class UserAccountServiceConnector : ServiceConnector
39 { 38 {
40 public IUserDataPlugin UserDataPlugin 39 private IUserAccountService m_UserAccountService;
41 { 40 private string m_ConfigName = "UserAccountService";
42 get { return m_userDataPlugin; }
43 }
44 private IUserDataPlugin m_userDataPlugin;
45
46 // public IInventoryDataPlugin InventoryDataPlugin
47 // {
48 // get { return m_inventoryDataPlugin; }
49 // }
50 // private IInventoryDataPlugin m_inventoryDataPlugin;
51 41
52 public TestCommunicationsManager() 42 public UserAccountServiceConnector(IConfigSource config, IHttpServer server, string configName) :
53 : this(null) 43 base(config, server, configName)
54 { 44 {
55 } 45 IConfig serverConfig = config.Configs[m_ConfigName];
46 if (serverConfig == null)
47 throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
56 48
57 public TestCommunicationsManager(NetworkServersInfo serversInfo) 49 string service = serverConfig.GetString("LocalServiceModule",
58 : base(serversInfo, null) 50 String.Empty);
59 { 51
52 if (service == String.Empty)
53 throw new Exception("No LocalServiceModule in config file");
60 54
61 LocalUserServices lus = new LocalUserServices(991, 992, this); 55 Object[] args = new Object[] { config };
62 lus.AddPlugin(new TemporaryUserProfilePlugin()); 56 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(service, args);
63 m_userDataPlugin = new TestUserDataPlugin();
64 lus.AddPlugin(m_userDataPlugin);
65 m_userService = lus;
66 m_userAdminService = lus;
67 57
58 server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService));
68 } 59 }
69 } 60 }
70} 61}
diff --git a/OpenSim/Tests/Common/Mock/MockUserAccountService.cs b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs
new file mode 100644
index 0000000..0769c7a
--- /dev/null
+++ b/OpenSim/Tests/Common/Mock/MockUserAccountService.cs
@@ -0,0 +1,46 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System.Collections.Generic;
29using Nini.Config;
30using OpenMetaverse;
31using OpenSim.Services.Interfaces;
32
33namespace 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/Mock/MockUserService.cs b/OpenSim/Tests/Common/Mock/MockUserService.cs
deleted file mode 100644
index 396ef25..0000000
--- a/OpenSim/Tests/Common/Mock/MockUserService.cs
+++ /dev/null
@@ -1,149 +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
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using OpenSim.Framework;
32using OpenSim.Framework.Communications;
33using OpenSim.Framework.Communications.Cache;
34using OpenSim.Services.Interfaces;
35
36namespace OpenSim.Tests.Common
37{
38 public class MockUserService : IUserService
39 {
40 public void AddTemporaryUserProfile(UserProfileData userProfile)
41 {
42 throw new NotImplementedException();
43 }
44
45 public UserProfileData GetUserProfile(string firstName, string lastName)
46 {
47 throw new NotImplementedException();
48 }
49
50 public UserProfileData GetUserProfile(UUID userId)
51 {
52 throw new NotImplementedException();
53 }
54
55 public UserProfileData GetUserProfile(Uri uri)
56 {
57 UserProfileData userProfile = new UserProfileData();
58
59// userProfile.ID = new UUID(Util.GetHashGuid(uri.ToString(), AssetCache.AssetInfo.Secret));
60
61 return userProfile;
62 }
63
64 public Uri GetUserUri(UserProfileData userProfile)
65 {
66 throw new NotImplementedException();
67 }
68
69 public UserAgentData GetAgentByUUID(UUID userId)
70 {
71 throw new NotImplementedException();
72 }
73
74 public void ClearUserAgent(UUID avatarID)
75 {
76 throw new NotImplementedException();
77 }
78
79 public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID QueryID, string Query)
80 {
81 throw new NotImplementedException();
82 }
83
84 public UserProfileData SetupMasterUser(string firstName, string lastName)
85 {
86 throw new NotImplementedException();
87 }
88
89 public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
90 {
91 throw new NotImplementedException();
92 }
93
94 public UserProfileData SetupMasterUser(UUID userId)
95 {
96 throw new NotImplementedException();
97 }
98
99 public bool UpdateUserProfile(UserProfileData data)
100 {
101 throw new NotImplementedException();
102 }
103
104 public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
105 {
106 throw new NotImplementedException();
107 }
108
109 public void RemoveUserFriend(UUID friendlistowner, UUID friend)
110 {
111 throw new NotImplementedException();
112 }
113
114 public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
115 {
116 throw new NotImplementedException();
117 }
118
119 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, Vector3 position, Vector3 lookat)
120 {
121 throw new NotImplementedException();
122 }
123
124 public void LogOffUser(UUID userid, UUID regionid, ulong regionhandle, float posx, float posy, float posz)
125 {
126 throw new NotImplementedException();
127 }
128
129 public List<FriendListItem> GetUserFriendList(UUID friendlistowner)
130 {
131 throw new NotImplementedException();
132 }
133
134 public bool VerifySession(UUID userID, UUID sessionID)
135 {
136 return true;
137 }
138
139 public void SetInventoryService(IInventoryService inv)
140 {
141 throw new NotImplementedException();
142 }
143
144 public virtual bool AuthenticateUserByPassword(UUID userID, string password)
145 {
146 throw new NotImplementedException();
147 }
148 }
149}
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 68ac96a..f015db2 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -95,7 +95,8 @@ namespace OpenSim.Tests.Common.Mock
95 public event DeRezObject OnDeRezObject; 95 public event DeRezObject OnDeRezObject;
96 public event Action<IClientAPI> OnRegionHandShakeReply; 96 public event Action<IClientAPI> OnRegionHandShakeReply;
97 public event GenericCall2 OnRequestWearables; 97 public event GenericCall2 OnRequestWearables;
98 public event GenericCall2 OnCompleteMovementToRegion; 98 public event GenericCall1 OnCompleteMovementToRegion;
99 public event UpdateAgent OnPreAgentUpdate;
99 public event UpdateAgent OnAgentUpdate; 100 public event UpdateAgent OnAgentUpdate;
100 public event AgentRequestSit OnAgentRequestSit; 101 public event AgentRequestSit OnAgentRequestSit;
101 public event AgentSit OnAgentSit; 102 public event AgentSit OnAgentSit;
@@ -367,7 +368,11 @@ namespace OpenSim.Tests.Common.Mock
367 get { return true; } 368 get { return true; }
368 set { } 369 set { }
369 } 370 }
370 371 public bool IsLoggingOut
372 {
373 get { return false; }
374 set { }
375 }
371 public UUID ActiveGroupId 376 public UUID ActiveGroupId
372 { 377 {
373 get { return UUID.Zero; } 378 get { return UUID.Zero; }
@@ -449,7 +454,7 @@ namespace OpenSim.Tests.Common.Mock
449 454
450 public void CompleteMovement() 455 public void CompleteMovement()
451 { 456 {
452 OnCompleteMovementToRegion(); 457 OnCompleteMovementToRegion(this);
453 } 458 }
454 459
455 public virtual void ActivateGesture(UUID assetId, UUID gestureId) 460 public virtual void ActivateGesture(UUID assetId, UUID gestureId)
@@ -748,7 +753,7 @@ namespace OpenSim.Tests.Common.Mock
748 753
749 if (OnCompleteMovementToRegion != null) 754 if (OnCompleteMovementToRegion != null)
750 { 755 {
751 OnCompleteMovementToRegion(); 756 OnCompleteMovementToRegion(this);
752 } 757 }
753 } 758 }
754 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) 759 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
@@ -1205,5 +1210,13 @@ namespace OpenSim.Tests.Common.Mock
1205 public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) 1210 public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals)
1206 { 1211 {
1207 } 1212 }
1213
1214 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
1215 {
1216 }
1217
1218 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1219 {
1220 }
1208 } 1221 }
1209} 1222}
diff --git a/OpenSim/Tests/Common/Mock/TestScene.cs b/OpenSim/Tests/Common/Mock/TestScene.cs
index 22cfa2c..01f2c14 100644
--- a/OpenSim/Tests/Common/Mock/TestScene.cs
+++ b/OpenSim/Tests/Common/Mock/TestScene.cs
@@ -29,7 +29,7 @@ using System;
29using Nini.Config; 29using Nini.Config;
30using OpenSim.Framework; 30using OpenSim.Framework;
31using OpenSim.Framework.Communications; 31using OpenSim.Framework.Communications;
32using OpenSim.Framework.Communications.Cache; 32
33using OpenSim.Framework.Servers; 33using OpenSim.Framework.Servers;
34using OpenSim.Region.Framework; 34using OpenSim.Region.Framework;
35using OpenSim.Region.Framework.Scenes; 35using OpenSim.Region.Framework.Scenes;
@@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock
40 { 40 {
41 public TestScene( 41 public TestScene(
42 RegionInfo regInfo, AgentCircuitManager authen, 42 RegionInfo regInfo, AgentCircuitManager authen,
43 CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager, 43 SceneCommunicationService sceneGridService, StorageManager storeManager,
44 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, 44 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
45 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) 45 bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
46 : base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader, 46 : base(regInfo, authen, sceneGridService, storeManager, moduleLoader,
47 dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) 47 dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
48 { 48 {
49 } 49 }
@@ -56,7 +56,7 @@ namespace OpenSim.Tests.Common.Mock
56 /// 56 ///
57 /// <param name="agent"></param> 57 /// <param name="agent"></param>
58 /// <returns></returns> 58 /// <returns></returns>
59 public override bool AuthenticateUser(AgentCircuitData agent, out string reason) 59 public override bool VerifyUserPresence(AgentCircuitData agent, out string reason)
60 { 60 {
61 reason = String.Empty; 61 reason = String.Empty;
62 return true; 62 return true;
@@ -65,6 +65,6 @@ namespace OpenSim.Tests.Common.Mock
65 public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter 65 public AsyncSceneObjectGroupDeleter SceneObjectGroupDeleter
66 { 66 {
67 get { return m_asyncSceneObjectDeleter; } 67 get { return m_asyncSceneObjectDeleter; }
68 } 68 }
69 } 69 }
70} 70} \ No newline at end of file
diff --git a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs
deleted file mode 100644
index 5188cf6..0000000
--- a/OpenSim/Tests/Common/Mock/TestUserDataPlugin.cs
+++ /dev/null
@@ -1,216 +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
28using System;
29using System.Collections.Generic;
30using OpenMetaverse;
31using OpenSim.Framework;
32using OpenSim.Data;
33
34namespace OpenSim.Tests.Common.Mock
35{
36 /// <summary>
37 /// In memory user data provider. Might be quite useful as a proper user data plugin, though getting mono addins
38 /// to load any plugins when running unit tests has proven impossible so far. Currently no locking since unit
39 /// tests are single threaded.
40 /// </summary>
41 public class TestUserDataPlugin : IUserDataPlugin
42 {
43 public string Version { get { return "0"; } }
44 public string Name { get { return "TestUserDataPlugin"; } }
45
46 /// <summary>
47 /// User profiles keyed by name
48 /// </summary>
49 private Dictionary<string, UserProfileData> m_userProfilesByName = new Dictionary<string, UserProfileData>();
50
51 /// <summary>
52 /// User profiles keyed by uuid
53 /// </summary>
54 private Dictionary<UUID, UserProfileData> m_userProfilesByUuid = new Dictionary<UUID, UserProfileData>();
55
56 /// <summary>
57 /// User profiles and their agents
58 /// </summary>
59 private Dictionary<UUID, UserAgentData> m_agentByProfileUuid = new Dictionary<UUID, UserAgentData>();
60
61 /// <summary>
62 /// Friends list by uuid
63 /// </summary>
64 private Dictionary<UUID, List<FriendListItem>> m_friendsListByUuid = new Dictionary<UUID, List<FriendListItem>>();
65
66 public void Initialise() {}
67 public void Dispose() {}
68
69 public void AddTemporaryUserProfile(UserProfileData userProfile)
70 {
71 // Not interested
72 }
73
74 public void AddNewUserProfile(UserProfileData user)
75 {
76 UpdateUserProfile(user);
77 }
78
79 public UserProfileData GetUserByUUID(UUID user)
80 {
81 UserProfileData userProfile = null;
82 m_userProfilesByUuid.TryGetValue(user, out userProfile);
83
84 return userProfile;
85 }
86
87 public UserProfileData GetUserByName(string fname, string lname)
88 {
89 UserProfileData userProfile = null;
90 m_userProfilesByName.TryGetValue(fname + " " + lname, out userProfile);
91
92 return userProfile;
93 }
94
95 public UserProfileData GetUserByUri(Uri uri) { return null; }
96
97 public bool UpdateUserProfile(UserProfileData user)
98 {
99 m_userProfilesByUuid[user.ID] = user;
100 m_userProfilesByName[user.FirstName + " " + user.SurName] = user;
101
102 return true;
103 }
104
105 public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query) { return null; }
106
107 public UserAgentData GetAgentByUUID(UUID user)
108 {
109 UserAgentData userAgent = null;
110 m_agentByProfileUuid.TryGetValue(user, out userAgent);
111
112 return userAgent;
113 }
114
115 public UserAgentData GetAgentByName(string name)
116 {
117 UserProfileData userProfile = null;
118 m_userProfilesByName.TryGetValue(name, out userProfile);
119 UserAgentData userAgent = null;
120 m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent);
121
122 return userAgent;
123 }
124
125 public UserAgentData GetAgentByName(string fname, string lname)
126 {
127 UserProfileData userProfile = GetUserByName(fname,lname);
128 UserAgentData userAgent = null;
129 m_agentByProfileUuid.TryGetValue(userProfile.ID, out userAgent);
130
131 return userAgent;
132 }
133
134 public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {}
135
136 public void AddNewUserAgent(UserAgentData agent)
137 {
138 m_agentByProfileUuid[agent.ProfileID] = agent;
139 }
140 public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms)
141 {
142 FriendListItem newfriend = new FriendListItem();
143 newfriend.FriendPerms = perms;
144 newfriend.Friend = friend;
145 newfriend.FriendListOwner = friendlistowner;
146
147 if (!m_friendsListByUuid.ContainsKey(friendlistowner))
148 {
149 List<FriendListItem> friendslist = new List<FriendListItem>();
150 m_friendsListByUuid[friendlistowner] = friendslist;
151
152 }
153 m_friendsListByUuid[friendlistowner].Add(newfriend);
154 }
155
156 public void RemoveUserFriend(UUID friendlistowner, UUID friend)
157 {
158 if (m_friendsListByUuid.ContainsKey(friendlistowner))
159 {
160 List<FriendListItem> friendslist = m_friendsListByUuid[friendlistowner];
161 foreach (FriendListItem frienditem in friendslist)
162 {
163 if (frienditem.Friend == friend)
164 {
165 friendslist.Remove(frienditem);
166 break;
167 }
168 }
169 }
170 }
171
172 public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms)
173 {
174 if (m_friendsListByUuid.ContainsKey(friendlistowner))
175 {
176 List<FriendListItem> friendslist = m_friendsListByUuid[friendlistowner];
177 foreach (FriendListItem frienditem in friendslist)
178 {
179 if (frienditem.Friend == friend)
180 {
181 frienditem.FriendPerms = perms;
182 break;
183 }
184 }
185 }
186 }
187
188 public List<FriendListItem> GetUserFriendList(UUID friendlistowner)
189 {
190 if (m_friendsListByUuid.ContainsKey(friendlistowner))
191 {
192 return m_friendsListByUuid[friendlistowner];
193 }
194 else
195 return new List<FriendListItem>();
196
197
198 }
199
200 public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos(List<UUID> uuids) { return null; }
201
202 public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; }
203
204 public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; }
205
206 public void Initialise(string connect) { return; }
207
208 public AvatarAppearance GetUserAppearance(UUID user) { return null; }
209
210 public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {}
211
212 public void ResetAttachments(UUID userID) {}
213
214 public void LogoutUsers(UUID regionID) {}
215 }
216}