aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
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/Framework/Communications
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/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs21
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServer.cs8
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetServerBase.cs18
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs18
-rw-r--r--OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs38
-rw-r--r--OpenSim/Framework/Communications/Cache/SQLAssetServer.cs13
-rw-r--r--OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs26
-rw-r--r--OpenSim/Framework/Communications/Capabilities/Caps.cs38
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs12
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs24
-rw-r--r--OpenSim/Framework/Communications/LoginResponse.cs14
-rw-r--r--OpenSim/Framework/Communications/LoginService.cs44
-rw-r--r--OpenSim/Framework/Communications/RestClient/RestClient.cs14
-rw-r--r--OpenSim/Framework/Communications/UserManagerBase.cs49
14 files changed, 169 insertions, 168 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index db2d2fe..84713b9 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Communications.Cache
44 /// </summary> 44 /// </summary>
45 public class AssetCache : IAssetReceiver 45 public class AssetCache : IAssetReceiver
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
47 public Dictionary<LLUUID, AssetInfo> Assets; 49 public Dictionary<LLUUID, AssetInfo> Assets;
48 public Dictionary<LLUUID, TextureImage> Textures; 50 public Dictionary<LLUUID, TextureImage> Textures;
49 51
@@ -61,14 +63,13 @@ namespace OpenSim.Framework.Communications.Cache
61 private readonly IAssetServer m_assetServer; 63 private readonly IAssetServer m_assetServer;
62 64
63 private readonly Thread m_assetCacheThread; 65 private readonly Thread m_assetCacheThread;
64 private readonly LogBase m_log;
65 66
66 /// <summary> 67 /// <summary>
67 /// 68 ///
68 /// </summary> 69 /// </summary>
69 public AssetCache(IAssetServer assetServer, LogBase log) 70 public AssetCache(IAssetServer assetServer)
70 { 71 {
71 log.Verbose("ASSETSTORAGE", "Creating Asset cache"); 72 m_log.Info("[ASSETSTORAGE]: Creating Asset cache");
72 m_assetServer = assetServer; 73 m_assetServer = assetServer;
73 m_assetServer.SetReceiver(this); 74 m_assetServer.SetReceiver(this);
74 Assets = new Dictionary<LLUUID, AssetInfo>(); 75 Assets = new Dictionary<LLUUID, AssetInfo>();
@@ -76,8 +77,6 @@ namespace OpenSim.Framework.Communications.Cache
76 m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); 77 m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
77 m_assetCacheThread.IsBackground = true; 78 m_assetCacheThread.IsBackground = true;
78 m_assetCacheThread.Start(); 79 m_assetCacheThread.Start();
79
80 m_log = log;
81 } 80 }
82 81
83 /// <summary> 82 /// <summary>
@@ -94,7 +93,7 @@ namespace OpenSim.Framework.Communications.Cache
94 } 93 }
95 catch (Exception e) 94 catch (Exception e)
96 { 95 {
97 m_log.Error("ASSETCACHE", e.ToString()); 96 m_log.Error("[ASSETCACHE]: " + e.ToString());
98 } 97 }
99 } 98 }
100 } 99 }
@@ -198,8 +197,8 @@ namespace OpenSim.Framework.Communications.Cache
198 } 197 }
199 } while (--maxPolls > 0); 198 } while (--maxPolls > 0);
200 199
201 MainLog.Instance.Warn( 200 m_log.Warn(
202 "ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached"); 201 String.Format("[ASSETCACHE]: Asset {0} was not received before the retrieval timeout was reached"));
203 202
204 return null; 203 return null;
205 } 204 }
@@ -266,7 +265,7 @@ namespace OpenSim.Framework.Communications.Cache
266 } 265 }
267 } 266 }
268 267
269 m_log.Verbose("ASSETCACHE", "Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); 268 m_log.Info(String.Format("[ASSETCACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result));
270 } 269 }
271 270
272 public void DeleteAsset(LLUUID assetID) 271 public void DeleteAsset(LLUUID assetID)
@@ -362,7 +361,7 @@ namespace OpenSim.Framework.Communications.Cache
362 { 361 {
363 //if (this.RequestedTextures.ContainsKey(assetID)) 362 //if (this.RequestedTextures.ContainsKey(assetID))
364 //{ 363 //{
365 // MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID); 364 // m_log.Warn(String.Format("[ASSET CACHE]: sending image not found for {0}", assetID));
366 // AssetRequest req = this.RequestedTextures[assetID]; 365 // AssetRequest req = this.RequestedTextures[assetID];
367 // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); 366 // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
368 // notFound.ImageID.ID = assetID; 367 // notFound.ImageID.ID = assetID;
@@ -371,7 +370,7 @@ namespace OpenSim.Framework.Communications.Cache
371 //} 370 //}
372 //else 371 //else
373 //{ 372 //{
374 // MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID); 373 // m_log.Error(String.Format("[ASSET CACHE]: Cound not send image not found for {0}", assetID));
375 //} 374 //}
376 } 375 }
377 376
diff --git a/OpenSim/Framework/Communications/Cache/AssetServer.cs b/OpenSim/Framework/Communications/Cache/AssetServer.cs
index 575e80a..c1cf100 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServer.cs
@@ -35,6 +35,8 @@ namespace OpenSim.Framework.Communications.Cache
35{ 35{
36 public class LocalAssetServer : AssetServerBase 36 public class LocalAssetServer : AssetServerBase
37 { 37 {
38 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
39
38 private IObjectContainer db; 40 private IObjectContainer db;
39 41
40 public LocalAssetServer() 42 public LocalAssetServer()
@@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
43 yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap")); 45 yapfile = File.Exists(Path.Combine(Util.dataDir(), "regionassets.yap"));
44 46
45 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap")); 47 db = Db4oFactory.OpenFile(Path.Combine(Util.dataDir(), "regionassets.yap"));
46 MainLog.Instance.Verbose("ASSETS", "Db4 Asset database creation"); 48 m_log.Info("[ASSETS]: Db4 Asset database creation");
47 49
48 if (!yapfile) 50 if (!yapfile)
49 { 51 {
@@ -67,7 +69,7 @@ namespace OpenSim.Framework.Communications.Cache
67 69
68 if (db != null) 70 if (db != null)
69 { 71 {
70 MainLog.Instance.Verbose("ASSETSERVER", "Closing local asset server database"); 72 m_log.Info("[ASSETSERVER]: Closing local asset server database");
71 db.Close(); 73 db.Close();
72 } 74 }
73 } 75 }
@@ -120,7 +122,7 @@ namespace OpenSim.Framework.Communications.Cache
120 122
121 protected virtual void SetUpAssetDatabase() 123 protected virtual void SetUpAssetDatabase()
122 { 124 {
123 MainLog.Instance.Verbose("LOCAL ASSET SERVER", "Setting up asset database"); 125 m_log.Info("[LOCAL ASSET SERVER]: Setting up asset database");
124 126
125 base.LoadDefaultAssets(); 127 base.LoadDefaultAssets();
126 } 128 }
diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
index 09f8a0c..1d8f6ba 100644
--- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Framework.Communications.Cache
37{ 37{
38 public abstract class AssetServerBase : IAssetServer 38 public abstract class AssetServerBase : IAssetServer
39 { 39 {
40 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
41
40 protected IAssetReceiver m_receiver; 42 protected IAssetReceiver m_receiver;
41 protected BlockingQueue<AssetRequest> m_assetRequests; 43 protected BlockingQueue<AssetRequest> m_assetRequests;
42 protected Thread m_localAssetServerThread; 44 protected Thread m_localAssetServerThread;
@@ -68,15 +70,15 @@ namespace OpenSim.Framework.Communications.Cache
68 70
69 if (asset != null) 71 if (asset != null)
70 { 72 {
71 //MainLog.Instance.Verbose( 73 //m_log.Info(
72 // "ASSET", "Asset {0} received from asset server", req.AssetID); 74 // String.Format("[ASSET]: Asset {0} received from asset server", req.AssetID));
73 75
74 m_receiver.AssetReceived(asset, req.IsTexture); 76 m_receiver.AssetReceived(asset, req.IsTexture);
75 } 77 }
76 else 78 else
77 { 79 {
78 MainLog.Instance.Error( 80 m_log.Error(
79 "ASSET", "Asset {0} not found by asset server", req.AssetID); 81 String.Format("[ASSET]: Asset {0} not found by asset server", req.AssetID));
80 82
81 m_receiver.AssetNotFound(req.AssetID); 83 m_receiver.AssetNotFound(req.AssetID);
82 } 84 }
@@ -84,7 +86,7 @@ namespace OpenSim.Framework.Communications.Cache
84 86
85 public virtual void LoadDefaultAssets() 87 public virtual void LoadDefaultAssets()
86 { 88 {
87 MainLog.Instance.Verbose("ASSETSERVER", "Setting up asset database"); 89 m_log.Info("[ASSETSERVER]: Setting up asset database");
88 90
89 assetLoader.ForEachDefaultXmlAsset(StoreAsset); 91 assetLoader.ForEachDefaultXmlAsset(StoreAsset);
90 92
@@ -94,7 +96,7 @@ namespace OpenSim.Framework.Communications.Cache
94 96
95 public AssetServerBase() 97 public AssetServerBase()
96 { 98 {
97 MainLog.Instance.Verbose("ASSETSERVER", "Starting asset storage system"); 99 m_log.Info("[ASSETSERVER]: Starting asset storage system");
98 m_assetRequests = new BlockingQueue<AssetRequest>(); 100 m_assetRequests = new BlockingQueue<AssetRequest>();
99 101
100 m_localAssetServerThread = new Thread(RunRequests); 102 m_localAssetServerThread = new Thread(RunRequests);
@@ -114,7 +116,7 @@ namespace OpenSim.Framework.Communications.Cache
114 } 116 }
115 catch (Exception e) 117 catch (Exception e)
116 { 118 {
117 MainLog.Instance.Error("ASSETSERVER", e.Message); 119 m_log.Error("[ASSETSERVER]: " + e.Message);
118 } 120 }
119 } 121 }
120 } 122 }
@@ -131,7 +133,7 @@ namespace OpenSim.Framework.Communications.Cache
131 req.IsTexture = isTexture; 133 req.IsTexture = isTexture;
132 m_assetRequests.Enqueue(req); 134 m_assetRequests.Enqueue(req);
133 135
134 MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID); 136 m_log.Info(String.Format("[ASSET]: Added {0} to request queue", assetID));
135 } 137 }
136 138
137 public virtual void UpdateAsset(AssetBase asset) 139 public virtual void UpdateAsset(AssetBase asset)
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 2f0727f..48d9ec8 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications.Cache
36{ 36{
37 public class GridAssetClient : AssetServerBase 37 public class GridAssetClient : AssetServerBase
38 { 38 {
39 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
40
39 private string _assetServerUrl; 41 private string _assetServerUrl;
40 42
41 public GridAssetClient(string serverUrl) 43 public GridAssetClient(string serverUrl)
@@ -50,7 +52,7 @@ namespace OpenSim.Framework.Communications.Cache
50 Stream s = null; 52 Stream s = null;
51 try 53 try
52 { 54 {
53 MainLog.Instance.Debug("ASSETCACHE", "Querying for {0}", req.AssetID.ToString()); 55 m_log.Debug(String.Format("[ASSETCACHE]: Querying for {0}", req.AssetID.ToString()));
54 56
55 RestClient rc = new RestClient(_assetServerUrl); 57 RestClient rc = new RestClient(_assetServerUrl);
56 rc.AddResourcePath("assets"); 58 rc.AddResourcePath("assets");
@@ -70,9 +72,9 @@ namespace OpenSim.Framework.Communications.Cache
70 } 72 }
71 catch (Exception e) 73 catch (Exception e)
72 { 74 {
73 MainLog.Instance.Error("ASSETCACHE", e.Message); 75 m_log.Error("[ASSETCACHE]: " + e.Message);
74 MainLog.Instance.Debug("ASSETCACHE", "Getting asset {0}", req.AssetID.ToString()); 76 m_log.Debug(String.Format("[ASSETCACHE]: Getting asset {0}", req.AssetID.ToString()));
75 MainLog.Instance.Error("ASSETCACHE", e.StackTrace); 77 m_log.Error("[ASSETCACHE]: " + e.StackTrace);
76 } 78 }
77 79
78 return null; 80 return null;
@@ -93,19 +95,19 @@ namespace OpenSim.Framework.Communications.Cache
93 // XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); 95 // XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
94 // xs.Serialize(s, asset); 96 // xs.Serialize(s, asset);
95 // RestClient rc = new RestClient(_assetServerUrl); 97 // RestClient rc = new RestClient(_assetServerUrl);
96 MainLog.Instance.Verbose("ASSET", "Storing asset"); 98 m_log.Info("[ASSET]: Storing asset");
97 //rc.AddResourcePath("assets"); 99 //rc.AddResourcePath("assets");
98 100
99 // rc.RequestMethod = "POST"; 101 // rc.RequestMethod = "POST";
100 // rc.Request(s); 102 // rc.Request(s);
101 //MainLog.Instance.Verbose("ASSET", "Stored {0}", rc); 103 //m_log.Info(String.Format("[ASSET]: Stored {0}", rc));
102 MainLog.Instance.Verbose("ASSET", "Sending to " + _assetServerUrl + "/assets/"); 104 m_log.Info("[ASSET]: Sending to " + _assetServerUrl + "/assets/");
103 RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset); 105 RestObjectPoster.BeginPostObject<AssetBase>(_assetServerUrl + "/assets/", asset);
104 106
105 } 107 }
106 catch (Exception e) 108 catch (Exception e)
107 { 109 {
108 MainLog.Instance.Error("ASSETS", e.Message); 110 m_log.Error("[ASSETS]: " + e.Message);
109 } 111 }
110 } 112 }
111 113
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index ae07898..46767bb 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -26,12 +26,12 @@
26* 26*
27*/ 27*/
28 28
29using System;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
31using System.Xml; 32using System.Xml;
32using libsecondlife; 33using libsecondlife;
33using Nini.Config; 34using Nini.Config;
34
35using OpenSim.Framework.Console; 35using OpenSim.Framework.Console;
36 36
37namespace OpenSim.Framework.Communications.Cache 37namespace OpenSim.Framework.Communications.Cache
@@ -42,6 +42,8 @@ namespace OpenSim.Framework.Communications.Cache
42 /// </summary> 42 /// </summary>
43 public class LibraryRootFolder : InventoryFolderImpl 43 public class LibraryRootFolder : InventoryFolderImpl
44 { 44 {
45 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46
45 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000"); 47 private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
46 48
47 /// <summary> 49 /// <summary>
@@ -53,7 +55,7 @@ namespace OpenSim.Framework.Communications.Cache
53 55
54 public LibraryRootFolder() 56 public LibraryRootFolder()
55 { 57 {
56 MainLog.Instance.Verbose("LIBRARYINVENTORY", "Loading library inventory"); 58 m_log.Info("[LIBRARYINVENTORY]: Loading library inventory");
57 59
58 agentID = libOwner; 60 agentID = libOwner;
59 folderID = new LLUUID("00000112-000f-0000-0000-000100bba000"); 61 folderID = new LLUUID("00000112-000f-0000-0000-000100bba000");
@@ -138,8 +140,8 @@ namespace OpenSim.Framework.Communications.Cache
138 /// <param name="assets"></param> 140 /// <param name="assets"></param>
139 protected void LoadLibraries(string librariesControlPath) 141 protected void LoadLibraries(string librariesControlPath)
140 { 142 {
141 MainLog.Instance.Verbose( 143 m_log.Info(
142 "LIBRARYINVENTORY", "Loading libraries control file {0}", librariesControlPath); 144 String.Format("LIBRARYINVENTORY", "Loading libraries control file {0}", librariesControlPath));
143 145
144 LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig); 146 LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig);
145 } 147 }
@@ -186,15 +188,15 @@ namespace OpenSim.Framework.Communications.Cache
186 libraryFolders.Add(folderInfo.folderID, folderInfo); 188 libraryFolders.Add(folderInfo.folderID, folderInfo);
187 parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo); 189 parentFolder.SubFolders.Add(folderInfo.folderID, folderInfo);
188 190
189// MainLog.Instance.Verbose( 191// m_log.Info(
190// "LIBRARYINVENTORY", "Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID); 192// String.Format("[LIBRARYINVENTORY]: Adding folder {0} ({1})", folderInfo.name, folderInfo.folderID));
191 } 193 }
192 else 194 else
193 { 195 {
194 MainLog.Instance.Warn( 196 m_log.Warn(
195 "LIBRARYINVENTORY", 197 String.Format("[LIBRARYINVENTORY]: " +
196 "Couldn't add folder {0} ({1}) since parent folder with ID {2} does not exist!", 198 "Couldn't add folder {0} ({1}) since parent folder with ID {2} does not exist!",
197 folderInfo.name, folderInfo.folderID, folderInfo.parentID); 199 folderInfo.name, folderInfo.folderID, folderInfo.parentID));
198 } 200 }
199 } 201 }
200 202
@@ -227,10 +229,10 @@ namespace OpenSim.Framework.Communications.Cache
227 } 229 }
228 else 230 else
229 { 231 {
230 MainLog.Instance.Warn( 232 m_log.Warn(
231 "LIBRARYINVENTORY", 233 String.Format("[LIBRARYINVENTORY]: " +
232 "Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!", 234 "Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
233 item.inventoryName, item.inventoryID, item.parentFolderID); 235 item.inventoryName, item.inventoryID, item.parentFolderID));
234 } 236 }
235 } 237 }
236 238
@@ -257,14 +259,14 @@ namespace OpenSim.Framework.Communications.Cache
257 } 259 }
258 catch (XmlException e) 260 catch (XmlException e)
259 { 261 {
260 MainLog.Instance.Error( 262 m_log.Error(
261 "LIBRARYINVENTORY", "Error loading {0} : {1}", path, e); 263 String.Format("[LIBRARYINVENTORY]: Error loading {0} : {1}", path, e));
262 } 264 }
263 } 265 }
264 else 266 else
265 { 267 {
266 MainLog.Instance.Error( 268 m_log.Error(
267 "LIBRARYINVENTORY", "{0} file {1} does not exist!", fileDescription, path); 269 String.Format("[LIBRARYINVENTORY]: {0} file {1} does not exist!", fileDescription, path));
268 } 270 }
269 } 271 }
270 272
diff --git a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
index 0a141c3..d3a283a 100644
--- a/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
+++ b/OpenSim/Framework/Communications/Cache/SQLAssetServer.cs
@@ -33,6 +33,8 @@ namespace OpenSim.Framework.Communications.Cache
33{ 33{
34 public class SQLAssetServer : AssetServerBase 34 public class SQLAssetServer : AssetServerBase
35 { 35 {
36 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
37
36 public SQLAssetServer(string pluginName) 38 public SQLAssetServer(string pluginName)
37 { 39 {
38 AddPlugin(pluginName); 40 AddPlugin(pluginName);
@@ -45,7 +47,7 @@ namespace OpenSim.Framework.Communications.Cache
45 47
46 public void AddPlugin(string FileName) 48 public void AddPlugin(string FileName)
47 { 49 {
48 MainLog.Instance.Verbose("SQLAssetServer", "AssetStorage: Attempting to load " + FileName); 50 m_log.Info("[SQLAssetServer]: AssetStorage: Attempting to load " + FileName);
49 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 51 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
50 52
51 foreach (Type pluginType in pluginAssembly.GetTypes()) 53 foreach (Type pluginType in pluginAssembly.GetTypes())
@@ -61,15 +63,14 @@ namespace OpenSim.Framework.Communications.Cache
61 m_assetProvider = plug; 63 m_assetProvider = plug;
62 m_assetProvider.Initialise(); 64 m_assetProvider.Initialise();
63 65
64 MainLog.Instance.Verbose("AssetStorage", 66 m_log.Info("[AssetStorage]: " +
65 "Added " + m_assetProvider.Name + " " + 67 "Added " + m_assetProvider.Name + " " +
66 m_assetProvider.Version); 68 m_assetProvider.Version);
67 } 69 }
68 } 70 }
69 } 71 }
70 } 72 }
71 73
72
73 public override void Close() 74 public override void Close()
74 { 75 {
75 base.Close(); 76 base.Close();
@@ -98,4 +99,4 @@ namespace OpenSim.Framework.Communications.Cache
98 m_assetProvider.CommitAssets(); 99 m_assetProvider.CommitAssets();
99 } 100 }
100 } 101 }
101} \ No newline at end of file 102}
diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
index 14670fd..79c0c86 100644
--- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
+++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs
@@ -25,6 +25,8 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28
29using System;
28using System.Collections.Generic; 30using System.Collections.Generic;
29using libsecondlife; 31using libsecondlife;
30using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
@@ -33,6 +35,8 @@ namespace OpenSim.Framework.Communications.Cache
33{ 35{
34 public class UserProfileCacheService 36 public class UserProfileCacheService
35 { 37 {
38 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
39
36 // Fields 40 // Fields
37 private readonly CommunicationsManager m_parent; 41 private readonly CommunicationsManager m_parent;
38 private readonly Dictionary<LLUUID, CachedUserInfo> m_userProfiles = new Dictionary<LLUUID, CachedUserInfo>(); 42 private readonly Dictionary<LLUUID, CachedUserInfo> m_userProfiles = new Dictionary<LLUUID, CachedUserInfo>();
@@ -69,7 +73,7 @@ namespace OpenSim.Framework.Communications.Cache
69 } 73 }
70 else 74 else
71 { 75 {
72 MainLog.Instance.Error("USERCACHE", "User profile for user {0} not found", userID); 76 m_log.Error(String.Format("[USERCACHE]: User profile for user {0} not found", userID));
73 } 77 }
74 } 78 }
75 } 79 }
@@ -229,28 +233,28 @@ namespace OpenSim.Framework.Communications.Cache
229 } 233 }
230 else 234 else
231 { 235 {
232 MainLog.Instance.Error( 236 m_log.Error(
233 "INVENTORYCACHE", "Could not find root folder for user {0}", remoteClient.Name); 237 String.Format("[INVENTORYCACHE]: Could not find root folder for user {0}", remoteClient.Name));
234 238
235 return; 239 return;
236 } 240 }
237 } 241 }
238 else 242 else
239 { 243 {
240 MainLog.Instance.Error( 244 m_log.Error(
241 "INVENTORYCACHE", 245 String.Format("[INVENTORYCACHE]: " +
242 "Could not find user profile for {0} for folder {1}", 246 "Could not find user profile for {0} for folder {1}",
243 remoteClient.Name, folderID); 247 remoteClient.Name, folderID));
244 248
245 return; 249 return;
246 } 250 }
247 251
248 // If we've reached this point then we couldn't find the folder, even though the client thinks 252 // If we've reached this point then we couldn't find the folder, even though the client thinks
249 // it exists 253 // it exists
250 MainLog.Instance.Error( 254 m_log.Error(
251 "INVENTORYCACHE", 255 String.Format("[INVENTORYCACHE]: " +
252 "Could not find folder {0} for user {1}", 256 "Could not find folder {0} for user {1}",
253 folderID, remoteClient.Name); 257 folderID, remoteClient.Name));
254 } 258 }
255 259
256 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID) 260 public void HandlePurgeInventoryDescendents(IClientAPI remoteClient, LLUUID folderID)
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index f85b4ab..6473c26 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -54,6 +54,8 @@ namespace OpenSim.Region.Capabilities
54 54
55 public class Caps 55 public class Caps
56 { 56 {
57 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
58
57 private string m_httpListenerHostName; 59 private string m_httpListenerHostName;
58 private uint m_httpListenPort; 60 private uint m_httpListenPort;
59 61
@@ -96,7 +98,7 @@ namespace OpenSim.Region.Capabilities
96 /// </summary> 98 /// </summary>
97 public void RegisterHandlers() 99 public void RegisterHandlers()
98 { 100 {
99 MainLog.Instance.Verbose("CAPS", "Registering CAPS handlers"); 101 m_log.Info("[CAPS]: Registering CAPS handlers");
100 string capsBase = "/CAPS/" + m_capsObjectPath; 102 string capsBase = "/CAPS/" + m_capsObjectPath;
101 try 103 try
102 { 104 {
@@ -115,7 +117,7 @@ namespace OpenSim.Region.Capabilities
115 } 117 }
116 catch (Exception e) 118 catch (Exception e)
117 { 119 {
118 MainLog.Instance.Error("CAPS", e.ToString()); 120 m_log.Error("[CAPS]: " + e.ToString());
119 } 121 }
120 } 122 }
121 123
@@ -275,7 +277,7 @@ namespace OpenSim.Region.Capabilities
275 { 277 {
276 try 278 try
277 { 279 {
278// MainLog.Instance.Debug("CAPS", "request: {0}, path: {1}, param: {2}", request, path, param); 280// m_log.Debug(String.Format("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param));
279 281
280 Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); 282 Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request));
281 LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); 283 LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate();
@@ -303,16 +305,16 @@ namespace OpenSim.Region.Capabilities
303 uploadResponse.uploader = uploaderURL; 305 uploadResponse.uploader = uploaderURL;
304 uploadResponse.state = "upload"; 306 uploadResponse.state = "upload";
305 307
306// MainLog.Instance.Verbose( 308// m_log.Info(
307// "CAPS", 309// String.Format("[CAPS]: " +
308// "ScriptTaskInventory response: {0}", 310// "ScriptTaskInventory response: {0}",
309// LLSDHelpers.SerialiseLLSDReply(uploadResponse)); 311// LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
310 312
311 return LLSDHelpers.SerialiseLLSDReply(uploadResponse); 313 return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
312 } 314 }
313 catch (Exception e) 315 catch (Exception e)
314 { 316 {
315 MainLog.Instance.Error("CAPS", e.ToString()); 317 m_log.Error("[CAPS]: " + e.ToString());
316 } 318 }
317 319
318 return null; 320 return null;
@@ -349,10 +351,10 @@ namespace OpenSim.Region.Capabilities
349 uploadResponse.uploader = uploaderURL; 351 uploadResponse.uploader = uploaderURL;
350 uploadResponse.state = "upload"; 352 uploadResponse.state = "upload";
351 353
352// MainLog.Instance.Verbose( 354// m_log.Info(
353// "CAPS", 355// String.Format("[CAPS]: " +
354// "NoteCardAgentInventory response: {0}", 356// "NoteCardAgentInventory response: {0}",
355// LLSDHelpers.SerialiseLLSDReply(uploadResponse)); 357// LLSDHelpers.SerialiseLLSDReply(uploadResponse)));
356 358
357 return LLSDHelpers.SerialiseLLSDReply(uploadResponse); 359 return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
358 } 360 }
@@ -681,10 +683,10 @@ namespace OpenSim.Region.Capabilities
681 { 683 {
682 try 684 try
683 { 685 {
684// MainLog.Instance.Verbose( 686// m_log.Info(
685// "CAPS", 687// String.Format("[CAPS]: " +
686// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", 688// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}",
687// data, path, param); 689// data, path, param));
688 690
689 string res = String.Empty; 691 string res = String.Empty;
690 LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); 692 LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete();
@@ -707,13 +709,13 @@ namespace OpenSim.Region.Capabilities
707 SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); 709 SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data);
708 } 710 }
709 711
710// MainLog.Instance.Verbose("CAPS", "TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); 712// m_log.Info(String.Format("[CAPS]: TaskInventoryScriptUpdater.uploaderCaps res: {0}", res));
711 713
712 return res; 714 return res;
713 } 715 }
714 catch (Exception e) 716 catch (Exception e)
715 { 717 {
716 MainLog.Instance.Error("CAPS", e.ToString()); 718 m_log.Error("[CAPS]: " + e.ToString());
717 } 719 }
718 720
719 // XXX Maybe this should be some meaningful error packet 721 // XXX Maybe this should be some meaningful error packet
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index dd7c168..f6cfda7 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications
36{ 36{
37 public class CommunicationsManager 37 public class CommunicationsManager
38 { 38 {
39 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
40
39 protected IUserService m_userService; 41 protected IUserService m_userService;
40 42
41 public IUserService UserService 43 public IUserService UserService
@@ -114,11 +116,11 @@ namespace OpenSim.Framework.Communications
114 116
115 if (cmmdParams.Length < 2) 117 if (cmmdParams.Length < 2)
116 { 118 {
117 firstName = MainLog.Instance.CmdPrompt("First name", "Default"); 119 firstName = MainConsole.Instance.CmdPrompt("First name", "Default");
118 lastName = MainLog.Instance.CmdPrompt("Last name", "User"); 120 lastName = MainConsole.Instance.CmdPrompt("Last name", "User");
119 password = MainLog.Instance.PasswdPrompt("Password"); 121 password = MainConsole.Instance.PasswdPrompt("Password");
120 regX = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region X", "1000")); 122 regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", "1000"));
121 regY = Convert.ToUInt32(MainLog.Instance.CmdPrompt("Start Region Y", "1000")); 123 regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", "1000"));
122 } 124 }
123 else 125 else
124 { 126 {
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index a48988d..897aa9a 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications
36{ 36{
37 public abstract class InventoryServiceBase : IInventoryServices 37 public abstract class InventoryServiceBase : IInventoryServices
38 { 38 {
39 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
40
39 protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); 41 protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>();
40 //protected IAssetServer m_assetServer; 42 //protected IAssetServer m_assetServer;
41 43
@@ -52,7 +54,7 @@ namespace OpenSim.Framework.Communications
52 { 54 {
53 if (!String.IsNullOrEmpty(FileName)) 55 if (!String.IsNullOrEmpty(FileName))
54 { 56 {
55 MainLog.Instance.Verbose("AGENTINVENTORY", "Inventorystorage: Attempting to load " + FileName); 57 m_log.Info("[AGENTINVENTORY]: Inventorystorage: Attempting to load " + FileName);
56 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 58 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
57 59
58 foreach (Type pluginType in pluginAssembly.GetTypes()) 60 foreach (Type pluginType in pluginAssembly.GetTypes())
@@ -67,7 +69,7 @@ namespace OpenSim.Framework.Communications
67 (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); 69 (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
68 plug.Initialise(); 70 plug.Initialise();
69 m_plugins.Add(plug.getName(), plug); 71 m_plugins.Add(plug.getName(), plug);
70 MainLog.Instance.Verbose("AGENTINVENTORY", "Added IInventoryData Interface"); 72 m_log.Info("[AGENTINVENTORY]: Added IInventoryData Interface");
71 } 73 }
72 } 74 }
73 } 75 }
@@ -95,9 +97,8 @@ namespace OpenSim.Framework.Communications
95 rootFolder = plugin.Value.getUserRootFolder(userID); 97 rootFolder = plugin.Value.getUserRootFolder(userID);
96 if (rootFolder != null) 98 if (rootFolder != null)
97 { 99 {
98 MainLog.Instance.Verbose( 100 m_log.Info(
99 "INVENTORY", 101 "[INVENTORY]: Found root folder for user with ID " + userID + ". Retrieving inventory contents.");
100 "Found root folder for user with ID " + userID + ". Retrieving inventory contents.");
101 102
102 inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); 103 inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID);
103 inventoryList.Insert(0, rootFolder); 104 inventoryList.Insert(0, rootFolder);
@@ -105,8 +106,8 @@ namespace OpenSim.Framework.Communications
105 } 106 }
106 } 107 }
107 108
108 MainLog.Instance.Warn( 109 m_log.Warn(
109 "INVENTORY", "Could not find a root folder belonging to user with ID " + userID); 110 "[INVENTORY]: Could not find a root folder belonging to user with ID " + userID);
110 111
111 return inventoryList; 112 return inventoryList;
112 } 113 }
@@ -226,10 +227,10 @@ namespace OpenSim.Framework.Communications
226 227
227 if (null != existingRootFolder) 228 if (null != existingRootFolder)
228 { 229 {
229 MainLog.Instance.Error( 230 m_log.Error(
230 "AGENTINVENTORY", 231 String.Format("[AGENTINVENTORY]: " +
231 "Did not create a new inventory for user {0} since they already have " 232 "Did not create a new inventory for user {0} since they already have "
232 + "a root inventory folder with id {1}", user, existingRootFolder); 233 + "a root inventory folder with id {1}", user, existingRootFolder));
233 } 234 }
234 else 235 else
235 { 236 {
@@ -251,6 +252,7 @@ namespace OpenSim.Framework.Communications
251 public virtual void CreateNewInventorySet(LLUUID user) 252 public virtual void CreateNewInventorySet(LLUUID user)
252 { 253 {
253 InventoryFolderBase folder = new InventoryFolderBase(); 254 InventoryFolderBase folder = new InventoryFolderBase();
255
254 folder.parentID = LLUUID.Zero; 256 folder.parentID = LLUUID.Zero;
255 folder.agentID = user; 257 folder.agentID = user;
256 folder.folderID = LLUUID.Random(); 258 folder.folderID = LLUUID.Random();
diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs
index 7f8658d..9036884 100644
--- a/OpenSim/Framework/Communications/LoginResponse.cs
+++ b/OpenSim/Framework/Communications/LoginResponse.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Framework.UserManagement
42 /// </summary> 42 /// </summary>
43 public class LoginResponse 43 public class LoginResponse
44 { 44 {
45 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
46
45 private Hashtable loginFlagsHash; 47 private Hashtable loginFlagsHash;
46 private Hashtable globalTexturesHash; 48 private Hashtable globalTexturesHash;
47 private Hashtable loginError; 49 private Hashtable loginError;
@@ -362,10 +364,8 @@ namespace OpenSim.Framework.UserManagement
362 } 364 }
363 catch (Exception e) 365 catch (Exception e)
364 { 366 {
365 MainLog.Instance.Warn( 367 m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message);
366 "CLIENT", 368
367 "LoginResponse: Error creating XML-RPC Response: " + e.Message
368 );
369 return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false")); 369 return (GenerateFailureResponse("Internal Error", "Error generating Login Response", "false"));
370 } 370 }
371 } // ToXmlRpcResponse 371 } // ToXmlRpcResponse
@@ -461,10 +461,8 @@ namespace OpenSim.Framework.UserManagement
461 } 461 }
462 catch (Exception e) 462 catch (Exception e)
463 { 463 {
464 MainLog.Instance.Warn( 464 m_log.Warn("[CLIENT]: LoginResponse: Error creating XML-RPC Response: " + e.Message);
465 "CLIENT", 465
466 "LoginResponse: Error creating XML-RPC Response: " + e.Message
467 );
468 return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false"); 466 return GenerateFailureResponseLLSD("Internal Error", "Error generating Login Response", "false");
469 } 467 }
470 } 468 }
diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs
index 865349f..db86a97 100644
--- a/OpenSim/Framework/Communications/LoginService.cs
+++ b/OpenSim/Framework/Communications/LoginService.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.UserManagement
44{ 44{
45 public class LoginService 45 public class LoginService
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
47 protected string m_welcomeMessage = "Welcome to OpenSim"; 49 protected string m_welcomeMessage = "Welcome to OpenSim";
48 protected UserManagerBase m_userManager = null; 50 protected UserManagerBase m_userManager = null;
49 protected Mutex m_loginMutex = new Mutex(false); 51 protected Mutex m_loginMutex = new Mutex(false);
@@ -83,7 +85,7 @@ namespace OpenSim.Framework.UserManagement
83 try 85 try
84 { 86 {
85 //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this. 87 //CFK: CustomizeResponse contains sufficient strings to alleviate the need for this.
86 //CKF: MainLog.Instance.Verbose("LOGIN", "Attempting login now..."); 88 //CKF: m_log.Info("[LOGIN]: Attempting login now...");
87 XmlRpcResponse response = new XmlRpcResponse(); 89 XmlRpcResponse response = new XmlRpcResponse();
88 Hashtable requestData = (Hashtable) request.Params[0]; 90 Hashtable requestData = (Hashtable) request.Params[0];
89 91
@@ -102,16 +104,14 @@ namespace OpenSim.Framework.UserManagement
102 if( requestData.Contains("version")) 104 if( requestData.Contains("version"))
103 { 105 {
104 string clientversion = (string)requestData["version"]; 106 string clientversion = (string)requestData["version"];
105 MainLog.Instance.Verbose("LOGIN","Client Version " + clientversion + " for " + firstname + " " + lastname); 107 m_log.Info("[LOGIN]: Client Version " + clientversion + " for " + firstname + " " + lastname);
106 } 108 }
107 109
108 110
109 userProfile = GetTheUser(firstname, lastname); 111 userProfile = GetTheUser(firstname, lastname);
110 if (userProfile == null) 112 if (userProfile == null)
111 { 113 {
112 MainLog.Instance.Verbose( 114 m_log.Info("[LOGIN]: Could not find a profile for " + firstname + " " + lastname);
113 "LOGIN",
114 "Could not find a profile for " + firstname + " " + lastname);
115 115
116 return logResponse.CreateLoginFailedResponse(); 116 return logResponse.CreateLoginFailedResponse();
117 } 117 }
@@ -213,7 +213,7 @@ namespace OpenSim.Framework.UserManagement
213 } 213 }
214 catch (Exception e) 214 catch (Exception e)
215 { 215 {
216 MainLog.Instance.Verbose("LOGIN", e.ToString()); 216 m_log.Info("[LOGIN]: " + e.ToString());
217 return logResponse.CreateDeadRegionResponse(); 217 return logResponse.CreateDeadRegionResponse();
218 //return logResponse.ToXmlRpcResponse(); 218 //return logResponse.ToXmlRpcResponse();
219 } 219 }
@@ -225,10 +225,9 @@ namespace OpenSim.Framework.UserManagement
225 225
226 return logResponse.ToXmlRpcResponse(); 226 return logResponse.ToXmlRpcResponse();
227 } 227 }
228 228 catch (Exception e)
229 catch (Exception E)
230 { 229 {
231 MainLog.Instance.Verbose("LOGIN", E.ToString()); 230 m_log.Info("[LOGIN]: " + e.ToString());
232 } 231 }
233 //} 232 //}
234 } 233 }
@@ -265,9 +264,7 @@ namespace OpenSim.Framework.UserManagement
265 userProfile = GetTheUser(firstname, lastname); 264 userProfile = GetTheUser(firstname, lastname);
266 if (userProfile == null) 265 if (userProfile == null)
267 { 266 {
268 MainLog.Instance.Verbose( 267 m_log.Info("[LOGIN]: Could not find a profile for " + firstname + " " + lastname);
269 "LOGIN",
270 "Could not find a profile for " + firstname + " " + lastname);
271 268
272 return logResponse.CreateLoginFailedResponseLLSD(); 269 return logResponse.CreateLoginFailedResponseLLSD();
273 } 270 }
@@ -345,7 +342,7 @@ namespace OpenSim.Framework.UserManagement
345 } 342 }
346 catch (Exception ex) 343 catch (Exception ex)
347 { 344 {
348 MainLog.Instance.Verbose("LOGIN", ex.ToString()); 345 m_log.Info("[LOGIN]: " + ex.ToString());
349 return logResponse.CreateDeadRegionResponseLLSD(); 346 return logResponse.CreateDeadRegionResponseLLSD();
350 } 347 }
351 348
@@ -359,7 +356,7 @@ namespace OpenSim.Framework.UserManagement
359 } 356 }
360 catch (Exception ex) 357 catch (Exception ex)
361 { 358 {
362 MainLog.Instance.Verbose("LOGIN", ex.ToString()); 359 m_log.Info("[LOGIN]: " + ex.ToString());
363 return logResponse.CreateFailedResponseLLSD(); 360 return logResponse.CreateFailedResponseLLSD();
364 } 361 }
365 } 362 }
@@ -458,7 +455,7 @@ namespace OpenSim.Framework.UserManagement
458 string redirectURL = "about:blank?redirect-http-hack=" + System.Web.HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" + 455 string redirectURL = "about:blank?redirect-http-hack=" + System.Web.HttpUtility.UrlEncode("secondlife:///app/login?first_name=" + firstname + "&last_name=" +
459 lastname + 456 lastname +
460 "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString()); 457 "&location=" + location + "&grid=Other&web_login_key=" + webloginkey.ToString());
461 //MainLog.Instance.Verbose("WEB", "R:" + redirectURL); 458 //m_log.Info("[WEB]: R:" + redirectURL);
462 returnactions["int_response_code"] = statuscode; 459 returnactions["int_response_code"] = statuscode;
463 returnactions["str_redirect_location"] = redirectURL; 460 returnactions["str_redirect_location"] = redirectURL;
464 returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>"; 461 returnactions["str_response_string"] = "<HTML><BODY>GoodLogin</BODY></HTML>";
@@ -604,27 +601,22 @@ namespace OpenSim.Framework.UserManagement
604 public virtual bool AuthenticateUser(UserProfileData profile, string password) 601 public virtual bool AuthenticateUser(UserProfileData profile, string password)
605 { 602 {
606 bool passwordSuccess = false; 603 bool passwordSuccess = false;
607 MainLog.Instance.Verbose( 604 m_log.Info(
608 "LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); 605 String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID));
609 606
610 // Web Login method seems to also occasionally send the hashed password itself 607 // Web Login method seems to also occasionally send the hashed password itself
611 608
612
613 // we do this to get our hash in a form that the server password code can consume 609 // we do this to get our hash in a form that the server password code can consume
614 // when the web-login-form submits the password in the clear (supposed to be over SSL!) 610 // when the web-login-form submits the password in the clear (supposed to be over SSL!)
615 if (!password.StartsWith("$1$")) 611 if (!password.StartsWith("$1$"))
616 password = "$1$" + Util.Md5Hash(password); 612 password = "$1$" + Util.Md5Hash(password);
617 613
618
619
620 password = password.Remove(0, 3); //remove $1$ 614 password = password.Remove(0, 3); //remove $1$
621 615
622
623
624 string s = Util.Md5Hash(password + ":" + profile.passwordSalt); 616 string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
625 // Testing... 617 // Testing...
626 //MainLog.Instance.Verbose("LOGIN", "SubHash:" + s + " userprofile:" + profile.passwordHash); 618 //m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash);
627 //MainLog.Instance.Verbose("LOGIN", "userprofile:" + profile.passwordHash + " SubCT:" + password); 619 //m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password);
628 620
629 passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase) 621 passwordSuccess = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
630 || profile.passwordHash.Equals(password,StringComparison.InvariantCultureIgnoreCase)); 622 || profile.passwordHash.Equals(password,StringComparison.InvariantCultureIgnoreCase));
@@ -635,8 +627,8 @@ namespace OpenSim.Framework.UserManagement
635 public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey) 627 public virtual bool AuthenticateUser(UserProfileData profile, LLUUID webloginkey)
636 { 628 {
637 bool passwordSuccess = false; 629 bool passwordSuccess = false;
638 MainLog.Instance.Verbose( 630 m_log.Info(
639 "LOGIN", "Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID); 631 String.Format("[LOGIN]: Authenticating {0} {1} ({2})", profile.username, profile.surname, profile.UUID));
640 632
641 // Match web login key unless it's the default weblogin key LLUUID.Zero 633 // Match web login key unless it's the default weblogin key LLUUID.Zero
642 passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero); 634 passwordSuccess = ((profile.webLoginKey==webloginkey) && profile.webLoginKey != LLUUID.Zero);
diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs
index 76bad64..f968c9a 100644
--- a/OpenSim/Framework/Communications/RestClient/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs
@@ -56,6 +56,8 @@ namespace OpenSim.Framework.Communications
56 /// </remarks> 56 /// </remarks>
57 public class RestClient 57 public class RestClient
58 { 58 {
59 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
60
59 private string realuri; 61 private string realuri;
60 62
61 #region member variables 63 #region member variables
@@ -238,7 +240,7 @@ namespace OpenSim.Framework.Communications
238 } 240 }
239 } 241 }
240 realuri = sb.ToString(); 242 realuri = sb.ToString();
241 MainLog.Instance.Verbose("REST", "RestURL: {0}", realuri); 243 m_log.Info(String.Format("[REST]: RestURL: {0}", realuri));
242 return new Uri(sb.ToString()); 244 return new Uri(sb.ToString());
243 } 245 }
244 246
@@ -374,16 +376,16 @@ namespace OpenSim.Framework.Communications
374 _asyncException = null; 376 _asyncException = null;
375 _request.ContentLength = src.Length; 377 _request.ContentLength = src.Length;
376 378
377 MainLog.Instance.Verbose("REST", "Request Length {0}", _request.ContentLength); 379 m_log.Info(String.Format("[REST]: Request Length {0}", _request.ContentLength));
378 MainLog.Instance.Verbose("REST", "Sending Web Request {0}", buildUri()); 380 m_log.Info(String.Format("[REST]: Sending Web Request {0}", buildUri()));
379 src.Seek(0, SeekOrigin.Begin); 381 src.Seek(0, SeekOrigin.Begin);
380 MainLog.Instance.Verbose("REST", "Seek is ok"); 382 m_log.Info("[REST]: Seek is ok");
381 Stream dst = _request.GetRequestStream(); 383 Stream dst = _request.GetRequestStream();
382 MainLog.Instance.Verbose("REST", "GetRequestStream is ok"); 384 m_log.Info("[REST]: GetRequestStream is ok");
383 385
384 byte[] buf = new byte[1024]; 386 byte[] buf = new byte[1024];
385 int length = src.Read(buf, 0, 1024); 387 int length = src.Read(buf, 0, 1024);
386 MainLog.Instance.Verbose("REST", "First Read is ok"); 388 m_log.Info("[REST]: First Read is ok");
387 while (length > 0) 389 while (length > 0)
388 { 390 {
389 dst.Write(buf, 0, length); 391 dst.Write(buf, 0, length);
diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs
index 3b1d837..edab6ae 100644
--- a/OpenSim/Framework/Communications/UserManagerBase.cs
+++ b/OpenSim/Framework/Communications/UserManagerBase.cs
@@ -43,6 +43,8 @@ namespace OpenSim.Framework.UserManagement
43 /// </summary> 43 /// </summary>
44 public abstract class UserManagerBase : IUserService 44 public abstract class UserManagerBase : IUserService
45 { 45 {
46 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
47
46 public UserConfig _config; 48 public UserConfig _config;
47 private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>(); 49 private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
48 50
@@ -54,10 +56,10 @@ namespace OpenSim.Framework.UserManagement
54 { 56 {
55 if (!String.IsNullOrEmpty(FileName)) 57 if (!String.IsNullOrEmpty(FileName))
56 { 58 {
57 MainLog.Instance.Verbose("USERSTORAGE", "Attempting to load " + FileName); 59 m_log.Info("[USERSTORAGE]: Attempting to load " + FileName);
58 Assembly pluginAssembly = Assembly.LoadFrom(FileName); 60 Assembly pluginAssembly = Assembly.LoadFrom(FileName);
59 61
60 MainLog.Instance.Verbose("USERSTORAGE", "Found " + pluginAssembly.GetTypes().Length + " interfaces."); 62 m_log.Info("[USERSTORAGE]: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
61 foreach (Type pluginType in pluginAssembly.GetTypes()) 63 foreach (Type pluginType in pluginAssembly.GetTypes())
62 { 64 {
63 if (!pluginType.IsAbstract) 65 if (!pluginType.IsAbstract)
@@ -79,7 +81,7 @@ namespace OpenSim.Framework.UserManagement
79 { 81 {
80 plug.Initialise(); 82 plug.Initialise();
81 _plugins.Add(plug.getName(), plug); 83 _plugins.Add(plug.getName(), plug);
82 MainLog.Instance.Verbose("USERSTORAGE", "Added IUserData Interface"); 84 m_log.Info("[USERSTORAGE]: Added IUserData Interface");
83 } 85 }
84 86
85 #region Get UserProfile 87 #region Get UserProfile
@@ -116,8 +118,7 @@ namespace OpenSim.Framework.UserManagement
116 } 118 }
117 catch (Exception) 119 catch (Exception)
118 { 120 {
119 MainLog.Instance.Verbose("USERSTORAGE", 121 m_log.Info("[USERSTORAGE]: Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")");
120 "Unable to generate AgentPickerData via " + plugin.Key + "(" + query + ")");
121 return new List<AvatarPickerAvatar>(); 122 return new List<AvatarPickerAvatar>();
122 } 123 }
123 } 124 }
@@ -163,8 +164,7 @@ namespace OpenSim.Framework.UserManagement
163 } 164 }
164 catch (Exception e) 165 catch (Exception e)
165 { 166 {
166 MainLog.Instance.Verbose("USERSTORAGE", 167 m_log.Info("[USERSTORAGE]: Unable to set user via " + plugin.Key + "(" + e.ToString() + ")");
167 "Unable to set user via " + plugin.Key + "(" + e.ToString() + ")");
168 } 168 }
169 } 169 }
170 170
@@ -190,8 +190,7 @@ namespace OpenSim.Framework.UserManagement
190 } 190 }
191 catch (Exception e) 191 catch (Exception e)
192 { 192 {
193 MainLog.Instance.Verbose("USERSTORAGE", 193 m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
194 "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
195 } 194 }
196 } 195 }
197 196
@@ -214,8 +213,7 @@ namespace OpenSim.Framework.UserManagement
214 } 213 }
215 catch (Exception e) 214 catch (Exception e)
216 { 215 {
217 MainLog.Instance.Verbose("USERSTORAGE", 216 m_log.Info("[USERSTORAGE]: Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")");
218 "Unable to GetUserFriendList via " + plugin.Key + "(" + e.ToString() + ")");
219 } 217 }
220 } 218 }
221 219
@@ -234,8 +232,7 @@ namespace OpenSim.Framework.UserManagement
234 } 232 }
235 catch (Exception e) 233 catch (Exception e)
236 { 234 {
237 MainLog.Instance.Verbose("USERSTORAGE", 235 m_log.Info("[USERSTORAGE]: Unable to Store WebLoginKey via " + plugin.Key + "(" + e.ToString() + ")");
238 "Unable to Store WebLoginKey via " + plugin.Key + "(" + e.ToString() + ")");
239 } 236 }
240 } 237 }
241 } 238 }
@@ -250,8 +247,7 @@ namespace OpenSim.Framework.UserManagement
250 } 247 }
251 catch (Exception e) 248 catch (Exception e)
252 { 249 {
253 MainLog.Instance.Verbose("USERSTORAGE", 250 m_log.Info("[USERSTORAGE]: Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
254 "Unable to AddNewUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
255 } 251 }
256 } 252 }
257 253
@@ -268,8 +264,7 @@ namespace OpenSim.Framework.UserManagement
268 } 264 }
269 catch (Exception e) 265 catch (Exception e)
270 { 266 {
271 MainLog.Instance.Verbose("USERSTORAGE", 267 m_log.Info("[USERSTORAGE]: Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
272 "Unable to RemoveUserFriend via " + plugin.Key + "(" + e.ToString() + ")");
273 } 268 }
274 } 269 }
275 } 270 }
@@ -284,8 +279,7 @@ namespace OpenSim.Framework.UserManagement
284 } 279 }
285 catch (Exception e) 280 catch (Exception e)
286 { 281 {
287 MainLog.Instance.Verbose("USERSTORAGE", 282 m_log.Info("[USERSTORAGE]: Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")");
288 "Unable to UpdateUserFriendPerms via " + plugin.Key + "(" + e.ToString() + ")");
289 } 283 }
290 } 284 }
291 } 285 }
@@ -304,8 +298,7 @@ namespace OpenSim.Framework.UserManagement
304 } 298 }
305 catch (Exception e) 299 catch (Exception e)
306 { 300 {
307 MainLog.Instance.Verbose("USERSTORAGE", 301 m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
308 "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
309 } 302 }
310 } 303 }
311 304
@@ -337,8 +330,7 @@ namespace OpenSim.Framework.UserManagement
337 } 330 }
338 catch (Exception e) 331 catch (Exception e)
339 { 332 {
340 MainLog.Instance.Verbose("USERSTORAGE", 333 m_log.Info("[USERSTORAGE]: Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
341 "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
342 } 334 }
343 } 335 }
344 336
@@ -454,14 +446,14 @@ namespace OpenSim.Framework.UserManagement
454 } 446 }
455 else 447 else
456 { 448 {
457 MainLog.Instance.Verbose("LOGOUT", "didn't save logout position, currentAgent is null *do Fix "); 449 m_log.Info("[LOGOUT]: didn't save logout position, currentAgent is null *do Fix ");
458 } 450 }
459 MainLog.Instance.Verbose("LOGOUT", userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")" ); 451 m_log.Info("[LOGOUT]: " + userProfile.username + " " + userProfile.surname + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")" );
460 MainLog.Instance.Verbose("LOGOUT", "userid: " + userid.ToString() + " regionid: " + regionid.ToString() ); 452 m_log.Info("[LOGOUT]: userid: " + userid.ToString() + " regionid: " + regionid.ToString() );
461 } 453 }
462 else 454 else
463 { 455 {
464 MainLog.Instance.Warn("LOGOUT", "Unknown User logged out"); 456 m_log.Warn("[LOGOUT]: Unknown User logged out");
465 } 457 }
466 } 458 }
467 459
@@ -539,8 +531,7 @@ namespace OpenSim.Framework.UserManagement
539 } 531 }
540 catch (Exception e) 532 catch (Exception e)
541 { 533 {
542 MainLog.Instance.Verbose("USERSTORAGE", 534 m_log.Info("[USERSTORAGE]: Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
543 "Unable to add user via " + plugin.Key + "(" + e.ToString() + ")");
544 } 535 }
545 } 536 }
546 537