aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/UserServer/UserLoginService.cs
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/Grid/UserServer/UserLoginService.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs42
1 files changed, 21 insertions, 21 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index 10f9468..d5cdf1c 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -46,9 +46,10 @@ namespace OpenSim.Grid.UserServer
46{ 46{
47 public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position); 47 public delegate void UserLoggedInAtLocation(LLUUID agentID, LLUUID sessionID, LLUUID RegionID, ulong regionhandle, LLVector3 Position);
48 48
49
50 public class UserLoginService : LoginService 49 public class UserLoginService : LoginService
51 { 50 {
51 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
52
52 public event UserLoggedInAtLocation OnUserLoggedInAtLocation; 53 public event UserLoggedInAtLocation OnUserLoggedInAtLocation;
53 54
54 public UserConfig m_config; 55 public UserConfig m_config;
@@ -70,7 +71,7 @@ namespace OpenSim.Grid.UserServer
70 { 71 {
71 bool tryDefault = false; 72 bool tryDefault = false;
72 //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. 73 //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one.
73 //CFK: MainLog.Instance.Verbose("LOGIN", "Load information from the gridserver"); 74 //CFK: m_log.Info("[LOGIN]: Load information from the gridserver");
74 RegionProfileData SimInfo = new RegionProfileData(); 75 RegionProfileData SimInfo = new RegionProfileData();
75 try 76 try
76 { 77 {
@@ -80,7 +81,7 @@ namespace OpenSim.Grid.UserServer
80 81
81 // Customise the response 82 // Customise the response
82 //CFK: This is redundant and the next message should always appear. 83 //CFK: This is redundant and the next message should always appear.
83 //CFK: MainLog.Instance.Verbose("LOGIN", "Home Location"); 84 //CFK: m_log.Info("[LOGIN]: Home Location");
84 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + 85 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" +
85 (SimInfo.regionLocY*256).ToString() + "], " + 86 (SimInfo.regionLocY*256).ToString() + "], " +
86 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + 87 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@@ -91,7 +92,7 @@ namespace OpenSim.Grid.UserServer
91 // Destination 92 // Destination
92 //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into 93 //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
93 //CFK: the next one for X & Y and comment this one. 94 //CFK: the next one for X & Y and comment this one.
94 //CFK: MainLog.Instance.Verbose("LOGIN", "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + 95 //CFK: m_log.Info("[LOGIN]: CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX +
95 //CFK: "; Region Y: " + SimInfo.regionLocY); 96 //CFK: "; Region Y: " + SimInfo.regionLocY);
96 response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); 97 response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
97 response.SimPort = (uint) SimInfo.serverPort; 98 response.SimPort = (uint) SimInfo.serverPort;
@@ -105,7 +106,7 @@ namespace OpenSim.Grid.UserServer
105 // Notify the target of an incoming user 106 // Notify the target of an incoming user
106 //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into 107 //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
107 //CFK: the next one for X & Y and comment this one. 108 //CFK: the next one for X & Y and comment this one.
108 //CFK: MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " (" + SimInfo.serverURI + ") " + 109 //CFK: m_log.Info("[LOGIN]: " + SimInfo.regionName + " (" + SimInfo.serverURI + ") " +
109 //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY); 110 //CFK: SimInfo.regionLocX + "," + SimInfo.regionLocY);
110 111
111 // Prepare notification 112 // Prepare notification
@@ -128,7 +129,7 @@ namespace OpenSim.Grid.UserServer
128 theUser.currentAgent.currentRegion = SimInfo.UUID; 129 theUser.currentAgent.currentRegion = SimInfo.UUID;
129 theUser.currentAgent.currentHandle = SimInfo.regionHandle; 130 theUser.currentAgent.currentHandle = SimInfo.regionHandle;
130 131
131 MainLog.Instance.Verbose("LOGIN", SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + 132 m_log.Info("[LOGIN]: " + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " +
132 SimInfo.regionLocX + "," + SimInfo.regionLocY); 133 SimInfo.regionLocX + "," + SimInfo.regionLocY);
133 134
134 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); 135 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
@@ -145,9 +146,8 @@ namespace OpenSim.Grid.UserServer
145 146
146 ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256); 147 ulong defaultHandle = (((ulong) m_config.DefaultX*256) << 32) | ((ulong) m_config.DefaultY*256);
147 148
148 MainLog.Instance.Warn( 149 m_log.Warn(
149 "LOGIN", 150 "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString());
150 "Home region not available: sending to default " + defaultHandle.ToString());
151 151
152 SimInfo = new RegionProfileData(); 152 SimInfo = new RegionProfileData();
153 try 153 try
@@ -157,7 +157,7 @@ namespace OpenSim.Grid.UserServer
157 m_config.GridSendKey, m_config.GridRecvKey); 157 m_config.GridSendKey, m_config.GridRecvKey);
158 158
159 // Customise the response 159 // Customise the response
160 MainLog.Instance.Verbose("LOGIN", "Home Location"); 160 m_log.Info("[LOGIN]: Home Location");
161 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" + 161 response.Home = "{'region_handle':[r" + (SimInfo.regionLocX*256).ToString() + ",r" +
162 (SimInfo.regionLocY*256).ToString() + "], " + 162 (SimInfo.regionLocY*256).ToString() + "], " +
163 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" + 163 "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
@@ -166,9 +166,9 @@ namespace OpenSim.Grid.UserServer
166 theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}"; 166 theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
167 167
168 // Destination 168 // Destination
169 MainLog.Instance.Verbose("LOGIN", 169 m_log.Info("[LOGIN]: " +
170 "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " + 170 "CUSTOMISERESPONSE: Region X: " + SimInfo.regionLocX + "; Region Y: " +
171 SimInfo.regionLocY); 171 SimInfo.regionLocY);
172 response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString(); 172 response.SimAddress = Util.GetHostFromDNS(SimInfo.serverIP).ToString();
173 response.SimPort = (uint) SimInfo.serverPort; 173 response.SimPort = (uint) SimInfo.serverPort;
174 response.RegionX = SimInfo.regionLocX; 174 response.RegionX = SimInfo.regionLocX;
@@ -179,7 +179,7 @@ namespace OpenSim.Grid.UserServer
179 response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; 179 response.SeedCapability = SimInfo.httpServerURI + "CAPS/" + capsPath + "0000/";
180 180
181 // Notify the target of an incoming user 181 // Notify the target of an incoming user
182 MainLog.Instance.Verbose("LOGIN", "Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")"); 182 m_log.Info("[LOGIN]: Notifying " + SimInfo.regionName + " (" + SimInfo.serverURI + ")");
183 183
184 // Update agent with target sim 184 // Update agent with target sim
185 theUser.currentAgent.currentRegion = SimInfo.UUID; 185 theUser.currentAgent.currentRegion = SimInfo.UUID;
@@ -201,7 +201,7 @@ namespace OpenSim.Grid.UserServer
201 ArrayList SendParams = new ArrayList(); 201 ArrayList SendParams = new ArrayList();
202 SendParams.Add(SimParams); 202 SendParams.Add(SimParams);
203 203
204 MainLog.Instance.Verbose("LOGIN", "Informing region at " + SimInfo.httpServerURI); 204 m_log.Info("[LOGIN]: Informing region at " + SimInfo.httpServerURI);
205 // Send 205 // Send
206 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); 206 XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
207 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); 207 XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000);
@@ -213,8 +213,8 @@ namespace OpenSim.Grid.UserServer
213 213
214 catch (Exception e) 214 catch (Exception e)
215 { 215 {
216 MainLog.Instance.Warn("LOGIN", "Default region also not available"); 216 m_log.Warn("[LOGIN]: Default region also not available");
217 MainLog.Instance.Warn("LOGIN", e.ToString()); 217 m_log.Warn("[LOGIN]: " + e.ToString());
218 } 218 }
219 } 219 }
220 } 220 }
@@ -230,8 +230,8 @@ namespace OpenSim.Grid.UserServer
230 // which does. 230 // which does.
231 if (null == folders | folders.Count == 0) 231 if (null == folders | folders.Count == 0)
232 { 232 {
233 MainLog.Instance.Warn( 233 m_log.Warn(
234 "LOGIN", 234 "[LOGIN]: " +
235 "A root inventory folder for user ID " + userID + " was not found. A new set" 235 "A root inventory folder for user ID " + userID + " was not found. A new set"
236 + " of empty inventory folders is being created."); 236 + " of empty inventory folders is being created.");
237 237
@@ -269,8 +269,8 @@ namespace OpenSim.Grid.UserServer
269 } 269 }
270 else 270 else
271 { 271 {
272 MainLog.Instance.Warn("LOGIN", "The root inventory folder could still not be retrieved" + 272 m_log.Warn("[LOGIN]: The root inventory folder could still not be retrieved" +
273 " for user ID " + userID); 273 " for user ID " + userID);
274 274
275 AgentInventory userInventory = new AgentInventory(); 275 AgentInventory userInventory = new AgentInventory();
276 userInventory.CreateRootFolder(userID, false); 276 userInventory.CreateRootFolder(userID, false);