diff options
author | Jeff Ames | 2008-02-05 19:44:27 +0000 |
---|---|---|
committer | Jeff Ames | 2008-02-05 19:44:27 +0000 |
commit | 6ed5283bc06a62f38eb517e67b975832b603bf61 (patch) | |
tree | e5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/ClientStack | |
parent | Cut down on the number of packets sent during terraforming. Terraforming shou... (diff) | |
download | opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2 opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz |
Converted logging to use log4net.
Changed LogBase to ConsoleBase, which handles console I/O.
This is mostly an in-place conversion, so lots of refactoring can still be done.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 86 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketQueue.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/RegionApplicationBase.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/UDPServer.cs | 30 |
4 files changed, 75 insertions, 70 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 5fdb9b3..10bf0d1 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -51,6 +51,8 @@ namespace OpenSim.Region.ClientStack | |||
51 | /// </summary> | 51 | /// </summary> |
52 | public class ClientView : IClientAPI | 52 | public class ClientView : IClientAPI |
53 | { | 53 | { |
54 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
55 | |||
54 | /* static variables */ | 56 | /* static variables */ |
55 | public static TerrainManager TerrainManager; | 57 | public static TerrainManager TerrainManager; |
56 | 58 | ||
@@ -196,7 +198,7 @@ namespace OpenSim.Region.ClientStack | |||
196 | // m_inventoryCache = inventoryCache; | 198 | // m_inventoryCache = inventoryCache; |
197 | m_authenticateSessionsHandler = authenSessions; | 199 | m_authenticateSessionsHandler = authenSessions; |
198 | 200 | ||
199 | MainLog.Instance.Verbose("CLIENT", "Started up new client thread to handle incoming request"); | 201 | m_log.Info("[CLIENT]: Started up new client thread to handle incoming request"); |
200 | 202 | ||
201 | m_agentId = agentId; | 203 | m_agentId = agentId; |
202 | m_sessionId = sessionId; | 204 | m_sessionId = sessionId; |
@@ -260,7 +262,7 @@ namespace OpenSim.Region.ClientStack | |||
260 | public void Close(bool ShutdownCircult) | 262 | public void Close(bool ShutdownCircult) |
261 | { | 263 | { |
262 | // Pull Client out of Region | 264 | // Pull Client out of Region |
263 | MainLog.Instance.Verbose("CLIENT", "Close has been called"); | 265 | m_log.Info("[CLIENT]: Close has been called"); |
264 | 266 | ||
265 | //raiseevent on the packet server to Shutdown the circuit | 267 | //raiseevent on the packet server to Shutdown the circuit |
266 | if (ShutdownCircult) | 268 | if (ShutdownCircult) |
@@ -286,7 +288,7 @@ namespace OpenSim.Region.ClientStack | |||
286 | 288 | ||
287 | public void Stop() | 289 | public void Stop() |
288 | { | 290 | { |
289 | MainLog.Instance.Verbose("BUG", "Stop called, please find out where and remove it"); | 291 | m_log.Info("[BUG]: Stop called, please find out where and remove it"); |
290 | } | 292 | } |
291 | 293 | ||
292 | #endregion | 294 | #endregion |
@@ -378,7 +380,7 @@ namespace OpenSim.Region.ClientStack | |||
378 | 380 | ||
379 | protected virtual void ClientLoop() | 381 | protected virtual void ClientLoop() |
380 | { | 382 | { |
381 | MainLog.Instance.Verbose("CLIENT", "Entered loop"); | 383 | m_log.Info("[CLIENT]: Entered loop"); |
382 | while (true) | 384 | while (true) |
383 | { | 385 | { |
384 | QueItem nextPacket = m_packetQueue.Dequeue(); | 386 | QueItem nextPacket = m_packetQueue.Dequeue(); |
@@ -445,7 +447,7 @@ namespace OpenSim.Region.ClientStack | |||
445 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); | 447 | m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); |
446 | m_clientPingTimer.Enabled = true; | 448 | m_clientPingTimer.Enabled = true; |
447 | 449 | ||
448 | MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene"); | 450 | m_log.Info("[CLIENT]: Adding viewer agent to scene"); |
449 | m_scene.AddNewClient(this, true); | 451 | m_scene.AddNewClient(this, true); |
450 | } | 452 | } |
451 | 453 | ||
@@ -458,13 +460,13 @@ namespace OpenSim.Region.ClientStack | |||
458 | if (!sessionInfo.Authorised) | 460 | if (!sessionInfo.Authorised) |
459 | { | 461 | { |
460 | //session/circuit not authorised | 462 | //session/circuit not authorised |
461 | MainLog.Instance.Notice("CLIENT", "New user request denied to " + m_userEndPoint.ToString()); | 463 | m_log.Info("[CLIENT]: New user request denied to " + m_userEndPoint.ToString()); |
462 | m_packetQueue.Close(); | 464 | m_packetQueue.Close(); |
463 | m_clientThread.Abort(); | 465 | m_clientThread.Abort(); |
464 | } | 466 | } |
465 | else | 467 | else |
466 | { | 468 | { |
467 | MainLog.Instance.Notice("CLIENT", "Got authenticated connection from " + m_userEndPoint.ToString()); | 469 | m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString()); |
468 | //session is authorised | 470 | //session is authorised |
469 | m_firstName = sessionInfo.LoginInfo.First; | 471 | m_firstName = sessionInfo.LoginInfo.First; |
470 | m_lastName = sessionInfo.LoginInfo.Last; | 472 | m_lastName = sessionInfo.LoginInfo.Last; |
@@ -731,7 +733,7 @@ namespace OpenSim.Region.ClientStack | |||
731 | } | 733 | } |
732 | catch (Exception e) | 734 | catch (Exception e) |
733 | { | 735 | { |
734 | MainLog.Instance.Warn("client", | 736 | m_log.Warn("[client]: " + |
735 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); | 737 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); |
736 | } | 738 | } |
737 | } | 739 | } |
@@ -758,7 +760,7 @@ namespace OpenSim.Region.ClientStack | |||
758 | } | 760 | } |
759 | catch (Exception e) | 761 | catch (Exception e) |
760 | { | 762 | { |
761 | MainLog.Instance.Warn("client", | 763 | m_log.Warn("[client]: " + |
762 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); | 764 | "ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString()); |
763 | } | 765 | } |
764 | } | 766 | } |
@@ -2102,7 +2104,7 @@ namespace OpenSim.Region.ClientStack | |||
2102 | 2104 | ||
2103 | protected virtual bool Logout(IClientAPI client, Packet packet) | 2105 | protected virtual bool Logout(IClientAPI client, Packet packet) |
2104 | { | 2106 | { |
2105 | MainLog.Instance.Verbose("CLIENT", "Got a logout request"); | 2107 | m_log.Info("[CLIENT]: Got a logout request"); |
2106 | 2108 | ||
2107 | if (OnLogout != null) | 2109 | if (OnLogout != null) |
2108 | { | 2110 | { |
@@ -2431,10 +2433,10 @@ namespace OpenSim.Region.ClientStack | |||
2431 | } | 2433 | } |
2432 | catch (Exception e) | 2434 | catch (Exception e) |
2433 | { | 2435 | { |
2434 | MainLog.Instance.Warn("client", | 2436 | m_log.Warn("[client]: " + |
2435 | "ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + | 2437 | "ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + |
2436 | m_userEndPoint.ToString() + " - killing thread"); | 2438 | m_userEndPoint.ToString() + " - killing thread"); |
2437 | MainLog.Instance.Error(e.ToString()); | 2439 | m_log.Error(e.ToString()); |
2438 | Close(true); | 2440 | Close(true); |
2439 | } | 2441 | } |
2440 | } | 2442 | } |
@@ -2545,7 +2547,7 @@ namespace OpenSim.Region.ClientStack | |||
2545 | { | 2547 | { |
2546 | if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) | 2548 | if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) |
2547 | { | 2549 | { |
2548 | MainLog.Instance.Verbose("NETWORK", "Resending " + packet.Type.ToString() + " packet, " + | 2550 | m_log.Info("[NETWORK]: Resending " + packet.Type.ToString() + " packet, " + |
2549 | (now - packet.TickCount) + "ms have passed"); | 2551 | (now - packet.TickCount) + "ms have passed"); |
2550 | 2552 | ||
2551 | packet.Header.Resent = true; | 2553 | packet.Header.Resent = true; |
@@ -2564,11 +2566,11 @@ namespace OpenSim.Region.ClientStack | |||
2564 | if (m_pendingAcks.Count > 250) | 2566 | if (m_pendingAcks.Count > 250) |
2565 | { | 2567 | { |
2566 | // FIXME: Handle the odd case where we have too many pending ACKs queued up | 2568 | // FIXME: Handle the odd case where we have too many pending ACKs queued up |
2567 | MainLog.Instance.Verbose("NETWORK", "Too many ACKs queued up!"); | 2569 | m_log.Info("[NETWORK]: Too many ACKs queued up!"); |
2568 | return; | 2570 | return; |
2569 | } | 2571 | } |
2570 | 2572 | ||
2571 | //MainLog.Instance.Verbose("NETWORK", "Sending PacketAck"); | 2573 | //m_log.Info("[NETWORK]: Sending PacketAck"); |
2572 | 2574 | ||
2573 | int i = 0; | 2575 | int i = 0; |
2574 | PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); | 2576 | PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); |
@@ -2754,7 +2756,7 @@ namespace OpenSim.Region.ClientStack | |||
2754 | //rezPacket.RezData.RemoveItem; | 2756 | //rezPacket.RezData.RemoveItem; |
2755 | //rezPacket.RezData.RezSelected; | 2757 | //rezPacket.RezData.RezSelected; |
2756 | //rezPacket.RezData.FromTaskID; | 2758 | //rezPacket.RezData.FromTaskID; |
2757 | //MainLog.Instance.Verbose("REZData", rezPacket.ToString()); | 2759 | //m_log.Info("[REZData]: " + rezPacket.ToString()); |
2758 | OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, | 2760 | OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, |
2759 | rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, | 2761 | rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, |
2760 | rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, | 2762 | rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, |
@@ -2772,7 +2774,7 @@ namespace OpenSim.Region.ClientStack | |||
2772 | break; | 2774 | break; |
2773 | case PacketType.ModifyLand: | 2775 | case PacketType.ModifyLand: |
2774 | ModifyLandPacket modify = (ModifyLandPacket)Pack; | 2776 | ModifyLandPacket modify = (ModifyLandPacket)Pack; |
2775 | //MainLog.Instance.Verbose("LAND", "LAND:" + modify.ToString()); | 2777 | //m_log.Info("[LAND]: LAND:" + modify.ToString()); |
2776 | if (modify.ParcelData.Length > 0) | 2778 | if (modify.ParcelData.Length > 0) |
2777 | { | 2779 | { |
2778 | if (OnModifyTerrain != null) | 2780 | if (OnModifyTerrain != null) |
@@ -2941,7 +2943,7 @@ namespace OpenSim.Region.ClientStack | |||
2941 | { | 2943 | { |
2942 | ObjectAddPacket addPacket = (ObjectAddPacket)Pack; | 2944 | ObjectAddPacket addPacket = (ObjectAddPacket)Pack; |
2943 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); | 2945 | PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); |
2944 | // MainLog.Instance.Verbose("REZData", addPacket.ToString()); | 2946 | // m_log.Info("[REZData]: " + addPacket.ToString()); |
2945 | //BypassRaycast: 1 | 2947 | //BypassRaycast: 1 |
2946 | //RayStart: <69.79469, 158.2652, 98.40343> | 2948 | //RayStart: <69.79469, 158.2652, 98.40343> |
2947 | //RayEnd: <61.97724, 141.995, 92.58341> | 2949 | //RayEnd: <61.97724, 141.995, 92.58341> |
@@ -3068,7 +3070,7 @@ namespace OpenSim.Region.ClientStack | |||
3068 | } | 3070 | } |
3069 | break; | 3071 | break; |
3070 | case PacketType.ObjectPermissions: | 3072 | case PacketType.ObjectPermissions: |
3071 | MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString()); | 3073 | m_log.Warn("[CLIENT]: unhandled packet " + PacketType.ObjectPermissions.ToString()); |
3072 | ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; | 3074 | ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; |
3073 | 3075 | ||
3074 | List<ObjectPermissionsPacket.ObjectDataBlock> permChanges = | 3076 | List<ObjectPermissionsPacket.ObjectDataBlock> permChanges = |
@@ -3344,7 +3346,7 @@ namespace OpenSim.Region.ClientStack | |||
3344 | } | 3346 | } |
3345 | break; | 3347 | break; |
3346 | case PacketType.MoveTaskInventory: | 3348 | case PacketType.MoveTaskInventory: |
3347 | MainLog.Instance.Warn("CLIENT", "unhandled MoveTaskInventory packet"); | 3349 | m_log.Warn("[CLIENT]: unhandled MoveTaskInventory packet"); |
3348 | break; | 3350 | break; |
3349 | case PacketType.RezScript: | 3351 | case PacketType.RezScript: |
3350 | //Console.WriteLine(Pack.ToString()); | 3352 | //Console.WriteLine(Pack.ToString()); |
@@ -3594,7 +3596,7 @@ namespace OpenSim.Region.ClientStack | |||
3594 | 3596 | ||
3595 | break; | 3597 | break; |
3596 | case PacketType.GodKickUser: | 3598 | case PacketType.GodKickUser: |
3597 | MainLog.Instance.Warn("CLIENT", "unhandled GodKickUser packet"); | 3599 | m_log.Warn("[CLIENT]: unhandled GodKickUser packet"); |
3598 | 3600 | ||
3599 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; | 3601 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; |
3600 | 3602 | ||
@@ -3624,88 +3626,88 @@ namespace OpenSim.Region.ClientStack | |||
3624 | // Send the client the ping response back | 3626 | // Send the client the ping response back |
3625 | // Pass the same PingID in the matching packet | 3627 | // Pass the same PingID in the matching packet |
3626 | // Handled In the packet processing | 3628 | // Handled In the packet processing |
3627 | //MainLog.Instance.Debug("CLIENT", "possibly unhandled StartPingCheck packet"); | 3629 | //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet"); |
3628 | break; | 3630 | break; |
3629 | case PacketType.CompletePingCheck: | 3631 | case PacketType.CompletePingCheck: |
3630 | // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client | 3632 | // TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client |
3631 | //MainLog.Instance.Warn("CLIENT", "unhandled CompletePingCheck packet"); | 3633 | //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet"); |
3632 | break; | 3634 | break; |
3633 | case PacketType.ObjectScale: | 3635 | case PacketType.ObjectScale: |
3634 | // TODO: handle this packet | 3636 | // TODO: handle this packet |
3635 | MainLog.Instance.Warn("CLIENT", "unhandled ObjectScale packet"); | 3637 | m_log.Warn("[CLIENT]: unhandled ObjectScale packet"); |
3636 | break; | 3638 | break; |
3637 | case PacketType.ViewerStats: | 3639 | case PacketType.ViewerStats: |
3638 | // TODO: handle this packet | 3640 | // TODO: handle this packet |
3639 | MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet"); | 3641 | m_log.Warn("[CLIENT]: unhandled ViewerStats packet"); |
3640 | break; | 3642 | break; |
3641 | 3643 | ||
3642 | case PacketType.CreateGroupRequest: | 3644 | case PacketType.CreateGroupRequest: |
3643 | // TODO: handle this packet | 3645 | // TODO: handle this packet |
3644 | MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet"); | 3646 | m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet"); |
3645 | break; | 3647 | break; |
3646 | case PacketType.GenericMessage: | 3648 | case PacketType.GenericMessage: |
3647 | // TODO: handle this packet | 3649 | // TODO: handle this packet |
3648 | MainLog.Instance.Warn("CLIENT", "unhandled GenericMessage packet"); | 3650 | m_log.Warn("[CLIENT]: unhandled GenericMessage packet"); |
3649 | break; | 3651 | break; |
3650 | case PacketType.MapItemRequest: | 3652 | case PacketType.MapItemRequest: |
3651 | // TODO: handle this packet | 3653 | // TODO: handle this packet |
3652 | MainLog.Instance.Warn("CLIENT", "unhandled MapItemRequest packet"); | 3654 | m_log.Warn("[CLIENT]: unhandled MapItemRequest packet"); |
3653 | break; | 3655 | break; |
3654 | case PacketType.AgentResume: | 3656 | case PacketType.AgentResume: |
3655 | // TODO: handle this packet | 3657 | // TODO: handle this packet |
3656 | MainLog.Instance.Warn("CLIENT", "unhandled AgentResume packet"); | 3658 | m_log.Warn("[CLIENT]: unhandled AgentResume packet"); |
3657 | break; | 3659 | break; |
3658 | case PacketType.AgentPause: | 3660 | case PacketType.AgentPause: |
3659 | // TODO: handle this packet | 3661 | // TODO: handle this packet |
3660 | MainLog.Instance.Warn("CLIENT", "unhandled AgentPause packet"); | 3662 | m_log.Warn("[CLIENT]: unhandled AgentPause packet"); |
3661 | break; | 3663 | break; |
3662 | case PacketType.TransferAbort: | 3664 | case PacketType.TransferAbort: |
3663 | // TODO: handle this packet | 3665 | // TODO: handle this packet |
3664 | MainLog.Instance.Warn("CLIENT", "unhandled TransferAbort packet"); | 3666 | m_log.Warn("[CLIENT]: unhandled TransferAbort packet"); |
3665 | break; | 3667 | break; |
3666 | case PacketType.MuteListRequest: | 3668 | case PacketType.MuteListRequest: |
3667 | // TODO: handle this packet | 3669 | // TODO: handle this packet |
3668 | MainLog.Instance.Warn("CLIENT", "unhandled MuteListRequest packet"); | 3670 | m_log.Warn("[CLIENT]: unhandled MuteListRequest packet"); |
3669 | break; | 3671 | break; |
3670 | case PacketType.AgentDataUpdateRequest: | 3672 | case PacketType.AgentDataUpdateRequest: |
3671 | // TODO: handle this packet | 3673 | // TODO: handle this packet |
3672 | MainLog.Instance.Warn("CLIENT", "unhandled AgentDataUpdateRequest packet"); | 3674 | m_log.Warn("[CLIENT]: unhandled AgentDataUpdateRequest packet"); |
3673 | break; | 3675 | break; |
3674 | 3676 | ||
3675 | case PacketType.ParcelDwellRequest: | 3677 | case PacketType.ParcelDwellRequest: |
3676 | // TODO: handle this packet | 3678 | // TODO: handle this packet |
3677 | MainLog.Instance.Warn("CLIENT", "unhandled ParcelDwellRequest packet"); | 3679 | m_log.Warn("[CLIENT]: unhandled ParcelDwellRequest packet"); |
3678 | break; | 3680 | break; |
3679 | case PacketType.UseCircuitCode: | 3681 | case PacketType.UseCircuitCode: |
3680 | // TODO: handle this packet | 3682 | // TODO: handle this packet |
3681 | //MainLog.Instance.Warn("CLIENT", "unhandled UseCircuitCode packet"); | 3683 | //m_log.Warn("[CLIENT]: unhandled UseCircuitCode packet"); |
3682 | break; | 3684 | break; |
3683 | case PacketType.EconomyDataRequest: | 3685 | case PacketType.EconomyDataRequest: |
3684 | // TODO: handle this packet | 3686 | // TODO: handle this packet |
3685 | MainLog.Instance.Warn("CLIENT", "unhandled EconomyDataRequest packet"); | 3687 | m_log.Warn("[CLIENT]: unhandled EconomyDataRequest packet"); |
3686 | break; | 3688 | break; |
3687 | case PacketType.AgentHeightWidth: | 3689 | case PacketType.AgentHeightWidth: |
3688 | // TODO: handle this packet | 3690 | // TODO: handle this packet |
3689 | MainLog.Instance.Warn("CLIENT", "unhandled AgentHeightWidth packet"); | 3691 | m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet"); |
3690 | break; | 3692 | break; |
3691 | case PacketType.ObjectSpinStop: | 3693 | case PacketType.ObjectSpinStop: |
3692 | // TODO: handle this packet | 3694 | // TODO: handle this packet |
3693 | MainLog.Instance.Warn("CLIENT", "unhandled ObjectSpinStop packet"); | 3695 | m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet"); |
3694 | break; | 3696 | break; |
3695 | case PacketType.SoundTrigger: | 3697 | case PacketType.SoundTrigger: |
3696 | // TODO: handle this packet | 3698 | // TODO: handle this packet |
3697 | MainLog.Instance.Warn("CLIENT", "unhandled SoundTrigger packet"); | 3699 | m_log.Warn("[CLIENT]: unhandled SoundTrigger packet"); |
3698 | break; | 3700 | break; |
3699 | case PacketType.UserInfoRequest: | 3701 | case PacketType.UserInfoRequest: |
3700 | // TODO: handle this packet | 3702 | // TODO: handle this packet |
3701 | MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet"); | 3703 | m_log.Warn("[CLIENT]: unhandled UserInfoRequest packet"); |
3702 | break; | 3704 | break; |
3703 | case PacketType.InventoryDescendents: | 3705 | case PacketType.InventoryDescendents: |
3704 | // TODO: handle this packet | 3706 | // TODO: handle this packet |
3705 | MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet"); | 3707 | m_log.Warn("[CLIENT]: unhandled InventoryDescent packet"); |
3706 | break; | 3708 | break; |
3707 | default: | 3709 | default: |
3708 | MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); | 3710 | m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString()); |
3709 | break; | 3711 | break; |
3710 | 3712 | ||
3711 | #endregion | 3713 | #endregion |
diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs index 685f91b..8b2a93a 100644 --- a/OpenSim/Region/ClientStack/PacketQueue.cs +++ b/OpenSim/Region/ClientStack/PacketQueue.cs | |||
@@ -37,6 +37,8 @@ namespace OpenSim.Region.ClientStack | |||
37 | { | 37 | { |
38 | public class PacketQueue | 38 | public class PacketQueue |
39 | { | 39 | { |
40 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
41 | |||
40 | private bool m_enabled = true; | 42 | private bool m_enabled = true; |
41 | 43 | ||
42 | private BlockingQueue<QueItem> SendQueue; | 44 | private BlockingQueue<QueItem> SendQueue; |
@@ -204,7 +206,7 @@ namespace OpenSim.Region.ClientStack | |||
204 | SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue()); | 206 | SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue()); |
205 | } | 207 | } |
206 | } | 208 | } |
207 | // MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets"); | 209 | // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets"); |
208 | } | 210 | } |
209 | } | 211 | } |
210 | 212 | ||
@@ -253,7 +255,7 @@ namespace OpenSim.Region.ClientStack | |||
253 | lock (this) | 255 | lock (this) |
254 | { | 256 | { |
255 | ResetCounters(); | 257 | ResetCounters(); |
256 | // MainLog.Instance.Verbose("THROTTLE", "Entering Throttle"); | 258 | // m_log.Info("[THROTTLE]: Entering Throttle"); |
257 | while (TotalThrottle.UnderLimit() && PacketsWaiting() && | 259 | while (TotalThrottle.UnderLimit() && PacketsWaiting() && |
258 | (throttleLoops <= MaxThrottleLoops)) | 260 | (throttleLoops <= MaxThrottleLoops)) |
259 | { | 261 | { |
@@ -316,7 +318,7 @@ namespace OpenSim.Region.ClientStack | |||
316 | AssetThrottle.Add(qpack.Packet.ToBytes().Length); | 318 | AssetThrottle.Add(qpack.Packet.ToBytes().Length); |
317 | } | 319 | } |
318 | } | 320 | } |
319 | // MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets"); | 321 | // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets"); |
320 | } | 322 | } |
321 | } | 323 | } |
322 | 324 | ||
@@ -426,7 +428,7 @@ namespace OpenSim.Region.ClientStack | |||
426 | 428 | ||
427 | tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset; | 429 | tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset; |
428 | /* | 430 | /* |
429 | MainLog.Instance.Verbose("CLIENT", "Client AgentThrottle - Got throttle:resendbytes=" + tResend + | 431 | m_log.Info("[CLIENT]: Client AgentThrottle - Got throttle:resendbytes=" + tResend + |
430 | " landbytes=" + tLand + | 432 | " landbytes=" + tLand + |
431 | " windbytes=" + tWind + | 433 | " windbytes=" + tWind + |
432 | " cloudbytes=" + tCloud + | 434 | " cloudbytes=" + tCloud + |
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 72917d1..8a042b1 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs | |||
@@ -42,6 +42,8 @@ namespace OpenSim.Region.ClientStack | |||
42 | { | 42 | { |
43 | public abstract class RegionApplicationBase : BaseOpenSimServer | 43 | public abstract class RegionApplicationBase : BaseOpenSimServer |
44 | { | 44 | { |
45 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
45 | protected AssetCache m_assetCache; | 47 | protected AssetCache m_assetCache; |
46 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); | 48 | protected Dictionary<EndPoint, uint> m_clientCircuits = new Dictionary<EndPoint, uint>(); |
47 | protected NetworkServersInfo m_networkServersInfo; | 49 | protected NetworkServersInfo m_networkServersInfo; |
@@ -75,19 +77,20 @@ namespace OpenSim.Region.ClientStack | |||
75 | 77 | ||
76 | m_httpServer = new BaseHttpServer(m_httpServerPort); | 78 | m_httpServer = new BaseHttpServer(m_httpServerPort); |
77 | 79 | ||
78 | m_log.Status("REGION", "Starting HTTP server"); | 80 | m_log.Info("[REGION]: Starting HTTP server"); |
81 | |||
79 | m_httpServer.Start(); | 82 | m_httpServer.Start(); |
80 | } | 83 | } |
81 | 84 | ||
82 | protected abstract void Initialize(); | 85 | protected abstract void Initialize(); |
83 | 86 | ||
84 | protected void StartLog() | 87 | protected void StartConsole() |
85 | { | 88 | { |
86 | m_log = CreateLog(); | 89 | m_console = CreateConsole(); |
87 | MainLog.Instance = m_log; | 90 | MainConsole.Instance = m_console; |
88 | } | 91 | } |
89 | 92 | ||
90 | protected abstract LogBase CreateLog(); | 93 | protected abstract ConsoleBase CreateConsole(); |
91 | protected abstract PhysicsScene GetPhysicsScene(); | 94 | protected abstract PhysicsScene GetPhysicsScene(); |
92 | protected abstract StorageManager CreateStorageManager(string connectionstring); | 95 | protected abstract StorageManager CreateStorageManager(string connectionstring); |
93 | 96 | ||
@@ -107,7 +110,7 @@ namespace OpenSim.Region.ClientStack | |||
107 | // listenIP = IPAddress.Parse("0.0.0.0"); | 110 | // listenIP = IPAddress.Parse("0.0.0.0"); |
108 | 111 | ||
109 | uint port = (uint) regionInfo.InternalEndPoint.Port; | 112 | uint port = (uint) regionInfo.InternalEndPoint.Port; |
110 | udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, m_log, circuitManager); | 113 | udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, circuitManager); |
111 | regionInfo.InternalEndPoint.Port = (int)port; | 114 | regionInfo.InternalEndPoint.Port = (int)port; |
112 | 115 | ||
113 | Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); | 116 | Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); |
@@ -136,12 +139,12 @@ namespace OpenSim.Region.ClientStack | |||
136 | 139 | ||
137 | if (masterAvatar != null) | 140 | if (masterAvatar != null) |
138 | { | 141 | { |
139 | m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToString() + "]"); | 142 | m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.UUID.ToString() + "]"); |
140 | scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; | 143 | scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID; |
141 | } | 144 | } |
142 | else | 145 | else |
143 | { | 146 | { |
144 | m_log.Verbose("PARCEL", "No master avatar found, using null."); | 147 | m_log.Info("[PARCEL]: No master avatar found, using null."); |
145 | scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero; | 148 | scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero; |
146 | } | 149 | } |
147 | 150 | ||
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 3e2b536..f9918ff 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs | |||
@@ -39,6 +39,8 @@ namespace OpenSim.Region.ClientStack | |||
39 | { | 39 | { |
40 | public class UDPServer : ClientStackNetworkHandler | 40 | public class UDPServer : ClientStackNetworkHandler |
41 | { | 41 | { |
42 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | ||
43 | |||
42 | protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); | 44 | protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>(); |
43 | public Dictionary<uint, EndPoint> clientCircuits_reverse = new Dictionary<uint, EndPoint>(); | 45 | public Dictionary<uint, EndPoint> clientCircuits_reverse = new Dictionary<uint, EndPoint>(); |
44 | public Socket Server; | 46 | public Socket Server; |
@@ -56,7 +58,6 @@ namespace OpenSim.Region.ClientStack | |||
56 | protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); | 58 | protected IPAddress listenIP = IPAddress.Parse("0.0.0.0"); |
57 | protected IScene m_localScene; | 59 | protected IScene m_localScene; |
58 | protected AssetCache m_assetCache; | 60 | protected AssetCache m_assetCache; |
59 | protected LogBase m_log; | ||
60 | protected AgentCircuitManager m_authenticateSessionsClass; | 61 | protected AgentCircuitManager m_authenticateSessionsClass; |
61 | 62 | ||
62 | public PacketServer PacketServer | 63 | public PacketServer PacketServer |
@@ -84,13 +85,12 @@ namespace OpenSim.Region.ClientStack | |||
84 | { | 85 | { |
85 | } | 86 | } |
86 | 87 | ||
87 | public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass) | 88 | public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager authenticateClass) |
88 | { | 89 | { |
89 | listenIP = _listenIP; | 90 | listenIP = _listenIP; |
90 | listenPort = port; | 91 | listenPort = port; |
91 | Allow_Alternate_Port = allow_alternate_port; | 92 | Allow_Alternate_Port = allow_alternate_port; |
92 | m_assetCache = assetCache; | 93 | m_assetCache = assetCache; |
93 | m_log = console; | ||
94 | m_authenticateSessionsClass = authenticateClass; | 94 | m_authenticateSessionsClass = authenticateClass; |
95 | CreatePacketServer(); | 95 | CreatePacketServer(); |
96 | 96 | ||
@@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack | |||
121 | { | 121 | { |
122 | // TODO : Actually only handle those states that we have control over, re-throw everything else, | 122 | // TODO : Actually only handle those states that we have control over, re-throw everything else, |
123 | // TODO: implement cases as we encounter them. | 123 | // TODO: implement cases as we encounter them. |
124 | //m_log.Error("UDPSERVER", "Connection Error! - " + e.ToString()); | 124 | //m_log.Error("[UDPSERVER]: Connection Error! - " + e.ToString()); |
125 | switch (e.SocketErrorCode) | 125 | switch (e.SocketErrorCode) |
126 | { | 126 | { |
127 | case SocketError.AlreadyInProgress: | 127 | case SocketError.AlreadyInProgress: |
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack | |||
134 | } | 134 | } |
135 | catch (Exception a) | 135 | catch (Exception a) |
136 | { | 136 | { |
137 | MainLog.Instance.Verbose("UDPSERVER", a.ToString()); | 137 | m_log.Info("[UDPSERVER]: " + a.ToString()); |
138 | } | 138 | } |
139 | try | 139 | try |
140 | { | 140 | { |
@@ -159,7 +159,7 @@ namespace OpenSim.Region.ClientStack | |||
159 | } | 159 | } |
160 | catch (Exception) | 160 | catch (Exception) |
161 | { | 161 | { |
162 | //MainLog.Instance.Verbose("UDPSERVER", a.ToString()); | 162 | //m_log.Info("[UDPSERVER]" + a.ToString()); |
163 | } | 163 | } |
164 | try | 164 | try |
165 | { | 165 | { |
@@ -191,8 +191,7 @@ namespace OpenSim.Region.ClientStack | |||
191 | } | 191 | } |
192 | catch (ObjectDisposedException) | 192 | catch (ObjectDisposedException) |
193 | { | 193 | { |
194 | 194 | //m_log.Debug("[UDPSERVER]: " + e.ToString()); | |
195 | //MainLog.Instance.Debug("UDPSERVER", e.ToString()); | ||
196 | return; | 195 | return; |
197 | } | 196 | } |
198 | 197 | ||
@@ -214,20 +213,20 @@ namespace OpenSim.Region.ClientStack | |||
214 | if (clientCircuits.TryGetValue(epSender, out circuit)) | 213 | if (clientCircuits.TryGetValue(epSender, out circuit)) |
215 | { | 214 | { |
216 | //if so then send packet to the packetserver | 215 | //if so then send packet to the packetserver |
217 | //MainLog.Instance.Warn("UDPSERVER", "ALREADY HAVE Circuit!"); | 216 | //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!"); |
218 | m_packetServer.InPacket(circuit, packet); | 217 | m_packetServer.InPacket(circuit, packet); |
219 | } | 218 | } |
220 | else if (packet.Type == PacketType.UseCircuitCode) | 219 | else if (packet.Type == PacketType.UseCircuitCode) |
221 | { | 220 | { |
222 | // new client | 221 | // new client |
223 | MainLog.Instance.Debug("UDPSERVER", "Adding New Client"); | 222 | m_log.Debug("[UDPSERVER]: Adding New Client"); |
224 | AddNewClient(packet); | 223 | AddNewClient(packet); |
225 | } | 224 | } |
226 | else | 225 | else |
227 | { | 226 | { |
228 | // invalid client | 227 | // invalid client |
229 | //CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now | 228 | //CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now |
230 | //m_log.Warn("UDPSERVER", "Got a packet from an invalid client - " + packet.ToString()); | 229 | //m_log.Warn("[UDPSERVER]: Got a packet from an invalid client - " + packet.ToString()); |
231 | 230 | ||
232 | } | 231 | } |
233 | } | 232 | } |
@@ -255,12 +254,11 @@ namespace OpenSim.Region.ClientStack | |||
255 | 254 | ||
256 | public void ServerListener() | 255 | public void ServerListener() |
257 | { | 256 | { |
258 | |||
259 | uint newPort = listenPort; | 257 | uint newPort = listenPort; |
260 | for (uint i = 0; i < 20; i++) | 258 | for (uint i = 0; i < 20; i++) |
261 | { | 259 | { |
262 | newPort = listenPort + i; | 260 | newPort = listenPort + i; |
263 | m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString()); | 261 | m_log.Info("[SERVER]: Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString()); |
264 | try | 262 | try |
265 | { | 263 | { |
266 | ServerIncoming = new IPEndPoint(listenIP, (int) newPort); | 264 | ServerIncoming = new IPEndPoint(listenIP, (int) newPort); |
@@ -276,19 +274,19 @@ namespace OpenSim.Region.ClientStack | |||
276 | throw (ex); | 274 | throw (ex); |
277 | 275 | ||
278 | // We are looking for alternate ports! | 276 | // We are looking for alternate ports! |
279 | m_log.Verbose("SERVER", "UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next."); | 277 | m_log.Info("[SERVER]: UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next."); |
280 | } | 278 | } |
281 | System.Threading.Thread.Sleep(100); // Wait before we retry socket | 279 | System.Threading.Thread.Sleep(100); // Wait before we retry socket |
282 | } | 280 | } |
283 | 281 | ||
284 | m_log.Verbose("SERVER", "UDP socket bound, getting ready to listen"); | 282 | m_log.Info("[SERVER]: UDP socket bound, getting ready to listen"); |
285 | 283 | ||
286 | ipeSender = new IPEndPoint(listenIP, 0); | 284 | ipeSender = new IPEndPoint(listenIP, 0); |
287 | epSender = (EndPoint) ipeSender; | 285 | epSender = (EndPoint) ipeSender; |
288 | ReceivedData = new AsyncCallback(OnReceivedData); | 286 | ReceivedData = new AsyncCallback(OnReceivedData); |
289 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); | 287 | Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); |
290 | 288 | ||
291 | m_log.Status("SERVER", "Listening on port " + newPort); | 289 | m_log.Info("[SERVER]: Listening on port " + newPort); |
292 | } | 290 | } |
293 | 291 | ||
294 | public virtual void RegisterPacketServer(PacketServer server) | 292 | public virtual void RegisterPacketServer(PacketServer server) |