cosmetics

0.9.1.1
UbitUmarov 2019-11-08 17:43:22 +00:00
parent ca4bb8c492
commit 4b5a3308ad
1 changed files with 44 additions and 23 deletions

View File

@ -1254,9 +1254,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
++pos;
int count = 0;
foreach (string val in message)
for(int indx = 0; indx < message.Count; ++indx)
{
tmp = Util.StringToBytes256(val);
tmp = Util.StringToBytes256(message[indx]);
len = tmp.Length;
if (pos + len >= LLUDPServer.MAXPAYLOAD)
@ -1325,9 +1325,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int countpos = pos;
++pos;
byte[] val;
int count = 0;
foreach (byte[] val in message)
for (int indx = 0; indx < message.Count; ++indx)
{
val = message[indx];
len = val.Length;
if(len > 255)
len = 255;
@ -2036,8 +2038,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// check if we will need sizes block and get them aside
int count = 0;
ushort ut;
foreach (MapBlockData md in mapBlocks)
MapBlockData md;
for (int indx = 0; indx < mapBlocks.Count; ++indx)
{
md = mapBlocks[indx];
ut = md.SizeX;
sizes[count++] = ut;
if (ut > 256)
@ -2065,8 +2069,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
count = 0;
foreach (MapBlockData md in mapBlocks)
for (int indx = 0; indx < mapBlocks.Count; ++indx)
{
md = mapBlocks[indx];
lastpos = pos;
Utils.UInt16ToBytes(md.X, data, pos); pos += 2;
@ -2633,9 +2638,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
List<InventoryFolderBase> subFolders = contents.Folders;
foreach (InventoryFolderBase subFolder in subFolders)
for (int indx = 0; indx < subFolders.Count; ++indx)
{
SendBulkUpdateInventoryFolderRecursive(subFolder, ref folderDataBlocks, transactionId);
SendBulkUpdateInventoryFolderRecursive(subFolders[indx], ref folderDataBlocks, transactionId);
}
}
@ -4043,8 +4048,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
else
{
LLSDxmlEncode.AddArray("GroupData", sb);
foreach (GroupMembershipData m in data)
GroupMembershipData m;
for (int indx = 0; indx < data.Length; ++indx)
{
m = data[indx];
LLSDxmlEncode.AddMap(sb);
LLSDxmlEncode.AddElem("GroupPowers", m.GroupPowers, sb);
LLSDxmlEncode.AddElem("GroupTitle", m.GroupTitle, sb);
@ -4075,7 +4082,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// use UDP if no caps
AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[data.Length];
for (int i = 0; i < data.Length; i++)
for (int i = 0; i < data.Length; ++i)
{
AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
Group.AcceptNotices = data[i].AcceptNotices;
@ -4506,30 +4513,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
List<int> withobjects = new List<int>(animations.Length);
List<int> noobjects = new List<int>(animations.Length);
for (int i = 0; i < animations.Length; ++i)
for (int indx = 0; indx < animations.Length; ++indx)
{
if (objectIDs[i] == sourceAgentId || objectIDs[i] == UUID.Zero)
noobjects.Add(i);
if (objectIDs[indx] == sourceAgentId || objectIDs[indx] == UUID.Zero)
noobjects.Add(indx);
else
withobjects.Add(i);
withobjects.Add(indx);
}
int i;
// first the ones with corresponding objects
foreach (int i in withobjects)
for (int indx = 0; indx < withobjects.Count; ++indx)
{
i = withobjects[indx];
animations[i].ToBytes(data, pos); pos += 16;
Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4;
}
// then the rest
foreach (int i in noobjects)
for (int indx = 0; indx < noobjects.Count; ++indx)
{
i = noobjects[indx];
animations[i].ToBytes(data, pos); pos += 16;
Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4;
}
// object ids block
data[pos++] = (byte)withobjects.Count;
foreach (int i in withobjects)
for (int indx = 0; indx < withobjects.Count; ++indx)
{
i = withobjects[indx];
objectIDs[i].ToBytes(data, pos); pos += 16;
}
}
@ -4931,9 +4942,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// doesn't seem to be attached, skip
List<SceneObjectGroup> atts = sp.GetAttachments();
bool found = false;
foreach (SceneObjectGroup att in atts)
for (int indx = 0; indx < atts.Count; ++indx)
{
if (att == grp)
if (atts[indx] == grp)
{
found = true;
break;
@ -5141,8 +5152,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int lastzc = 0;
int count = 0;
foreach (EntityUpdate eu in objectUpdates)
EntityUpdate eu;
for(int indx = 0; indx < objectUpdates.Count;++indx)
{
eu = objectUpdates[indx];
lastpos = zc.Position;
lastzc = zc.ZeroCount;
if (eu.Entity is ScenePresence)
@ -5301,8 +5314,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int lastzc = 0;
int count = 0;
foreach (EntityUpdate eu in compressedUpdates)
EntityUpdate eu;
for (int indx = 0; indx < compressedUpdates.Count; ++indx)
{
eu = compressedUpdates[indx];
SceneObjectPart sop = (SceneObjectPart)eu.Entity;
if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
continue;
@ -5386,8 +5401,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int pos = 18;
int count = 0;
foreach (EntityUpdate eu in objectUpdateProbes)
EntityUpdate eu;
for (int indx = 0; indx < objectUpdateProbes.Count; ++indx)
{
eu = objectUpdateProbes[indx];
SceneObjectPart sop = (SceneObjectPart)eu.Entity;
if (sop.ParentGroup == null || sop.ParentGroup.IsDeleted)
continue;
@ -5448,8 +5465,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
int lastpos = 0;
int count = 0;
foreach (EntityUpdate eu in terseUpdates)
EntityUpdate eu;
for (int indx = 0; indx < terseUpdates.Count; ++indx)
{
eu = terseUpdates[indx];
lastpos = pos;
CreateImprovedTerseBlock(eu.Entity, buf.Data, ref pos, (eu.Flags & PrimUpdateFlags.Textures) != 0);
if (pos < LLUDPServer.MAXPAYLOAD)
@ -5497,8 +5516,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (ObjectAnimationUpdates != null)
{
foreach (SceneObjectPart sop in ObjectAnimationUpdates)
SceneObjectPart sop;
for (int indx = 0; indx < ObjectAnimationUpdates.Count; ++indx)
{
sop = ObjectAnimationUpdates[indx];
if (sop.Animations == null)
continue;