From 9b6b6d05d45cf0f754a0b26bf6240ef50be66563 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 3 Jul 2007 14:37:29 +0000 Subject: * Optimized usings (the 'LL ate my scripts' commit) * added some licensing info --- OpenSim/Grid/AssetServer/AssetHttpServer.cs | 15 ++---- OpenSim/Grid/AssetServer/Main.cs | 24 +++------- .../Grid/AssetServer/Properties/AssemblyInfo.cs | 2 - .../Grid/Framework.Manager/GridManagementAgent.cs | 6 +-- .../Grid/Framework.Manager/GridServerManager.cs | 3 +- OpenSim/Grid/GridServer.Config/AssemblyInfo.cs | 2 - OpenSim/Grid/GridServer.Config/DbGridConfig.cs | 55 +++++++++++----------- OpenSim/Grid/GridServer/GridManager.cs | 41 ++++++++-------- OpenSim/Grid/GridServer/Main.cs | 14 ++---- OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer.Config/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer.Config/DbUserConfig.cs | 35 +++++++------- OpenSim/Grid/UserServer/Main.cs | 17 +++---- OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs | 2 - OpenSim/Grid/UserServer/UserManager.cs | 13 +---- 15 files changed, 90 insertions(+), 143 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/AssetServer/AssetHttpServer.cs b/OpenSim/Grid/AssetServer/AssetHttpServer.cs index 31cb379..9546891 100644 --- a/OpenSim/Grid/AssetServer/AssetHttpServer.cs +++ b/OpenSim/Grid/AssetServer/AssetHttpServer.cs @@ -26,15 +26,10 @@ * */ using System; -using System.Collections.Generic; +using System.IO; using System.Net; using System.Text; using System.Text.RegularExpressions; -using System.Threading; -//using OpenSim.CAPS; -using Nwc.XmlRpc; -using System.Collections; -using OpenSim.Framework.Console; using OpenSim.Framework.Servers; namespace OpenSim.Grid.AssetServer @@ -69,9 +64,9 @@ namespace OpenSim.Grid.AssetServer response.KeepAlive = false; response.SendChunked = false; - System.IO.Stream body = request.InputStream; - System.Text.Encoding encoding = System.Text.Encoding.UTF8; - System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding); + Stream body = request.InputStream; + Encoding encoding = Encoding.UTF8; + StreamReader reader = new StreamReader(body, encoding); string requestBody = reader.ReadToEnd(); body.Close(); @@ -114,7 +109,7 @@ namespace OpenSim.Grid.AssetServer Encoding Windows1252Encoding = Encoding.GetEncoding(1252); byte[] buffer = Windows1252Encoding.GetBytes(responseString); - System.IO.Stream output = response.OutputStream; + Stream output = response.OutputStream; response.SendChunked = false; response.ContentLength64 = buffer.Length; output.Write(buffer, 0, buffer.Length); diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index d06998d..112d72f 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -29,20 +29,10 @@ using System; using System.IO; using System.Text; -using System.Timers; -using System.Net; -using System.Reflection; -using System.Threading; +using Db4objects.Db4o; using libsecondlife; -using OpenSim.Framework; -using OpenSim.Framework.Sims; using OpenSim.Framework.Console; using OpenSim.Framework.Types; -using OpenSim.Framework.Interfaces; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Servers; -using Db4objects.Db4o; -using Db4objects.Db4o.Query; namespace OpenSim.Grid.AssetServer { @@ -81,7 +71,7 @@ namespace OpenSim.Grid.AssetServer private OpenAsset_Main() { m_console = new LogBase("opengrid-AssetServer-console.log", "OpenAsset", this, false); - OpenSim.Framework.Console.MainLog.Instance = m_console; + MainLog.Instance = m_console; } public void Startup() @@ -161,17 +151,17 @@ namespace OpenSim.Grid.AssetServer public void setupDB() { - bool yapfile = System.IO.File.Exists("assets.yap"); + bool yapfile = File.Exists("assets.yap"); try { db = Db4oFactory.OpenFile("assets.yap"); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); + MainLog.Instance.Verbose( "Main.cs:setupDB() - creation"); } catch (Exception e) { db.Close(); - OpenSim.Framework.Console.MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } if (!yapfile) { @@ -273,7 +263,7 @@ namespace OpenSim.Grid.AssetServer { - string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; + string dataPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder; string fileName = Path.Combine(dataPath, filename); FileInfo fInfo = new FileInfo(fileName); long numBytes = fInfo.Length; diff --git a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs index f9a18a8..dc39ce2 100644 --- a/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/AssetServer/Properties/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs index 3f5d7dd..6c916a2 100644 --- a/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs +++ b/OpenSim/Grid/Framework.Manager/GridManagementAgent.cs @@ -25,12 +25,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ -using Nwc.XmlRpc; -using OpenSim.Framework; -using OpenSim.Framework.Servers; using System.Collections; -using System.Collections.Generic; using libsecondlife; +using Nwc.XmlRpc; +using OpenSim.Framework.Servers; namespace OpenSim.Framework.Manager { diff --git a/OpenSim/Grid/Framework.Manager/GridServerManager.cs b/OpenSim/Grid/Framework.Manager/GridServerManager.cs index d5eaf6f..67cd35d 100644 --- a/OpenSim/Grid/Framework.Manager/GridServerManager.cs +++ b/OpenSim/Grid/Framework.Manager/GridServerManager.cs @@ -28,10 +28,9 @@ using System; using System.Collections; -using System.Collections.Generic; -using Nwc.XmlRpc; using System.Threading; using libsecondlife; +using Nwc.XmlRpc; namespace OpenSim.Framework.Manager { diff --git a/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs index c9701d6..39c9e8f 100644 --- a/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs +++ b/OpenSim/Grid/GridServer.Config/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // Information about this assembly is defined by the following // attributes. // diff --git a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs index 2218004..4acf81d 100644 --- a/OpenSim/Grid/GridServer.Config/DbGridConfig.cs +++ b/OpenSim/Grid/GridServer.Config/DbGridConfig.cs @@ -26,10 +26,9 @@ * */ using System; -using System.Collections.Generic; +using Db4objects.Db4o; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; namespace OpenGrid.Config.GridConfigDb4o { @@ -44,7 +43,7 @@ namespace OpenGrid.Config.GridConfigDb4o /// A grid configuration object public GridConfig GetConfigObject() { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + MainLog.Instance.Verbose("Loading Db40Config dll"); return ( new DbGridConfig()); } } @@ -63,24 +62,24 @@ namespace OpenGrid.Config.GridConfigDb4o /// User configuration for the Grid Config interfaces /// public void LoadDefaults() { - OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); // About the grid options - this.GridOwner = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); + this.GridOwner = MainLog.Instance.CmdPrompt("Grid owner", "OGS development team"); // Asset Options - this.DefaultAssetServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); - this.AssetSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to asset server","null"); - this.AssetRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); + this.DefaultAssetServer = MainLog.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/"); + this.AssetSendKey = MainLog.Instance.CmdPrompt("Key to send to asset server","null"); + this.AssetRecvKey = MainLog.Instance.CmdPrompt("Key to expect from asset server","null"); // User Server Options - this.DefaultUserServer = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); - this.UserSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to user server","null"); - this.UserRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from user server","null"); + this.DefaultUserServer = MainLog.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/"); + this.UserSendKey = MainLog.Instance.CmdPrompt("Key to send to user server","null"); + this.UserRecvKey = MainLog.Instance.CmdPrompt("Key to expect from user server","null"); // Region Server Options - this.SimSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to sims","null"); - this.SimRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from sims","null"); + this.SimSendKey = MainLog.Instance.CmdPrompt("Key to send to sims","null"); + this.SimRecvKey = MainLog.Instance.CmdPrompt("Key to expect from sims","null"); } /// @@ -95,7 +94,7 @@ namespace OpenGrid.Config.GridConfigDb4o IObjectSet result = db.Get(typeof(DbGridConfig)); // Found? if(result.Count==1) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading"); foreach (DbGridConfig cfg in result) { // Import each setting into this class // Grid Settings @@ -114,40 +113,40 @@ namespace OpenGrid.Config.GridConfigDb4o } // Create a new configuration object from this class } else { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); // Load default settings into this class LoadDefaults(); // Saves to the database file... - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Writing out default settings to local database"); + MainLog.Instance.Verbose( "Writing out default settings to local database"); db.Set(this); // Closes file locks db.Close(); } } catch(Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } // Grid Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid owner: " + this.GridOwner); + MainLog.Instance.Verbose("Grid settings loaded:"); + MainLog.Instance.Verbose("Grid owner: " + this.GridOwner); // Asset Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); + MainLog.Instance.Verbose("Default asset server: " + this.DefaultAssetServer); + MainLog.Instance.Verbose("Key to send to asset server: " + this.AssetSendKey); + MainLog.Instance.Verbose("Key to expect from asset server: " + this.AssetRecvKey); // User Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default user server: " + this.DefaultUserServer); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to user server: " + this.UserSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); + MainLog.Instance.Verbose("Default user server: " + this.DefaultUserServer); + MainLog.Instance.Verbose("Key to send to user server: " + this.UserSendKey); + MainLog.Instance.Verbose("Key to expect from user server: " + this.UserRecvKey); // Region Settings - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to sims: " + this.SimSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); + MainLog.Instance.Verbose("Key to send to sims: " + this.SimSendKey); + MainLog.Instance.Verbose("Key to expect from sims: " + this.SimRecvKey); } /// diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index e562721..7986591 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -28,15 +28,14 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Text; using System.Reflection; -using OpenSim.Framework.Data; -using OpenSim.Framework.Utilities; -using OpenSim.Framework.Console; -using OpenSim.Framework.Sims; +using System.Xml; using libsecondlife; using Nwc.XmlRpc; -using System.Xml; +using OpenSim.Framework.Console; +using OpenSim.Framework.Data; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Utilities; namespace OpenSim.Grid.GridServer { @@ -45,7 +44,7 @@ namespace OpenSim.Grid.GridServer Dictionary _plugins = new Dictionary(); Dictionary _logplugins = new Dictionary(); - public OpenSim.Framework.Interfaces.GridConfig config; + public GridConfig config; /// /// Adds a new grid server plugin - grid servers will be requested in the order they were loaded. @@ -53,10 +52,10 @@ namespace OpenSim.Grid.GridServer /// The filename to the grid server plugin DLL public void AddPlugin(string FileName) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Attempting to load " + FileName); + MainLog.Instance.Verbose("Storage: Attempting to load " + FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); + MainLog.Instance.Verbose("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces."); foreach (Type pluginType in pluginAssembly.GetTypes()) { if (!pluginType.IsAbstract) @@ -69,7 +68,7 @@ namespace OpenSim.Grid.GridServer IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); this._plugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Storage: Added IGridData Interface"); + MainLog.Instance.Verbose("Storage: Added IGridData Interface"); } typeInterface = null; @@ -82,7 +81,7 @@ namespace OpenSim.Grid.GridServer ILogData plug = (ILogData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); this._logplugins.Add(plug.getName(), plug); - OpenSim.Framework.Console.MainLog.Instance.Verbose( "Storage: Added ILogData Interface"); + MainLog.Instance.Verbose( "Storage: Added ILogData Interface"); } typeInterface = null; @@ -110,7 +109,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); + MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); } } } @@ -120,7 +119,7 @@ namespace OpenSim.Grid.GridServer /// /// A UUID key of the region to return /// A SimProfileData for the region - public SimProfileData getRegion(libsecondlife.LLUUID uuid) + public SimProfileData getRegion(LLUUID uuid) { foreach(KeyValuePair kvp in _plugins) { try @@ -129,7 +128,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key); } } return null; @@ -150,7 +149,7 @@ namespace OpenSim.Grid.GridServer } catch { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); } } return null; @@ -174,7 +173,7 @@ namespace OpenSim.Grid.GridServer } catch { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); + MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); } } @@ -370,7 +369,7 @@ namespace OpenSim.Grid.GridServer simProfileList.Add(simProfileBlock); } - OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); + MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via FastMode"); } else { @@ -403,7 +402,7 @@ namespace OpenSim.Grid.GridServer } } } - OpenSim.Framework.Console.MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); + MainLog.Instance.Verbose("World map request processed, returned " + simProfileList.Count.ToString() + " region(s) in range via Standard Mode"); } responseData["sim-profiles"] = simProfileList; @@ -565,7 +564,7 @@ namespace OpenSim.Grid.GridServer try { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); + MainLog.Instance.Verbose("Updating / adding via " + _plugins.Count + " storage provider(s) registered."); foreach (KeyValuePair kvp in _plugins) { try @@ -575,7 +574,7 @@ namespace OpenSim.Grid.GridServer if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null)) { kvp.Value.AddProfile(TheSim); - OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); + MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); } else @@ -585,7 +584,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); + MainLog.Instance.Verbose("getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString()); } } return "OK"; diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 490f757..20c4905 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -27,20 +27,14 @@ */ using System; -using System.IO; -using System.Text; -using System.Timers; -using System.Net; -using System.Threading; using System.Reflection; -using libsecondlife; -using OpenSim.Framework.Manager; -using OpenSim.Framework; -using OpenSim.Framework.Sims; +using System.Threading; +using System.Timers; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; using OpenSim.GenericConfig; +using Timer=System.Timers.Timer; namespace OpenSim.Grid.GridServer { @@ -156,7 +150,7 @@ namespace OpenSim.Grid.GridServer m_console.Verbose( "Main.cs:Startup() - Starting sim status checker"); - System.Timers.Timer simCheckTimer = new System.Timers.Timer(3600000 * 3); // 3 Hours between updates. + Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); simCheckTimer.Enabled = true; } diff --git a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs index 303dddf..62a68a8 100644 --- a/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/GridServer/Properties/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs index 25e0211..15298e8 100644 --- a/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs +++ b/OpenSim/Grid/UserServer.Config/AssemblyInfo.cs @@ -26,9 +26,7 @@ * */ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // Information about this assembly is defined by the following // attributes. // diff --git a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs index 770a6b9..c7f8255 100644 --- a/OpenSim/Grid/UserServer.Config/DbUserConfig.cs +++ b/OpenSim/Grid/UserServer.Config/DbUserConfig.cs @@ -26,10 +26,9 @@ * */ using System; -using System.Collections.Generic; +using Db4objects.Db4o; using OpenSim.Framework.Console; using OpenSim.Framework.Interfaces; -using Db4objects.Db4o; namespace OpenUser.Config.UserConfigDb4o { @@ -37,7 +36,7 @@ namespace OpenUser.Config.UserConfigDb4o { public UserConfig GetConfigObject() { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Loading Db40Config dll"); + MainLog.Instance.Verbose("Loading Db40Config dll"); return ( new DbUserConfig()); } } @@ -47,13 +46,13 @@ namespace OpenUser.Config.UserConfigDb4o private IObjectContainer db; public void LoadDefaults() { - OpenSim.Framework.Console.MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); + MainLog.Instance.Notice("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); - this.DefaultStartupMsg = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); + this.DefaultStartupMsg = MainLog.Instance.CmdPrompt("Default startup message", "Welcome to OGS"); - this.GridServerURL = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); - this.GridSendKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to send to grid server","null"); - this.GridRecvKey = OpenSim.Framework.Console.MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); + this.GridServerURL = MainLog.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/"); + this.GridSendKey = MainLog.Instance.CmdPrompt("Key to send to grid server","null"); + this.GridRecvKey = MainLog.Instance.CmdPrompt("Key to expect from grid server","null"); } public override void InitConfig() { @@ -61,7 +60,7 @@ namespace OpenUser.Config.UserConfigDb4o db = Db4oFactory.OpenFile("openuser.yap"); IObjectSet result = db.Get(typeof(DbUserConfig)); if(result.Count==1) { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Found a UserConfig object in the local database, loading"); foreach (DbUserConfig cfg in result) { this.GridServerURL=cfg.GridServerURL; this.GridSendKey=cfg.GridSendKey; @@ -69,22 +68,22 @@ namespace OpenUser.Config.UserConfigDb4o this.DefaultStartupMsg=cfg.DefaultStartupMsg; } } else { - OpenSim.Framework.Console.MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); + MainLog.Instance.Verbose("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); LoadDefaults(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Writing out default settings to local database"); + MainLog.Instance.Verbose("Writing out default settings to local database"); db.Set(this); db.Close(); } } catch(Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("Config.cs:InitConfig() - Exception occured"); + MainLog.Instance.Warn(e.ToString()); } - OpenSim.Framework.Console.MainLog.Instance.Verbose("User settings loaded:"); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Grid server URL: " + this.GridServerURL); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to send to grid: " + this.GridSendKey); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); + MainLog.Instance.Verbose("User settings loaded:"); + MainLog.Instance.Verbose("Default startup message: " + this.DefaultStartupMsg); + MainLog.Instance.Verbose("Grid server URL: " + this.GridServerURL); + MainLog.Instance.Verbose("Key to send to grid: " + this.GridSendKey); + MainLog.Instance.Verbose("Key to expect from grid: " + this.GridRecvKey); } diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index c65bb97..5560e7d 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -27,18 +27,13 @@ */ using System; -using System.Collections; using System.Collections.Generic; using System.Reflection; -using System.IO; -using System.Text; using libsecondlife; -using OpenSim.Framework.User; -using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Interfaces; using OpenSim.Framework.Console; +using OpenSim.Framework.Interfaces; using OpenSim.Framework.Servers; +using OpenSim.Framework.User; using OpenSim.Framework.Utilities; using OpenSim.GenericConfig; @@ -73,7 +68,7 @@ namespace OpenSim.Grid.UserServer private OpenUser_Main() { m_console = new LogBase("opengrid-userserver-console.log", "OpenUser", this , false); - OpenSim.Framework.Console.MainLog.Instance = m_console; + MainLog.Instance = m_console; } private void Work() @@ -93,16 +88,16 @@ namespace OpenSim.Grid.UserServer this.ConfigDB(this.localXMLConfig); this.localXMLConfig.Close(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); + MainLog.Instance.Verbose("Main.cs:Startup() - Loading configuration"); Cfg = this.LoadConfigDll(this.ConfigDll); Cfg.InitConfig(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); + MainLog.Instance.Verbose("Main.cs:Startup() - Establishing data connection"); m_userManager = new UserManager(); m_userManager._config = Cfg; m_userManager.AddPlugin(StorageDll); - OpenSim.Framework.Console.MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); + MainLog.Instance.Verbose("Main.cs:Startup() - Starting HTTP process"); BaseHttpServer httpServer = new BaseHttpServer(8002); httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod); diff --git a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs index 5d5ce8d..a0a6f3c 100644 --- a/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs +++ b/OpenSim/Grid/UserServer/Properties/AssemblyInfo.cs @@ -1,7 +1,5 @@ using System.Reflection; -using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index a3e3322..4610a9d 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -27,22 +27,11 @@ */ using System; using System.Collections; -using System.Collections.Generic; -using System.Text; -using OpenSim.Framework.Data; -using libsecondlife; -using System.Reflection; - -using System.Xml; using Nwc.XmlRpc; +using OpenSim.Framework.Data; using OpenSim.Framework.Sims; -using OpenSim.Framework.Inventory; -using OpenSim.Framework.Utilities; - using OpenSim.Framework.UserManagement; -using System.Security.Cryptography; - namespace OpenSim.Grid.UserServer { public class UserManager : UserManagerBase -- cgit v1.1