diff options
author | Melanie Thielker | 2010-09-05 14:16:42 +0200 |
---|---|---|
committer | Melanie | 2010-09-05 14:28:33 +0100 |
commit | 6a0a878f7c268c6f248588895e232e3d14eb6eb3 (patch) | |
tree | 19cf0fcd48035f34dee80fd07ce95f39bf486d99 /OpenSim/Framework | |
parent | Logout the presence if client IP verification fails. (diff) | |
download | opensim-SC_OLD-6a0a878f7c268c6f248588895e232e3d14eb6eb3.zip opensim-SC_OLD-6a0a878f7c268c6f248588895e232e3d14eb6eb3.tar.gz opensim-SC_OLD-6a0a878f7c268c6f248588895e232e3d14eb6eb3.tar.bz2 opensim-SC_OLD-6a0a878f7c268c6f248588895e232e3d14eb6eb3.tar.xz |
Remove "Dwell" support from core and replace it with calls to methods
on IDwellModule
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/LandData.cs | 14 | ||||
-rw-r--r-- | OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 111 |
3 files changed, 57 insertions, 73 deletions
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs index f263e67..8d3266b 100644 --- a/OpenSim/Framework/LandData.cs +++ b/OpenSim/Framework/LandData.cs | |||
@@ -88,7 +88,6 @@ namespace OpenSim.Framework | |||
88 | private UUID _snapshotID = UUID.Zero; | 88 | private UUID _snapshotID = UUID.Zero; |
89 | private Vector3 _userLocation = new Vector3(); | 89 | private Vector3 _userLocation = new Vector3(); |
90 | private Vector3 _userLookAt = new Vector3(); | 90 | private Vector3 _userLookAt = new Vector3(); |
91 | private int _dwell = 0; | ||
92 | private int _otherCleanTime = 0; | 91 | private int _otherCleanTime = 0; |
93 | private string _mediaType = "none/none"; | 92 | private string _mediaType = "none/none"; |
94 | private string _mediaDescription = ""; | 93 | private string _mediaDescription = ""; |
@@ -620,18 +619,6 @@ namespace OpenSim.Framework | |||
620 | } | 619 | } |
621 | 620 | ||
622 | /// <summary> | 621 | /// <summary> |
623 | /// Deprecated idea. Number of visitors ~= free money | ||
624 | /// </summary> | ||
625 | public int Dwell { | ||
626 | get { | ||
627 | return _dwell; | ||
628 | } | ||
629 | set { | ||
630 | _dwell = value; | ||
631 | } | ||
632 | } | ||
633 | |||
634 | /// <summary> | ||
635 | /// Number of minutes to return SceneObjectGroup that are owned by someone who doesn't own | 622 | /// Number of minutes to return SceneObjectGroup that are owned by someone who doesn't own |
636 | /// the parcel and isn't set to the same 'group' as the parcel. | 623 | /// the parcel and isn't set to the same 'group' as the parcel. |
637 | /// </summary> | 624 | /// </summary> |
@@ -703,7 +690,6 @@ namespace OpenSim.Framework | |||
703 | landData._userLocation = _userLocation; | 690 | landData._userLocation = _userLocation; |
704 | landData._userLookAt = _userLookAt; | 691 | landData._userLookAt = _userLookAt; |
705 | landData._otherCleanTime = _otherCleanTime; | 692 | landData._otherCleanTime = _otherCleanTime; |
706 | landData._dwell = _dwell; | ||
707 | landData._mediaType = _mediaType; | 693 | landData._mediaType = _mediaType; |
708 | landData._mediaDescription = _mediaDescription; | 694 | landData._mediaDescription = _mediaDescription; |
709 | landData._mediaWidth = _mediaWidth; | 695 | 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 | |||
118 | landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); | 118 | landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); |
119 | landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); | 119 | landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); |
120 | landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); | 120 | landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); |
121 | landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell")); | 121 | // No longer used here |
122 | xtr.ReadElementString("Dwell"); | ||
122 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); | 123 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); |
123 | 124 | ||
124 | xtr.ReadEndElement(); | 125 | xtr.ReadEndElement(); |
@@ -177,7 +178,7 @@ namespace OpenSim.Framework.Serialization.External | |||
177 | xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); | 178 | xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); |
178 | xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); | 179 | xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); |
179 | xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); | 180 | xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); |
180 | xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell)); | 181 | xtw.WriteElementString("Dwell", "0"); |
181 | xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime)); | 182 | xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime)); |
182 | 183 | ||
183 | xtw.WriteEndElement(); | 184 | xtw.WriteEndElement(); |
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index b2c1c54..0135a6c 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | |||
@@ -57,80 +57,77 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
57 | { | 57 | { |
58 | WebRequest request = WebRequest.Create(requestUrl); | 58 | WebRequest request = WebRequest.Create(requestUrl); |
59 | request.Method = verb; | 59 | request.Method = verb; |
60 | string respstring = String.Empty; | ||
60 | 61 | ||
61 | if ((verb == "POST") || (verb == "PUT")) | 62 | using (MemoryStream buffer = new MemoryStream()) |
62 | { | 63 | { |
63 | request.ContentType = "text/www-form-urlencoded"; | 64 | if ((verb == "POST") || (verb == "PUT")) |
64 | |||
65 | MemoryStream buffer = new MemoryStream(); | ||
66 | int length = 0; | ||
67 | using (StreamWriter writer = new StreamWriter(buffer)) | ||
68 | { | 65 | { |
69 | writer.Write(obj); | 66 | request.ContentType = "text/www-form-urlencoded"; |
70 | writer.Flush(); | ||
71 | } | ||
72 | 67 | ||
73 | length = (int)obj.Length; | 68 | int length = 0; |
74 | request.ContentLength = length; | 69 | using (StreamWriter writer = new StreamWriter(buffer)) |
70 | { | ||
71 | writer.Write(obj); | ||
72 | writer.Flush(); | ||
73 | } | ||
75 | 74 | ||
76 | Stream requestStream = null; | 75 | length = (int)obj.Length; |
77 | try | 76 | request.ContentLength = length; |
78 | { | ||
79 | requestStream = request.GetRequestStream(); | ||
80 | requestStream.Write(buffer.ToArray(), 0, length); | ||
81 | } | ||
82 | catch (Exception e) | ||
83 | { | ||
84 | m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl); | ||
85 | } | ||
86 | finally | ||
87 | { | ||
88 | // If this is closed, it will be disposed internally, | ||
89 | // but the above write is asynchronous and may hit after | ||
90 | // we're through here. So the thread handling that will | ||
91 | // throw and put us back into the catch above. Isn't | ||
92 | // .NET great? | ||
93 | //if (requestStream != null) | ||
94 | // requestStream.Close(); | ||
95 | // Let's not close this | ||
96 | //buffer.Close(); | ||
97 | 77 | ||
78 | Stream requestStream = null; | ||
79 | try | ||
80 | { | ||
81 | requestStream = request.GetRequestStream(); | ||
82 | requestStream.Write(buffer.ToArray(), 0, length); | ||
83 | } | ||
84 | catch (Exception e) | ||
85 | { | ||
86 | m_log.DebugFormat("[FORMS]: exception occured on sending request to {0}: " + e.ToString(), requestUrl); | ||
87 | } | ||
88 | finally | ||
89 | { | ||
90 | if (requestStream != null) | ||
91 | requestStream.Close(); | ||
92 | } | ||
98 | } | 93 | } |
99 | } | ||
100 | |||
101 | string respstring = String.Empty; | ||
102 | 94 | ||
103 | try | 95 | try |
104 | { | ||
105 | using (WebResponse resp = request.GetResponse()) | ||
106 | { | 96 | { |
97 | <<<<<<< HEAD:OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | ||
107 | if (resp.ContentLength > 0) | 98 | if (resp.ContentLength > 0) |
99 | ======= | ||
100 | using (WebResponse resp = request.GetResponse()) | ||
101 | >>>>>>> e593607... Remove "Dwell" support from core and replace it with calls to methods:OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | ||
108 | { | 102 | { |
109 | Stream respStream = null; | 103 | if (resp.ContentLength != 0) |
110 | try | ||
111 | { | 104 | { |
112 | respStream = resp.GetResponseStream(); | 105 | Stream respStream = null; |
113 | using (StreamReader reader = new StreamReader(respStream)) | 106 | try |
114 | { | 107 | { |
115 | respstring = reader.ReadToEnd(); | 108 | respStream = resp.GetResponseStream(); |
109 | using (StreamReader reader = new StreamReader(respStream)) | ||
110 | { | ||
111 | respstring = reader.ReadToEnd(); | ||
112 | } | ||
113 | } | ||
114 | catch (Exception e) | ||
115 | { | ||
116 | m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString()); | ||
117 | } | ||
118 | finally | ||
119 | { | ||
120 | if (respStream != null) | ||
121 | respStream.Close(); | ||
116 | } | 122 | } |
117 | } | ||
118 | catch (Exception e) | ||
119 | { | ||
120 | m_log.DebugFormat("[FORMS]: exception occured on receiving reply " + e.ToString()); | ||
121 | } | ||
122 | finally | ||
123 | { | ||
124 | if (respStream != null) | ||
125 | respStream.Close(); | ||
126 | } | 123 | } |
127 | } | 124 | } |
128 | } | 125 | } |
129 | } | 126 | catch (System.InvalidOperationException) |
130 | catch (System.InvalidOperationException) | 127 | { |
131 | { | 128 | // This is what happens when there is invalid XML |
132 | // This is what happens when there is invalid XML | 129 | m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request"); |
133 | m_log.DebugFormat("[FORMS]: InvalidOperationException on receiving request"); | 130 | } |
134 | } | 131 | } |
135 | return respstring; | 132 | return respstring; |
136 | } | 133 | } |