Some cleanup with foreach
This commit is contained in:
@@ -59,9 +59,9 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
Client.Network.Simulators[i].ObjectsAvatars.ForEach(
|
||||
sim.ObjectsAvatars.ForEach(
|
||||
delegate(Avatar av)
|
||||
{
|
||||
lock (m_AgentList)
|
||||
|
||||
@@ -21,9 +21,11 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim
|
||||
in Client.Network.Simulators)
|
||||
{
|
||||
Client.Network.Simulators[i].ObjectsAvatars.ForEach(
|
||||
sim
|
||||
.ObjectsAvatars.ForEach(
|
||||
delegate(Avatar av)
|
||||
{
|
||||
result.AppendLine();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -22,8 +23,7 @@ namespace OpenMetaverse.TestClient
|
||||
string targetName = String.Empty;
|
||||
List<DirectoryManager.AgentSearchData> matches;
|
||||
|
||||
for (int ct = 0; ct < args.Length; ct++)
|
||||
targetName = targetName + args[ct] + " ";
|
||||
targetName = args.Aggregate(targetName, (current, t) => current + t + " ");
|
||||
targetName = targetName.TrimEnd();
|
||||
|
||||
if (targetName.Length == 0)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient.Commands
|
||||
@@ -20,9 +21,7 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
if (args.Length < 1)
|
||||
return "Usage: searchclassifieds [search text]";
|
||||
|
||||
string searchText = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
searchText += args[i] + " ";
|
||||
string searchText = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
searchText = searchText.TrimEnd();
|
||||
waitQuery.Reset();
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient.Commands
|
||||
@@ -22,9 +23,7 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
if (args.Length < 1)
|
||||
return "Usage: searchevents [search text]";
|
||||
|
||||
string searchText = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
searchText += args[i] + " ";
|
||||
string searchText = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
searchText = searchText.TrimEnd();
|
||||
|
||||
waitQuery.Reset();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient.Commands
|
||||
@@ -22,9 +23,7 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
if (args.Length < 1)
|
||||
return "Usage: searchpeople [search text]";
|
||||
|
||||
string searchText = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
searchText += args[i] + " ";
|
||||
string searchText = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
searchText = searchText.TrimEnd();
|
||||
|
||||
waitQuery.Reset();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient.Commands
|
||||
@@ -20,9 +21,7 @@ namespace OpenMetaverse.TestClient.Commands
|
||||
if (args.Length < 1)
|
||||
return "Usage: searchplaces [search text]";
|
||||
|
||||
string searchText = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
searchText += args[i] + " ";
|
||||
string searchText = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
searchText = searchText.TrimEnd();
|
||||
waitQuery.Reset();
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -28,9 +29,7 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
activeGroup = string.Empty;
|
||||
|
||||
string groupName = String.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
groupName += args[i] + " ";
|
||||
string groupName = args.Aggregate(String.Empty, (current, t) => current + (t + " "));
|
||||
groupName = groupName.Trim();
|
||||
|
||||
UUID groupUUID = Client.GroupName2UUID(groupName);
|
||||
|
||||
@@ -30,8 +30,9 @@ namespace OpenMetaverse.TestClient
|
||||
return Description;
|
||||
|
||||
GroupName = String.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
GroupName += args[i] + " ";
|
||||
foreach (var arg in args)
|
||||
GroupName += arg + " ";
|
||||
|
||||
GroupName = GroupName.Trim();
|
||||
|
||||
GroupUUID = Client.GroupName2UUID(GroupName);
|
||||
|
||||
@@ -30,8 +30,9 @@ namespace OpenMetaverse.TestClient
|
||||
return Description;
|
||||
|
||||
GroupName = String.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
GroupName += args[i] + " ";
|
||||
foreach (var arg in args)
|
||||
GroupName += arg + " ";
|
||||
|
||||
GroupName = GroupName.Trim();
|
||||
|
||||
GroupUUID = Client.GroupName2UUID(GroupName);
|
||||
|
||||
@@ -42,8 +42,9 @@ namespace OpenMetaverse.TestClient
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
groupName += args[i] + " ";
|
||||
foreach (var arg in args)
|
||||
groupName += arg + " ";
|
||||
|
||||
groupName = groupName.Trim();
|
||||
|
||||
Client.Directory.DirGroupsReply += Directory_DirGroups;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -23,9 +24,7 @@ namespace OpenMetaverse.TestClient
|
||||
if (args.Length < 1)
|
||||
return Description;
|
||||
|
||||
string groupName = String.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
groupName += args[i] + " ";
|
||||
string groupName = args.Aggregate(String.Empty, (current, t) => current + (t + " "));
|
||||
groupName = groupName.Trim();
|
||||
|
||||
UUID groupUUID = Client.GroupName2UUID(groupName);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
@@ -24,9 +25,7 @@ namespace OpenMetaverse.TestClient
|
||||
public override string Execute(string[] args, UUID fromAgentID)
|
||||
{
|
||||
// parse the command line
|
||||
string target = String.Empty;
|
||||
for (int ct = 0; ct < args.Length; ct++)
|
||||
target = target + args[ct] + " ";
|
||||
string target = args.Aggregate(String.Empty, (current, t) => current + t + " ");
|
||||
target = target.TrimEnd();
|
||||
|
||||
// initialize results list
|
||||
|
||||
@@ -57,9 +57,9 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
Avatar targetAv = Client.Network.Simulators[i].ObjectsAvatars.Find(
|
||||
Avatar targetAv = sim.ObjectsAvatars.Find(
|
||||
avatar => avatar.ID == target
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
|
||||
@@ -30,9 +31,7 @@ namespace OpenMetaverse.TestClient.Commands.Inventory.Shell
|
||||
string ret = "";
|
||||
string nl = "\n";
|
||||
|
||||
string target = String.Empty;
|
||||
for (int ct = 0; ct < args.Length; ct++)
|
||||
target = target + args[ct] + " ";
|
||||
string target = args.Aggregate(String.Empty, (current, t) => current + t + " ");
|
||||
target = target.TrimEnd();
|
||||
|
||||
string inventoryName = target;
|
||||
|
||||
@@ -35,17 +35,16 @@ namespace OpenMetaverse.TestClient
|
||||
{
|
||||
string result = String.Empty;
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
foreach (var i in items)
|
||||
{
|
||||
if (items[i] is InventoryFolder)
|
||||
if (i is InventoryFolder)
|
||||
{
|
||||
result += String.Format("[Folder] Name: {0}", items[i].Name) + Environment.NewLine;
|
||||
result += $"[Folder] Name: {i.Name}" + Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryItem item = (InventoryItem)items[i];
|
||||
result += String.Format("[Item] Name: {0} Desc: {1} Type: {2}", item.Name, item.Description,
|
||||
item.AssetType) + Environment.NewLine;
|
||||
InventoryItem item = (InventoryItem)i;
|
||||
result += $"[Item] Name: {item.Name} Desc: {item.Description} Type: {item.AssetType}" + Environment.NewLine;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace OpenMetaverse.TestClient
|
||||
catch (Exception e) { return e.Message; }
|
||||
|
||||
// Execute all of the commands
|
||||
for (int i = 0; i < lines.Length; i++)
|
||||
foreach (var l in lines)
|
||||
{
|
||||
string line = lines[i].Trim();
|
||||
string line = l.Trim();
|
||||
|
||||
if (line.Length > 0)
|
||||
ClientManager.Instance.DoCommandAll(line, UUID.Zero);
|
||||
|
||||
@@ -82,19 +82,18 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
Client.Inventory.ScriptRunningReply += callback;
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
foreach (var t in items)
|
||||
{
|
||||
if (items[i] is InventoryFolder)
|
||||
if (t is InventoryFolder)
|
||||
{
|
||||
// this shouldn't happen this year
|
||||
result += String.Format("[Folder] Name: {0}", items[i].Name) + Environment.NewLine;
|
||||
result += $"[Folder] Name: {t.Name}" + Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
InventoryItem item = (InventoryItem)items[i];
|
||||
InventoryItem item = (InventoryItem)t;
|
||||
AssetType assetType = item.AssetType;
|
||||
result += String.Format("[Item] Name: {0} Desc: {1} Type: {2}", item.Name, item.Description,
|
||||
assetType);
|
||||
result += $"[Item] Name: {item.Name} Desc: {item.Description} Type: {assetType}";
|
||||
if (assetType == AssetType.LSLBytecode || assetType == AssetType.LSLText)
|
||||
{
|
||||
OnScriptRunningReset.Reset();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -34,12 +35,9 @@ namespace OpenMetaverse.TestClient
|
||||
StringBuilder ret = new StringBuilder();
|
||||
ret.AppendLine("Agent locations:");
|
||||
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
foreach (var location in items.Cast<MapAgentLocation>())
|
||||
{
|
||||
MapAgentLocation location = (MapAgentLocation)items[i];
|
||||
|
||||
ret.AppendLine(String.Format("{0} avatar(s) at {1},{2}", location.AvatarCount, location.LocalX,
|
||||
location.LocalY));
|
||||
ret.AppendLine($"{location.AvatarCount} avatar(s) at {location.LocalX},{location.LocalY}");
|
||||
}
|
||||
|
||||
return ret.ToString();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -20,9 +21,7 @@ namespace OpenMetaverse.TestClient
|
||||
return "Usage: findsim [Simulator Name]";
|
||||
|
||||
// Build the simulator name from the args list
|
||||
string simName = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
simName += args[i] + " ";
|
||||
string simName = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
simName = simName.TrimEnd().ToLower();
|
||||
|
||||
//if (!GridDataCached[Client])
|
||||
|
||||
@@ -32,13 +32,12 @@ namespace OpenMetaverse.TestClient
|
||||
AutoResetEvent wait = new AutoResetEvent(false);
|
||||
EventHandler<ForceSelectObjectsReplyEventArgs> callback = delegate(object sender, ForceSelectObjectsReplyEventArgs e)
|
||||
{
|
||||
|
||||
for (int i = 0; i < e.ObjectIDs.Count; i++)
|
||||
foreach (var id in e.ObjectIDs)
|
||||
{
|
||||
result.Append(e.ObjectIDs[i].ToString() + " ");
|
||||
result.Append(id + " ");
|
||||
counter++;
|
||||
}
|
||||
|
||||
|
||||
if (e.ObjectIDs.Count < 251)
|
||||
wait.Set();
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -23,10 +24,8 @@ namespace OpenMetaverse.TestClient
|
||||
public override string Execute(string[] args, UUID fromAgentID)
|
||||
{
|
||||
// Construct the target name from the passed arguments
|
||||
string target = String.Empty;
|
||||
for (int ct = 0; ct < args.Length; ct++)
|
||||
target = target + args[ct] + " ";
|
||||
target = target.TrimEnd();
|
||||
string target = args.Aggregate(String.Empty, (current, t) => current + t + " ");
|
||||
target = target.TrimEnd();
|
||||
|
||||
if (target.Length == 0 || target == "off")
|
||||
{
|
||||
@@ -48,9 +47,9 @@ namespace OpenMetaverse.TestClient
|
||||
{
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
Avatar target = Client.Network.Simulators[i].ObjectsAvatars.Find(
|
||||
Avatar target = sim.ObjectsAvatars.Find(
|
||||
avatar => avatar.Name == name
|
||||
);
|
||||
|
||||
@@ -79,15 +78,15 @@ namespace OpenMetaverse.TestClient
|
||||
// Find the target position
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var t in Client.Network.Simulators)
|
||||
{
|
||||
Avatar targetAv;
|
||||
|
||||
if (Client.Network.Simulators[i].ObjectsAvatars.TryGetValue(targetLocalID, out targetAv))
|
||||
if (t.ObjectsAvatars.TryGetValue(targetLocalID, out targetAv))
|
||||
{
|
||||
float distance = 0.0f;
|
||||
|
||||
if (Client.Network.Simulators[i] == Client.Network.CurrentSim)
|
||||
if (t == Client.Network.CurrentSim)
|
||||
{
|
||||
distance = Vector3.Distance(targetAv.Position, Client.Self.SimPosition);
|
||||
}
|
||||
@@ -99,7 +98,7 @@ namespace OpenMetaverse.TestClient
|
||||
if (distance > DISTANCE_BUFFER)
|
||||
{
|
||||
uint regionX, regionY;
|
||||
Utils.LongToUInts(Client.Network.Simulators[i].Handle, out regionX, out regionY);
|
||||
Utils.LongToUInts(t.Handle, out regionX, out regionY);
|
||||
|
||||
double xTarget = (double)targetAv.Position.X + (double)regionX;
|
||||
double yTarget = (double)targetAv.Position.Y + (double)regionY;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
|
||||
namespace OpenMetaverse.TestClient
|
||||
@@ -81,13 +82,12 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
// Build a dictionary of primitives for referencing later
|
||||
Objects[rootPrim.ID] = rootPrim;
|
||||
for (int i = 0; i < childPrims.Count; i++)
|
||||
Objects[childPrims[i].ID] = childPrims[i];
|
||||
foreach (var p in childPrims)
|
||||
Objects[p.ID] = p;
|
||||
|
||||
// Build a list of all the localIDs to set permissions for
|
||||
localIDs.Add(rootPrim.LocalID);
|
||||
for (int i = 0; i < childPrims.Count; i++)
|
||||
localIDs.Add(childPrims[i].LocalID);
|
||||
localIDs.AddRange(childPrims.Select(t => t.LocalID));
|
||||
|
||||
// Go through each of the three main permissions and enable or disable them
|
||||
#region Set Linkset Permissions
|
||||
@@ -128,24 +128,16 @@ namespace OpenMetaverse.TestClient
|
||||
int taskItems = 0;
|
||||
foreach (Primitive prim in Objects.Values)
|
||||
{
|
||||
if ((prim.Flags & PrimFlags.InventoryEmpty) == 0)
|
||||
if ((prim.Flags & PrimFlags.InventoryEmpty) != 0) continue;
|
||||
List<InventoryBase> items = Client.Inventory.GetTaskInventory(prim.ID, prim.LocalID, 1000 * 30);
|
||||
|
||||
if (items == null) continue;
|
||||
foreach (var item in items.Where(i => !(i is InventoryFolder)).Cast<InventoryItem>())
|
||||
{
|
||||
List<InventoryBase> items = Client.Inventory.GetTaskInventory(prim.ID, prim.LocalID, 1000 * 30);
|
||||
item.Permissions.NextOwnerMask = Perms;
|
||||
|
||||
if (items != null)
|
||||
{
|
||||
for (int i = 0; i < items.Count; i++)
|
||||
{
|
||||
if (!(items[i] is InventoryFolder))
|
||||
{
|
||||
InventoryItem item = (InventoryItem)items[i];
|
||||
item.Permissions.NextOwnerMask = Perms;
|
||||
|
||||
Client.Inventory.UpdateTaskInventory(prim.LocalID, item);
|
||||
++taskItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
Client.Inventory.UpdateTaskInventory(prim.LocalID, item);
|
||||
++taskItems;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
@@ -114,23 +115,21 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Textures)
|
||||
{
|
||||
for (int i = 0; i < prims.Count; i++)
|
||||
foreach (var prim in prims)
|
||||
{
|
||||
Primitive prim = prims[i];
|
||||
|
||||
if (prim.Textures.DefaultTexture.TextureID != Primitive.TextureEntry.WHITE_TEXTURE &&
|
||||
!Textures.Contains(prim.Textures.DefaultTexture.TextureID))
|
||||
{
|
||||
Textures.Add(prim.Textures.DefaultTexture.TextureID);
|
||||
}
|
||||
|
||||
for (int j = 0; j < prim.Textures.FaceTextures.Length; j++)
|
||||
foreach (var face in prim.Textures.FaceTextures)
|
||||
{
|
||||
if (prim.Textures.FaceTextures[j] != null &&
|
||||
prim.Textures.FaceTextures[j].TextureID != Primitive.TextureEntry.WHITE_TEXTURE &&
|
||||
!Textures.Contains(prim.Textures.FaceTextures[j].TextureID))
|
||||
if (face != null &&
|
||||
face.TextureID != Primitive.TextureEntry.WHITE_TEXTURE &&
|
||||
!Textures.Contains(face.TextureID))
|
||||
{
|
||||
Textures.Add(prim.Textures.FaceTextures[j].TextureID);
|
||||
Textures.Add(face.TextureID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,8 +140,7 @@ namespace OpenMetaverse.TestClient
|
||||
}
|
||||
|
||||
// Create a request list from all of the images
|
||||
for (int i = 0; i < Textures.Count; i++)
|
||||
textureRequests.Add(new ImageRequest(Textures[i], ImageType.Normal, 1013000.0f, 0));
|
||||
textureRequests.AddRange(Textures.Select(t => new ImageRequest(t, ImageType.Normal, 1013000.0f, 0)));
|
||||
}
|
||||
|
||||
// Download all of the textures in the export list
|
||||
|
||||
@@ -68,10 +68,8 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
// Build an organized structure from the imported prims
|
||||
Dictionary<uint, Linkset> linksets = new Dictionary<uint, Linkset>();
|
||||
for (int i = 0; i < prims.Count; i++)
|
||||
foreach (var prim in prims)
|
||||
{
|
||||
Primitive prim = prims[i];
|
||||
|
||||
if (prim.ParentID == 0)
|
||||
{
|
||||
if (linksets.ContainsKey(prim.LocalID))
|
||||
|
||||
@@ -18,13 +18,13 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
int avcount = Client.Network.Simulators[i].ObjectsAvatars.Count;
|
||||
int primcount = Client.Network.Simulators[i].ObjectsPrimitives.Count;
|
||||
int avcount = sim.ObjectsAvatars.Count;
|
||||
int primcount = sim.ObjectsPrimitives.Count;
|
||||
|
||||
Console.WriteLine("{0} (Avatars: {1} Primitives: {2})",
|
||||
Client.Network.Simulators[i].Name, avcount, primcount);
|
||||
sim.Name, avcount, primcount);
|
||||
|
||||
count += avcount;
|
||||
count += primcount;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -22,9 +23,7 @@ namespace OpenMetaverse.TestClient
|
||||
try
|
||||
{
|
||||
// Build the predicat from the args list
|
||||
string predicatPrim = string.Empty;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
predicatPrim += args[i] + " ";
|
||||
string predicatPrim = args.Aggregate(string.Empty, (current, t) => current + (t + " "));
|
||||
predicatPrim = predicatPrim.TrimEnd();
|
||||
|
||||
// Build Regex
|
||||
|
||||
@@ -87,17 +87,13 @@ namespace OpenMetaverse.TestClient
|
||||
if (enabled)
|
||||
{
|
||||
// Search this prim for textures
|
||||
for (int i = 0; i < prim.Textures.FaceTextures.Length; i++)
|
||||
foreach (var face in prim.Textures.FaceTextures)
|
||||
{
|
||||
Primitive.TextureEntryFace face = prim.Textures.FaceTextures[i];
|
||||
|
||||
if (face != null)
|
||||
if (face == null) continue;
|
||||
if (!alreadyRequested.ContainsKey(face.TextureID))
|
||||
{
|
||||
if (!alreadyRequested.ContainsKey(face.TextureID))
|
||||
{
|
||||
alreadyRequested[face.TextureID] = face.TextureID;
|
||||
Client.Assets.RequestImage(face.TextureID, ImageType.Normal, Assets_OnImageReceived);
|
||||
}
|
||||
alreadyRequested[face.TextureID] = face.TextureID;
|
||||
Client.Assets.RequestImage(face.TextureID, ImageType.Normal, Assets_OnImageReceived);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
Simulator sim = Client.Network.Simulators[i];
|
||||
|
||||
output.AppendLine(String.Format(
|
||||
"[{0}] Dilation: {1} InBPS: {2} OutBPS: {3} ResentOut: {4} ResentIn: {5}",
|
||||
sim.ToString(), sim.Stats.Dilation, sim.Stats.IncomingBPS, sim.Stats.OutgoingBPS,
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace OpenMetaverse.TestClient
|
||||
{
|
||||
result.AppendFormat(System.Environment.NewLine + "* {0} Related Commands:" + System.Environment.NewLine, kvp.Key.ToString());
|
||||
int colMax = 0;
|
||||
for (int i = 0; i < kvp.Value.Count; i++)
|
||||
foreach (var val in kvp.Value)
|
||||
{
|
||||
if (colMax >= 120)
|
||||
{
|
||||
@@ -57,7 +57,7 @@ namespace OpenMetaverse.TestClient
|
||||
colMax = 0;
|
||||
}
|
||||
|
||||
result.AppendFormat(" {0,-15}", kvp.Value[i].Name);
|
||||
result.AppendFormat(" {0,-15}", val.Name);
|
||||
colMax += 15;
|
||||
}
|
||||
result.AppendLine();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using OpenMetaverse;
|
||||
@@ -23,9 +24,7 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
public override string Execute(string[] args, UUID fromAgentID)
|
||||
{
|
||||
string masterName = String.Empty;
|
||||
for (int ct = 0; ct < args.Length;ct++)
|
||||
masterName = masterName + args[ct] + " ";
|
||||
string masterName = args.Aggregate(string.Empty, (current, t) => current + t + " ");
|
||||
masterName = masterName.TrimEnd();
|
||||
|
||||
if (masterName.Length == 0)
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace OpenMetaverse.TestClient
|
||||
|
||||
lock (Client.Network.Simulators)
|
||||
{
|
||||
for (int i = 0; i < Client.Network.Simulators.Count; i++)
|
||||
foreach (var sim in Client.Network.Simulators)
|
||||
{
|
||||
Avatar master = Client.Network.Simulators[i].ObjectsAvatars.Find(
|
||||
Avatar master = sim.ObjectsAvatars.Find(
|
||||
avatar => avatar.ID == Client.MasterKey
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user