diff options
author | Jeff Ames | 2008-05-16 01:22:11 +0000 |
---|---|---|
committer | Jeff Ames | 2008-05-16 01:22:11 +0000 |
commit | 65c5efe43b68700bad94076d4cd421160203c5de (patch) | |
tree | 589b56649ed02f4942671fd6e51c6dc43f682e0d /OpenSim/Grid/InventoryServer | |
parent | Thank you very much, mjm for : (diff) | |
download | opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.zip opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.gz opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.bz2 opensim-SC-65c5efe43b68700bad94076d4cd421160203c5de.tar.xz |
Formatting cleanup.
Diffstat (limited to 'OpenSim/Grid/InventoryServer')
-rw-r--r-- | OpenSim/Grid/InventoryServer/GridInventoryService.cs | 38 | ||||
-rw-r--r-- | OpenSim/Grid/InventoryServer/Main.cs | 16 |
2 files changed, 27 insertions, 27 deletions
diff --git a/OpenSim/Grid/InventoryServer/GridInventoryService.cs b/OpenSim/Grid/InventoryServer/GridInventoryService.cs index 80f0c5e..5388263 100644 --- a/OpenSim/Grid/InventoryServer/GridInventoryService.cs +++ b/OpenSim/Grid/InventoryServer/GridInventoryService.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Grid.InventoryServer | |||
43 | /// </summary> | 43 | /// </summary> |
44 | public class GridInventoryService : InventoryServiceBase | 44 | public class GridInventoryService : InventoryServiceBase |
45 | { | 45 | { |
46 | private static readonly ILog m_log | 46 | private static readonly ILog m_log |
47 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) | 49 | public override void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback) |
@@ -56,31 +56,31 @@ namespace OpenSim.Grid.InventoryServer | |||
56 | /// <param name="rawUserID"></param> | 56 | /// <param name="rawUserID"></param> |
57 | /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> | 57 | /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> |
58 | public InventoryCollection GetUserInventory(Guid rawUserID) | 58 | public InventoryCollection GetUserInventory(Guid rawUserID) |
59 | { | 59 | { |
60 | LLUUID userID = new LLUUID(rawUserID); | 60 | LLUUID userID = new LLUUID(rawUserID); |
61 | 61 | ||
62 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); | 62 | m_log.InfoFormat("[GRID AGENT INVENTORY]: Processing request for inventory of {0}", userID); |
63 | 63 | ||
64 | // Uncomment me to simulate a slow responding inventory server | 64 | // Uncomment me to simulate a slow responding inventory server |
65 | //Thread.Sleep(16000); | 65 | //Thread.Sleep(16000); |
66 | 66 | ||
67 | InventoryCollection invCollection = new InventoryCollection(); | 67 | InventoryCollection invCollection = new InventoryCollection(); |
68 | 68 | ||
69 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); | 69 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); |
70 | 70 | ||
71 | if (null == allFolders) | 71 | if (null == allFolders) |
72 | { | 72 | { |
73 | m_log.WarnFormat("[GRID AGENT INVENTORY]: No inventory found for user {0}", rawUserID); | 73 | m_log.WarnFormat("[GRID AGENT INVENTORY]: No inventory found for user {0}", rawUserID); |
74 | 74 | ||
75 | return invCollection; | 75 | return invCollection; |
76 | } | 76 | } |
77 | 77 | ||
78 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | 78 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); |
79 | 79 | ||
80 | foreach (InventoryFolderBase folder in allFolders) | 80 | foreach (InventoryFolderBase folder in allFolders) |
81 | { | 81 | { |
82 | List<InventoryItemBase> items = RequestFolderItems(folder.ID); | 82 | List<InventoryItemBase> items = RequestFolderItems(folder.ID); |
83 | 83 | ||
84 | if (items != null) | 84 | if (items != null) |
85 | { | 85 | { |
86 | allItems.InsertRange(0, items); | 86 | allItems.InsertRange(0, items); |
@@ -88,36 +88,36 @@ namespace OpenSim.Grid.InventoryServer | |||
88 | } | 88 | } |
89 | 89 | ||
90 | invCollection.UserID = userID; | 90 | invCollection.UserID = userID; |
91 | invCollection.Folders = allFolders; | 91 | invCollection.Folders = allFolders; |
92 | invCollection.Items = allItems; | 92 | invCollection.Items = allItems; |
93 | 93 | ||
94 | // foreach (InventoryFolderBase folder in invCollection.Folders) | 94 | // foreach (InventoryFolderBase folder in invCollection.Folders) |
95 | // { | 95 | // { |
96 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); | 96 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); |
97 | // } | 97 | // } |
98 | // | 98 | // |
99 | // foreach (InventoryItemBase item in invCollection.Items) | 99 | // foreach (InventoryItemBase item in invCollection.Items) |
100 | // { | 100 | // { |
101 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); | 101 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); |
102 | // } | 102 | // } |
103 | 103 | ||
104 | m_log.InfoFormat( | 104 | m_log.InfoFormat( |
105 | "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", | 105 | "[GRID AGENT INVENTORY]: Sending back inventory response to user {0} containing {1} folders and {2} items", |
106 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); | 106 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); |
107 | 107 | ||
108 | return invCollection; | 108 | return invCollection; |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// Guid to UUID wrapper for same name IInventoryServices method | 112 | /// Guid to UUID wrapper for same name IInventoryServices method |
113 | /// </summary> | 113 | /// </summary> |
114 | /// <param name="rawUserID"></param> | 114 | /// <param name="rawUserID"></param> |
115 | /// <returns></returns> | 115 | /// <returns></returns> |
116 | public List<InventoryFolderBase> GetInventorySkeleton(Guid rawUserID) | 116 | public List<InventoryFolderBase> GetInventorySkeleton(Guid rawUserID) |
117 | { | 117 | { |
118 | LLUUID userID = new LLUUID(rawUserID); | 118 | LLUUID userID = new LLUUID(rawUserID); |
119 | return GetInventorySkeleton(userID); | 119 | return GetInventorySkeleton(userID); |
120 | } | 120 | } |
121 | 121 | ||
122 | /// <summary> | 122 | /// <summary> |
123 | /// Create an inventory for the given user. | 123 | /// Create an inventory for the given user. |
diff --git a/OpenSim/Grid/InventoryServer/Main.cs b/OpenSim/Grid/InventoryServer/Main.cs index 2279191..b7c46c2 100644 --- a/OpenSim/Grid/InventoryServer/Main.cs +++ b/OpenSim/Grid/InventoryServer/Main.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Grid.InventoryServer | |||
41 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback | 41 | public class OpenInventory_Main : BaseOpenSimServer, conscmd_callback |
42 | { | 42 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | private InventoryConfig m_config; | 45 | private InventoryConfig m_config; |
46 | private GridInventoryService m_inventoryService; | 46 | private GridInventoryService m_inventoryService; |
47 | 47 | ||
@@ -73,7 +73,7 @@ namespace OpenSim.Grid.InventoryServer | |||
73 | m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); | 73 | m_inventoryService.AddPlugin(m_config.DatabaseProvider, m_config.DatabaseConnect); |
74 | 74 | ||
75 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); | 75 | m_log.Info("[" + LogName + "]: Starting HTTP server ..."); |
76 | 76 | ||
77 | m_httpServer = new BaseHttpServer(m_config.HttpPort); | 77 | m_httpServer = new BaseHttpServer(m_config.HttpPort); |
78 | AddHttpHandlers(); | 78 | AddHttpHandlers(); |
79 | m_httpServer.Start(); | 79 | m_httpServer.Start(); |
@@ -86,11 +86,11 @@ namespace OpenSim.Grid.InventoryServer | |||
86 | m_httpServer.AddStreamHandler( | 86 | m_httpServer.AddStreamHandler( |
87 | new RestDeserialisehandler<Guid, InventoryCollection>( | 87 | new RestDeserialisehandler<Guid, InventoryCollection>( |
88 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory)); | 88 | "POST", "/GetInventory/", m_inventoryService.GetUserInventory)); |
89 | 89 | ||
90 | m_httpServer.AddStreamHandler( | 90 | m_httpServer.AddStreamHandler( |
91 | new RestDeserialisehandler<Guid, bool>( | 91 | new RestDeserialisehandler<Guid, bool>( |
92 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); | 92 | "POST", "/CreateInventory/", m_inventoryService.CreateUsersInventory)); |
93 | 93 | ||
94 | m_httpServer.AddStreamHandler( | 94 | m_httpServer.AddStreamHandler( |
95 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 95 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
96 | "POST", "/NewFolder/", m_inventoryService.AddFolder)); | 96 | "POST", "/NewFolder/", m_inventoryService.AddFolder)); |
@@ -98,15 +98,15 @@ namespace OpenSim.Grid.InventoryServer | |||
98 | m_httpServer.AddStreamHandler( | 98 | m_httpServer.AddStreamHandler( |
99 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 99 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
100 | "POST", "/MoveFolder/", m_inventoryService.MoveFolder)); | 100 | "POST", "/MoveFolder/", m_inventoryService.MoveFolder)); |
101 | 101 | ||
102 | m_httpServer.AddStreamHandler( | 102 | m_httpServer.AddStreamHandler( |
103 | new RestDeserialisehandler<InventoryFolderBase, bool>( | 103 | new RestDeserialisehandler<InventoryFolderBase, bool>( |
104 | "POST", "/PurgeFolder/", m_inventoryService.PurgeFolder)); | 104 | "POST", "/PurgeFolder/", m_inventoryService.PurgeFolder)); |
105 | 105 | ||
106 | m_httpServer.AddStreamHandler( | 106 | m_httpServer.AddStreamHandler( |
107 | new RestDeserialisehandler<InventoryItemBase, bool>( | 107 | new RestDeserialisehandler<InventoryItemBase, bool>( |
108 | "POST", "/NewItem/", m_inventoryService.AddItem)); | 108 | "POST", "/NewItem/", m_inventoryService.AddItem)); |
109 | 109 | ||
110 | m_httpServer.AddStreamHandler( | 110 | m_httpServer.AddStreamHandler( |
111 | new RestDeserialisehandler<InventoryItemBase, bool>( | 111 | new RestDeserialisehandler<InventoryItemBase, bool>( |
112 | "POST", "/DeleteItem/", m_inventoryService.DeleteItem)); | 112 | "POST", "/DeleteItem/", m_inventoryService.DeleteItem)); |
@@ -134,7 +134,7 @@ namespace OpenSim.Grid.InventoryServer | |||
134 | public override void RunCmd(string cmd, string[] cmdparams) | 134 | public override void RunCmd(string cmd, string[] cmdparams) |
135 | { | 135 | { |
136 | base.RunCmd(cmd, cmdparams); | 136 | base.RunCmd(cmd, cmdparams); |
137 | 137 | ||
138 | switch (cmd) | 138 | switch (cmd) |
139 | { | 139 | { |
140 | case "add-user": | 140 | case "add-user": |