mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
Remove "Dwell" support from core and replace it with calls to methods
on IDwellModule
This commit is contained in:
@@ -88,7 +88,6 @@ namespace OpenSim.Framework
|
||||
private UUID _snapshotID = UUID.Zero;
|
||||
private Vector3 _userLocation = new Vector3();
|
||||
private Vector3 _userLookAt = new Vector3();
|
||||
private int _dwell = 0;
|
||||
private int _otherCleanTime = 0;
|
||||
private string _mediaType = "none/none";
|
||||
private string _mediaDescription = "";
|
||||
@@ -619,18 +618,6 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deprecated idea. Number of visitors ~= free money
|
||||
/// </summary>
|
||||
public int Dwell {
|
||||
get {
|
||||
return _dwell;
|
||||
}
|
||||
set {
|
||||
_dwell = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
|
||||
/// the parcel and isn't set to the same 'group' as the parcel.
|
||||
@@ -703,7 +690,6 @@ namespace OpenSim.Framework
|
||||
landData._userLocation = _userLocation;
|
||||
landData._userLookAt = _userLookAt;
|
||||
landData._otherCleanTime = _otherCleanTime;
|
||||
landData._dwell = _dwell;
|
||||
landData._mediaType = _mediaType;
|
||||
landData._mediaDescription = _mediaDescription;
|
||||
landData._mediaWidth = _mediaWidth;
|
||||
|
||||
@@ -118,7 +118,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID"));
|
||||
landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation"));
|
||||
landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt"));
|
||||
landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell"));
|
||||
// No longer used here
|
||||
xtr.ReadElementString("Dwell");
|
||||
landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime"));
|
||||
|
||||
xtr.ReadEndElement();
|
||||
@@ -177,7 +178,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString());
|
||||
xtw.WriteElementString("UserLocation", landData.UserLocation.ToString());
|
||||
xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString());
|
||||
xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell));
|
||||
xtw.WriteElementString("Dwell", "0");
|
||||
xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime));
|
||||
|
||||
xtw.WriteEndElement();
|
||||
|
||||
@@ -57,80 +57,73 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
{
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
{
|
||||
request.ContentType = "text/www-form-urlencoded";
|
||||
|
||||
MemoryStream buffer = new MemoryStream();
|
||||
int length = 0;
|
||||
using (StreamWriter writer = new StreamWriter(buffer))
|
||||
{
|
||||
writer.Write(obj);
|
||||
writer.Flush();
|
||||
}
|
||||
|
||||
length = (int)obj.Length;
|
||||
request.ContentLength = length;
|
||||
|
||||
Stream requestStream = null;
|
||||
try
|
||||
{
|
||||
requestStream = request.GetRequestStream();
|
||||
requestStream.Write(buffer.ToArray(), 0, length);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// If this is closed, it will be disposed internally,
|
||||
// but the above write is asynchronous and may hit after
|
||||
// we're through here. So the thread handling that will
|
||||
// throw and put us back into the catch above. Isn't
|
||||
// .NET great?
|
||||
//if (requestStream != null)
|
||||
// requestStream.Close();
|
||||
// Let's not close this
|
||||
//buffer.Close();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
string respstring = String.Empty;
|
||||
|
||||
try
|
||||
using (MemoryStream buffer = new MemoryStream())
|
||||
{
|
||||
using (WebResponse resp = request.GetResponse())
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
{
|
||||
if (resp.ContentLength != 0)
|
||||
request.ContentType = "text/www-form-urlencoded";
|
||||
|
||||
int length = 0;
|
||||
using (StreamWriter writer = new StreamWriter(buffer))
|
||||
{
|
||||
Stream respStream = null;
|
||||
try
|
||||
writer.Write(obj);
|
||||
writer.Flush();
|
||||
}
|
||||
|
||||
length = (int)obj.Length;
|
||||
request.ContentLength = length;
|
||||
|
||||
Stream requestStream = null;
|
||||
try
|
||||
{
|
||||
requestStream = request.GetRequestStream();
|
||||
requestStream.Write(buffer.ToArray(), 0, length);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (requestStream != null)
|
||||
requestStream.Close();
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using (WebResponse resp = request.GetResponse())
|
||||
{
|
||||
if (resp.ContentLength != 0)
|
||||
{
|
||||
respStream = resp.GetResponseStream();
|
||||
using (StreamReader reader = new StreamReader(respStream))
|
||||
Stream respStream = null;
|
||||
try
|
||||
{
|
||||
respstring = reader.ReadToEnd();
|
||||
respStream = resp.GetResponseStream();
|
||||
using (StreamReader reader = new StreamReader(respStream))
|
||||
{
|
||||
respstring = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (respStream != null)
|
||||
respStream.Close();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (respStream != null)
|
||||
respStream.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
// This is what happens when there is invalid XML
|
||||
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
|
||||
catch (System.InvalidOperationException)
|
||||
{
|
||||
// This is what happens when there is invalid XML
|
||||
m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request");
|
||||
}
|
||||
}
|
||||
return respstring;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user