From e5936071711e35f9edf44d8393b8ad28ef4023db Mon Sep 17 00:00:00 2001
From: Melanie Thielker
Date: Sun, 5 Sep 2010 14:16:42 +0200
Subject: Remove "Dwell" support from core and replace it with calls to methods
on IDwellModule
---
OpenSim/Framework/LandData.cs | 14 ---
.../Serialization/External/LandDataSerializer.cs | 5 +-
.../HttpServer/SynchronousRestFormsRequester.cs | 109 ++++++++++-----------
3 files changed, 54 insertions(+), 74 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 4440c94..5bb0413 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -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 = "";
@@ -620,18 +619,6 @@ namespace OpenSim.Framework
}
///
- /// Deprecated idea. Number of visitors ~= free money
- ///
- public int Dwell {
- get {
- return _dwell;
- }
- set {
- _dwell = value;
- }
- }
-
- ///
/// 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;
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
index ff0afc8..fc0387b 100644
--- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -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();
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
index f955df7..41ece86 100644
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
@@ -57,80 +57,73 @@ namespace OpenSim.Framework.Servers.HttpServer
{
WebRequest request = WebRequest.Create(requestUrl);
request.Method = verb;
+ string respstring = String.Empty;
- if ((verb == "POST") || (verb == "PUT"))
+ using (MemoryStream buffer = new MemoryStream())
{
- request.ContentType = "text/www-form-urlencoded";
-
- MemoryStream buffer = new MemoryStream();
- int length = 0;
- using (StreamWriter writer = new StreamWriter(buffer))
+ if ((verb == "POST") || (verb == "PUT"))
{
- writer.Write(obj);
- writer.Flush();
- }
+ request.ContentType = "text/www-form-urlencoded";
- length = (int)obj.Length;
- request.ContentLength = length;
+ int length = 0;
+ using (StreamWriter writer = new StreamWriter(buffer))
+ {
+ writer.Write(obj);
+ writer.Flush();
+ }
- 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();
+ 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();
+ }
}
- }
-
- string respstring = String.Empty;
- try
- {
- using (WebResponse resp = request.GetResponse())
+ try
{
- if (resp.ContentLength != 0)
+ using (WebResponse resp = request.GetResponse())
{
- Stream respStream = null;
- try
+ 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;
}
--
cgit v1.1