Make "show asset" command available simulator side. Actually make the service command be "show asset" instead of "show digest" this time.
Last time I accidnetally just changed the usage message.0.7.2-post-fixes
parent
7b564b8b35
commit
ff0f90bc35
|
@ -87,6 +87,14 @@ namespace OpenSim.Region.OptionalModules.Asset
|
||||||
if (m_scene == null)
|
if (m_scene == null)
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
|
||||||
|
MainConsole.Instance.Commands.AddCommand(
|
||||||
|
"asset",
|
||||||
|
false,
|
||||||
|
"show asset",
|
||||||
|
"show asset <ID>",
|
||||||
|
"Show asset information",
|
||||||
|
HandleShowAsset);
|
||||||
|
|
||||||
MainConsole.Instance.Commands.AddCommand(
|
MainConsole.Instance.Commands.AddCommand(
|
||||||
"asset", false, "dump asset",
|
"asset", false, "dump asset",
|
||||||
"dump asset <id>",
|
"dump asset <id>",
|
||||||
|
@ -130,5 +138,48 @@ namespace OpenSim.Region.OptionalModules.Asset
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
|
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HandleShowAsset(string module, string[] args)
|
||||||
|
{
|
||||||
|
if (args.Length < 3)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Syntax: show asset <ID>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetBase asset = m_scene.AssetService.Get(args[2]);
|
||||||
|
|
||||||
|
if (asset == null || asset.Data.Length == 0)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Asset not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
MainConsole.Instance.OutputFormat("Name: {0}", asset.Name);
|
||||||
|
MainConsole.Instance.OutputFormat("Description: {0}", asset.Description);
|
||||||
|
MainConsole.Instance.OutputFormat("Type: {0} (type number = {1})", (AssetType)asset.Type, asset.Type);
|
||||||
|
MainConsole.Instance.OutputFormat("Content-type: {0}", asset.Metadata.ContentType);
|
||||||
|
MainConsole.Instance.OutputFormat("Size: {0} bytes", asset.Data.Length);
|
||||||
|
MainConsole.Instance.OutputFormat("Temporary: {0}", asset.Temporary ? "yes" : "no");
|
||||||
|
MainConsole.Instance.OutputFormat("Flags: {0}", asset.Metadata.Flags);
|
||||||
|
|
||||||
|
for (i = 0 ; i < 5 ; i++)
|
||||||
|
{
|
||||||
|
int off = i * 16;
|
||||||
|
if (asset.Data.Length <= off)
|
||||||
|
break;
|
||||||
|
int len = 16;
|
||||||
|
if (asset.Data.Length < off + len)
|
||||||
|
len = asset.Data.Length - off;
|
||||||
|
|
||||||
|
byte[] line = new byte[len];
|
||||||
|
Array.Copy(asset.Data, off, line, 0, len);
|
||||||
|
|
||||||
|
string text = BitConverter.ToString(line);
|
||||||
|
MainConsole.Instance.Output(String.Format("{0:x4}: {1}", off, text));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -73,10 +73,10 @@ namespace OpenSim.Server.Handlers.Asset
|
||||||
server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete));
|
server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete));
|
||||||
|
|
||||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||||
"show digest",
|
"show asset",
|
||||||
"show digest <ID>",
|
"show asset <ID>",
|
||||||
"Show asset digest",
|
"Show asset information",
|
||||||
HandleShowDigest);
|
HandleShowAsset);
|
||||||
|
|
||||||
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
MainConsole.Instance.Commands.AddCommand("kfs", false,
|
||||||
"delete asset",
|
"delete asset",
|
||||||
|
@ -153,7 +153,7 @@ namespace OpenSim.Server.Handlers.Asset
|
||||||
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
|
MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleShowDigest(string module, string[] args)
|
void HandleShowAsset(string module, string[] args)
|
||||||
{
|
{
|
||||||
if (args.Length < 3)
|
if (args.Length < 3)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue