Comment out unused private methods.

0.6.0-stable
Jeff Ames 2008-03-25 03:49:08 +00:00
parent a8d9a58dd2
commit 9d1b42c39a
22 changed files with 539 additions and 518 deletions

View File

@ -195,15 +195,16 @@ namespace OpenSim.Framework.Communications
return s.Substring(s.Length - 1, 1) == "/"; return s.Substring(s.Length - 1, 1) == "/";
} }
/// <summary> // TODO: unused
/// return a slash or blank. A slash will be returned if the string does not contain one // /// <summary>
/// </summary> // /// return a slash or blank. A slash will be returned if the string does not contain one
/// <param name="s">stromg to be examined</param> // /// </summary>
/// <returns>slash '/' if not already present</returns> // /// <param name="s">stromg to be examined</param>
private string slash(string s) // /// <returns>slash '/' if not already present</returns>
{ // private string slash(string s)
return isSlashed(s) ? String.Empty : "/"; // {
} // return isSlashed(s) ? String.Empty : "/";
// }
/// <summary> /// <summary>
/// Build a Uri based on the initial Url, path elements and parameters /// Build a Uri based on the initial Url, path elements and parameters
@ -278,46 +279,48 @@ namespace OpenSim.Framework.Communications
} }
} }
/// <summary> // TODO: unused
/// Async method, invoked when the initial response if received from the server // /// <summary>
/// </summary> // /// Async method, invoked when the initial response if received from the server
/// <param name="ar"></param> // /// </summary>
private void ResponseIsReadyDelegate(IAsyncResult ar) // /// <param name="ar"></param>
{ // private void ResponseIsReadyDelegate(IAsyncResult ar)
try // {
{ // try
// grab response // {
WebRequest wr = (WebRequest) ar.AsyncState; // // grab response
_response = (HttpWebResponse) wr.EndGetResponse(ar); // WebRequest wr = (WebRequest) ar.AsyncState;
// _response = (HttpWebResponse) wr.EndGetResponse(ar);
// get response stream, and setup async reading // // get response stream, and setup async reading
Stream s = _response.GetResponseStream(); // Stream s = _response.GetResponseStream();
IAsyncResult asynchronousResult = // IAsyncResult asynchronousResult =
s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s); // s.BeginRead(_readbuf, 0, BufferSize, new AsyncCallback(StreamIsReadyDelegate), s);
// TODO! Implement timeout, without killing the server // // TODO! Implement timeout, without killing the server
// wait until completed, or we timed out // // wait until completed, or we timed out
// ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); // // ThreadPool.RegisterWaitForSingleObject(asynchronousResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
} // }
catch (Exception e) // catch (Exception e)
{ // {
_allDone.Set(); // _allDone.Set();
_asyncException = e; // _asyncException = e;
} // }
} // }
// Abort the request if the timer fires. // TODO: unused
private static void TimeoutCallback(object state, bool timedOut) // // Abort the request if the timer fires.
{ // private static void TimeoutCallback(object state, bool timedOut)
if (timedOut) // {
{ // if (timedOut)
HttpWebRequest request = state as HttpWebRequest; // {
if (request != null) // HttpWebRequest request = state as HttpWebRequest;
{ // if (request != null)
request.Abort(); // {
} // request.Abort();
} // }
} // }
// }
#endregion Async communications with server #endregion Async communications with server

View File

@ -1351,12 +1351,13 @@ namespace OpenSim.Framework.Data.MSSQL
return param; return param;
} }
private SqlParameter createParamWithValue(string name, Type type, Object o) // TODO: unused
{ // private SqlParameter createParamWithValue(string name, Type type, Object o)
SqlParameter param = createSqlParameter(name, type); // {
param.Value = o; // SqlParameter param = createSqlParameter(name, type);
return param; // param.Value = o;
} // return param;
// }
private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn) private void setupPrimCommands(SqlDataAdapter da, SqlConnection conn)
{ {

View File

@ -478,38 +478,39 @@ namespace OpenSim.Framework.Data.MySQL
return landDataForRegion; return landDataForRegion;
} }
private void DisplayDataSet(DataSet ds, string title) // TODO: unused
{ // private void DisplayDataSet(DataSet ds, string title)
Debug.WriteLine(title); // {
//--- Loop through the DataTables // Debug.WriteLine(title);
foreach (DataTable table in ds.Tables) // //--- Loop through the DataTables
{ // foreach (DataTable table in ds.Tables)
Debug.WriteLine("*** DataTable: " + table.TableName + "***"); // {
//--- Loop through each DataTable's DataRows // Debug.WriteLine("*** DataTable: " + table.TableName + "***");
foreach (DataRow row in table.Rows) // //--- 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)) // //--- 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("Original Row Values ===> ");
Debug.Write(column.ColumnName + " = " + // foreach (DataColumn column in table.Columns)
row[column, DataRowVersion.Original] + ", "); // Debug.Write(column.ColumnName + " = " +
Debug.WriteLine(String.Empty); // row[column, DataRowVersion.Original] + ", ");
} // Debug.WriteLine(String.Empty);
//--- Display the current values, if there are any. // }
if (row.HasVersion(DataRowVersion.Current)) // //--- 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("Current Row Values ====> ");
Debug.Write(column.ColumnName + " = " + // foreach (DataColumn column in table.Columns)
row[column, DataRowVersion.Current] + ", "); // Debug.Write(column.ColumnName + " = " +
Debug.WriteLine(String.Empty); // row[column, DataRowVersion.Current] + ", ");
} // Debug.WriteLine(String.Empty);
Debug.WriteLine(String.Empty); // }
} // Debug.WriteLine(String.Empty);
} // }
} // }
// }
public void Commit() public void Commit()
{ {
@ -1397,12 +1398,13 @@ namespace OpenSim.Framework.Data.MySQL
return param; return param;
} }
private MySqlParameter createParamWithValue(string name, Type type, Object o) // TODO: unused
{ // private MySqlParameter createParamWithValue(string name, Type type, Object o)
MySqlParameter param = createMySqlParameter(name, type); // {
param.Value = o; // MySqlParameter param = createMySqlParameter(name, type);
return param; // param.Value = o;
} // return param;
// }
private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn) private void SetupPrimCommands(MySqlDataAdapter da, MySqlConnection conn)
{ {

View File

@ -92,72 +92,74 @@ namespace OpenSim.Framework.Data.SQLite
return (IDbCommand) dbcommand; return (IDbCommand) dbcommand;
} }
private bool TestTables(SQLiteConnection conn) // TODO: unused
{ // private bool TestTables(SQLiteConnection conn)
SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn); // {
SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd); // SQLiteCommand cmd = new SQLiteCommand("SELECT * FROM regions", conn);
DataSet tmpDS = new DataSet(); // SQLiteDataAdapter pDa = new SQLiteDataAdapter(cmd);
try // DataSet tmpDS = new DataSet();
{ // try
pDa.Fill(tmpDS, "regions"); // {
} // pDa.Fill(tmpDS, "regions");
catch (SqliteSyntaxException) // }
{ // catch (SqliteSyntaxException)
m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating"); // {
InitDB(conn); // m_log.Info("[DATASTORE]: SQLite Database doesn't exist... creating");
} // InitDB(conn);
return true; // }
} // return true;
// }
private DataTable createRegionsTable() // TODO: unused
{ // private DataTable createRegionsTable()
DataTable regions = new DataTable("regions"); // {
// DataTable regions = new DataTable("regions");
createCol(regions, "regionHandle", typeof (ulong)); // createCol(regions, "regionHandle", typeof (ulong));
createCol(regions, "regionName", typeof (String)); // createCol(regions, "regionName", typeof (String));
createCol(regions, "uuid", typeof (String)); // createCol(regions, "uuid", typeof (String));
createCol(regions, "regionRecvKey", typeof (String)); // createCol(regions, "regionRecvKey", typeof (String));
createCol(regions, "regionSecret", typeof (String)); // createCol(regions, "regionSecret", typeof (String));
createCol(regions, "regionSendKey", typeof (String)); // createCol(regions, "regionSendKey", typeof (String));
createCol(regions, "regionDataURI", typeof (String)); // createCol(regions, "regionDataURI", typeof (String));
createCol(regions, "serverIP", typeof (String)); // createCol(regions, "serverIP", typeof (String));
createCol(regions, "serverPort", typeof (String)); // createCol(regions, "serverPort", typeof (String));
createCol(regions, "serverURI", typeof (String)); // createCol(regions, "serverURI", typeof (String));
createCol(regions, "locX", typeof (uint)); // createCol(regions, "locX", typeof (uint));
createCol(regions, "locY", typeof (uint)); // createCol(regions, "locY", typeof (uint));
createCol(regions, "locZ", typeof (uint)); // createCol(regions, "locZ", typeof (uint));
createCol(regions, "eastOverrideHandle", typeof (ulong)); // createCol(regions, "eastOverrideHandle", typeof (ulong));
createCol(regions, "westOverrideHandle", typeof (ulong)); // createCol(regions, "westOverrideHandle", typeof (ulong));
createCol(regions, "southOverrideHandle", typeof (ulong)); // createCol(regions, "southOverrideHandle", typeof (ulong));
createCol(regions, "northOverrideHandle", typeof (ulong)); // createCol(regions, "northOverrideHandle", typeof (ulong));
createCol(regions, "regionAssetURI", typeof (String)); // createCol(regions, "regionAssetURI", typeof (String));
createCol(regions, "regionAssetRecvKey", typeof (String)); // createCol(regions, "regionAssetRecvKey", typeof (String));
createCol(regions, "regionAssetSendKey", typeof (String)); // createCol(regions, "regionAssetSendKey", typeof (String));
createCol(regions, "regionUserURI", typeof (String)); // createCol(regions, "regionUserURI", typeof (String));
createCol(regions, "regionUserRecvKey", typeof (String)); // createCol(regions, "regionUserRecvKey", typeof (String));
createCol(regions, "regionUserSendKey", typeof (String)); // createCol(regions, "regionUserSendKey", typeof (String));
// Add in contraints // // Add in contraints
regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]}; // regions.PrimaryKey = new DataColumn[] {regions.Columns["UUID"]};
return regions; // return regions;
} // }
private void InitDB(SQLiteConnection conn)
{
string createUsers = defineTable(createRegionsTable());
SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn);
conn.Open();
pcmd.ExecuteNonQuery();
conn.Close();
}
// TODO: unused
// private void InitDB(SQLiteConnection conn)
// {
// string createUsers = defineTable(createRegionsTable());
// SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn);
// conn.Open();
// pcmd.ExecuteNonQuery();
// conn.Close();
// }
/// <summary> /// <summary>
/// Reads a region row from a database reader /// Reads a region row from a database reader

View File

@ -624,19 +624,20 @@ namespace OpenSim.Framework.Data.SQLite
return user; return user;
} }
private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms) // TODO: unused
{ // private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms)
row["ownerID"] = ownerID.UUID.ToString(); // {
row["friendID"] = friendID.UUID.ToString(); // row["ownerID"] = ownerID.UUID.ToString();
row["friendPerms"] = perms; // row["friendID"] = friendID.UUID.ToString();
foreach (DataColumn col in ds.Tables["userfriends"].Columns) // row["friendPerms"] = perms;
{ // foreach (DataColumn col in ds.Tables["userfriends"].Columns)
if (row[col] == null) // {
{ // if (row[col] == null)
row[col] = String.Empty; // {
} // row[col] = String.Empty;
} // }
} // }
// }
private void fillUserRow(DataRow row, UserProfileData user) private void fillUserRow(DataRow row, UserProfileData user)
{ {

View File

@ -41,16 +41,17 @@ namespace OpenSim.Grid.ScriptServer
m_Connection = Connection; m_Connection = Connection;
} }
private void DataReceived(object objectID, object scriptID) // TODO: unused:
{ // private void DataReceived(object objectID, object scriptID)
// TODO: HOW DO WE RECEIVE DATA? ASYNC? // {
// ANYHOW WE END UP HERE? // // TODO: HOW DO WE RECEIVE DATA? ASYNC?
// // ANYHOW WE END UP HERE?
// NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT // // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT
ScriptRez(); // ScriptRez();
// EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE // // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE
touch_start(); // touch_start();
} // }
} }
} }

View File

@ -175,117 +175,119 @@ namespace OpenSim.Region.Environment.Modules
} }
} }
private void RunAssetQueue() // TODO: unused
{ // private void RunAssetQueue()
while (true) // {
{ // while (true)
try // {
{ // try
ProcessAssetQueue(); // {
Thread.Sleep(500); // ProcessAssetQueue();
} // Thread.Sleep(500);
catch (Exception) // }
{ // catch (Exception)
// m_log.Error("[ASSET CACHE]: " + e.ToString()); // {
} // // m_log.Error("[ASSET CACHE]: " + e.ToString());
} // }
} // }
// }
/// <summary> // TODO: unused
/// Process the asset queue which sends packets directly back to the client. // /// <summary>
/// </summary> // /// Process the asset queue which sends packets directly back to the client.
private void ProcessAssetQueue() // /// </summary>
{ // private void ProcessAssetQueue()
//should move the asset downloading to a module, like has been done with texture downloading // {
if (AssetRequests.Count == 0) // //should move the asset downloading to a module, like has been done with texture downloading
{ // if (AssetRequests.Count == 0)
//no requests waiting // {
return; // //no requests waiting
} // return;
// if less than 5, do all of them // }
int num = Math.Min(5, AssetRequests.Count); // // if less than 5, do all of them
// int num = Math.Min(5, AssetRequests.Count);
AssetRequest req; // AssetRequest req;
for (int i = 0; i < num; i++) // for (int i = 0; i < num; i++)
{ // {
req = (AssetRequest)AssetRequests[i]; // req = (AssetRequest)AssetRequests[i];
//Console.WriteLine("sending asset " + req.RequestAssetID); // //Console.WriteLine("sending asset " + req.RequestAssetID);
TransferInfoPacket Transfer = new TransferInfoPacket(); // TransferInfoPacket Transfer = new TransferInfoPacket();
Transfer.TransferInfo.ChannelType = 2; // Transfer.TransferInfo.ChannelType = 2;
Transfer.TransferInfo.Status = 0; // Transfer.TransferInfo.Status = 0;
Transfer.TransferInfo.TargetType = 0; // Transfer.TransferInfo.TargetType = 0;
if (req.AssetRequestSource == 2) // if (req.AssetRequestSource == 2)
{ // {
Transfer.TransferInfo.Params = new byte[20]; // Transfer.TransferInfo.Params = new byte[20];
Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); // Array.Copy(req.RequestAssetID.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
int assType = (int)req.AssetInf.Type; // int assType = (int)req.AssetInf.Type;
Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4); // Array.Copy(Helpers.IntToBytes(assType), 0, Transfer.TransferInfo.Params, 16, 4);
} // }
else if (req.AssetRequestSource == 3) // else if (req.AssetRequestSource == 3)
{ // {
Transfer.TransferInfo.Params = req.Params; // Transfer.TransferInfo.Params = req.Params;
// Transfer.TransferInfo.Params = new byte[100]; // // Transfer.TransferInfo.Params = new byte[100];
//Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16); // //Array.Copy(req.RequestUser.AgentId.GetBytes(), 0, Transfer.TransferInfo.Params, 0, 16);
//Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16); // //Array.Copy(req.RequestUser.SessionId.GetBytes(), 0, Transfer.TransferInfo.Params, 16, 16);
} // }
Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length; // Transfer.TransferInfo.Size = (int)req.AssetInf.Data.Length;
Transfer.TransferInfo.TransferID = req.TransferRequestID; // Transfer.TransferInfo.TransferID = req.TransferRequestID;
req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset); // req.RequestUser.OutPacket(Transfer, ThrottleOutPacketType.Asset);
if (req.NumPackets == 1) // if (req.NumPackets == 1)
{ // {
TransferPacketPacket TransferPacket = new TransferPacketPacket(); // TransferPacketPacket TransferPacket = new TransferPacketPacket();
TransferPacket.TransferData.Packet = 0; // TransferPacket.TransferData.Packet = 0;
TransferPacket.TransferData.ChannelType = 2; // TransferPacket.TransferData.ChannelType = 2;
TransferPacket.TransferData.TransferID = req.TransferRequestID; // TransferPacket.TransferData.TransferID = req.TransferRequestID;
TransferPacket.TransferData.Data = req.AssetInf.Data; // TransferPacket.TransferData.Data = req.AssetInf.Data;
TransferPacket.TransferData.Status = 1; // TransferPacket.TransferData.Status = 1;
req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); // req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
} // }
else // else
{ // {
int processedLength = 0; // int processedLength = 0;
// libsecondlife hardcodes 1500 as the maximum data chunk size // // libsecondlife hardcodes 1500 as the maximum data chunk size
int maxChunkSize = 1250; // int maxChunkSize = 1250;
int packetNumber = 0; // int packetNumber = 0;
while (processedLength < req.AssetInf.Data.Length) // while (processedLength < req.AssetInf.Data.Length)
{ // {
TransferPacketPacket TransferPacket = new TransferPacketPacket(); // TransferPacketPacket TransferPacket = new TransferPacketPacket();
TransferPacket.TransferData.Packet = packetNumber; // TransferPacket.TransferData.Packet = packetNumber;
TransferPacket.TransferData.ChannelType = 2; // TransferPacket.TransferData.ChannelType = 2;
TransferPacket.TransferData.TransferID = req.TransferRequestID; // TransferPacket.TransferData.TransferID = req.TransferRequestID;
int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize); // int chunkSize = Math.Min(req.AssetInf.Data.Length - processedLength, maxChunkSize);
byte[] chunk = new byte[chunkSize]; // byte[] chunk = new byte[chunkSize];
Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length); // Array.Copy(req.AssetInf.Data, processedLength, chunk, 0, chunk.Length);
TransferPacket.TransferData.Data = chunk; // TransferPacket.TransferData.Data = chunk;
// 0 indicates more packets to come, 1 indicates last packet // // 0 indicates more packets to come, 1 indicates last packet
if (req.AssetInf.Data.Length - processedLength > maxChunkSize) // if (req.AssetInf.Data.Length - processedLength > maxChunkSize)
{ // {
TransferPacket.TransferData.Status = 0; // TransferPacket.TransferData.Status = 0;
} // }
else // else
{ // {
TransferPacket.TransferData.Status = 1; // TransferPacket.TransferData.Status = 1;
} // }
req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset); // req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
processedLength += chunkSize; // processedLength += chunkSize;
packetNumber++; // packetNumber++;
} // }
} // }
} // }
//remove requests that have been completed // //remove requests that have been completed
for (int i = 0; i < num; i++) // for (int i = 0; i < num; i++)
{ // {
AssetRequests.RemoveAt(0); // AssetRequests.RemoveAt(0);
} // }
} // }
/// <summary> /// <summary>
/// Calculate the number of packets required to send the asset to the client. /// Calculate the number of packets required to send the asset to the client.

View File

@ -228,10 +228,11 @@ namespace OpenSim.Region.Environment.Modules
part.ScheduleFullUpdate(); part.ScheduleFullUpdate();
} }
private byte[] BlendTextures(byte[] frontImage, byte[] backImage) // TODO: unused
{ // private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
return BlendTextures(frontImage, backImage, false, 0); // {
} // return BlendTextures(frontImage, backImage, false, 0);
// }
private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha) private byte[] BlendTextures(byte[] frontImage, byte[] backImage, bool setNewAlpha, byte newAlpha)
{ {

View File

@ -37,38 +37,39 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
return z; return z;
} }
private double GetBilinearInterpolate(double x, double y, ITerrainChannel map) // TODO: unused
{ // private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
int w = map.Width; // {
int h = map.Height; // int w = map.Width;
// int h = map.Height;
if (x > w - 2.0) // if (x > w - 2.0)
x = w - 2.0; // x = w - 2.0;
if (y > h - 2.0) // if (y > h - 2.0)
y = h - 2.0; // y = h - 2.0;
if (x < 0.0) // if (x < 0.0)
x = 0.0; // x = 0.0;
if (y < 0.0) // if (y < 0.0)
y = 0.0; // y = 0.0;
int stepSize = 1; // int stepSize = 1;
double h00 = map[(int)x, (int)y]; // double h00 = map[(int)x, (int)y];
double h10 = map[(int)x + stepSize, (int)y]; // double h10 = map[(int)x + stepSize, (int)y];
double h01 = map[(int)x, (int)y + stepSize]; // double h01 = map[(int)x, (int)y + stepSize];
double h11 = map[(int)x + stepSize, (int)y + stepSize]; // double h11 = map[(int)x + stepSize, (int)y + stepSize];
double h1 = h00; // double h1 = h00;
double h2 = h10; // double h2 = h10;
double h3 = h01; // double h3 = h01;
double h4 = h11; // double h4 = h11;
double a00 = h1; // double a00 = h1;
double a10 = h2 - h1; // double a10 = h2 - h1;
double a01 = h3 - h1; // double a01 = h3 - h1;
double a11 = h1 - h2 - h3 + h4; // double a11 = h1 - h2 - h3 + h4;
double partialx = x - (int)x; // double partialx = x - (int)x;
double partialz = y - (int)y; // double partialz = y - (int)y;
double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz); // double hi = a00 + (a10 * partialx) + (a01 * partialz) + (a11 * partialx * partialz);
return hi; // return hi;
} // }
#region ITerrainPaintableEffect Members #region ITerrainPaintableEffect Members

View File

