diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Caches/CachedUserInfo.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Caches/InventoryFolder.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/Caches/UserProfileCache.cs | 75 |
3 files changed, 146 insertions, 0 deletions
diff --git a/OpenSim/Region/Caches/CachedUserInfo.cs b/OpenSim/Region/Caches/CachedUserInfo.cs new file mode 100644 index 0000000..08a7848 --- /dev/null +++ b/OpenSim/Region/Caches/CachedUserInfo.cs | |||
@@ -0,0 +1,20 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenSim.Framework.Data; | ||
5 | using libsecondlife; | ||
6 | |||
7 | namespace OpenSim.Region.Caches | ||
8 | { | ||
9 | public class CachedUserInfo | ||
10 | { | ||
11 | public UserProfileData UserProfile; | ||
12 | //public Dictionary<LLUUID, InventoryFolder> Folders = new Dictionary<LLUUID, InventoryFolder>(); | ||
13 | public InventoryFolder RootFolder; | ||
14 | |||
15 | public CachedUserInfo() | ||
16 | { | ||
17 | |||
18 | } | ||
19 | } | ||
20 | } | ||
diff --git a/OpenSim/Region/Caches/InventoryFolder.cs b/OpenSim/Region/Caches/InventoryFolder.cs new file mode 100644 index 0000000..364a184 --- /dev/null +++ b/OpenSim/Region/Caches/InventoryFolder.cs | |||
@@ -0,0 +1,51 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | using OpenSim.Framework.Data; | ||
6 | |||
7 | namespace OpenSim.Region.Caches | ||
8 | { | ||
9 | public class InventoryFolder : InventoryFolderBase | ||
10 | { | ||
11 | public Dictionary<LLUUID, InventoryFolder> SubFolders = new Dictionary<LLUUID, InventoryFolder>(); | ||
12 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); | ||
13 | |||
14 | public InventoryFolder() | ||
15 | { | ||
16 | } | ||
17 | |||
18 | public InventoryFolder HasSubFolder(LLUUID folderID) | ||
19 | { | ||
20 | InventoryFolder returnFolder = null; | ||
21 | if (this.SubFolders.ContainsKey(folderID)) | ||
22 | { | ||
23 | returnFolder = this.SubFolders[folderID]; | ||
24 | } | ||
25 | else | ||
26 | { | ||
27 | foreach (InventoryFolder folder in this.SubFolders.Values) | ||
28 | { | ||
29 | returnFolder = folder.HasSubFolder(folderID); | ||
30 | if (returnFolder != null) | ||
31 | { | ||
32 | break; | ||
33 | } | ||
34 | } | ||
35 | } | ||
36 | return returnFolder; | ||
37 | } | ||
38 | |||
39 | public InventoryFolder CreateNewSubFolder(LLUUID folderID, string folderName, ushort type) | ||
40 | { | ||
41 | InventoryFolder subFold = new InventoryFolder(); | ||
42 | subFold.name = folderName; | ||
43 | subFold.folderID = folderID; | ||
44 | subFold.type = type; | ||
45 | subFold.parentID = this.folderID; | ||
46 | subFold.agentID = this.agentID; | ||
47 | this.SubFolders.Add(subFold.folderID, subFold); | ||
48 | return subFold; | ||
49 | } | ||
50 | } | ||
51 | } | ||
diff --git a/OpenSim/Region/Caches/UserProfileCache.cs b/OpenSim/Region/Caches/UserProfileCache.cs new file mode 100644 index 0000000..0717e55 --- /dev/null +++ b/OpenSim/Region/Caches/UserProfileCache.cs | |||
@@ -0,0 +1,75 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | using OpenSim.Framework.Data; | ||
6 | |||
7 | namespace OpenSim.Region.Caches | ||
8 | { | ||
9 | public class UserProfileCache | ||
10 | { | ||
11 | public Dictionary<LLUUID, CachedUserInfo> UserProfiles = new Dictionary<LLUUID, CachedUserInfo>(); | ||
12 | |||
13 | public UserProfileCache() | ||
14 | { | ||
15 | |||
16 | } | ||
17 | |||
18 | /// <summary> | ||
19 | /// A new user has moved into a region in this instance | ||
20 | /// so get info from servers | ||
21 | /// </summary> | ||
22 | /// <param name="userID"></param> | ||
23 | public void AddNewUser(LLUUID userID) | ||
24 | { | ||
25 | |||
26 | } | ||
27 | |||
28 | /// <summary> | ||
29 | /// A user has left this instance | ||
30 | /// so make sure servers have been updated | ||
31 | /// Then remove cached info | ||
32 | /// </summary> | ||
33 | /// <param name="userID"></param> | ||
34 | public void UserLogOut(LLUUID userID) | ||
35 | { | ||
36 | |||
37 | } | ||
38 | |||
39 | /// <summary> | ||
40 | /// Request the user profile from User server | ||
41 | /// </summary> | ||
42 | /// <param name="userID"></param> | ||
43 | private void RequestUserProfileForUser(LLUUID userID) | ||
44 | { | ||
45 | |||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Request Iventory Info from Inventory server | ||
50 | /// </summary> | ||
51 | /// <param name="userID"></param> | ||
52 | private void RequestInventoryForUser(LLUUID userID) | ||
53 | { | ||
54 | |||
55 | } | ||
56 | |||
57 | /// <summary> | ||
58 | /// Make sure UserProfile is updated on user server | ||
59 | /// </summary> | ||
60 | /// <param name="userID"></param> | ||
61 | private void UpdateUserProfileToServer(LLUUID userID) | ||
62 | { | ||
63 | |||
64 | } | ||
65 | |||
66 | /// <summary> | ||
67 | /// Update Inventory data to Inventory server | ||
68 | /// </summary> | ||
69 | /// <param name="userID"></param> | ||
70 | private void UpdateInventoryToServer(LLUUID userID) | ||
71 | { | ||
72 | |||
73 | } | ||
74 | } | ||
75 | } | ||