* Optimized sending of terrain data
* Send terrain data in a spiral pattern instead of a typewriter pattern (placeholder until terrain data becomes part of the interest list management) * Added a debug line when resent packets are being sentprioritization
parent
fdce1be3db
commit
0a6ea33ac8
|
@ -45,7 +45,7 @@ using OpenSim.Region.Framework.Interfaces;
|
|||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Hypergrid;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using Timer=System.Timers.Timer;
|
||||
using Timer = System.Timers.Timer;
|
||||
using AssetLandmark = OpenSim.Framework.AssetLandmark;
|
||||
using Nini.Config;
|
||||
|
||||
|
@ -342,7 +342,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
protected UUID m_activeGroupID;
|
||||
protected string m_activeGroupName = String.Empty;
|
||||
protected ulong m_activeGroupPowers;
|
||||
protected Dictionary<UUID,ulong> m_groupPowers = new Dictionary<UUID, ulong>();
|
||||
protected Dictionary<UUID, ulong> m_groupPowers = new Dictionary<UUID, ulong>();
|
||||
protected int m_terrainCheckerCount;
|
||||
protected uint m_agentFOVCounter;
|
||||
|
||||
|
@ -621,7 +621,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
|
||||
// Sound
|
||||
public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid,UUID ParentId,float Gain, Vector3 Position,UInt64 Handle)
|
||||
public void SoundTrigger(UUID soundId, UUID owerid, UUID Objectid, UUID ParentId, float Gain, Vector3 Position, UInt64 Handle)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -800,32 +800,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
/// <param name="o"></param>
|
||||
private void DoSendLayerData(object o)
|
||||
{
|
||||
float[] map = (float[])o;
|
||||
float[] map = LLHeightFieldMoronize((float[])o);
|
||||
|
||||
try
|
||||
{
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
// For some terrains, sending more than one terrain patch at once results in a libsecondlife exception
|
||||
// see http://opensimulator.org/mantis/view.php?id=1662
|
||||
//for (int x = 0; x < 16; x += 4)
|
||||
//{
|
||||
// SendLayerPacket(map, y, x);
|
||||
// Thread.Sleep(150);
|
||||
//}
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
SendLayerData(x, y, LLHeightFieldMoronize(map));
|
||||
Thread.Sleep(35);
|
||||
}
|
||||
}
|
||||
//for (int y = 0; y < 16; y++)
|
||||
//{
|
||||
// for (int x = 0; x < 16; x++)
|
||||
// {
|
||||
// SendLayerData(x, y, map);
|
||||
// }
|
||||
//}
|
||||
|
||||
// Send LayerData in a spiral pattern. Fun!
|
||||
SendLayerTopRight(map, 0, 0, 15, 15);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[CLIENT]: ClientView.API.cs: SendLayerData() - Failed with exception " + e);
|
||||
m_log.Error("[CLIENT]: SendLayerData() Failed with exception: " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row
|
||||
for (int i = x1; i <= x2; i++)
|
||||
SendLayerData(i, y1, map);
|
||||
|
||||
// Column
|
||||
for (int j = y1 + 1; j <= y2; j++)
|
||||
SendLayerData(x2, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
|
||||
}
|
||||
|
||||
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row in reverse
|
||||
for (int i = x2; i >= x1; i--)
|
||||
SendLayerData(i, y2, map);
|
||||
|
||||
// Column in reverse
|
||||
for (int j = y2 - 1; j >= y1; j--)
|
||||
SendLayerData(x1, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
|
||||
/// </summary>
|
||||
|
@ -854,22 +877,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
try
|
||||
{
|
||||
int[] patches = new int[1];
|
||||
int patchx, patchy;
|
||||
patchx = px;
|
||||
patchy = py;
|
||||
int[] patches = new int[] { py * 16 + px };
|
||||
float[] heightmap = (map.Length == 65536) ?
|
||||
map :
|
||||
LLHeightFieldMoronize(map);
|
||||
|
||||
patches[0] = patchx + 0 + patchy * 16;
|
||||
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(((map.Length==65536)? map : LLHeightFieldMoronize(map)), patches);
|
||||
layerpack.Header.Zerocoded = true;
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
layerpack.Header.Reliable = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[client]: ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
|
||||
m_log.Error("[CLIENT]: SendLayerData() Failed with exception: " + e.Message, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -898,7 +918,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
Array.Copy(map, i * (int)Constants.RegionSize, returnmap, i * 256, 256);
|
||||
}
|
||||
|
||||
|
||||
//Array.Copy(map,0,returnmap,0,(map.Length < 65536)? map.Length : 65536);
|
||||
|
||||
return returnmap;
|
||||
|
@ -1017,7 +1036,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
return agentData;
|
||||
|
||||
agentData.CapsPath = capsModule.GetCapsPath(m_agentId);
|
||||
agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId));
|
||||
agentData.ChildrenCapSeeds = new Dictionary<ulong, string>(capsModule.GetChildrenSeeds(m_agentId));
|
||||
|
||||
return agentData;
|
||||
}
|
||||
|
@ -3100,9 +3119,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
awb.ItemID = wearables[i].ItemID;
|
||||
aw.WearableData[i] = awb;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
|
||||
// awb.ItemID, awb.AssetID, i, Name);
|
||||
// m_log.DebugFormat(
|
||||
// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
|
||||
// awb.ItemID, awb.AssetID, i, Name);
|
||||
}
|
||||
|
||||
OutPacket(aw, ThrottleOutPacketType.Task);
|
||||
|
@ -3817,7 +3836,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public void SendBannedUserList(UUID invoice, EstateBan[] bl, uint estateID)
|
||||
{
|
||||
List<UUID>BannedUsers = new List<UUID>();
|
||||
List<UUID> BannedUsers = new List<UUID>();
|
||||
|
||||
for (int i = 0; i < bl.Length; i++)
|
||||
{
|
||||
|
@ -4448,7 +4467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack;
|
||||
MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack;
|
||||
// validate the agent owns the agentID and sessionID
|
||||
if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId &&
|
||||
money.AgentData.SessionID == sender.SessionId)
|
||||
|
@ -4469,7 +4488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
ParcelBuyPacket parcel = (ParcelBuyPacket) Pack;
|
||||
ParcelBuyPacket parcel = (ParcelBuyPacket)Pack;
|
||||
if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
|
||||
{
|
||||
ParcelBuy handlerParcelBuy = OnParcelBuy;
|
||||
|
@ -4505,7 +4524,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public bool HandleGenericMessage(IClientAPI sender, Packet pack)
|
||||
{
|
||||
GenericMessagePacket gmpack = (GenericMessagePacket) pack;
|
||||
GenericMessagePacket gmpack = (GenericMessagePacket)pack;
|
||||
if (m_genericPacketHandlers.Count == 0) return false;
|
||||
if (gmpack.AgentData.SessionID != SessionId) return false;
|
||||
|
||||
|
@ -4750,7 +4769,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation;
|
||||
if (handlerUpdatePrimSingleRotation != null)
|
||||
{
|
||||
// m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W);
|
||||
// m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W);
|
||||
handlerUpdatePrimSingleRotation(localId, rot1, this);
|
||||
}
|
||||
break;
|
||||
|
@ -4761,8 +4780,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition;
|
||||
if (handlerUpdatePrimSingleRotationPosition != null)
|
||||
{
|
||||
// m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z);
|
||||
// m_log.Info("new mouse rotation is " + rot2.X + " , " + rot2.Y + " , " + rot2.Z + " , " + rot2.W);
|
||||
// m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z);
|
||||
// m_log.Info("new mouse rotation is " + rot2.X + " , " + rot2.Y + " , " + rot2.Z + " , " + rot2.W);
|
||||
handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this);
|
||||
}
|
||||
break;
|
||||
|
@ -4773,7 +4792,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale;
|
||||
if (handlerUpdatePrimScale != null)
|
||||
{
|
||||
// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z);
|
||||
// m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z);
|
||||
handlerUpdatePrimScale(localId, scale4, this);
|
||||
}
|
||||
break;
|
||||
|
@ -4812,7 +4831,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation;
|
||||
if (handlerUpdatePrimRotation != null)
|
||||
{
|
||||
// Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W);
|
||||
// Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W);
|
||||
handlerUpdatePrimRotation(localId, rot3, this);
|
||||
}
|
||||
break;
|
||||
|
@ -4823,8 +4842,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation;
|
||||
if (handlerUpdatePrimGroupRotation != null)
|
||||
{
|
||||
// m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
|
||||
// m_log.Debug("new group mouse rotation is " + rot4.X + " , " + rot4.Y + " , " + rot4.Z + " , " + rot4.W);
|
||||
// m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z);
|
||||
// m_log.Debug("new group mouse rotation is " + rot4.X + " , " + rot4.Y + " , " + rot4.Z + " , " + rot4.W);
|
||||
handlerUpdatePrimGroupRotation(localId, pos3, rot4, this);
|
||||
}
|
||||
break;
|
||||
|
@ -4835,7 +4854,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
|
||||
if (handlerUpdatePrimGroupScale != null)
|
||||
{
|
||||
// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z);
|
||||
// m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z);
|
||||
handlerUpdatePrimGroupScale(localId, scale7, this);
|
||||
}
|
||||
break;
|
||||
|
@ -5067,7 +5086,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// Main packet processing conditional
|
||||
switch (Pack.Type)
|
||||
{
|
||||
#region Scene/Avatar
|
||||
#region Scene/Avatar
|
||||
|
||||
case PacketType.AvatarPropertiesRequest:
|
||||
AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
|
||||
|
@ -5318,7 +5337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
break;
|
||||
|
||||
case PacketType.DeRezObject:
|
||||
DeRezObjectPacket DeRezPacket = (DeRezObjectPacket) Pack;
|
||||
DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)Pack;
|
||||
|
||||
#region Packet Session and User Check
|
||||
if (m_checkPackets)
|
||||
|
@ -5339,12 +5358,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
deRezIDs.Add(data.ObjectLocalID);
|
||||
}
|
||||
// It just so happens that the values on the DeRezAction enumerator match the Destination
|
||||
// values given by a Second Life client
|
||||
handlerDeRezObject(this, deRezIDs,
|
||||
DeRezPacket.AgentBlock.GroupID,
|
||||
(DeRezAction)DeRezPacket.AgentBlock.Destination,
|
||||
DeRezPacket.AgentBlock.DestinationID);
|
||||
// It just so happens that the values on the DeRezAction enumerator match the Destination
|
||||
// values given by a Second Life client
|
||||
handlerDeRezObject(this, deRezIDs,
|
||||
DeRezPacket.AgentBlock.GroupID,
|
||||
(DeRezAction)DeRezPacket.AgentBlock.Destination,
|
||||
DeRezPacket.AgentBlock.DestinationID);
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -5943,9 +5962,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Objects/m_sceneObjects
|
||||
#region Objects/m_sceneObjects
|
||||
|
||||
case PacketType.ObjectLink:
|
||||
ObjectLinkPacket link = (ObjectLinkPacket)Pack;
|
||||
|
@ -6096,7 +6115,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
ObjectExtraParams handlerUpdateExtraParams = OnUpdateExtraParams;
|
||||
if (handlerUpdateExtraParams != null)
|
||||
{
|
||||
for (int i = 0 ; i < extraPar.ObjectData.Length ; i++)
|
||||
for (int i = 0; i < extraPar.ObjectData.Length; i++)
|
||||
{
|
||||
handlerUpdateExtraParams(m_agentId, extraPar.ObjectData[i].ObjectLocalID,
|
||||
extraPar.ObjectData[i].ParamType,
|
||||
|
@ -6739,9 +6758,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Inventory/Asset/Other related packets
|
||||
#region Inventory/Asset/Other related packets
|
||||
|
||||
case PacketType.RequestImage:
|
||||
RequestImagePacket imageRequest = (RequestImagePacket)Pack;
|
||||
|
@ -6770,7 +6789,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
//handlerTextureRequest = OnRequestTexture;
|
||||
|
||||
//if (handlerTextureRequest != null)
|
||||
//OnRequestTexture(this, args);
|
||||
//OnRequestTexture(this, args);
|
||||
|
||||
// in the end, we null this, so we have to check if it's null
|
||||
if (m_imageManager != null)
|
||||
|
@ -6816,7 +6835,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
if (ti.OwnerID != AgentId)
|
||||
break;
|
||||
|
||||
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify| (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
|
||||
if ((ti.CurrentPermissions & ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer)) != ((uint)PermissionMask.Modify | (uint)PermissionMask.Copy | (uint)PermissionMask.Transfer))
|
||||
break;
|
||||
|
||||
if (ti.AssetID != requestID)
|
||||
|
@ -7590,7 +7609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
case PacketType.UUIDNameRequest:
|
||||
UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;
|
||||
|
@ -7605,7 +7624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#region Parcel related packets
|
||||
#region Parcel related packets
|
||||
|
||||
case PacketType.RegionHandleRequest:
|
||||
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
|
||||
|
@ -7986,9 +8005,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Estate Packets
|
||||
#region Estate Packets
|
||||
|
||||
case PacketType.EstateOwnerMessage:
|
||||
EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack;
|
||||
|
@ -8022,21 +8041,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
convertParamStringToBool(messagePacket.ParamList[7].Parameter), convertParamStringToBool(messagePacket.ParamList[8].Parameter));
|
||||
}
|
||||
break;
|
||||
// case "texturebase":
|
||||
// if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
|
||||
// {
|
||||
// foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||
// {
|
||||
// string s = Utils.BytesToString(block.Parameter);
|
||||
// string[] splitField = s.Split(' ');
|
||||
// if (splitField.Length == 2)
|
||||
// {
|
||||
// UUID tempUUID = new UUID(splitField[1]);
|
||||
// OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
// case "texturebase":
|
||||
// if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
|
||||
// {
|
||||
// foreach (EstateOwnerMessagePacket.ParamListBlock block in messagePacket.ParamList)
|
||||
// {
|
||||
// string s = Utils.BytesToString(block.Parameter);
|
||||
// string[] splitField = s.Split(' ');
|
||||
// if (splitField.Length == 2)
|
||||
// {
|
||||
// UUID tempUUID = new UUID(splitField[1]);
|
||||
// OnSetEstateTerrainBaseTexture(this, Convert.ToInt16(splitField[0]), tempUUID);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// break;
|
||||
case "texturedetail":
|
||||
if (((Scene)m_scene).Permissions.CanIssueEstateCommand(AgentId, false))
|
||||
{
|
||||
|
@ -8318,9 +8337,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region GodPackets
|
||||
#region GodPackets
|
||||
|
||||
case PacketType.RequestGodlikePowers:
|
||||
RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack;
|
||||
|
@ -8366,9 +8385,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
//OutPacket(kupack, ThrottleOutPacketType.Task);
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Economy/Transaction Packets
|
||||
#region Economy/Transaction Packets
|
||||
|
||||
case PacketType.MoneyBalanceRequest:
|
||||
MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack;
|
||||
|
@ -8468,9 +8487,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Script Packets
|
||||
#region Script Packets
|
||||
|
||||
case PacketType.GetScriptRunning:
|
||||
GetScriptRunningPacket scriptRunning = (GetScriptRunningPacket)Pack;
|
||||
|
@ -8520,9 +8539,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Gesture Managment
|
||||
#region Gesture Managment
|
||||
|
||||
case PacketType.ActivateGestures:
|
||||
ActivateGesturesPacket activateGesturePacket = (ActivateGesturesPacket)Pack;
|
||||
|
@ -8589,7 +8608,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
case PacketType.AgentFOV:
|
||||
AgentFOVPacket fovPacket = (AgentFOVPacket)Pack;
|
||||
|
@ -8605,7 +8624,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
}
|
||||
break;
|
||||
|
||||
#region unimplemented handlers
|
||||
#region unimplemented handlers
|
||||
|
||||
case PacketType.ViewerStats:
|
||||
// TODO: handle this packet
|
||||
|
@ -8628,8 +8647,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
MapItemRequest handlerMapItemRequest = OnMapItemRequest;
|
||||
if (handlerMapItemRequest != null)
|
||||
{
|
||||
handlerMapItemRequest(this,mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
|
||||
mirpk.AgentData.Godlike,mirpk.RequestData.ItemType,
|
||||
handlerMapItemRequest(this, mirpk.AgentData.Flags, mirpk.AgentData.EstateID,
|
||||
mirpk.AgentData.Godlike, mirpk.RequestData.ItemType,
|
||||
mirpk.RequestData.RegionHandle);
|
||||
|
||||
}
|
||||
|
@ -9037,7 +9056,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
groupMembersRequestPacket.GroupData.RequestID;
|
||||
groupMembersReply.GroupData.MemberCount = memberCount;
|
||||
|
||||
for (int i = 0 ; i < blockCount ; i++)
|
||||
for (int i = 0; i < blockCount; i++)
|
||||
{
|
||||
GroupMembersData m = members[0];
|
||||
members.RemoveAt(0);
|
||||
|
@ -9174,7 +9193,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
groupRoleMembersReply.MemberData =
|
||||
new GroupRoleMembersReplyPacket.MemberDataBlock[pairs];
|
||||
|
||||
for (int i = 0 ; i < pairs ; i++)
|
||||
for (int i = 0; i < pairs; i++)
|
||||
{
|
||||
GroupRoleMembersData d = mappings[0];
|
||||
mappings.RemoveAt(0);
|
||||
|
@ -9301,7 +9320,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
ParcelDeedToGroup handlerParcelDeedToGroup = OnParcelDeedToGroup;
|
||||
if (handlerParcelDeedToGroup != null)
|
||||
{
|
||||
handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID,this);
|
||||
handlerParcelDeedToGroup(parcelDeedToGroup.Data.LocalID, parcelDeedToGroup.Data.GroupID, this);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -9870,7 +9889,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
m_log.Warn("[CLIENT]: unhandled packet " + Pack);
|
||||
break;
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
PacketPool.Instance.ReturnPacket(Pack);
|
||||
|
@ -9935,7 +9954,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
ParcelMediaCommandMessagePacket commandMessagePacket = new ParcelMediaCommandMessagePacket();
|
||||
commandMessagePacket.CommandBlock.Flags = flags;
|
||||
commandMessagePacket.CommandBlock.Command =(uint) command;
|
||||
commandMessagePacket.CommandBlock.Command = (uint)command;
|
||||
commandMessagePacket.CommandBlock.Time = time;
|
||||
|
||||
OutPacket(commandMessagePacket, ThrottleOutPacketType.Unknown);
|
||||
|
@ -9963,7 +9982,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
#region Camera
|
||||
|
||||
public void SendSetFollowCamProperties (UUID objectID, SortedDictionary<int, float> parameters)
|
||||
public void SendSetFollowCamProperties(UUID objectID, SortedDictionary<int, float> parameters)
|
||||
{
|
||||
SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties);
|
||||
packet.ObjectData.ObjectID = objectID;
|
||||
|
@ -9981,7 +10000,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendClearFollowCamProperties (UUID objectID)
|
||||
public void SendClearFollowCamProperties(UUID objectID)
|
||||
{
|
||||
ClearFollowCamPropertiesPacket packet = (ClearFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ClearFollowCamProperties);
|
||||
packet.ObjectData.ObjectID = objectID;
|
||||
|
@ -10381,7 +10400,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
#endregion
|
||||
|
||||
#region LookupItem
|
||||
private struct LookupItem {
|
||||
private struct LookupItem
|
||||
{
|
||||
internal MinHeap<MinHeapItem> Heap;
|
||||
internal IHandle Handle;
|
||||
}
|
||||
|
|
|
@ -372,23 +372,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
public void ResendUnacked(LLUDPClient udpClient)
|
||||
{
|
||||
if (udpClient.IsConnected && udpClient.NeedAcks.Count > 0)
|
||||
if (!udpClient.IsConnected)
|
||||
return;
|
||||
|
||||
// Disconnect an agent if no packets are received for some time
|
||||
//FIXME: Make 60 an .ini setting
|
||||
if (Environment.TickCount - udpClient.TickLastPacketReceived > 1000 * 60)
|
||||
{
|
||||
// Disconnect an agent if no packets are received for some time
|
||||
//FIXME: Make 60 an .ini setting
|
||||
if (Environment.TickCount - udpClient.TickLastPacketReceived > 1000 * 60)
|
||||
{
|
||||
m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
|
||||
m_log.Warn("[LLUDPSERVER]: Ack timeout, disconnecting " + udpClient.AgentID);
|
||||
|
||||
RemoveClient(udpClient);
|
||||
return;
|
||||
}
|
||||
RemoveClient(udpClient);
|
||||
return;
|
||||
}
|
||||
|
||||
if (udpClient.NeedAcks.Count > 0)
|
||||
{
|
||||
// Get a list of all of the packets that have been sitting unacked longer than udpClient.RTO
|
||||
List<OutgoingPacket> expiredPackets = udpClient.NeedAcks.GetExpiredPackets(udpClient.RTO);
|
||||
|
||||
if (expiredPackets != null)
|
||||
{
|
||||
m_log.Debug("[LLUDPSERVER]: Resending " + expiredPackets.Count + " packets to " + udpClient.AgentID);
|
||||
|
||||
// Resend packets
|
||||
for (int i = 0; i < expiredPackets.Count; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue