From 25a49ac4de056f43d6c5803fcd34804fcea96ae2 Mon Sep 17 00:00:00 2001
From: Adam Frisby
Date: Wed, 30 Apr 2008 23:11:07 +0000
Subject: * Spring cleaned a bunch of '//TODO: unused' marked functions.
---
OpenSim/Data/MSSQL/MSSQLDataStore.cs | 8 --
OpenSim/Data/MySQL/MySQLDataStore.cs | 42 --------
OpenSim/Data/SQLite/SQLiteManager.cs | 69 -------------
.../Communications/RestClient/RestClient.cs | 54 ----------
.../ScriptServer/Region/RegionConnectionManager.cs | 13 ---
.../Agent/AssetDownload/AssetDownloadModule.cs | 114 ---------------------
.../DynamicTexture/DynamicTextureModule.cs | 6 --
.../World/Terrain/PaintBrushes/FlattenSphere.cs | 33 ------
OpenSim/Region/Environment/Scenes/Scene.cs | 22 ----
.../Engines/CSharp/Examples/ExportRegionToLSL.cs | 19 ----
OpenSim/TestSuite/BotManager.cs | 17 ---
OpenSim/Tools/pCampBot/BotManager.cs | 17 ---
12 files changed, 414 deletions(-)
diff --git a/OpenSim/Data/MSSQL/MSSQLDataStore.cs b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
index 6b3b8ef..dd3d20e 100644
--- a/OpenSim/Data/MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Data/MSSQL/MSSQLDataStore.cs
@@ -1350,14 +1350,6 @@ namespace OpenSim.Data.MSSQL
return param;
}
-// TODO: unused
-// private SqlParameter createParamWithValue(string name, Type type, Object o)
-// {
-// SqlParameter param = createSqlParameter(name, type);
-// param.Value = o;
-// return param;
-// }
-
private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn)
{
da.InsertCommand = createInsertCommand("prims", m_dataSet.Tables["prims"]);
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs
index d438064..1f9ea70 100644
--- a/OpenSim/Data/MySQL/MySQLDataStore.cs
+++ b/OpenSim/Data/MySQL/MySQLDataStore.cs
@@ -586,40 +586,6 @@ namespace OpenSim.Data.MySQL
return landDataForRegion;
}
-// TODO: unused
-// private void DisplayDataSet(DataSet ds, string title)
-// {
-// Debug.WriteLine(title);
-// //--- Loop through the DataTables
-// foreach (DataTable table in ds.Tables)
-// {
-// Debug.WriteLine("*** DataTable: " + table.TableName + "***");
-// //--- Loop through each DataTable's DataRows
-// foreach (DataRow row in table.Rows)
-// {
-// //--- Display the original values, if there are any.
-// if (row.HasVersion(DataRowVersion.Original))
-// {
-// Debug.Write("Original Row Values ===> ");
-// foreach (DataColumn column in table.Columns)
-// Debug.Write(column.ColumnName + " = " +
-// row[column, DataRowVersion.Original] + ", ");
-// Debug.WriteLine(String.Empty);
-// }
-// //--- Display the current values, if there are any.
-// if (row.HasVersion(DataRowVersion.Current))
-// {
-// Debug.Write("Current Row Values ====> ");
-// foreach (DataColumn column in table.Columns)
-// Debug.Write(column.ColumnName + " = " +
-// row[column, DataRowVersion.Current] + ", ");
-// Debug.WriteLine(String.Empty);
-// }
-// Debug.WriteLine(String.Empty);
-// }
-// }
-// }
-
public void Commit()
{
if (m_connection.State != ConnectionState.Open)
@@ -1515,14 +1481,6 @@ namespace OpenSim.Data.MySQL
return param;
}
-// TODO: unused
-// private MySqlParameter createParamWithValue(string name, Type type, Object o)
-// {
-// MySqlParameter param = createMySqlParameter(name, type);
-// param.Value = o;
-// return param;
-// }
-
private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn)
{
MySqlCommand insertCommand = createInsertCommand("prims", m_primTable);
diff --git a/OpenSim/Data/SQLite/SQLiteManager.cs b/OpenSim/Data/SQLite/SQLiteManager.cs
index 66ce6ab..e1d2cdf 100644
--- a/OpenSim/Data/SQLite/SQLiteManager.cs
+++ b/OpenSim/Data/SQLite/SQLiteManager.cs
@@ -92,75 +92,6 @@ namespace OpenSim.Data.SQLite
return (IDbCommand) dbcommand;
}
-// TODO: unused
-// private bool TestTables(SQLiteConnection conn)
-// {
-// SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn);
-// SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd);
-// DataSet tmpDS = new DataSet();
-// try
-// {
-// pDa.Fill(tmpDS, "regions");
-// }
-// catch (SqliteSyntaxException)
-// {
-// m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
-// InitDB(conn);
-// }
-// return true;
-// }
-
-// TODO: unused
-// private DataTable createRegionsTable()
-// {
-// DataTable regions = new DataTable("regions");
-
-// createCol(regions, "regionHandle", typeof (ulong));
-// createCol(regions, "regionName", typeof (String));
-// createCol(regions, "uuid", typeof (String));
-
-// createCol(regions, "regionRecvKey", typeof (String));
-// createCol(regions, "regionSecret", typeof (String));
-// createCol(regions, "regionSendKey", typeof (String));
-
-// createCol(regions, "regionDataURI", typeof (String));
-// createCol(regions, "serverIP", typeof (String));
-// createCol(regions, "serverPort", typeof (String));
-// createCol(regions, "serverURI", typeof (String));
-
-
-// createCol(regions, "locX", typeof (uint));
-// createCol(regions, "locY", typeof (uint));
-// createCol(regions, "locZ", typeof (uint));
-
-// createCol(regions, "eastOverrideHandle", typeof (ulong));
-// createCol(regions, "westOverrideHandle", typeof (ulong));
-// createCol(regions, "southOverrideHandle", typeof (ulong));
-// createCol(regions, "northOverrideHandle", typeof (ulong));
-
-// createCol(regions, "regionAssetURI", typeof (String));
-// createCol(regions, "regionAssetRecvKey", typeof (String));
-// createCol(regions, "regionAssetSendKey", typeof (String));
-
-// createCol(regions, "regionUserURI", typeof (String));
-// createCol(regions, "regionUserRecvKey", typeof (String));
-// createCol(regions, "regionUserSendKey", typeof (String));
-
-// // Add in contraints
-// regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]};
-// return regions;
-// }
-
-// TODO: unused
-// private void InitDB(SQLiteConnection conn)
-// {
-// string createUsers = defineTable(createRegionsTable());
-// SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn);
-// conn.Open();
-// pcmd.ExecuteNonQuery();
-// conn.Close();
-// }
-
///
/// Reads a region row from a database reader
///
diff --git a/OpenSim/Framework/Communications/RestClient/RestClient.cs b/OpenSim/Framework/Communications/RestClient/RestClient.cs
index 5463134..6877690 100644
--- a/OpenSim/Framework/Communications/RestClient/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient/RestClient.cs
@@ -196,17 +196,6 @@ namespace OpenSim.Framework.Communications
return s.Substring(s.Length - 1, 1) == "/";
}
-// TODO: unused
-// ///
-// /// return a slash or blank. A slash will be returned if the string does not contain one
-// ///
-// /// stromg to be examined
-// /// slash '/' if not already present
-// private string slash(string s)
-// {
-// return isSlashed(s) ? String.Empty : "/";
-// }
-
///
/// Build a Uri based on the initial Url, path elements and parameters
///
@@ -280,49 +269,6 @@ namespace OpenSim.Framework.Communications
}
}
-// TODO: unused
-// ///
-// /// Async method, invoked when the initial response if received from the server
-// ///
-// ///
-// private void ResponseIsReadyDelegate(IAsyncResult ar)
-// {
-// try
-// {
-// // grab response
-// WebRequest wr = (WebRequest) ar.AsyncState;
-// _response = (HttpWebResponse) wr.EndGetResponse(ar);
-
-// // get response stream, and setup async reading
-// Stream s = _response.GetResponseStream();
-// IAsyncResult asynchronousResult =
-// s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s);
-
-// // TODO! Implement timeout, without killing the server
-// // wait until completed, or we timed out
-// // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
-// }
-// catch (Exception e)
-// {
-// _allDone.Set();
-// _asyncException = e;
-// }
-// }
-
-// TODO: unused
-// // Abort the request if the timer fires.
-// private static void TimeoutCallback(object state, bool timedOut)
-// {
-// if (timedOut)
-// {
-// HttpWebRequest request = state as HttpWebRequest;
-// if (request != null)
-// {
-// request.Abort();
-// }
-// }
-// }
-
#endregion Async communications with server
///
diff --git a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
index a9679f8..b815a37 100644
--- a/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
+++ b/OpenSim/Grid/ScriptServer/ScriptServer/Region/RegionConnectionManager.cs
@@ -38,18 +38,5 @@ namespace OpenSim.Grid.ScriptServer
m_ScriptServerMain = scm;
m_Connection = Connection;
}
-
-// TODO: unused:
-// private void DataReceived(object objectID, object scriptID)
-// {
-// // TODO: HOW DO WE RECEIVE DATA? ASYNC?
-// // ANYHOW WE END UP HERE?
-
-// // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT
-// ScriptRez();
-
-// // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE
-// touch_start();
-// }
}
}
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
index 33e917a..c0b7380 100644
--- a/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
+++ b/OpenSim/Region/Environment/Modules/Agent/AssetDownload/AssetDownloadModule.cs
@@ -178,120 +178,6 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetDownload
}
}
-// TODO: unused
-// private void RunAssetQueue()
-// {
-// while (true)
-// {
-// try
-// {
-// ProcessAssetQueue();
-// Thread.Sleep(500);
-// }
-// catch (Exception)
-// {
-// // m_log.Error("[ASSET CACHE]: " + e.ToString());
-// }
-// }
-// }
-
-// TODO: unused
-// ///
-// /// Process the asset queue which sends packets directly back to the client.
-// ///
-// private void ProcessAssetQueue()
-// {
-// //should move the asset downloading to a module, like has been done with texture downloading
-// if (AssetRequests.Count == 0)
-// {
-// //no requests waiting
-// return;
-// }
-// // if less than 5, do all of them
-// int num = Math.Min(5, AssetRequests.Count);
-
-// AssetRequest req;
-// for (int i = 0; i < num; i++)
-// {
-// req = (AssetRequest)AssetRequests[i];
-// //Console.WriteLine("sending asset " + req.RequestAssetID);
-// TransferInfoPacket Transfer = new TransferInfoPacket();
-// Transfer.TransferInfo.ChannelType = 2;
-// Transfer.TransferInfo.Status = 0;
-// Transfer.TransferInfo.TargetType = 0;
-// if (req.AssetRequestSource == 2)
-// {
-// Transfer.TransferInfo.Params = new byte[20];
-// Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
-// int assType = (int)req.AssetInf.Type;
-// Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
-// }
-// else if (req.AssetRequestSource == 3)
-// {
-// Transfer.TransferInfo.Params = req.Params;
-// // Transfer.TransferInfo.Params = new byte[100];
-// //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
-// //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
-// }
-// Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
-// Transfer.TransferInfo.TransferID = req.TransferRequestID;
-// req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
-
-// if (req.NumPackets == 1)
-// {
-// TransferPacketPacket TransferPacket = new TransferPacketPacket();
-// TransferPacket.TransferData.Packet = 0;
-// TransferPacket.TransferData.ChannelType = 2;
-// TransferPacket.TransferData.TransferID = req.TransferRequestID;
-// TransferPacket.TransferData.Data = req.AssetInf.Data;
-// TransferPacket.TransferData.Status = 1;
-// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
-// }
-// else
-// {
-// int processedLength = 0;
-// // libsecondlife hardcodes 1500 as the maximum data chunk size
-// int maxChunkSize = 1250;
-// int packetNumber = 0;
-
-// while (processedLength < req.AssetInf.Data.Length)
-// {
-// TransferPacketPacket TransferPacket = new TransferPacketPacket();
-// TransferPacket.TransferData.Packet = packetNumber;
-// TransferPacket.TransferData.ChannelType = 2;
-// TransferPacket.TransferData.TransferID = req.TransferRequestID;
-
-// int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
-// byte[] chunk = new byte[chunkSize];
-// Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
-
-// TransferPacket.TransferData.Data = chunk;
-
-// // 0 indicates more packets to come, 1 indicates last packet
-// if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
-// {
-// TransferPacket.TransferData.Status = 0;
-// }
-// else
-// {
-// TransferPacket.TransferData.Status = 1;
-// }
-
-// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
-
-// processedLength += chunkSize;
-// packetNumber++;
-// }
-// }
-// }
-
-// //remove requests that have been completed
-// for (int i = 0; i < num; i++)
-// {
-// AssetRequests.RemoveAt(0);
-// }
-// }
-
///
/// Calculate the number of packets required to send the asset to the client.
///
diff --git a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
index 735a3cf..68ca5e9 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -239,12 +239,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.DynamicTexture
part.ScheduleFullUpdate();
}
-// TODO: unused
-// private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
-// {
-// return BlendTextures(frontImage, backImage, false, 0);
-// }
-
private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha)
{
Bitmap image1 = new Bitmap(OpenJPEG.DecodeToImage(frontImage));
diff --git a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
index 6a5a166..d4f3b9f 100644
--- a/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
+++ b/OpenSim/Region/Environment/Modules/World/Terrain/PaintBrushes/FlattenSphere.cs
@@ -31,39 +31,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain.PaintBrushes
{
public class FlattenSphere : ITerrainPaintableEffect
{
-// TODO: unused
-// private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
-// {
-// int w = map.Width;
-// int h = map.Height;
-
-// if (x > w - 2.0)
-// x = w - 2.0;
-// if (y > h - 2.0)
-// y = h - 2.0;
-// if (x < 0.0)
-// x = 0.0;
-// if (y < 0.0)
-// y = 0.0;
-
-// int stepSize = 1;
-// double h00 = map[(int)x, (int)y];
-// double h10 = map[(int)x + stepSize, (int)y];
-// double h01 = map[(int)x, (int)y + stepSize];
-// double h11 = map[(int)x + stepSize, (int)y + stepSize];
-// double h1 = h00;
-// double h2 = h10;
-// double h3 = h01;
-// double h4 = h11;
-// double a00 = h1;
-// double a10 = h2 - h1;
-// double a01 = h3 - h1;
-// double a11 = h1 - h2 - h3 + h4;
-// double partialx = x - (int)x;
-// double partialz = y - (int)y;
-// double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
-// return hi;
-// }
#region ITerrainPaintableEffect Members
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 4a80b8d..2ce6314 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -794,28 +794,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- //Updates the time in the viewer.
-// TODO: unused
-// private void UpdateInWorldTime()
-// {
-// m_timeUpdateCount++;
-// if (m_timeUpdateCount > 600)
-// {
-// List avatars = GetAvatars();
-// foreach (ScenePresence avatar in avatars)
-// {
-// avatar.ControllingClient.SendViewerTime(m_timePhase);
-// }
-
-// m_timeUpdateCount = 0;
-// m_timePhase++;
-// if (m_timePhase > 94)
-// {
-// m_timePhase = 0;
-// }
-// }
-// }
-
private void SendSimStatsPackets(SimStatsPacket pack)
{
List StatSendAgents = GetScenePresences();
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
index 00a7df3..1b0b6b7 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/Examples/ExportRegionToLSL.cs
@@ -71,24 +71,5 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
System.Console.WriteLine(sequence);
}*/
}
-
-// TODO: unused
-// private string processPrimitiveToString(SceneObjectPart prim)
-// {
-// /*string desc = prim.Description;
-// string name = prim.Name;
-// LLVector3 pos = prim.Pos;
-// LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w);
-// LLVector3 scale = prim.Scale;
-// LLVector3 rootPos = prim.WorldPos;
-
-// string setPrimParams = String.Empty;
-
-// setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n";
-
-// return setPrimParams;
-// */
-// return System.String.Empty;
-// }
}
}
diff --git a/OpenSim/TestSuite/BotManager.cs b/OpenSim/TestSuite/BotManager.cs
index ec71973..61cc908 100644
--- a/OpenSim/TestSuite/BotManager.cs
+++ b/OpenSim/TestSuite/BotManager.cs
@@ -178,23 +178,6 @@ namespace OpenSim.TestSuite
{
return new ConsoleBase("Region", this);
}
-
- ///
- /// I don't think the bots use this..
- ///
- ///
- ///
- ///
- // TODO: unused: private string CombineParams(string[] commandParams, int pos)
- // TODO: unused: {
- // TODO: unused: string result = String.Empty;
- // TODO: unused: for (int i = pos; i < commandParams.Length; i++)
- // TODO: unused: {
- // TODO: unused: result += commandParams[i] + " ";
- // TODO: unused: }
- // TODO: unused: result = result.TrimEnd(' ');
- // TODO: unused: return result;
- // TODO: unused: }
///
/// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit
diff --git a/OpenSim/Tools/pCampBot/BotManager.cs b/OpenSim/Tools/pCampBot/BotManager.cs
index df06f47..8877f7d 100644
--- a/OpenSim/Tools/pCampBot/BotManager.cs
+++ b/OpenSim/Tools/pCampBot/BotManager.cs
@@ -177,23 +177,6 @@ namespace pCampBot
{
return new ConsoleBase("Region", this);
}
-
- ///
- /// I don't think the bots use this..
- ///
- ///
- ///
- ///
- // TODO: unused: private string CombineParams(string[] commandParams, int pos)
- // TODO: unused: {
- // TODO: unused: string result = String.Empty;
- // TODO: unused: for (int i = pos; i < commandParams.Length; i++)
- // TODO: unused: {
- // TODO: unused: result += commandParams[i] + " ";
- // TODO: unused: }
- // TODO: unused: result = result.TrimEnd(' ');
- // TODO: unused: return result;
- // TODO: unused: }
///
/// Command runnint tool.. Currently use it to add bots, shutdown and (dangerous)Forcequit
--
cgit v1.1