aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/Local
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Region/Communications/Local
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC-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/Communications/Local')
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs23
-rw-r--r--OpenSim/Region/Communications/Local/LocalLoginService.cs12
2 files changed, 20 insertions, 15 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 25452c1..98419ab 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Region.Communications.Local
36{ 36{
37 public class LocalBackEndServices : IGridServices, IInterRegionCommunications 37 public class LocalBackEndServices : IGridServices, IInterRegionCommunications
38 { 38 {
39 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
40
39 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>(); 41 protected Dictionary<ulong, RegionInfo> m_regions = new Dictionary<ulong, RegionInfo>();
40 42
41 protected Dictionary<ulong, RegionCommsListener> m_regionListeners = 43 protected Dictionary<ulong, RegionCommsListener> m_regionListeners =
@@ -93,8 +95,9 @@ namespace OpenSim.Region.Communications.Local
93 RegionCommsListener regionHost = new RegionCommsListener(); 95 RegionCommsListener regionHost = new RegionCommsListener();
94 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle)) 96 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
95 { 97 {
96 MainLog.Instance.Error("INTERREGION", 98 m_log.Error("[INTERREGION]: " +
97 "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up."); 99 "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. " +
100 "In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
98 m_regionListeners.Remove(regionInfo.RegionHandle); 101 m_regionListeners.Remove(regionInfo.RegionHandle);
99 } 102 }
100 m_regionListeners.Add(regionInfo.RegionHandle, regionHost); 103 m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
@@ -105,7 +108,7 @@ namespace OpenSim.Region.Communications.Local
105 { 108 {
106 // Already in our list, so the region went dead and restarted. 109 // Already in our list, so the region went dead and restarted.
107 m_regions.Remove(regionInfo.RegionHandle); 110 m_regions.Remove(regionInfo.RegionHandle);
108 MainLog.Instance.Warn("INTERREGION", "Region registered twice. Region went down and came back up."); 111 m_log.Warn("[INTERREGION]: Region registered twice. Region went down and came back up.");
109 112
110 RegionCommsListener regionHost = new RegionCommsListener(); 113 RegionCommsListener regionHost = new RegionCommsListener();
111 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle)) 114 if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
@@ -229,7 +232,7 @@ namespace OpenSim.Region.Communications.Local
229 { 232 {
230 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 233 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
231 m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData); 234 m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData);
232 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); 235 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
233 236
234 return true; 237 return true;
235 } 238 }
@@ -292,13 +295,13 @@ namespace OpenSim.Region.Communications.Local
292 //should change from agentCircuitData 295 //should change from agentCircuitData
293 { 296 {
294 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent"); 297 //Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
295 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname); 298 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname);
296 299
297 if (m_regionListeners.ContainsKey(regionHandle)) 300 if (m_regionListeners.ContainsKey(regionHandle))
298 { 301 {
299 // Console.WriteLine("CommsManager- Informing a region to expect child agent"); 302 // Console.WriteLine("CommsManager- Informing a region to expect child agent");
300 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData); 303 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
301 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname); 304 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
302 305
303 return true; 306 return true;
304 } 307 }
@@ -389,11 +392,11 @@ namespace OpenSim.Region.Communications.Local
389 392
390 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent) 393 public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
391 { 394 {
392 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname); 395 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
393 396
394 if (m_regionListeners.ContainsKey(regionHandle)) 397 if (m_regionListeners.ContainsKey(regionHandle))
395 { 398 {
396 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname); 399 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
397 400
398 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent); 401 m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
399 } 402 }
@@ -443,11 +446,11 @@ namespace OpenSim.Region.Communications.Local
443 446
444 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) 447 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
445 { 448 {
446 // MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname); 449 // m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname);
447 450
448 if (m_regionListeners.ContainsKey(regionHandle)) 451 if (m_regionListeners.ContainsKey(regionHandle))
449 { 452 {
450 //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname); 453 //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname);
451 454
452 TriggerExpectUser(regionHandle, agentData); 455 TriggerExpectUser(regionHandle, agentData);
453 return true; 456 return true;
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 2848b8a..f6dd379 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Region.Communications.Local
44 44
45 public class LocalLoginService : LoginService 45 public class LocalLoginService : LoginService
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
47 private CommunicationsLocal m_Parent; 49 private CommunicationsLocal m_Parent;
48 50
49 private NetworkServersInfo serversInfo; 51 private NetworkServersInfo serversInfo;
@@ -77,7 +79,7 @@ namespace OpenSim.Region.Communications.Local
77 if (!authUsers) 79 if (!authUsers)
78 { 80 {
79 //no current user account so make one 81 //no current user account so make one
80 MainLog.Instance.Notice("LOGIN", "No user account found so creating a new one."); 82 m_log.Info("[LOGIN]: No user account found so creating a new one.");
81 83
82 m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); 84 m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
83 85
@@ -97,14 +99,14 @@ namespace OpenSim.Region.Communications.Local
97 if (!authUsers) 99 if (!authUsers)
98 { 100 {
99 //for now we will accept any password in sandbox mode 101 //for now we will accept any password in sandbox mode
100 MainLog.Instance.Notice("LOGIN", "Authorising user (no actual password check)"); 102 m_log.Info("[LOGIN]: Authorising user (no actual password check)");
101 103
102 return true; 104 return true;
103 } 105 }
104 else 106 else
105 { 107 {
106 MainLog.Instance.Notice( 108 m_log.Info(
107 "LOGIN", "Authenticating " + profile.username + " " + profile.surname); 109 "[LOGIN]: Authenticating " + profile.username + " " + profile.surname);
108 110
109 if (!password.StartsWith("$1$")) 111 if (!password.StartsWith("$1$"))
110 password = "$1$" + Util.Md5Hash(password); 112 password = "$1$" + Util.Md5Hash(password);
@@ -166,7 +168,7 @@ namespace OpenSim.Region.Communications.Local
166 } 168 }
167 else 169 else
168 { 170 {
169 MainLog.Instance.Warn("LOGIN", "Not found region " + currentRegion); 171 m_log.Warn("[LOGIN]: Not found region " + currentRegion);
170 } 172 }
171 } 173 }
172 private LoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL) 174 private LoginResponse.BuddyList ConvertFriendListItem(List<FriendListItem> LFL)