From 76d8eaa4069d6445c47784168e274ba4253f7b9c Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 18:50:44 +0000 Subject: * Thanks to Mic Bowman for inspiring me to look at that we are still using ASCIIEncoder in places we shouldn't. --- OpenSim/Data/MSSQL/MSSQLGridData.cs | 2 +- OpenSim/Data/MySQL/MySQLGridData.cs | 2 +- OpenSim/Data/SQLite/SQLiteGridData.cs | 2 +- OpenSim/Data/SQLite/SQLiteRegionData.cs | 16 ---------------- OpenSim/Framework/Servers/BaseHttpServer.cs | 2 +- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 2 +- .../Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 2 +- OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs | 4 ++-- OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs | 3 --- .../Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 15 --------------- OpenSim/TestSuite/BotManager.cs | 2 +- OpenSim/Tools/pCampBot/BotManager.cs | 2 +- 12 files changed, 10 insertions(+), 44 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLGridData.cs b/OpenSim/Data/MSSQL/MSSQLGridData.cs index 3330732..cf81bee 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridData.cs @@ -417,7 +417,7 @@ namespace OpenSim.Data.MSSQL public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { SHA512Managed HashProvider = new SHA512Managed(); - ASCIIEncoding TextProvider = new ASCIIEncoding(); + Encoding TextProvider = new UTF8Encoding(); byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); byte[] hash = HashProvider.ComputeHash(stream); diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index df52ae0..e830133 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs @@ -366,7 +366,7 @@ namespace OpenSim.Data.MySQL public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { SHA512Managed HashProvider = new SHA512Managed(); - ASCIIEncoding TextProvider = new ASCIIEncoding(); + Encoding TextProvider = new UTF8Encoding(); byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); byte[] hash = HashProvider.ComputeHash(stream); diff --git a/OpenSim/Data/SQLite/SQLiteGridData.cs b/OpenSim/Data/SQLite/SQLiteGridData.cs index f07b98f..989ec77 100644 --- a/OpenSim/Data/SQLite/SQLiteGridData.cs +++ b/OpenSim/Data/SQLite/SQLiteGridData.cs @@ -224,7 +224,7 @@ namespace OpenSim.Data.SQLite public bool AuthenticateSim(LLUUID uuid, ulong handle, string authhash, string challenge) { SHA512Managed HashProvider = new SHA512Managed(); - ASCIIEncoding TextProvider = new ASCIIEncoding(); + Encoding TextProvider = new UTF8Encoding(); byte[] stream = TextProvider.GetBytes(uuid.ToString() + ":" + handle.ToString() + ":" + challenge); byte[] hash = HashProvider.ComputeHash(stream); diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 9908735..b648ee8 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs @@ -1223,22 +1223,6 @@ namespace OpenSim.Data.SQLite s.TextureEntry = textureEntry; s.ExtraParams = (byte[]) row["ExtraParams"]; - // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); - // string texture = encoding.GetString((Byte[])row["Texture"]); - // if (!texture.StartsWith("<")) - // { - // //here so that we can still work with old format database files (ie from before I added xml serialization) - // LLObject.TextureEntry textureEntry = null; - // textureEntry = new LLObject.TextureEntry(new LLUUID(texture)); - // s.TextureEntry = textureEntry.ToBytes(); - // } - // else - // { - // TextureBlock textureEntry = TextureBlock.FromXmlString(texture); - // s.TextureEntry = textureEntry.TextureData; - // s.ExtraParams = textureEntry.ExtraParams; - // } - return s; } diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 088d944..e198c2c 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -201,7 +201,7 @@ namespace OpenSim.Framework.Servers } } } - catch (SocketException e) + catch (SocketException) { // At least on linux, it appears that if the client makes a request without requiring the response, // an unconnected socket exception is thrown when we close the response output stream. There's no diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index ba23216..2dbdce6 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -515,7 +515,7 @@ namespace OpenSim.Region.DataSnapshot m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace); } // This is not quite working, so... - string responseStr = ASCIIEncoding.UTF8.GetString(response); + string responseStr = Encoding.UTF8.GetString(response); m_log.Info("[DATASNAPSHOT] data service notified: " + url); } diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 419ca8f..67c6ad2 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -583,7 +583,7 @@ namespace OpenSim.Region.ScriptEngine.Common return objectname; } - EntityBase SensedObject = null; + EntityBase SensedObject; lock (World.Entities) { World.Entities.TryGetValue(objecUUID, out SensedObject); diff --git a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs index 013ae0f..c293ecb 100644 --- a/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs +++ b/OpenSim/Region/ScriptEngine/Common/TRPC_Remote.cs @@ -119,7 +119,7 @@ namespace OpenSim.Region.ScriptEngine.Common if (myIQS.QueueSize == 0) return; - string receivedData = Encoding.ASCII.GetString(myIQS.Queue, 0, myIQS.QueueSize); + string receivedData = Encoding.UTF8.GetString(myIQS.Queue, 0, myIQS.QueueSize); Debug.WriteLine("RAW: " + receivedData); byte newLine = 10; @@ -197,7 +197,7 @@ namespace OpenSim.Region.ScriptEngine.Common tmpStr += "," + p[i].GetType().ToString() + "|" + HttpUtility.UrlEncode(p[i].ToString()); // .Replace(",", "%44") } tmpStr += "\n"; - byte[] byteData = Encoding.ASCII.GetBytes(tmpStr); + byte[] byteData = Encoding.UTF8.GetBytes(tmpStr); TCPS.Send(ID, byteData, 0, byteData.Length); } } diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs index e4a57e8..06ae1e9 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs @@ -289,10 +289,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO //} // READ EVENT CODE CHUNKS - LSO_Struct.CodeChunk[] myEventCodeChunk; if (myStateFrameBlock.StateCount > 0) { - myEventCodeChunk = new LSO_Struct.CodeChunk[myStateFrameBlock.StateCount]; for (int i = 0; i < myStateFrameBlock.StateCount; i++) { // TODO: Somehow organize events and functions so they can be found again, @@ -465,7 +463,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO // TODO: How to determine number of codechunks -- does this method work? myCodeChunk.CodeChunkArguments = new List(); byte reader = br_read(1)[0]; - reader = br_read(1)[0]; // NOTE ON CODE CHUNK ARGUMENTS // This determins type definition diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs index 39babd6..c917e1e 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs @@ -656,21 +656,6 @@ namespace OpenSim.DataStore.MSSQL s.ExtraParams = (byte[]) row["ExtraParams"]; - // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); - // string texture = encoding.GetString((Byte[])row["Texture"]); - // if (!texture.StartsWith("<")) - // { - // //here so that we can still work with old format database files (ie from before I added xml serialization) - // LLObject.TextureEntry textureEntry = null; - // textureEntry = new LLObject.TextureEntry(new LLUUID(texture)); - // s.TextureEntry = textureEntry.ToBytes(); - // } - // else - // { - // TextureBlock textureEntry = TextureBlock.FromXmlString(texture); - // s.TextureEntry = textureEntry.TextureData; - // s.ExtraParams = textureEntry.ExtraParams; - // } return s; } diff --git a/OpenSim/TestSuite/BotManager.cs b/OpenSim/TestSuite/BotManager.cs index 61cc908..77e9044 100644 --- a/OpenSim/TestSuite/BotManager.cs +++ b/OpenSim/TestSuite/BotManager.cs @@ -197,7 +197,7 @@ namespace OpenSim.TestSuite Environment.Exit(0); break; case "addbots": - int newbots = 0; + int newbots; Helpers.TryParse(cmdparams[0], out newbots); if (newbots > 0) diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs index 8877f7d..302dc08 100644 --- a/OpenSim/Tools/pCampBot/BotManager.cs +++ b/OpenSim/Tools/pCampBot/BotManager.cs @@ -196,7 +196,7 @@ namespace pCampBot Environment.Exit(0); break; case "addbots": - int newbots = 0; + int newbots; Helpers.TryParse(cmdparams[0], out newbots); if (newbots > 0) -- cgit v1.1