Comment out unused private methods.
parent
a8d9a58dd2
commit
9d1b42c39a
|
@ -195,15 +195,16 @@ namespace OpenSim.Framework.Communications
|
|||
return s.Substring(s.Length - 1, 1) == "/";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// return a slash or blank. A slash will be returned if the string does not contain one
|
||||
/// </summary>
|
||||
/// <param name="s">stromg to be examined</param>
|
||||
/// <returns>slash '/' if not already present</returns>
|
||||
private string slash(string s)
|
||||
{
|
||||
return isSlashed(s) ? String.Empty : "/";
|
||||
}
|
||||
// TODO: unused
|
||||
// /// <summary>
|
||||
// /// return a slash or blank. A slash will be returned if the string does not contain one
|
||||
// /// </summary>
|
||||
// /// <param name="s">stromg to be examined</param>
|
||||
// /// <returns>slash '/' if not already present</returns>
|
||||
// private string slash(string s)
|
||||
// {
|
||||
// return isSlashed(s) ? String.Empty : "/";
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Build a Uri based on the initial Url, path elements and parameters
|
||||
|
@ -278,46 +279,48 @@ namespace OpenSim.Framework.Communications
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Async method, invoked when the initial response if received from the server
|
||||
/// </summary>
|
||||
/// <param name="ar"></param>
|
||||
private void ResponseIsReadyDelegate(IAsyncResult ar)
|
||||
{
|
||||
try
|
||||
{
|
||||
// grab response
|
||||
WebRequest wr = (WebRequest) ar.AsyncState;
|
||||
_response = (HttpWebResponse) wr.EndGetResponse(ar);
|
||||
// TODO: unused
|
||||
// /// <summary>
|
||||
// /// Async method, invoked when the initial response if received from the server
|
||||
// /// </summary>
|
||||
// /// <param name="ar"></param>
|
||||
// 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);
|
||||
// // 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! 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;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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
|
||||
|
||||
|
|
|
@ -1351,12 +1351,13 @@ namespace OpenSim.Framework.Data.MSSQL
|
|||
return param;
|
||||
}
|
||||
|
||||
private SqlParameter createParamWithValue(string name, Type type, Object o)
|
||||
{
|
||||
SqlParameter param = createSqlParameter(name, type);
|
||||
param.Value = o;
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -478,38 +478,39 @@ namespace OpenSim.Framework.Data.MySQL
|
|||
return landDataForRegion;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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()
|
||||
{
|
||||
|
@ -1397,12 +1398,13 @@ namespace OpenSim.Framework.Data.MySQL
|
|||
return param;
|
||||
}
|
||||
|
||||
private MySqlParameter createParamWithValue(string name, Type type, Object o)
|
||||
{
|
||||
MySqlParameter param = createMySqlParameter(name, type);
|
||||
param.Value = o;
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -92,72 +92,74 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
return (IDbCommand) dbcommand;
|
||||
}
|
||||
|
||||
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 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;
|
||||
// }
|
||||
|
||||
private DataTable createRegionsTable()
|
||||
{
|
||||
DataTable regions = new DataTable("regions");
|
||||
// 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, "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, "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, "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, "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, "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, "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));
|
||||
// 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;
|
||||
}
|
||||
|
||||
private void InitDB(SQLiteConnection conn)
|
||||
{
|
||||
string createUsers = defineTable(createRegionsTable());
|
||||
SQLiteCommand pcmd = new SQLiteCommand(createUsers, conn);
|
||||
conn.Open();
|
||||
pcmd.ExecuteNonQuery();
|
||||
conn.Close();
|
||||
}
|
||||
// // 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();
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Reads a region row from a database reader
|
||||
|
|
|
@ -624,19 +624,20 @@ namespace OpenSim.Framework.Data.SQLite
|
|||
return user;
|
||||
}
|
||||
|
||||
private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms)
|
||||
{
|
||||
row["ownerID"] = ownerID.UUID.ToString();
|
||||
row["friendID"] = friendID.UUID.ToString();
|
||||
row["friendPerms"] = perms;
|
||||
foreach (DataColumn col in ds.Tables["userfriends"].Columns)
|
||||
{
|
||||
if (row[col] == null)
|
||||
{
|
||||
row[col] = String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: unused
|
||||
// private void fillFriendRow(DataRow row, LLUUID ownerID, LLUUID friendID, uint perms)
|
||||
// {
|
||||
// row["ownerID"] = ownerID.UUID.ToString();
|
||||
// row["friendID"] = friendID.UUID.ToString();
|
||||
// row["friendPerms"] = perms;
|
||||
// foreach (DataColumn col in ds.Tables["userfriends"].Columns)
|
||||
// {
|
||||
// if (row[col] == null)
|
||||
// {
|
||||
// row[col] = String.Empty;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private void fillUserRow(DataRow row, UserProfileData user)
|
||||
{
|
||||
|
|
|
@ -41,16 +41,17 @@ namespace OpenSim.Grid.ScriptServer
|
|||
m_Connection = Connection;
|
||||
}
|
||||
|
||||
private void DataReceived(object objectID, object scriptID)
|
||||
{
|
||||
// TODO: HOW DO WE RECEIVE DATA? ASYNC?
|
||||
// ANYHOW WE END UP HERE?
|
||||
// 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();
|
||||
// // NEW SCRIPT? ASK SCRIPTENGINE TO INITIALIZE IT
|
||||
// ScriptRez();
|
||||
|
||||
// EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE
|
||||
touch_start();
|
||||
}
|
||||
// // EVENT? DELIVER EVENT DIRECTLY TO SCRIPTENGINE
|
||||
// touch_start();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,117 +175,119 @@ namespace OpenSim.Region.Environment.Modules
|
|||
}
|
||||
}
|
||||
|
||||
private void RunAssetQueue()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
ProcessAssetQueue();
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// m_log.Error("[ASSET CACHE]: " + e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO: unused
|
||||
// private void RunAssetQueue()
|
||||
// {
|
||||
// while (true)
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// ProcessAssetQueue();
|
||||
// Thread.Sleep(500);
|
||||
// }
|
||||
// catch (Exception)
|
||||
// {
|
||||
// // m_log.Error("[ASSET CACHE]: " + e.ToString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Process the asset queue which sends packets directly back to the client.
|
||||
/// </summary>
|
||||
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);
|
||||
// TODO: unused
|
||||
// /// <summary>
|
||||
// /// Process the asset queue which sends packets directly back to the client.
|
||||
// /// </summary>
|
||||
// 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);
|
||||
// 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;
|
||||
// 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;
|
||||
// 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);
|
||||
// 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;
|
||||
// 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;
|
||||
}
|
||||
// // 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);
|
||||
// req.RequestUser.OutPacket(TransferPacket, ThrottleOutPacketType.Asset);
|
||||
|
||||
processedLength += chunkSize;
|
||||
packetNumber++;
|
||||
}
|
||||
}
|
||||
}
|
||||
// processedLength += chunkSize;
|
||||
// packetNumber++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//remove requests that have been completed
|
||||
for (int i = 0; i < num; i++)
|
||||
{
|
||||
AssetRequests.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
// //remove requests that have been completed
|
||||
// for (int i = 0; i < num; i++)
|
||||
// {
|
||||
// AssetRequests.RemoveAt(0);
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Calculate the number of packets required to send the asset to the client.
|
||||
|
|
|
@ -228,10 +228,11 @@ namespace OpenSim.Region.Environment.Modules
|
|||
part.ScheduleFullUpdate();
|
||||
}
|
||||
|
||||
private byte[] BlendTextures(byte[] frontImage, byte[] backImage)
|
||||
{
|
||||
return BlendTextures(frontImage, backImage, false, 0);
|
||||
}
|
||||
// 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)
|
||||
{
|
||||
|
|
|
@ -37,38 +37,39 @@ namespace OpenSim.Region.Environment.Modules.Terrain.PaintBrushes
|
|||
return z;
|
||||
}
|
||||
|
||||
private double GetBilinearInterpolate(double x, double y, ITerrainChannel map)
|
||||
{
|
||||
int w = map.Width;
|
||||
int h = map.Height;
|
||||
// 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;
|
||||
// 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;
|
||||
}
|
||||
// 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
|
||||
|
||||
|
|
|
@ -790,25 +790,26 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
|
||||
//Updates the time in the viewer.
|
||||
private void UpdateInWorldTime()
|
||||
{
|
||||
m_timeUpdateCount++;
|
||||
if (m_timeUpdateCount > 600)
|
||||
{
|
||||
List<ScenePresence> avatars = GetAvatars();
|
||||
foreach (ScenePresence avatar in avatars)
|
||||
{
|
||||
avatar.ControllingClient.SendViewerTime(m_timePhase);
|
||||
}
|
||||
// TODO: unused
|
||||
// private void UpdateInWorldTime()
|
||||
// {
|
||||
// m_timeUpdateCount++;
|
||||
// if (m_timeUpdateCount > 600)
|
||||
// {
|
||||
// List<ScenePresence> avatars = GetAvatars();
|
||||
// foreach (ScenePresence avatar in avatars)
|
||||
// {
|
||||
// avatar.ControllingClient.SendViewerTime(m_timePhase);
|
||||
// }
|
||||
|
||||
m_timeUpdateCount = 0;
|
||||
m_timePhase++;
|
||||
if (m_timePhase > 94)
|
||||
{
|
||||
m_timePhase = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// m_timeUpdateCount = 0;
|
||||
// m_timePhase++;
|
||||
// if (m_timePhase > 94)
|
||||
// {
|
||||
// m_timePhase = 0;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private void SendSimStatsPackets(SimStatsPacket pack)
|
||||
{
|
||||
|
|
|
@ -72,22 +72,23 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp.Examples
|
|||
}*/
|
||||
}
|
||||
|
||||
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;
|
||||
// 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;
|
||||
// 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 System.String.Empty;
|
||||
}
|
||||
// return setPrimParams;
|
||||
// */
|
||||
// return System.String.Empty;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,35 +59,36 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
// const string baseDir = "rawFiles";
|
||||
private const string baseDir = null; //"rawFiles";
|
||||
|
||||
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!
|
||||
// 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
|
||||
// TODO: unused
|
||||
// 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!
|
||||
// // 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 r1y = r1.Y;
|
||||
float r2x = r2.X;
|
||||
float r2y = r2.Y;
|
||||
// float r1x = r1.X;
|
||||
// float r1y = r1.Y;
|
||||
// float r2x = r2.X;
|
||||
// float r2y = r2.Y;
|
||||
|
||||
float denom = r1y*r2x - r1x*r2y;
|
||||
// float denom = r1y*r2x - r1x*r2y;
|
||||
|
||||
if (denom == 0.0)
|
||||
{
|
||||
lambda = Single.NaN;
|
||||
mu = Single.NaN;
|
||||
return;
|
||||
}
|
||||
// if (denom == 0.0)
|
||||
// {
|
||||
// lambda = Single.NaN;
|
||||
// mu = Single.NaN;
|
||||
// return;
|
||||
// }
|
||||
|
||||
float p1x = p1.X;
|
||||
float p1y = p1.Y;
|
||||
float p2x = p2.X;
|
||||
float p2y = p2.Y;
|
||||
lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom;
|
||||
mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom;
|
||||
}
|
||||
// float p1x = p1.X;
|
||||
// float p1y = p1.Y;
|
||||
// float p2x = p2.X;
|
||||
// float p2y = p2.Y;
|
||||
// lambda = (-p2x*r2y + p1x*r2y + (p2y - p1y)*r2x)/denom;
|
||||
// mu = (-p2x*r1y + p1x*r1y + (p2y - p1y)*r1x)/denom;
|
||||
// }
|
||||
|
||||
private static List<Triangle> FindInfluencedTriangles(List<Triangle> triangles, Vertex v)
|
||||
{
|
||||
|
|
|
@ -170,11 +170,12 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
return result;
|
||||
}
|
||||
|
||||
private bool InsertVertex(Vertex v, int iAfter)
|
||||
{
|
||||
vertices.Insert(iAfter + 1, v);
|
||||
return true;
|
||||
}
|
||||
// TODO: unused
|
||||
// private bool InsertVertex(Vertex v, int iAfter)
|
||||
// {
|
||||
// vertices.Insert(iAfter + 1, v);
|
||||
// return true;
|
||||
// }
|
||||
|
||||
private Vertex getNextVertex(Vertex currentVertex)
|
||||
{
|
||||
|
|
|
@ -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.
|
||||
// The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
|
||||
// change appearance and when you enter the simulator
|
||||
// After this routine is done, the amotor stabilizes much quicker
|
||||
d.Vector3 feet;
|
||||
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;
|
||||
// TODO: unused:
|
||||
// private void standupStraight()
|
||||
// {
|
||||
// // The purpose of this routine here is to quickly stabilize the Body while it's popped up in the air.
|
||||
// // The amotor needs a few seconds to stabilize so without it, the avatar shoots up sky high when you
|
||||
// // change appearance and when you enter the simulator
|
||||
// // After this routine is done, the amotor stabilizes much quicker
|
||||
// d.Vector3 feet;
|
||||
// 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:
|
||||
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.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);
|
||||
}
|
||||
// // restoring force proportional to lack of posture:
|
||||
// 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.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);
|
||||
// }
|
||||
|
||||
public override PhysicsVector Force
|
||||
{
|
||||
|
|
|
@ -981,12 +981,11 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
|
||||
#endregion
|
||||
|
||||
private float GetTerrainHeightAtXY(float x, float y)
|
||||
{
|
||||
return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
|
||||
|
||||
|
||||
}
|
||||
// TODO: unused
|
||||
// private float GetTerrainHeightAtXY(float x, float y)
|
||||
// {
|
||||
// return (float)_origheightmap[(int)y * Constants.RegionSize + (int)x];
|
||||
// }
|
||||
|
||||
#region Add/Remove Entities
|
||||
|
||||
|
|
|
@ -141,26 +141,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
}
|
||||
|
||||
private static int privateThreadCount = 0;
|
||||
private Thread StartScriptLoadUnloadThread()
|
||||
{
|
||||
Thread t = new Thread(ScriptLoadUnloadThreadLoop);
|
||||
string name = "ScriptLoadUnloadThread:";
|
||||
if (PrivateThread)
|
||||
{
|
||||
name += "Private:" + privateThreadCount;
|
||||
privateThreadCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
name += "Shared";
|
||||
}
|
||||
t.Name = name;
|
||||
t.IsBackground = true;
|
||||
t.Priority = ThreadPriority.Normal;
|
||||
t.Start();
|
||||
OpenSim.Framework.ThreadTracker.Add(t);
|
||||
return t;
|
||||
}
|
||||
// TODO: unused
|
||||
// private Thread StartScriptLoadUnloadThread()
|
||||
// {
|
||||
// Thread t = new Thread(ScriptLoadUnloadThreadLoop);
|
||||
// string name = "ScriptLoadUnloadThread:";
|
||||
// if (PrivateThread)
|
||||
// {
|
||||
// name += "Private:" + privateThreadCount;
|
||||
// privateThreadCount++;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// name += "Shared";
|
||||
// }
|
||||
// t.Name = name;
|
||||
// t.IsBackground = true;
|
||||
// t.Priority = ThreadPriority.Normal;
|
||||
// t.Start();
|
||||
// OpenSim.Framework.ThreadTracker.Add(t);
|
||||
// return t;
|
||||
// }
|
||||
|
||||
~ScriptManager()
|
||||
{
|
||||
|
@ -184,26 +185,27 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
|
|||
|
||||
#region Load / Unload scripts (Thread loop)
|
||||
|
||||
private void ScriptLoadUnloadThreadLoop()
|
||||
{
|
||||
try
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (LUQueue.Count == 0)
|
||||
Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
|
||||
//if (PleaseShutdown)
|
||||
// return;
|
||||
DoScriptLoadUnload();
|
||||
}
|
||||
}
|
||||
catch (ThreadAbortException tae)
|
||||
{
|
||||
string a = tae.ToString();
|
||||
a = String.Empty;
|
||||
// Expected
|
||||
}
|
||||
}
|
||||
// TODO: unused
|
||||
// private void ScriptLoadUnloadThreadLoop()
|
||||
// {
|
||||
// try
|
||||
// {
|
||||
// while (true)
|
||||
// {
|
||||
// if (LUQueue.Count == 0)
|
||||
// Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
|
||||
// //if (PleaseShutdown)
|
||||
// // return;
|
||||
// DoScriptLoadUnload();
|
||||
// }
|
||||
// }
|
||||
// catch (ThreadAbortException tae)
|
||||
// {
|
||||
// string a = tae.ToString();
|
||||
// a = String.Empty;
|
||||
// // Expected
|
||||
// }
|
||||
// }
|
||||
|
||||
public void DoScriptLoadUnload()
|
||||
{
|
||||
|
|
|
@ -74,12 +74,13 @@ namespace OpenSim.Region.ScriptEngine.Common.TRPC
|
|||
Clients[ID].Disconnect();
|
||||
}
|
||||
|
||||
void asyncConnected(IAsyncResult iar)
|
||||
{
|
||||
Socket client = (Socket)iar.AsyncState;
|
||||
client.EndConnect(iar);
|
||||
ProcessConnection(client);
|
||||
}
|
||||
// TODO: unused
|
||||
// void asyncConnected(IAsyncResult iar)
|
||||
// {
|
||||
// Socket client = (Socket)iar.AsyncState;
|
||||
// client.EndConnect(iar);
|
||||
// ProcessConnection(client);
|
||||
// }
|
||||
|
||||
private int ProcessConnection(Socket client)
|
||||
{
|
||||
|
|
|
@ -34,18 +34,19 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
|||
{
|
||||
internal partial class LSO_Parser
|
||||
{
|
||||
private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
|
||||
{
|
||||
TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
|
||||
TypeAttributes.Public |
|
||||
TypeAttributes.Class |
|
||||
TypeAttributes.AutoClass |
|
||||
TypeAttributes.AnsiClass |
|
||||
TypeAttributes.BeforeFieldInit |
|
||||
TypeAttributes.AutoLayout,
|
||||
typeof (object),
|
||||
new Type[] {typeof (object)});
|
||||
return typeBuilder;
|
||||
}
|
||||
// TODO: unused:
|
||||
// private static TypeBuilder CreateType(ModuleBuilder modBuilder, string typeName)
|
||||
// {
|
||||
// TypeBuilder typeBuilder = modBuilder.DefineType(typeName,
|
||||
// TypeAttributes.Public |
|
||||
// TypeAttributes.Class |
|
||||
// TypeAttributes.AutoClass |
|
||||
// TypeAttributes.AnsiClass |
|
||||
// TypeAttributes.BeforeFieldInit |
|
||||
// TypeAttributes.AutoLayout,
|
||||
// typeof (object),
|
||||
// new Type[] {typeof (object)});
|
||||
// return typeBuilder;
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -342,10 +342,11 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
|
|||
return false;
|
||||
}
|
||||
|
||||
private void IL_PopToStack(ILGenerator il)
|
||||
{
|
||||
IL_PopToStack(il, 1);
|
||||
}
|
||||
// TODO: unused
|
||||
// private void IL_PopToStack(ILGenerator il)
|
||||
// {
|
||||
// IL_PopToStack(il, 1);
|
||||
// }
|
||||
|
||||
private void IL_PopToStack(ILGenerator il, int count)
|
||||
{
|
||||
|
|
|
@ -310,37 +310,33 @@ namespace OpenSim.Region.Terrain
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
lastEdit = DateTime.Now;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
|
||||
/// </summary>
|
||||
private void SetTerrainWithinBounds()
|
||||
{
|
||||
int x, y;
|
||||
for (x = 0; x < w; x++)
|
||||
{
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
if ((heightmap.Get(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))
|
||||
{
|
||||
heightmap.map[x, y] = revertmap.Get(x, y) - minLower;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: unused
|
||||
// /// <summary>
|
||||
// /// Checks to make sure the terrain is within baked values +/- maxRaise/minLower
|
||||
// /// </summary>
|
||||
// private void SetTerrainWithinBounds()
|
||||
// {
|
||||
// int x, y;
|
||||
// for (x = 0; x < w; x++)
|
||||
// {
|
||||
// for (y = 0; y < h; y++)
|
||||
// {
|
||||
// if ((heightmap.Get(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))
|
||||
// {
|
||||
// heightmap.map[x, y] = revertmap.Get(x, y) - minLower;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Converts the heightmap to a 65536 value 1D floating point array
|
||||
|
|
|
@ -70,48 +70,49 @@ namespace libTerrain
|
|||
Blend(flat, temp);
|
||||
}
|
||||
|
||||
private void FlattenFast(double rx, double ry, double size, double amount)
|
||||
{
|
||||
int x, y;
|
||||
double avg = 0;
|
||||
double div = 0;
|
||||
// TODO: unused
|
||||
// private void FlattenFast(double rx, double ry, double size, double amount)
|
||||
// {
|
||||
// int x, y;
|
||||
// double avg = 0;
|
||||
// double div = 0;
|
||||
|
||||
int minX = Math.Max(0, (int) (rx - (size + 1)));
|
||||
int maxX = Math.Min(w, (int) (rx + (size + 1)));
|
||||
int minY = Math.Max(0, (int) (ry - (size + 1)));
|
||||
int maxY = Math.Min(h, (int) (ry + (size + 1)));
|
||||
// int minX = Math.Max(0, (int) (rx - (size + 1)));
|
||||
// int maxX = Math.Min(w, (int) (rx + (size + 1)));
|
||||
// int minY = Math.Max(0, (int) (ry - (size + 1)));
|
||||
// int maxY = Math.Min(h, (int) (ry + (size + 1)));
|
||||
|
||||
for (x = minX; x < maxX; x++)
|
||||
{
|
||||
for (y = minY; y < maxY; y++)
|
||||
{
|
||||
double z = size;
|
||||
z *= z;
|
||||
z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
|
||||
// for (x = minX; x < maxX; x++)
|
||||
// {
|
||||
// for (y = minY; y < maxY; y++)
|
||||
// {
|
||||
// double z = size;
|
||||
// z *= z;
|
||||
// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
|
||||
|
||||
if (z < 0)
|
||||
z = 0;
|
||||
// if (z < 0)
|
||||
// z = 0;
|
||||
|
||||
avg += z*amount;
|
||||
div += z;
|
||||
}
|
||||
}
|
||||
// avg += z*amount;
|
||||
// div += z;
|
||||
// }
|
||||
// }
|
||||
|
||||
double height = avg/div;
|
||||
// double height = avg/div;
|
||||
|
||||
for (x = minX; x < maxX; x++)
|
||||
{
|
||||
for (y = minY; y < maxY; y++)
|
||||
{
|
||||
double z = size;
|
||||
z *= z;
|
||||
z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
|
||||
// for (x = minX; x < maxX; x++)
|
||||
// {
|
||||
// for (y = minY; y < maxY; y++)
|
||||
// {
|
||||
// double z = size;
|
||||
// z *= z;
|
||||
// z -= ((x - rx)*(x - rx)) + ((y - ry)*(y - ry));
|
||||
|
||||
if (z > 0.0)
|
||||
Set(x, y, Tools.LinearInterpolate(map[x, y], height, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (z > 0.0)
|
||||
// Set(x, y, Tools.LinearInterpolate(map[x, y], height, z));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
public void Flatten(Channel mask, double amount)
|
||||
{
|
||||
|
|
|
@ -40,12 +40,13 @@ namespace libTerrain
|
|||
return ((i) + (N + 2)*(j));
|
||||
}
|
||||
|
||||
private static void nsSwap(ref double x0, ref double x)
|
||||
{
|
||||
double tmp = x0;
|
||||
x0 = x;
|
||||
x = tmp;
|
||||
}
|
||||
// TODO: unused
|
||||
// private static void nsSwap(ref double x0, ref double x)
|
||||
// {
|
||||
// double tmp = x0;
|
||||
// x0 = x;
|
||||
// x = tmp;
|
||||
// }
|
||||
|
||||
private static void nsSwap(ref double[] x0, ref double[] x)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue