From 01f31fd933bbaec246d2fef5756b7d83be7980e0 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 16:23:53 +0000 Subject: * Breaking all the code, breaking all the code..! * Made a bunch more members static, removed some dead code, general cleaning. --- OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 8 ++++---- OpenSim/Framework/Communications/Cache/AssetCache.cs | 2 +- OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs | 2 +- OpenSim/Framework/Communications/Capabilities/Caps.cs | 8 ++++---- OpenSim/Framework/Communications/LoginResponse.cs | 2 +- OpenSim/Framework/Communications/LoginService.cs | 2 +- OpenSim/Framework/Communications/RestClient.cs | 4 ++-- OpenSim/Framework/ConfigurationMember.cs | 2 +- OpenSim/Framework/Console/ConsoleBase.cs | 2 +- OpenSim/Framework/Console/OpenSimAppender.cs | 2 +- OpenSim/Framework/PacketPool.cs | 4 ++-- OpenSim/Framework/Remoting.cs | 2 +- OpenSim/Framework/Servers/BaseHttpServer.cs | 8 ++++---- OpenSim/Framework/Servers/BinaryStreamHandler.cs | 2 +- 14 files changed, 25 insertions(+), 25 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 0cc10c4..945163c 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs @@ -43,7 +43,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage) + protected static AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage) { AssetBase asset = new AssetBase( new LLUUID(assetIdStr), @@ -64,7 +64,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem return asset; } - protected void LoadAsset(AssetBase info, bool image, string path) + protected static void LoadAsset(AssetBase info, bool image, string path) { FileInfo fInfo = new FileInfo(path); long numBytes = fInfo.Length; @@ -119,9 +119,9 @@ namespace OpenSim.Framework.AssetLoader.Filesystem /// /// Use the asset set information at path to load assets /// - /// + /// /// - protected void LoadXmlAssetSet(string assetSetPath, List assets) + protected static void LoadXmlAssetSet(string assetSetPath, List assets) { m_log.InfoFormat("[ASSETS]: Loading asset set {0}", assetSetPath); diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index c81ea35..69e0437 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -542,7 +542,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// /// - private int CalculateNumPackets(byte[] data) + private static int CalculateNumPackets(byte[] data) { const uint m_maxPacketSize = 600; int numPackets = 1; diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs index a39738d..b3852c0 100644 --- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs +++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs @@ -241,7 +241,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// /// - private void LoadFromFile(string path, string fileDescription, ConfigAction action) + private static void LoadFromFile(string path, string fileDescription, ConfigAction action) { if (File.Exists(path)) { diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index b6ee04d..8061e28 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -378,7 +378,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// /// /// - protected LLSDMapLayer GetLLSDMapLayerResponse() + protected static LLSDMapLayer GetLLSDMapLayerResponse() { LLSDMapLayer mapLayer = new LLSDMapLayer(); mapLayer.Right = 5000; @@ -758,7 +758,7 @@ namespace OpenSim.Framework.Communications.Capabilities // bw.Close(); // fs.Close(); //} - private void SaveAssetToFile(string filename, byte[] data) + private static void SaveAssetToFile(string filename, byte[] data) { string assetPath = "UserAssets"; if (!Directory.Exists(assetPath)) @@ -840,7 +840,7 @@ namespace OpenSim.Framework.Communications.Capabilities // bw.Close(); // fs.Close(); //} - private void SaveAssetToFile(string filename, byte[] data) + private static void SaveAssetToFile(string filename, byte[] data) { string assetPath = "UserAssets"; if (!Directory.Exists(assetPath)) @@ -945,7 +945,7 @@ namespace OpenSim.Framework.Communications.Capabilities // bw.Close(); // fs.Close(); //} - private void SaveAssetToFile(string filename, byte[] data) + private static void SaveAssetToFile(string filename, byte[] data) { string assetPath = "UserAssets"; if (!Directory.Exists(assetPath)) diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index f7989ab..b6f1f69 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -496,7 +496,7 @@ namespace OpenSim.Framework.Communications return llsdBack; } - private LLSDArray WrapLLSDMap(LLSDMap wrapMe) + private static LLSDArray WrapLLSDMap(LLSDMap wrapMe) { LLSDArray array = new LLSDArray(); array.Add(wrapMe); diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index db4e2ec..fa78a30 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -728,7 +728,7 @@ namespace OpenSim.Framework.Communications return m_welcomeMessage; } - private LoginResponse.BuddyList ConvertFriendListItem(List LFL) + private static LoginResponse.BuddyList ConvertFriendListItem(List LFL) { LoginResponse.BuddyList buddylistreturn = new LoginResponse.BuddyList(); foreach (FriendListItem fl in LFL) diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 91284e8..b0b7b1e 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -164,7 +164,7 @@ namespace OpenSim.Framework.Communications /// /// string to be examined /// true if slash is present - private bool isSlashed(string s) + private static bool isSlashed(string s) { return s.Substring(s.Length - 1, 1) == "/"; } @@ -196,7 +196,7 @@ namespace OpenSim.Framework.Communications sb.Append("&"); sb.Append(kv.Key); - if (kv.Value != null && kv.Value.Length != 0) + if (!string.IsNullOrEmpty(kv.Value)) { sb.Append("="); sb.Append(kv.Value); diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs index 91b87a5..b452794 100644 --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs @@ -472,7 +472,7 @@ namespace OpenSim.Framework } } - private IGenericConfig LoadConfigDll(string dllName) + private static IGenericConfig LoadConfigDll(string dllName) { Assembly pluginAssembly = Assembly.LoadFrom(dllName); IGenericConfig plug = null; diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 0b22d0e..b336545 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -66,7 +66,7 @@ namespace OpenSim.Framework.Console /// /// arbitrary string for input /// an ansii color - private ConsoleColor DeriveColor(string input) + private static ConsoleColor DeriveColor(string input) { int colIdx = (input.ToUpper().GetHashCode() % 6) + 9; return (ConsoleColor) colIdx; diff --git a/OpenSim/Framework/Console/OpenSimAppender.cs b/OpenSim/Framework/Console/OpenSimAppender.cs index 86df3c0..d381179 100644 --- a/OpenSim/Framework/Console/OpenSimAppender.cs +++ b/OpenSim/Framework/Console/OpenSimAppender.cs @@ -101,7 +101,7 @@ namespace OpenSim.Framework.Console } } - private ConsoleColor DeriveColor(string input) + private static ConsoleColor DeriveColor(string input) { int colIdx = (input.ToUpper().GetHashCode() % 6) + 9; return (ConsoleColor) colIdx; diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs index be56cdc..5eac9de 100644 --- a/OpenSim/Framework/PacketPool.cs +++ b/OpenSim/Framework/PacketPool.cs @@ -89,7 +89,7 @@ namespace OpenSim.Framework public Packet GetPacket(PacketType type) { - Packet packet = null; + Packet packet; lock (pool) { @@ -109,7 +109,7 @@ namespace OpenSim.Framework } // private byte[] decoded_header = new byte[10]; - private PacketType GetType(byte[] bytes) + private static PacketType GetType(byte[] bytes) { byte[] decoded_header = new byte[10 + 8]; ushort id; diff --git a/OpenSim/Framework/Remoting.cs b/OpenSim/Framework/Remoting.cs index 7f18221..cb0911e 100644 --- a/OpenSim/Framework/Remoting.cs +++ b/OpenSim/Framework/Remoting.cs @@ -123,7 +123,7 @@ namespace OpenSim.Framework /// A /// B /// C - private byte[] AppendArrays(byte[] a, byte[] b) + private static byte[] AppendArrays(byte[] a, byte[] b) { byte[] c = new byte[a.Length + b.Length]; Buffer.BlockCopy(a, 0, c, 0, a.Length); diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 7c268ed..088d944 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -496,7 +496,7 @@ namespace OpenSim.Framework.Servers } } - private void DoHTTPGruntWork(Hashtable responsedata, HttpListenerResponse response) + private static void DoHTTPGruntWork(Hashtable responsedata, HttpListenerResponse response) { int responsecode = (int)responsedata["int_response_code"]; string responseString = (string)responsedata["str_response_string"]; @@ -505,7 +505,7 @@ namespace OpenSim.Framework.Servers //Even though only one other part of the entire code uses HTTPHandlers, we shouldn't expect this //and should check for NullReferenceExceptions - if (contentType == null || contentType == "") + if (string.IsNullOrEmpty(contentType)) { contentType = "text/html"; } @@ -677,12 +677,12 @@ namespace OpenSim.Framework.Servers } // Fallback HTTP responses in case the HTTP error response files don't exist - private string getDefaultHTTP404(string host) + private static string getDefaultHTTP404(string host) { return "404 Page not found

Ooops!

The page you requested has been obsconded with by knomes. Find hippos quick!

If you are trying to log-in, your link parameters should have: "-loginpage http://" + host + "/?method=login -loginuri http://" + host + "/" in your link

"; } - private string getDefaultHTTP500() + private static string getDefaultHTTP500() { return "500 Internal Server Error

Ooops!

The server you requested is overun by knomes! Find hippos quick!

"; } diff --git a/OpenSim/Framework/Servers/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/BinaryStreamHandler.cs index bfa3bd5..dcd1cba 100644 --- a/OpenSim/Framework/Servers/BinaryStreamHandler.cs +++ b/OpenSim/Framework/Servers/BinaryStreamHandler.cs @@ -51,7 +51,7 @@ namespace OpenSim.Framework.Servers m_method = binaryMethod; } - private byte[] ReadFully(Stream stream) + private static byte[] ReadFully(Stream stream) { byte[] buffer = new byte[32768]; using (MemoryStream ms = new MemoryStream()) -- cgit v1.1