diff --git a/OpenMetaverse/AgentThrottle.cs b/OpenMetaverse/AgentThrottle.cs index 79d990d7..3e29c983 100644 --- a/OpenMetaverse/AgentThrottle.cs +++ b/OpenMetaverse/AgentThrottle.cs @@ -35,7 +35,7 @@ namespace OpenMetaverse /// public class AgentThrottle { - /// Maximum bytes per second for resending unacknowledged packets + /// Maximum bits per second for resending unacknowledged packets public float Resend { get { return resend; } @@ -46,7 +46,7 @@ namespace OpenMetaverse else resend = value; } } - /// Maximum bytes per second for LayerData terrain + /// Maximum bits per second for LayerData terrain public float Land { get { return land; } @@ -57,7 +57,7 @@ namespace OpenMetaverse else land = value; } } - /// Maximum bytes per second for LayerData wind data + /// Maximum bits per second for LayerData wind data public float Wind { get { return wind; } @@ -68,7 +68,7 @@ namespace OpenMetaverse else wind = value; } } - /// Maximum bytes per second for LayerData clouds + /// Maximum bits per second for LayerData clouds public float Cloud { get { return cloud; } @@ -90,7 +90,7 @@ namespace OpenMetaverse else task = value; } } - /// Maximum bytes per second for textures + /// Maximum bits per second for textures public float Texture { get { return texture; } @@ -101,7 +101,7 @@ namespace OpenMetaverse else texture = value; } } - /// Maximum bytes per second for downloaded assets + /// Maximum bits per second for downloaded assets public float Asset { get { return asset; } @@ -113,7 +113,7 @@ namespace OpenMetaverse } } - /// Maximum bytes per second the entire connection, divided up + /// Maximum bits per second the entire connection, divided up /// between invidiual streams using default multipliers public float Total { diff --git a/Programs/Simian/Extensions/ParcelManager.cs b/Programs/Simian/Extensions/ParcelManager.cs index 29601a23..e31dcc82 100644 --- a/Programs/Simian/Extensions/ParcelManager.cs +++ b/Programs/Simian/Extensions/ParcelManager.cs @@ -11,7 +11,7 @@ namespace Simian.Extensions Simian server; Dictionary parcels = new Dictionary(); /// X,Y ordered 2D array of the parcelIDs for each sq. meter of a simulator - int[] parcelOverlay = new int[256 * 256]; + int[] parcelOverlay = new int[64 * 64]; public ParcelManager(Simian server) { @@ -70,7 +70,7 @@ namespace Simian.Extensions byte tempByte = 0; // The flags for the current 4x4m parcel square Parcel parcel; - if (parcels.TryGetValue(parcelOverlay[y * 4 * 64 + x * 4], out parcel)) + if (parcels.TryGetValue(parcelOverlay[y * 64 + x], out parcel)) { // Set the ownership/sale flag if (parcel.OwnerID == agent.AgentID) @@ -89,13 +89,13 @@ namespace Simian.Extensions // Set the border flags if (x == 0) tempByte |= (byte)ParcelOverlayType.BorderWest; - else if (parcelOverlay[y * 4 * 64 + (x - 1) * 4] != parcel.LocalID) + else if (parcelOverlay[y * 64 + (x - 1)] != parcel.LocalID) // Parcel to the west is different from the current parcel tempByte |= (byte)ParcelOverlayType.BorderWest; if (y == 0) tempByte |= (byte)ParcelOverlayType.BorderSouth; - else if (parcelOverlay[(y - 1) * 4 * 64 + x * 4] != parcel.LocalID) + else if (parcelOverlay[(y - 1) * 64 + x] != parcel.LocalID) // Parcel to the south is different from the current parcel tempByte |= (byte)ParcelOverlayType.BorderSouth; @@ -115,7 +115,7 @@ namespace Simian.Extensions } else { - Logger.Log("Parcel overlay references missing parcel " + parcelOverlay[y * 4 * 64 + x * 4], + Logger.Log("Parcel overlay references missing parcel " + parcelOverlay[y * 64 + x], Helpers.LogLevel.Warning); } } @@ -130,17 +130,20 @@ namespace Simian.Extensions int maxY = 0; int area = 0; - for (int y = 0; y < 256; y++) + for (int y = 0; y < 64; y++) { - for (int x = 0; x < 256; x++) + for (int x = 0; x < 64; x++) { - if (parcelOverlay[y * 256 + x] == parcel.LocalID) + if (parcelOverlay[y * 64 + x] == parcel.LocalID) { - if (minX > x) minX = x; - if (minY > y) minY = y; - if (maxX < x) maxX = x; - if (maxX < y) maxY = y; - area += 1; + int x4 = x * 4; + int y4 = y * 4; + + if (minX > x4) minX = x4; + if (minY > y4) minY = y4; + if (maxX < x4) maxX = x4; + if (maxX < y4) maxY = y4; + area += 16; } } } @@ -229,10 +232,10 @@ namespace Simian.Extensions List parcels = new List(); // Convert the boundaries to integers - int north = (int)Math.Round(request.ParcelData.North); - int east = (int)Math.Round(request.ParcelData.East); - int south = (int)Math.Round(request.ParcelData.South); - int west = (int)Math.Round(request.ParcelData.West); + int north = (int)Math.Round(request.ParcelData.North) / 4; + int east = (int)Math.Round(request.ParcelData.East) / 4; + int south = (int)Math.Round(request.ParcelData.South) / 4; + int west = (int)Math.Round(request.ParcelData.West) / 4; // Find all of the parcels within the given boundaries int xLen = east - west; @@ -242,9 +245,9 @@ namespace Simian.Extensions { for (int y = 0; y < yLen; y++) { - if (west + x < 256 && south + y < 256) + if (west + x < 64 && south + y < 64) { - int currentParcelID = parcelOverlay[(south + y) * 256 + (west + x)]; + int currentParcelID = parcelOverlay[(south + y) * 64 + (west + x)]; if (!parcels.Contains(currentParcelID)) parcels.Add(currentParcelID); }