@ -790,25 +790,26 @@ namespace OpenSim.Region.Environment.Scenes
} }
//Updates the time in the viewer. //Updates the time in the viewer.
private void UpdateInWorldTime() // TODO: unused
{ // private void UpdateInWorldTime()
m_timeUpdateCount++; // {
if (m_timeUpdateCount > 600) // m_timeUpdateCount++;
{ // if (m_timeUpdateCount > 600)
List<ScenePresence> avatars = GetAvatars(); // {
foreach (ScenePresence avatar in avatars) // List<ScenePresence> avatars = GetAvatars();
{ // foreach (ScenePresence avatar in avatars)
avatar.ControllingClient.SendViewerTime(m_timePhase); // {
} // avatar.ControllingClient.SendViewerTime(m_timePhase);
// }
m_timeUpdateCount = 0; // m_timeUpdateCount = 0;
m_timePhase++; // m_timePhase++;
if (m_timePhase > 94) // if (m_timePhase > 94)
{ // {
m_timePhase = 0; // m_timePhase = 0;
} // }
} // }
} // }
private void SendSimStatsPackets(SimStatsPacket pack) private void SendSimStatsPackets(SimStatsPacket pack)
{ {

View File

@ -72,22 +72,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
}*/ }*/
} }
private string processPrimitiveToString(SceneObjectPart prim) // TODO: unused
{ // private string processPrimitiveToString(SceneObjectPart prim)
/*string desc = prim.Description; // {
string name = prim.Name; // /*string desc = prim.Description;
LLVector3 pos = prim.Pos; // string name = prim.Name;
LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w); // LLVector3 pos = prim.Pos;
LLVector3 scale = prim.Scale; // LLQuaternion rot = new LLQuaternion(prim.Rotation.x, prim.Rotation.y, prim.Rotation.z, prim.Rotation.w);
LLVector3 rootPos = prim.WorldPos; // LLVector3 scale = prim.Scale;
// LLVector3 rootPos = prim.WorldPos;
string setPrimParams = String.Empty; // string setPrimParams = String.Empty;
setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n"; // setPrimParams += "[PRIM_SCALE, " + scale.ToString() + ", PRIM_POS, " + rootPos.ToString() + ", PRIM_ROTATION, " + rot.ToString() + "]\n";
return setPrimParams; // return setPrimParams;
*/ // */
return System.String.Empty; // return System.String.Empty;
} // }
} }
} }

View File

