From d14a24d5caa6a8b8fc3a09fd0be12420d7ce6372 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 30 Mar 2007 10:14:15 +0000 Subject: Started to add a few features to the web front end that should be useful during debugging. First such feature is that you can see a list of any connected clients inventory. --- OpenSim.RegionServer/CAPS/AdminWebFront.cs | 47 +++++++++++++++++++++++++++--- OpenSim.RegionServer/OpenSimMain.cs | 2 +- 2 files changed, 44 insertions(+), 5 deletions(-) (limited to 'OpenSim.RegionServer') diff --git a/OpenSim.RegionServer/CAPS/AdminWebFront.cs b/OpenSim.RegionServer/CAPS/AdminWebFront.cs index 4995e54..72fbdaf 100644 --- a/OpenSim.RegionServer/CAPS/AdminWebFront.cs +++ b/OpenSim.RegionServer/CAPS/AdminWebFront.cs @@ -5,6 +5,8 @@ using System.IO; using OpenSim.world; using OpenSim.UserServer; using OpenSim.Servers; +using OpenSim.Assets; +using OpenSim.Framework.Inventory; namespace OpenSim.CAPS { @@ -16,9 +18,11 @@ namespace OpenSim.CAPS private string passWord = "Admin"; private World m_world; private LoginServer _userServer; + private InventoryCache _inventoryCache; - public AdminWebFront(string password, World world, LoginServer userserver) + public AdminWebFront(string password, World world, InventoryCache inventoryCache, LoginServer userserver) { + _inventoryCache = inventoryCache; _userServer = userserver; m_world = world; passWord = password; @@ -31,9 +35,10 @@ namespace OpenSim.CAPS server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage); server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage ); server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage ); + server.AddRestHandler("GET", "/ClientInventory", GetClientsInventory); server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount ); - server.AddRestHandler("POST", "/Admin/Login", PostLogin ); + server.AddRestHandler("POST", "/Admin/Login", PostLogin ); } private string GetWelcomePage(string request, string path) @@ -120,14 +125,48 @@ namespace OpenSim.CAPS if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar") { TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID]; - responseString += "

"; - responseString += String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()); + responseString += "

Client: "; + responseString += TempAv.firstname + " , " + TempAv.lastname + " , " + UUID + " , " + TempAv.ControllingClient.SessionID + " , " + TempAv.ControllingClient.CircuitCode + " , " + TempAv.ControllingClient.userEP.ToString();//String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()); responseString += "

"; } } return responseString; } + private string GetClientsInventory(string request, string path) + { + string[] line; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string responseString; + responseString = "

Listing Inventory

"; + + line = path.Split(delimiter); + if (line.Length > 2) + { + if (line[1] == "ClientInventory") + { + AgentInventory inven = this._inventoryCache.GetAgentsInventory(new libsecondlife.LLUUID(line[2])); + responseString += "

Client: " + inven.AgentID.ToStringHyphenated() +"

"; + if (inven != null) + { + foreach (InventoryItem item in inven.InventoryItems.Values) + { + responseString += "

InventoryItem: "; + responseString += item.Name +" , "+ item.ItemID +" , "+ item.Type +" , "+ item.FolderID +" , "+ item.AssetID +" , "+ item.Description ; //String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", item.Name, item.ItemID, item.Type, item.FolderID, item.AssetID, item.Description); + responseString += "

"; + } + } + } + } + return responseString; + } + + private string GetCachedAssets(string request, string path) + { + return ""; + } + private string GetAccountsPage(string request, string path) { string responseString; diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs index 36e1817..ffa64b5 100644 --- a/OpenSim.RegionServer/OpenSimMain.cs +++ b/OpenSim.RegionServer/OpenSimMain.cs @@ -199,7 +199,7 @@ namespace OpenSim } } - AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, adminLoginServer); + AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer); adminWebFront.LoadMethods( HttpServer ); m_console.WriteLine("Main.cs:Startup() - Starting HTTP server"); -- cgit v1.1