From 8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 22 Feb 2009 20:52:55 +0000 Subject: Mantis#3218. Thank you kindly, TLaukkan (Tommil) for a patch that: * Added log4net dependency to physxplugin in prebuild.xml. * Added missing m_log fields to classes. * Replaced Console.WriteLine with appropriate m_log.Xxxx * Tested that nant test target runs succesfully. * Tested that local opensim sandbox starts up without errors. --- .../Region/ClientStack/LindenUDP/LLClientView.cs | 66 +++++++++++----------- .../Region/ClientStack/LindenUDP/LLImageManager.cs | 18 +++--- .../ClientStack/LindenUDP/Tests/TestLLUDPServer.cs | 6 +- 3 files changed, 47 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region/ClientStack/LindenUDP') diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c4b025a..e643a0e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1877,7 +1877,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.AgentData.TransactionID = transactionId; bulkUpdate.FolderData = folderDataBlocks.ToArray(); - //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate); + //m_log.Debug("SendBulkUpdateInventory :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); } } @@ -1920,7 +1920,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP items.RemoveAt(items.Count - 1); } - //Console.WriteLine("SendBulkUpdateInventoryRecursive :" + bulkUpdate); + //m_log.Debug("SendBulkUpdateInventoryRecursive :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); folderDataBlocks = new List(); @@ -3101,7 +3101,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP packet.ParamList = returnblock; packet.Header.Reliable = false; - //System.Console.WriteLine("[ESTATE]: SIM--->" + packet.ToString()); + //m_log.Debug("[ESTATE]: SIM--->" + packet.ToString()); OutPacket(packet, ThrottleOutPacketType.Task); } @@ -3895,7 +3895,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// protected bool AgentTextureCached(IClientAPI simclient, Packet packet) { - //Console.WriteLine("texture cached: " + packet.ToString()); + //m_log.Debug("texture cached: " + packet.ToString()); AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); // TODO: don't create new blocks if recycling an old packet @@ -3924,7 +3924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) { MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; - // Console.WriteLine("new multi update packet " + multipleupdate.ToString()); + // m_log.Debug("new multi update packet " + multipleupdate.ToString()); Scene tScene = (Scene)m_scene; for (int i = 0; i < multipleupdate.ObjectData.Length; i++) @@ -3956,7 +3956,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; if (handlerUpdatePrimSinglePosition != null) { - // Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); handlerUpdatePrimSinglePosition(localId, pos1, this); } break; @@ -3966,7 +3966,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { - //Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimSingleRotation(localId, rot1, this); } break; @@ -3976,7 +3976,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { - //Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimSingleRotation(localId, rot2, this); } break; @@ -3988,7 +3988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale1, this); handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; @@ -4026,8 +4026,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; if (handlerUpdatePrimGroupRotation != null) { - //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimGroupRotation(localId, pos3, rot4, this); } break; @@ -4038,12 +4038,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + //m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale2, this); // Change the position based on scale (for bug number 246) handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; - // Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); if (handlerUpdatePrimSinglePosition != null) { handlerUpdatePrimSinglePosition(localId, pos4, this); @@ -4057,7 +4057,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; if (handlerUpdatePrimGroupScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimGroupScale(localId, scale5, this); handlerUpdateVector = OnUpdatePrimGroupPosition; @@ -4074,7 +4074,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale6, this); handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; if (handlerUpdatePrimSinglePosition != null) @@ -4733,7 +4733,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; - //Console.WriteLine("Agent Sends:" + Utils.BytesToString(querydata.Name)); + //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); handlerAvatarPickerRequest = OnAvatarPickerRequest; if (handlerAvatarPickerRequest != null) @@ -5285,7 +5285,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.RequestImage: RequestImagePacket imageRequest = (RequestImagePacket)Pack; - //Console.WriteLine("image request: " + Pack.ToString()); + //m_log.Debug("image request: " + Pack.ToString()); //handlerTextureRequest = null; @@ -5311,10 +5311,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case PacketType.TransferRequest: - //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); + //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); TransferRequestPacket transfer = (TransferRequestPacket)Pack; - //Console.WriteLine("Transfer Request: " + transfer.ToString()); + //m_log.Debug("Transfer Request: " + transfer.ToString()); // Validate inventory transfers // Has to be done here, because AssetCache can't do it // @@ -5409,8 +5409,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.AssetUploadRequest: AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; - // Console.WriteLine("upload request " + request.ToString()); - // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); + // m_log.Debug("upload request " + request.ToString()); + // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); handlerAssetUploadRequest = OnAssetUploadRequest; @@ -5606,7 +5606,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); /*for (int i = 0; i < update.InventoryData.Length; i++) { if (update.InventoryData[i].TransactionID != UUID.Zero) @@ -5614,7 +5614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionId)); if (asset != null) { - // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache"); + // m_log.Debug("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else @@ -5622,12 +5622,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); if (asset != null) { - //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache"); + //m_log.Debug("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else { - //Console.WriteLine("trying to update inventory item, but asset is null"); + //m_log.Debug("trying to update inventory item, but asset is null"); } } } @@ -5778,7 +5778,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.RezScript: - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); RezScriptPacket rezScriptx = (RezScriptPacket)Pack; handlerRezScript = OnRezScript; @@ -5894,7 +5894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.TeleportLocationRequest: TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; - // Console.WriteLine(tpLocReq.ToString()); + // m_log.Debug(tpLocReq.ToString()); handlerTeleportLocationRequest = OnTeleportLocationRequest; if (handlerTeleportLocationRequest != null) @@ -6070,7 +6070,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case PacketType.ParcelObjectOwnersRequest: - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; @@ -6135,7 +6135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.EstateOwnerMessage: EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; - //System.Console.WriteLine(messagePacket.ToString()); + //m_log.Debug(messagePacket.ToString()); switch (Utils.BytesToString(messagePacket.MethodData.Method)) { case "getinfo": @@ -6663,7 +6663,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.MapItemRequest: MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack; - //System.Console.WriteLine(mirpk.ToString()); + //m_log.Debug(mirpk.ToString()); handlerMapItemRequest = OnMapItemRequest; if (handlerMapItemRequest != null) { @@ -6711,7 +6711,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.DirPlacesQuery: DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack; - //Console.WriteLine(dirPlacesQueryPacket.ToString()); + //m_log.Debug(dirPlacesQueryPacket.ToString()); handlerDirPlacesQuery = OnDirPlacesQuery; if (handlerDirPlacesQuery != null) @@ -7674,7 +7674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAsset(AssetRequestToClient req) { - //Console.WriteLine("sending asset " + req.RequestAssetID); + //m_log.Debug("sending asset " + req.RequestAssetID); TransferInfoPacket Transfer = new TransferInfoPacket(); Transfer.TransferInfo.ChannelType = 2; Transfer.TransferInfo.Status = 0; @@ -8161,7 +8161,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP mrdata.Name = Utils.StringToBytes(replies[i].name); mirplk.Data[i] = mrdata; } - //System.Console.WriteLine(mirplk.ToString()); + //m_log.Debug(mirplk.ToString()); OutPacket(mirplk, ThrottleOutPacketType.Task); } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 23ed798..0fb27d4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs @@ -32,6 +32,8 @@ using OpenMetaverse; using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; +using log4net; +using System.Reflection; namespace OpenSim.Region.ClientStack.LindenUDP { @@ -41,6 +43,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public class LLImageManager { + /// /// Priority Queue for images. Contains lots of data /// @@ -114,7 +117,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_shuttingdown) return; - //Console.WriteLine("AssetCallback for assetId" + assetID); + //m_log.Debug("AssetCallback for assetId" + assetID); if (asset == null || asset.Data == null) { @@ -249,7 +252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } // uncomment the following line to see the upper most asset and the priority - //Console.WriteLine(process.ToString()); + //m_log.Debug(process.ToString()); // Lower priority to give the next image a chance to bubble up pq[h] -= 50000; @@ -359,6 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public class J2KImage { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private AssetBase m_asset_ref = null; public volatile int LastPacketNum = 0; public volatile int DiscardLimit = 0; @@ -550,7 +554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } catch (Exception) { - Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(), firstImageData.Length, FIRST_IMAGE_PACKET_SIZE)); + m_log.Error(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(), firstImageData.Length, FIRST_IMAGE_PACKET_SIZE)); //m_log.Error("Texture data copy failed on first packet for " + m_asset_ref.FullID.ToString()); //m_cancel = true; @@ -569,8 +573,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP //if (imagePacketSize > 0) // imagePacketSize = IMAGE_PACKET_SIZE; //if (imagePacketSize != 1000) - // Console.WriteLine("ENdPacket"); - //Console.WriteLine(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize)); + // m_log.Debug("ENdPacket"); + //m_log.Debug(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize)); bool atEnd = false; @@ -591,9 +595,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } catch (Exception e) { - Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), + m_log.Error(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), imageData.Length, imagePacketSize, CurrentPacket, StopPacket, TexturePacketCount())); - Console.WriteLine(e.ToString()); + m_log.Error(e.ToString()); //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); //m_cancel = true; //m_sending = false; diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs index 53506d3..9c231b5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs @@ -57,8 +57,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) { numBytes = 0; - - //System.Console.WriteLine("Queue size " + m_chunksToLoad.Count); + + //m_log.Debug("Queue size " + m_chunksToLoad.Count); if (m_chunksToLoad.Count <= 0) return false; @@ -150,4 +150,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests Sender = sender; } } -} \ No newline at end of file +} -- cgit v1.1