@ -59,35 +59,36 @@ namespace OpenSim.Region.Physics.Meshing
// const string baseDir = "rawFiles"; // const string baseDir = "rawFiles";
private const string baseDir = null; //"rawFiles"; private const string baseDir = null; //"rawFiles";
private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2, // TODO: unused
PhysicsVector r2, ref float lambda, ref float mu) // private static void IntersectionParameterPD(PhysicsVector p1, PhysicsVector r1, PhysicsVector p2,
{ // PhysicsVector r2, ref float lambda, ref float mu)
// p1, p2, points on the straight // {
// r1, r2, directional vectors of the straight. Not necessarily of length 1! // // p1, p2, points on the straight
// note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points, // // r1, r2, directional vectors of the straight. Not necessarily of length 1!
// thus allowing to decide whether an intersection is between two points // // note, that l, m can be scaled such, that the range 0..1 is mapped to the area between two points,
// // thus allowing to decide whether an intersection is between two points
float r1x = r1.X; // float r1x = r1.X;
float r1y = r1.Y; // float r1y = r1.Y;
float r2x = r2.X; // float r2x = r2.X;
float r2y = r2.Y; // float r2y = r2.Y;
float denom = r1y*r2x - r1x*r2y; // float denom = r1y*r2x - r1x*r2y;
if (denom == 0.0) // if (denom == 0.0)
{ // {
lambda = Single.NaN; // lambda = Single.NaN;
mu = Single.NaN; // mu = Single.NaN;
return; // return;
} // }
float p1x = p1.X; // float p1x = p1.X;
float p1y = p1.Y; // float p1y = p1.Y;
float p2x = p2.X; // float p2x = p2.X;
float p2y = p2.Y; // float p2y = p2.Y;
lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom; // lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom;
mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom; // mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom;
} // }
private static List<Triangle> FindInfluencedTriangles(List<Triangle> triangles, Vertex v) private static List<Triangle> FindInfluencedTriangles(List<Triangle> triangles, Vertex v)
{ {

View File

@ -170,11 +170,12 @@ namespace OpenSim.Region.Physics.Meshing
return result; return result;
} }
private bool InsertVertex(Vertex v, int iAfter) // TODO: unused
{ // private bool InsertVertex(Vertex v, int iAfter)
vertices.Insert(iAfter + 1, v); // {
return true; // vertices.Insert(iAfter + 1, v);
} // return true;
// }
private Vertex getNextVertex(Vertex currentVertex) private Vertex getNextVertex(Vertex currentVertex)
{ {

View File

@ -504,26 +504,27 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
} }
private void standupStraight()
{
// The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air. // TODO: unused:
// The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you // private void standupStraight()
// change appearance and when you enter the simulator // {
// After this routine is done, the amotor stabilizes much quicker // // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air.
d.Vector3 feet; // // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
d.Vector3 head; // // change appearance and when you enter the simulator
d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet); // // After this routine is done, the amotor stabilizes much quicker
d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head); // d.Vector3 feet;
float posture = head.Z - feet.Z; // d.Vector3 head;
// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, -1.0f, out feet);
// d.BodyGetRelPointPos(Body, 0.0f, 0.0f, 1.0f, out head);
// float posture = head.Z - feet.Z;
// restoring force proportional to lack of posture: // // restoring force proportional to lack of posture:
float servo = (2.5f - posture) * POSTURE_SERVO; // float servo = (2.5f - posture) * POSTURE_SERVO;
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f); // d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f); // d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
//d.Matrix3 bodyrotation = d.BodyGetRotation(Body); // //d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
//m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22); // //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
} // }
public override PhysicsVector Force public override PhysicsVector Force
{ {

View File

@ -981,12 +981,11 @@ namespace OpenSim.Region.Physics.OdePlugin
#endregion #endregion
private float GetTerrainHeightAtXY(float x, float y) // TODO: unused
{ // private float GetTerrainHeightAtXY(float x, float y)
return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x]; // {
// return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
// }
}
#region Add/Remove Entities #region Add/Remove Entities

View File

@ -141,26 +141,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
} }
private static int privateThreadCount = 0; private static int privateThreadCount = 0;
private Thread StartScriptLoadUnloadThread() // TODO: unused
{ // private Thread StartScriptLoadUnloadThread()
Thread t = new Thread(ScriptLoadUnloadThreadLoop); // {
string name = "ScriptLoadUnloadThread:"; // Thread t = new Thread(ScriptLoadUnloadThreadLoop);
if (PrivateThread) // string name = "ScriptLoadUnloadThread:";
{ // if (PrivateThread)
name += "Private:" + privateThreadCount; // {
privateThreadCount++; // name += "Private:" + privateThreadCount;
} // privateThreadCount++;
else // }
{ // else
name += "Shared"; // {
} // name += "Shared";
t.Name = name; // }
t.IsBackground = true; // t.Name = name;
t.Priority = ThreadPriority.Normal; // t.IsBackground = true;
t.Start(); // t.Priority = ThreadPriority.Normal;
OpenSim.Framework.ThreadTracker.Add(t); // t.Start();
return t; // OpenSim.Framework.ThreadTracker.Add(t);
} // return t;
// }
~ScriptManager() ~ScriptManager()
{ {
@ -184,26 +185,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
#region Load / Unload scripts (Thread loop) #region Load / Unload scripts (Thread loop)
private void ScriptLoadUnloadThreadLoop() // TODO: unused
{ // private void ScriptLoadUnloadThreadLoop()
try // {
{ // try
while (true) // {
{ // while (true)
if (LUQueue.Count == 0) // {
Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); // if (LUQueue.Count == 0)
//if (PleaseShutdown) // Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
// return; // //if (PleaseShutdown)
DoScriptLoadUnload(); // // return;
} // DoScriptLoadUnload();
} // }
catch (ThreadAbortException tae) // }
{ // catch (ThreadAbortException tae)
string a = tae.ToString(); // {
a = String.Empty; // string a = tae.ToString();
// Expected // a = String.Empty;
} // // Expected
} // }
// }
public void DoScriptLoadUnload() public void DoScriptLoadUnload()
{ {

View File

@ -74,12 +74,13 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
Clients[ID].Disconnect(); Clients[ID].Disconnect();
} }
void asyncConnected(IAsyncResult iar) // TODO: unused
{ // void asyncConnected(IAsyncResult iar)
Socket client = (Socket)iar.AsyncState; // {
client.EndConnect(iar); // Socket client = (Socket)iar.AsyncState;
ProcessConnection(client); // client.EndConnect(iar);
} // ProcessConnection(client);
// }
private int ProcessConnection(Socket client) private int ProcessConnection(Socket client)
{ {

View File

@ -34,18 +34,19 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{ {
internal partial class LSO_Parser internal partial class LSO_Parser
{ {
private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName) // TODO: unused:
{ // private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
TypeBuilder typeBuilder = modBuilder.DefineType(typeName, // {
TypeAttributes.Public | // TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
TypeAttributes.Class | // TypeAttributes.Public |
TypeAttributes.AutoClass | // TypeAttributes.Class |
TypeAttributes.AnsiClass | // TypeAttributes.AutoClass |
TypeAttributes.BeforeFieldInit | // TypeAttributes.AnsiClass |
TypeAttributes.AutoLayout, // TypeAttributes.BeforeFieldInit |
typeof (object), // TypeAttributes.AutoLayout,
new Type[] {typeof (object)}); // typeof (object),
return typeBuilder; // new Type[] {typeof (object)});
} // return typeBuilder;
// }
} }
} }

View File

@ -342,10 +342,11 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
return false; return false;
} }
private void IL_PopToStack(ILGenerator il) // TODO: unused
{ // private void IL_PopToStack(ILGenerator il)
IL_PopToStack(il, 1); // {
} // IL_PopToStack(il, 1);
// }
private void IL_PopToStack(ILGenerator il, int count) private void IL_PopToStack(ILGenerator il, int count)
{ {

View File

@ -310,37 +310,33 @@ namespace OpenSim.Region.Terrain
} }
} }
lastEdit = DateTime.Now; lastEdit = DateTime.Now;
return; return;
} }
// TODO: unused
// /// <summary>
// /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
/// <summary> // /// </summary>
/// Checks to make sure the terrain is within baked values +/- maxRaise/minLower // private void SetTerrainWithinBounds()
/// </summary> // {
private void SetTerrainWithinBounds() // int x, y;
{ // for (x = 0; x < w; x++)
int x, y; // {
for (x = 0; x < w; x++) // for (y = 0; y < h; y++)
{ // {
for (y = 0; y < h; y++) // if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise))
{ // {
if ((heightmap.Get(x, y) > revertmap.Get(x, y) + maxRaise)) // heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise;
{ // }
heightmap.map[x, y] = revertmap.Get(x, y) + maxRaise; // if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower))
} // {
if ((heightmap.Get(x, y) > revertmap.Get(x, y) - minLower)) // heightmap.map[x, y] = revertmap.Get(x, y) - minLower;
{ // }
heightmap.map[x, y] = revertmap.Get(x, y) - minLower; // }
} // }
} // }
}
}
/// <summary> /// <summary>
/// Converts the heightmap to a 65536 value 1D floating point array /// Converts the heightmap to a 65536 value 1D floating point array

