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.
0.1-prestable
MW 2007-03-30 10:14:15 +00:00
parent b2ae86dd6a
commit d14a24d5ca
7 changed files with 77 additions and 31 deletions

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{66591469-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{66591469-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon> <ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.UserServer</AssemblyName> <AssemblyName>OpenGridServices.UserServer</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder> <AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenGridServices.UserServer</RootNamespace> <RootNamespace>OpenGridServices.UserServer</RootNamespace>
<StartupObject></StartupObject> <StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -55,7 +61,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System"> <Reference Include="System">
@ -70,10 +77,6 @@
<HintPath>System.Xml.dll</HintPath> <HintPath>System.Xml.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="OpenSim.Framework.dll" >
<HintPath>..\bin\OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll"> <Reference Include="libsecondlife.dll">
<HintPath>..\bin\libsecondlife.dll</HintPath> <HintPath>..\bin\libsecondlife.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -86,6 +89,10 @@
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private> <Private>False</Private>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Main.cs"> <Compile Include="Main.cs">

View File

@ -5,6 +5,8 @@ using System.IO;
using OpenSim.world; using OpenSim.world;
using OpenSim.UserServer; using OpenSim.UserServer;
using OpenSim.Servers; using OpenSim.Servers;
using OpenSim.Assets;
using OpenSim.Framework.Inventory;
namespace OpenSim.CAPS namespace OpenSim.CAPS
{ {
@ -16,9 +18,11 @@ namespace OpenSim.CAPS
private string passWord = "Admin"; private string passWord = "Admin";
private World m_world; private World m_world;
private LoginServer _userServer; 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; _userServer = userserver;
m_world = world; m_world = world;
passWord = password; passWord = password;
@ -31,6 +35,7 @@ namespace OpenSim.CAPS
server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage); server.AddRestHandler("GET", "/Admin/Welcome", GetWelcomePage);
server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage ); server.AddRestHandler("GET", "/Admin/Accounts", GetAccountsPage );
server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage ); server.AddRestHandler("GET", "/Admin/Clients", GetConnectedClientsPage );
server.AddRestHandler("GET", "/ClientInventory", GetClientsInventory);
server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount ); server.AddRestHandler("POST", "/Admin/NewAccount", PostNewAccount );
server.AddRestHandler("POST", "/Admin/Login", PostLogin ); server.AddRestHandler("POST", "/Admin/Login", PostLogin );
@ -120,14 +125,48 @@ namespace OpenSim.CAPS
if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar") if (m_world.Entities[UUID].ToString() == "OpenSim.world.Avatar")
{ {
TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID]; TempAv = (OpenSim.world.Avatar)m_world.Entities[UUID];
responseString += "<p>"; responseString += "<p> Client: ";
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 += TempAv.firstname + " , " + TempAv.lastname + " , <A HREF=\"javascript:loadXMLDoc('ClientInventory/" + UUID.ToString() + "')\">" + UUID + "</A> , " + 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 += "</p>"; responseString += "</p>";
} }
} }
return responseString; return responseString;
} }
private string GetClientsInventory(string request, string path)
{
string[] line;
string delimStr = "/";
char[] delimiter = delimStr.ToCharArray();
string responseString;
responseString = " <p> Listing Inventory </p>";
line = path.Split(delimiter);
if (line.Length > 2)
{
if (line[1] == "ClientInventory")
{
AgentInventory inven = this._inventoryCache.GetAgentsInventory(new libsecondlife.LLUUID(line[2]));
responseString += " <p> Client: " + inven.AgentID.ToStringHyphenated() +" </p>";
if (inven != null)
{
foreach (InventoryItem item in inven.InventoryItems.Values)
{
responseString += "<p> 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 += "</p>";
}
}
}
}
return responseString;
}
private string GetCachedAssets(string request, string path)
{
return "";
}
private string GetAccountsPage(string request, string path) private string GetAccountsPage(string request, string path)
{ {
string responseString; string responseString;

View File

@ -199,7 +199,7 @@ namespace OpenSim
} }
} }
AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, adminLoginServer); AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
adminWebFront.LoadMethods( HttpServer ); adminWebFront.LoadMethods( HttpServer );
m_console.WriteLine("Main.cs:Startup() - Starting HTTP server"); m_console.WriteLine("Main.cs:Startup() - Starting HTTP server");

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Servers", "Servers\OpenSim.Servers.csproj", "{8BB20F0A-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Servers", "Servers\OpenSim.Servers.csproj", "{8BB20F0A-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Console", "OpenSim.Framework.Console\OpenSim.Framework.Console.csproj", "{A7CD0630-0000-0000-0000-000000000000}"

View File

@ -4,7 +4,7 @@ using System.Net;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using OpenSim.CAPS; //using OpenSim.CAPS;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using System.Collections; using System.Collections;

View File

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.CAPS namespace OpenSim.Servers
{ {
public delegate string RestMethod( string request, string path ); public delegate string RestMethod( string request, string path );
} }

View File

@ -110,7 +110,7 @@ if (http_request.readyState==4)
</head> </head>
<body onload="loadXMLDoc('Admin/Welcome')"> <body onload="loadXMLDoc('Admin/Welcome')">
<div id="T1" style="border:1px solid black;height:500;width:600"> <div id="T1" style="border:1px solid black;height:500;width:800">
<br> <br>
</div><br /> </div><br />
<button onclick="loadXMLDoc('Admin/Clients')">Clients</button> <button onclick="loadXMLDoc('Admin/Clients')">Clients</button>