Formatting cleanup.

This commit is contained in:
Jeff Ames
2008-08-18 00:39:10 +00:00
parent 531f6c01eb
commit 6ef9d4da90
208 changed files with 2980 additions and 3163 deletions

View File

@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private RegionHandleRequest handlerRegionHandleRequest = null; // OnRegionHandleRequest
private ParcelInfoRequest handlerParcelInfoRequest = null; // OnParcelInfoRequest
private ScriptAnswer handlerScriptAnswer = null;
private RequestPayPrice handlerRequestPayPrice = null;
private ObjectDeselect handlerObjectDetach = null;
@@ -366,7 +366,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public LLClientView(EndPoint remoteEP, IScene scene, AssetCache assetCache, LLPacketServer packServer,
AgentCircuitManager authenSessions, LLUUID agentId, LLUUID sessionId, uint circuitCode, EndPoint proxyEP)
{
{
m_moneyBalance = 1000;
m_channelVersion = Helpers.StringToField(scene.GetSimulatorVersion());
@@ -378,7 +378,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_networkServer = packServer;
// m_inventoryCache = inventoryCache;
m_authenticateSessionsHandler = authenSessions;
m_authenticateSessionsHandler = authenSessions;
m_agentId = agentId;
m_sessionId = sessionId;
@@ -404,8 +404,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_clientThread.IsBackground = true;
m_clientThread.Start();
ThreadTracker.Add(m_clientThread);
m_log.Info("[CLIENT]: Started up new thread to handle client UDP session");
m_log.Info("[CLIENT]: Started up new thread to handle client UDP session");
}
public void SetDebug(int newDebug)
@@ -457,9 +457,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void Close(bool shutdownCircuit)
{
m_log.DebugFormat(
"[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}",
"[CLIENT]: Close has been called with shutdownCircuit = {0} on scene {1}",
shutdownCircuit, m_scene.RegionInfo.RegionName);
m_PacketHandler.Flush();
// raise an event on the packet server to Shutdown the circuit
@@ -639,7 +639,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
# endregion
protected int m_terrainCheckerCount = 0;
/// <summary>
/// Event handler for check client timer
/// Checks to ensure that the client is still connected. If the client has failed to respond to many pings
@@ -652,15 +652,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (m_PacketHandler.PacketsReceived == m_PacketHandler.PacketsReceivedReported)
{
m_probesWithNoIngressPackets++;
if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked)
if ((m_probesWithNoIngressPackets > 30 && !m_clientBlocked)
|| (m_probesWithNoIngressPackets > 90 && m_clientBlocked))
{
if (OnConnectionClosed != null)
{
m_log.WarnFormat(
"[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection",
"[CLIENT]: Client for agent {0} {1} has stopped responding to pings. Closing connection",
Name, AgentId);
OnConnectionClosed(this);
}
}
@@ -694,7 +694,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_clientPingTimer = new Timer(5000);
m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
m_clientPingTimer.Enabled = true;
m_scene.AddNewClient(this, true);
}
@@ -764,7 +764,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LLQueItem item = new LLQueItem();
item.Packet = packet;
m_PacketHandler.ProcessOutPacket(item);
// There may be a better way to do this. Perhaps kick? Not sure this propogates notifications to
@@ -1091,7 +1091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
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
// see http://opensimulator.org/mantis/view.php?id=1662
//for (int x = 0; x < 16; x += 4)
//{
// SendLayerPacket(map, y, x);
@@ -1113,7 +1113,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
/// </summary>
/// <param name="map">heightmap</param>
/// <param name="map">heightmap</param>
/// <param name="px">X coordinate for patches 0..12</param>
/// <param name="py">Y coordinate for patches 0..15</param>
// private void SendLayerPacket(float[] map, int y, int x)
@@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
LayerDataPacket layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
layerpack.Header.Zerocoded = true;
OutPacket(layerpack, ThrottleOutPacketType.Land);
}
catch (Exception e)
@@ -1157,7 +1157,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
/// <summary>
/// Tell the client that the given neighbour region is ready to receive a child agent.
/// Tell the client that the given neighbour region is ready to receive a child agent.
/// </summary>
/// <param name="neighbourHandle"></param>
/// <param name="neighbourIP"></param>
@@ -3405,7 +3405,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
/// <summary>
///
///
/// </summary>
/// <param name="client"></param>
/// <returns></returns>
@@ -3682,7 +3682,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary>
/// returns a byte array of the client set throttles Gets multiplied by the multiplier
///
///
/// </summary>
/// <param name="multiplier">non 1 multiplier for subdividing the throttles between individual regions</param>
/// <returns></returns>
@@ -3691,7 +3691,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return m_PacketHandler.PacketQueue.GetThrottlesPacked(multiplier);
}
/// <summary>
/// sets the throttles from values supplied by the client
/// sets the throttles from values supplied by the client
/// </summary>
/// <param name="throttles"></param>
public void SetChildAgentThrottle(byte[] throttles)
@@ -5291,24 +5291,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
case PacketType.RegionHandleRequest:
RegionHandleRequestPacket rhrPack = (RegionHandleRequestPacket)Pack;
handlerRegionHandleRequest = OnRegionHandleRequest;
if (handlerRegionHandleRequest != null)
{
handlerRegionHandleRequest(this, rhrPack.RequestBlock.RegionID);
}
break;
case PacketType.ParcelInfoRequest:
ParcelInfoRequestPacket pirPack = (ParcelInfoRequestPacket)Pack;
handlerParcelInfoRequest = OnParcelInfoRequest;
if (handlerParcelInfoRequest != null)
{
handlerParcelInfoRequest(this, pirPack.Data.ParcelID);
}
break;
case PacketType.ParcelAccessListRequest:
ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack;
@@ -6277,10 +6277,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
#endregion
#region Camera
public void SendSetFollowCamProperties (LLUUID objectID, SortedDictionary<int, float> parameters)
{
SetFollowCamPropertiesPacket packet = (SetFollowCamPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.SetFollowCamProperties);
@@ -6292,7 +6292,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
SetFollowCamPropertiesPacket.CameraPropertyBlock block = new SetFollowCamPropertiesPacket.CameraPropertyBlock();
block.Type = pair.Key;
block.Value = pair.Value;
camPropBlock[idx++] = block;
}
packet.CameraProperty = camPropBlock;
@@ -6314,7 +6314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
reply.ReplyBlock.RegionHandle = handle;
OutPacket(reply, ThrottleOutPacketType.Land);
}
public void SendParcelInfo(RegionInfo info, LandData land, LLUUID parcelID, uint x, uint y)
{
ParcelInfoReplyPacket reply = (ParcelInfoReplyPacket)PacketPool.Instance.GetPacket(PacketType.ParcelInfoReply);
@@ -6325,16 +6325,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
reply.Data.Desc = Helpers.StringToField(land.Description);
reply.Data.ActualArea = land.Area;
reply.Data.BillableArea = land.Area; // TODO: what is this?
// Bit 0: Mature, bit 7: on sale, other bits: no idea
reply.Data.Flags = (byte)(
((land.Flags & (uint)Parcel.ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
((land.Flags & (uint)Parcel.ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
LLVector3 pos = land.UserLocation;
if (pos.Equals(LLVector3.Zero))
{
pos = (land.AABBMax + land.AABBMin) * 0.5f;
pos = (land.AABBMax + land.AABBMin) * 0.5f;
}
reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
@@ -6344,7 +6344,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
reply.Data.Dwell = 0; // TODO: not implemented yet
reply.Data.SalePrice = land.SalePrice;
reply.Data.AuctionID = (int)land.AuctionID;
OutPacket(reply, ThrottleOutPacketType.Land);
}
}

View File

@@ -230,7 +230,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
// Call the load balancer's hook. If this is not active here
// we defer to the sim server this client is actually connected
// to. Packet drop notifies will not be triggered in this
// to. Packet drop notifies will not be triggered in this
// configuration!
//
if ((m_SynchronizeClient != null) && (!m_Client.IsActive))
@@ -282,7 +282,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
}
private void QueuePacket(
Packet packet, ThrottleOutPacketType throttlePacketType,
Object id)
@@ -303,7 +303,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
int now = System.Environment.TickCount;
int lastAck = m_LastAck;
// Unless we have received at least one ack, don't bother resending
// anything. There may not be a client there, don't clog up the
// pipes.
@@ -558,7 +558,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
PruneDupeTracker();
// Check for duplicate packets.. packets that the client is
// Check for duplicate packets.. packets that the client is
// resending because it didn't receive our ack
//
lock (m_DupeTracker)
@@ -677,7 +677,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_Sequence = info.sequence;
}
public void AddImportantPacket(PacketType type)
{
if (m_ImportantPackets.Contains(type))
@@ -693,7 +693,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_ImportantPackets.Remove(type);
}
private void DropResend(Object id)
{
foreach (AckData data in new List<AckData>(m_NeedAck.Values))
@@ -736,7 +736,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (packet.Header.Reliable)
{
m_UnackedBytes += packet.ToBytes().Length;
m_NeedAck[packet.Header.Sequence] = new AckData(packet,
m_NeedAck[packet.Header.Sequence] = new AckData(packet,
item.Identifier);
}
}

View File

@@ -213,7 +213,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
BeginReceive();
if (packet != null)
{
try
@@ -297,11 +297,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_socket.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender,
ReceivedData, null);
// Ter: For some stupid reason ConnectionReset basically kills our async event structure..
// Ter: For some stupid reason ConnectionReset basically kills our async event structure..
// so therefore.. we've got to tell the server to BeginReceiveFrom again.
// This will happen over and over until we've gone through all packets
// This will happen over and over until we've gone through all packets
// sent to and from this particular user.
// Stupid I know..
// Stupid I know..
// but Flusing the buffer would be even more stupid... so, we're stuck with this ugly method.
}
catch (SocketException e)
@@ -329,7 +329,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (!(packet is UseCircuitCodePacket))
return;
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket) packet;
lock (clientCircuits)
{
@@ -424,13 +424,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public virtual void RemoveClientCircuit(uint circuitcode)
{
EndPoint sendto = null;
if (clientCircuits_reverse.Contains(circuitcode))
if (clientCircuits_reverse.Contains(circuitcode))
{
sendto = (EndPoint)clientCircuits_reverse[circuitcode];
clientCircuits_reverse.Remove(circuitcode);
lock (clientCircuits)
lock (clientCircuits)
{
if (sendto != null)
{
@@ -442,7 +442,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
"[UDPSERVER]: endpoint for circuit code {0} in RemoveClientCircuit() was unexpectedly null!", circuitcode);
}
}
lock (proxyCircuits)
lock (proxyCircuits)
{
proxyCircuits.Remove(circuitcode);
}

View File

@@ -74,7 +74,7 @@ namespace OpenSim.Region.ClientStack
public override void Startup()
{
base.Startup();
m_storageManager = CreateStorageManager(m_storageConnectionString, m_estateConnectionString);
m_clientStackManager = CreateClientStackManager();