View File

@ -70,48 +70,49 @@ namespace libTerrain
Blend(flat, temp); Blend(flat, temp);
} }
private void FlattenFast(double rx, double ry, double size, double amount) // TODO: unused
{ // private void FlattenFast(double rx, double ry, double size, double amount)
int x, y; // {
double avg = 0; // int x, y;
double div = 0; // double avg = 0;
// double div = 0;
int minX = Math.Max(0, (int) (rx - (size + 1))); // int minX = Math.Max(0, (int) (rx - (size + 1)));
int maxX = Math.Min(w, (int) (rx + (size + 1))); // int maxX = Math.Min(w, (int) (rx + (size + 1)));
int minY = Math.Max(0, (int) (ry - (size + 1))); // int minY = Math.Max(0, (int) (ry - (size + 1)));
int maxY = Math.Min(h, (int) (ry + (size + 1))); // int maxY = Math.Min(h, (int) (ry + (size + 1)));
for (x = minX; x < maxX; x++) // for (x = minX; x < maxX; x++)
{ // {
for (y = minY; y < maxY; y++) // for (y = minY; y < maxY; y++)
{ // {
double z = size; // double z = size;
z *= z; // z *= z;
z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); // z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
if (z < 0) // if (z < 0)
z = 0; // z = 0;
avg += z*amount; // avg += z*amount;
div += z; // div += z;
} // }
} // }
double height = avg/div; // double height = avg/div;
for (x = minX; x < maxX; x++) // for (x = minX; x < maxX; x++)
{ // {
for (y = minY; y < maxY; y++) // for (y = minY; y < maxY; y++)
{ // {
double z = size; // double z = size;
z *= z; // z *= z;
z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry)); // z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
if (z > 0.0) // if (z > 0.0)
Set(x, y, Tools.LinearInterpolate(map[x, y], height, z)); // Set(x, y, Tools.LinearInterpolate(map[x, y], height, z));
} // }
} // }
} // }
public void Flatten(Channel mask, double amount) public void Flatten(Channel mask, double amount)
{ {

View File

@ -40,12 +40,13 @@ namespace libTerrain
return ((i) + (N + 2)*(j)); return ((i) + (N + 2)*(j));
} }
private static void nsSwap(ref double x0, ref double x) // TODO: unused
{ // private static void nsSwap(ref double x0, ref double x)
double tmp = x0; // {
x0 = x; // double tmp = x0;
x = tmp; // x0 = x;
} // x = tmp;
// }
private static void nsSwap(ref double[] x0, ref double[] x) private static void nsSwap(ref double[] x0, ref double[] x)
{ {