This commit is contained in:
Cinder Roxley
2024-07-04 16:26:15 -05:00
parent 7df9068efa
commit 5b6a18d1d3
14 changed files with 39 additions and 44 deletions

View File

@@ -102,7 +102,7 @@ namespace OpenMetaverse.TestClient
{
if (args[3].IndexOf('/') >= 0)
{
char sep = '/';
const char sep = '/';
string[] startbits = args[3].Split(sep);
try
{

View File

@@ -16,11 +16,11 @@ namespace OpenMetaverse.TestClient
private string Usage()
{
string usage = "Usage:\n" +
"\tplay list - list the built in animations\n" +
"\tplay show - show any currently playing animations\n" +
"\tplay UUID - play an animation asset\n" +
"\tplay ANIMATION - where ANIMATION is one of the values returned from \"play list\"\n";
const string usage = "Usage:\n" +
"\tplay list - list the built in animations\n" +
"\tplay show - show any currently playing animations\n" +
"\tplay UUID - play an animation asset\n" +
"\tplay ANIMATION - where ANIMATION is one of the values returned from \"play list\"\n";
return usage;
}

View File

@@ -28,7 +28,6 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
Manager = Client.Inventory;
Inventory = Manager.Store;
string ret = "";
string nl = "\n";
string target = args.Aggregate(string.Empty, (current, t) => current + t + " ");
target = target.TrimEnd();
@@ -37,24 +36,21 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
// WARNING: Uses local copy of inventory contents, need to download them first.
List<InventoryBase> contents = Inventory.GetContents(Client.CurrentDirectory);
bool found = false;
foreach (InventoryBase b in contents)
foreach (var b in contents.Where(b => inventoryName == b.Name || inventoryName == b.UUID.ToString()))
{
if (inventoryName == b.Name || inventoryName == b.UUID.ToString())
found = true;
if (b is InventoryItem item)
{
found = true;
if (b is InventoryItem item)
{
Manager.GiveItem(item.UUID, item.Name, item.AssetType, dest, true);
ret += "Gave " + item.Name + " (" + item.AssetType + ")" + nl;
}
else
{
ret += "Unable to give folder " + b.Name + nl;
}
Manager.GiveItem(item.UUID, item.Name, item.AssetType, dest, true);
ret += "Gave " + item.Name + " (" + item.AssetType + ")" + '\n';
}
else
{
ret += "Unable to give folder " + b.Name + '\n';
}
}
if (!found)
ret += "No inventory item named " + inventoryName + " found." + nl;
ret += "No inventory item named " + inventoryName + " found." + '\n';
return ret;
}

View File

@@ -23,7 +23,6 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
// WARNING: Uses local copy of inventory contents, need to download them first.
List<InventoryBase> contents = Inventory.GetContents(Client.CurrentDirectory);
string displayString = "";
string nl = "\n"; // New line character
// Pretty simple, just print out the contents.
foreach (InventoryBase b in contents)
{
@@ -49,7 +48,7 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
displayString += PermMaskString(item.Permissions.EveryoneMask);
displayString += " " + item.UUID;
displayString += " " + item.Name;
displayString += nl;
displayString += '\n';
displayString += " AssetID: " + item.AssetUUID;
}
}
@@ -57,7 +56,7 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
{
displayString += b.Name;
}
displayString += nl;
displayString += '\n';
}
return displayString;
}

View File

@@ -113,7 +113,7 @@ namespace OpenMetaverse.TestClient
if (tokens.Length >= 4) // Optional starting position
{
char sep = '/';
const char sep = '/';
string[] startbits = tokens[3].Split(sep);
account.StartLocation = NetworkManager.StartLocation(startbits[0],
int.Parse(startbits[1]),
@@ -164,7 +164,7 @@ namespace OpenMetaverse.TestClient
if (arguments["startpos"] != null)
{
char sep = '/';
const char sep = '/';
string[] startbits = arguments["startpos"].Split(sep);
a.StartLocation = NetworkManager.StartLocation(startbits[0], int.Parse(startbits[1]),
int.Parse(startbits[2]), int.Parse(startbits[3]));