diff options
author | Diva Canto | 2013-07-09 14:13:51 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-09 14:13:51 -0700 |
commit | d0dfb744b206d3bd002ed72f415f177c6b04226b (patch) | |
tree | dba29f24667d254371abb726e2842700c189dfdf /OpenSim | |
parent | Put guards on a bunch of exception-inducing code, as seen in logs from load t... (diff) | |
parent | BulletSim: add parameter to optionally disable vehicle linear deflection. (diff) | |
download | opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.zip opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.gz opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.bz2 opensim-SC_OLD-d0dfb744b206d3bd002ed72f415f177c6b04226b.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
62 files changed, 709 insertions, 341 deletions
diff --git a/OpenSim/Addons/Groups/GroupsModule.cs b/OpenSim/Addons/Groups/GroupsModule.cs index 5959bac..82e2d6f 100644 --- a/OpenSim/Addons/Groups/GroupsModule.cs +++ b/OpenSim/Addons/Groups/GroupsModule.cs | |||
@@ -485,7 +485,7 @@ namespace OpenSim.Groups | |||
485 | return; | 485 | return; |
486 | 486 | ||
487 | //// 16 bytes are the UUID. Maybe. | 487 | //// 16 bytes are the UUID. Maybe. |
488 | UUID folderID = new UUID(im.binaryBucket, 0); | 488 | // UUID folderID = new UUID(im.binaryBucket, 0); |
489 | UUID noticeID = new UUID(im.imSessionID); | 489 | UUID noticeID = new UUID(im.imSessionID); |
490 | 490 | ||
491 | GroupNoticeInfo notice = m_groupData.GetGroupNotice(remoteClient.AgentId.ToString(), noticeID); | 491 | GroupNoticeInfo notice = m_groupData.GetGroupNotice(remoteClient.AgentId.ToString(), noticeID); |
diff --git a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs index cff7adf..c3c759e 100644 --- a/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs +++ b/OpenSim/Addons/Groups/Hypergrid/GroupsServiceHGConnectorModule.cs | |||
@@ -543,7 +543,6 @@ namespace OpenSim.Groups | |||
543 | List<string> urls = new List<string>(); | 543 | List<string> urls = new List<string>(); |
544 | foreach (GroupMembersData m in members) | 544 | foreach (GroupMembersData m in members) |
545 | { | 545 | { |
546 | UUID userID = UUID.Zero; | ||
547 | if (!m_UserManagement.IsLocalGridUser(m.AgentID)) | 546 | if (!m_UserManagement.IsLocalGridUser(m.AgentID)) |
548 | { | 547 | { |
549 | string gURL = m_UserManagement.GetUserServerURL(m.AgentID, "GroupsServerURI"); | 548 | string gURL = m_UserManagement.GetUserServerURL(m.AgentID, "GroupsServerURI"); |
diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index 3584f78..d2bcba5 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs | |||
@@ -47,7 +47,6 @@ namespace OpenSim.Groups | |||
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private HGGroupsService m_GroupsService; | 49 | private HGGroupsService m_GroupsService; |
50 | private string m_HomeURI = string.Empty; | ||
51 | private string m_ConfigName = "Groups"; | 50 | private string m_ConfigName = "Groups"; |
52 | 51 | ||
53 | // Called by Robust shell | 52 | // Called by Robust shell |
@@ -113,7 +112,7 @@ namespace OpenSim.Groups | |||
113 | m_GroupsService = service; | 112 | m_GroupsService = service; |
114 | } | 113 | } |
115 | 114 | ||
116 | public override byte[] Handle(string path, Stream requestData, | 115 | protected override byte[] ProcessRequest(string path, Stream requestData, |
117 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 116 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
118 | { | 117 | { |
119 | StreamReader sr = new StreamReader(requestData); | 118 | StreamReader sr = new StreamReader(requestData); |
@@ -209,7 +208,6 @@ namespace OpenSim.Groups | |||
209 | UUID groupID = new UUID(request["GroupID"].ToString()); | 208 | UUID groupID = new UUID(request["GroupID"].ToString()); |
210 | string agentID = request["AgentID"].ToString(); | 209 | string agentID = request["AgentID"].ToString(); |
211 | string token = request["AccessToken"].ToString(); | 210 | string token = request["AccessToken"].ToString(); |
212 | string reason = string.Empty; | ||
213 | 211 | ||
214 | m_GroupsService.RemoveAgentFromGroup(agentID, agentID, groupID, token); | 212 | m_GroupsService.RemoveAgentFromGroup(agentID, agentID, groupID, token); |
215 | } | 213 | } |
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 28f7acc..106c6c4 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Groups | |||
75 | m_GroupsService = service; | 75 | m_GroupsService = service; |
76 | } | 76 | } |
77 | 77 | ||
78 | public override byte[] Handle(string path, Stream requestData, | 78 | protected override byte[] ProcessRequest(string path, Stream requestData, |
79 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 79 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
80 | { | 80 | { |
81 | StreamReader sr = new StreamReader(requestData); | 81 | StreamReader sr = new StreamReader(requestData); |
@@ -269,7 +269,6 @@ namespace OpenSim.Groups | |||
269 | UUID groupID = new UUID(request["GroupID"].ToString()); | 269 | UUID groupID = new UUID(request["GroupID"].ToString()); |
270 | string agentID = request["AgentID"].ToString(); | 270 | string agentID = request["AgentID"].ToString(); |
271 | string requestingAgentID = request["RequestingAgentID"].ToString(); | 271 | string requestingAgentID = request["RequestingAgentID"].ToString(); |
272 | string reason = string.Empty; | ||
273 | 272 | ||
274 | m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID); | 273 | m_GroupsService.RemoveAgentFromGroup(requestingAgentID, agentID, groupID); |
275 | } | 274 | } |
@@ -500,7 +499,6 @@ namespace OpenSim.Groups | |||
500 | else | 499 | else |
501 | { | 500 | { |
502 | string op = request["OP"].ToString(); | 501 | string op = request["OP"].ToString(); |
503 | string reason = string.Empty; | ||
504 | 502 | ||
505 | bool success = false; | 503 | bool success = false; |
506 | if (op == "ADD") | 504 | if (op == "ADD") |
@@ -568,7 +566,6 @@ namespace OpenSim.Groups | |||
568 | else | 566 | else |
569 | { | 567 | { |
570 | string op = request["OP"].ToString(); | 568 | string op = request["OP"].ToString(); |
571 | string reason = string.Empty; | ||
572 | 569 | ||
573 | if (op == "GROUP") | 570 | if (op == "GROUP") |
574 | { | 571 | { |
@@ -631,7 +628,6 @@ namespace OpenSim.Groups | |||
631 | else | 628 | else |
632 | { | 629 | { |
633 | string op = request["OP"].ToString(); | 630 | string op = request["OP"].ToString(); |
634 | string reason = string.Empty; | ||
635 | 631 | ||
636 | if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) | 632 | if (op == "ADD" && request.ContainsKey("GroupID") && request.ContainsKey("RoleID") && request.ContainsKey("AgentID")) |
637 | { | 633 | { |
diff --git a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs index 2b3a01d..32c24db 100644 --- a/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs +++ b/OpenSim/Addons/OfflineIM/Remote/OfflineIMServiceRobustConnector.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.OfflineIM | |||
75 | m_OfflineIMService = service; | 75 | m_OfflineIMService = service; |
76 | } | 76 | } |
77 | 77 | ||
78 | public override byte[] Handle(string path, Stream requestData, | 78 | protected override byte[] ProcessRequest(string path, Stream requestData, |
79 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 79 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
80 | { | 80 | { |
81 | StreamReader sr = new StreamReader(requestData); | 81 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs index bc6f6f9..6c95d8b 100644 --- a/OpenSim/Capabilities/Caps.cs +++ b/OpenSim/Capabilities/Caps.cs | |||
@@ -143,8 +143,8 @@ namespace OpenSim.Framework.Capabilities | |||
143 | /// <param name="handler"></param> | 143 | /// <param name="handler"></param> |
144 | public void RegisterHandler(string capName, IRequestHandler handler) | 144 | public void RegisterHandler(string capName, IRequestHandler handler) |
145 | { | 145 | { |
146 | m_capsHandlers[capName] = handler; | ||
147 | //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); | 146 | //m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path); |
147 | m_capsHandlers[capName] = handler; | ||
148 | } | 148 | } |
149 | 149 | ||
150 | /// <summary> | 150 | /// <summary> |
diff --git a/OpenSim/Capabilities/CapsHandlers.cs b/OpenSim/Capabilities/CapsHandlers.cs index 458272d..890df90 100644 --- a/OpenSim/Capabilities/CapsHandlers.cs +++ b/OpenSim/Capabilities/CapsHandlers.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Framework.Capabilities | |||
39 | /// </summary> | 39 | /// </summary> |
40 | public class CapsHandlers | 40 | public class CapsHandlers |
41 | { | 41 | { |
42 | private Dictionary <string, IRequestHandler> m_capsHandlers = new Dictionary<string, IRequestHandler>(); | 42 | private Dictionary<string, IRequestHandler> m_capsHandlers = new Dictionary<string, IRequestHandler>(); |
43 | private IHttpServer m_httpListener; | 43 | private IHttpServer m_httpListener; |
44 | private string m_httpListenerHostName; | 44 | private string m_httpListenerHostName; |
45 | private uint m_httpListenerPort; | 45 | private uint m_httpListenerPort; |
@@ -184,5 +184,17 @@ namespace OpenSim.Framework.Capabilities | |||
184 | 184 | ||
185 | return caps; | 185 | return caps; |
186 | } | 186 | } |
187 | |||
188 | /// <summary> | ||
189 | /// Returns a copy of the dictionary of all the HTTP cap handlers | ||
190 | /// </summary> | ||
191 | /// <returns> | ||
192 | /// The dictionary copy. The key is the capability name, the value is the HTTP handler. | ||
193 | /// </returns> | ||
194 | public Dictionary<string, IRequestHandler> GetCapsHandlers() | ||
195 | { | ||
196 | lock (m_capsHandlers) | ||
197 | return new Dictionary<string, IRequestHandler>(m_capsHandlers); | ||
198 | } | ||
187 | } | 199 | } |
188 | } | 200 | } \ No newline at end of file |
diff --git a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs index 4dca592..426174d 100644 --- a/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs +++ b/OpenSim/Capabilities/Handlers/AvatarPickerSearch/AvatarPickerSearchHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Capabilities.Handlers | |||
56 | m_PeopleService = peopleService; | 56 | m_PeopleService = peopleService; |
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 59 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | // Try to parse the texture ID from the request URL | 61 | // Try to parse the texture ID from the request URL |
62 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 62 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs index 9f3cc19..789bf2b 100644 --- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs | |||
@@ -64,7 +64,7 @@ namespace OpenSim.Capabilities.Handlers | |||
64 | m_assetService = assService; | 64 | m_assetService = assService; |
65 | } | 65 | } |
66 | 66 | ||
67 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 67 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | // Try to parse the texture ID from the request URL | 69 | // Try to parse the texture ID from the request URL |
70 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 70 | NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
diff --git a/OpenSim/Capabilities/LLSDStreamHandler.cs b/OpenSim/Capabilities/LLSDStreamHandler.cs index 5df24b2..4fa1153 100644 --- a/OpenSim/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Capabilities/LLSDStreamHandler.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Capabilities | |||
48 | m_method = method; | 48 | m_method = method; |
49 | } | 49 | } |
50 | 50 | ||
51 | public override byte[] Handle(string path, Stream request, | 51 | protected override byte[] ProcessRequest(string path, Stream request, |
52 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 52 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
53 | { | 53 | { |
54 | //Encoding encoding = Util.UTF8; | 54 | //Encoding encoding = Util.UTF8; |
diff --git a/OpenSim/Framework/DAMap.cs b/OpenSim/Framework/DAMap.cs index 5c729e8..4995a92 100644 --- a/OpenSim/Framework/DAMap.cs +++ b/OpenSim/Framework/DAMap.cs | |||
@@ -132,10 +132,6 @@ namespace OpenSim.Framework | |||
132 | { | 132 | { |
133 | List<string> keysToRemove = null; | 133 | List<string> keysToRemove = null; |
134 | 134 | ||
135 | // Hard-coded special case that needs to be removed in the future. Normally, modules themselves should | ||
136 | // handle reading data from old locations | ||
137 | bool osMaterialsMigrationRequired = false; | ||
138 | |||
139 | OSDMap namespacesMap = daMap.m_map; | 135 | OSDMap namespacesMap = daMap.m_map; |
140 | 136 | ||
141 | foreach (string key in namespacesMap.Keys) | 137 | foreach (string key in namespacesMap.Keys) |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs new file mode 100644 index 0000000..72b3065 --- /dev/null +++ b/OpenSim/Framework/Servers/HttpServer/BaseOutputStreamHandler.cs | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.IO; | ||
29 | |||
30 | namespace OpenSim.Framework.Servers.HttpServer | ||
31 | { | ||
32 | /// <summary> | ||
33 | /// Base handler for writing to an output stream | ||
34 | /// </summary> | ||
35 | /// <remarks> | ||
36 | /// Inheriting classes should override ProcessRequest() rather than Handle() | ||
37 | /// </remarks> | ||
38 | public abstract class BaseOutputStreamHandler : BaseRequestHandler, IRequestHandler | ||
39 | { | ||
40 | protected BaseOutputStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {} | ||
41 | |||
42 | protected BaseOutputStreamHandler(string httpMethod, string path, string name, string description) | ||
43 | : base(httpMethod, path, name, description) {} | ||
44 | |||
45 | public virtual void Handle( | ||
46 | string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
47 | { | ||
48 | RequestsReceived++; | ||
49 | |||
50 | ProcessRequest(path, request, response, httpRequest, httpResponse); | ||
51 | |||
52 | RequestsHandled++; | ||
53 | } | ||
54 | |||
55 | protected virtual void ProcessRequest( | ||
56 | string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
57 | { | ||
58 | } | ||
59 | } | ||
60 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs index ae7aaf2..bbac699 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseRequestHandler.cs | |||
@@ -31,6 +31,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
31 | { | 31 | { |
32 | public abstract class BaseRequestHandler | 32 | public abstract class BaseRequestHandler |
33 | { | 33 | { |
34 | public int RequestsReceived { get; protected set; } | ||
35 | |||
36 | public int RequestsHandled { get; protected set; } | ||
37 | |||
34 | public virtual string ContentType | 38 | public virtual string ContentType |
35 | { | 39 | { |
36 | get { return "application/xml"; } | 40 | get { return "application/xml"; } |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs index 6342983..252cc2a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseStreamHandler.cs | |||
@@ -29,14 +29,35 @@ using System.IO; | |||
29 | 29 | ||
30 | namespace OpenSim.Framework.Servers.HttpServer | 30 | namespace OpenSim.Framework.Servers.HttpServer |
31 | { | 31 | { |
32 | /// <summary> | ||
33 | /// Base streamed request handler. | ||
34 | /// </summary> | ||
35 | /// <remarks> | ||
36 | /// Inheriting classes should override ProcessRequest() rather than Handle() | ||
37 | /// </remarks> | ||
32 | public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler | 38 | public abstract class BaseStreamHandler : BaseRequestHandler, IStreamedRequestHandler |
33 | { | 39 | { |
34 | public abstract byte[] Handle(string path, Stream request, | ||
35 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse); | ||
36 | |||
37 | protected BaseStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {} | 40 | protected BaseStreamHandler(string httpMethod, string path) : this(httpMethod, path, null, null) {} |
38 | 41 | ||
39 | protected BaseStreamHandler(string httpMethod, string path, string name, string description) | 42 | protected BaseStreamHandler(string httpMethod, string path, string name, string description) |
40 | : base(httpMethod, path, name, description) {} | 43 | : base(httpMethod, path, name, description) {} |
44 | |||
45 | public virtual byte[] Handle( | ||
46 | string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
47 | { | ||
48 | RequestsReceived++; | ||
49 | |||
50 | byte[] result = ProcessRequest(path, request, httpRequest, httpResponse); | ||
51 | |||
52 | RequestsHandled++; | ||
53 | |||
54 | return result; | ||
55 | } | ||
56 | |||
57 | protected virtual byte[] ProcessRequest( | ||
58 | string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
59 | { | ||
60 | return null; | ||
61 | } | ||
41 | } | 62 | } |
42 | } \ No newline at end of file | 63 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs index b94bfb4..1b03f54 100644 --- a/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/BinaryStreamHandler.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
45 | m_method = binaryMethod; | 45 | m_method = binaryMethod; |
46 | } | 46 | } |
47 | 47 | ||
48 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 48 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
49 | { | 49 | { |
50 | byte[] data = ReadFully(request); | 50 | byte[] data = ReadFully(request); |
51 | string param = GetParam(path); | 51 | string param = GetParam(path); |
diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs index cb5cce5..b8541cb 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IStreamHandler.cs | |||
@@ -32,7 +32,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
32 | { | 32 | { |
33 | public interface IRequestHandler | 33 | public interface IRequestHandler |
34 | { | 34 | { |
35 | |||
36 | /// <summary> | 35 | /// <summary> |
37 | /// Name for this handler. | 36 | /// Name for this handler. |
38 | /// </summary> | 37 | /// </summary> |
@@ -59,6 +58,19 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
59 | 58 | ||
60 | // Return path | 59 | // Return path |
61 | string Path { get; } | 60 | string Path { get; } |
61 | |||
62 | /// <summary> | ||
63 | /// Number of requests received by this handler | ||
64 | /// </summary> | ||
65 | int RequestsReceived { get; } | ||
66 | |||
67 | /// <summary> | ||
68 | /// Number of requests handled. | ||
69 | /// </summary> | ||
70 | /// <remarks> | ||
71 | /// Should be equal to RequestsReceived unless requested are being handled slowly or there is deadlock. | ||
72 | /// </remarks> | ||
73 | int RequestsHandled { get; } | ||
62 | } | 74 | } |
63 | 75 | ||
64 | public interface IStreamedRequestHandler : IRequestHandler | 76 | public interface IStreamedRequestHandler : IRequestHandler |
@@ -69,7 +81,6 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
69 | 81 | ||
70 | public interface IStreamHandler : IRequestHandler | 82 | public interface IStreamHandler : IRequestHandler |
71 | { | 83 | { |
72 | // Handle request stream, return byte array | ||
73 | void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse); | 84 | void Handle(string path, Stream request, Stream response, IOSHttpRequest httpReqbuest, IOSHttpResponse httpResponse); |
74 | } | 85 | } |
75 | 86 | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs index 07082a8..bd55657 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestDeserialiseHandler.cs | |||
@@ -33,7 +33,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
33 | { | 33 | { |
34 | public delegate TResponse RestDeserialiseMethod<TRequest, TResponse>(TRequest request); | 34 | public delegate TResponse RestDeserialiseMethod<TRequest, TResponse>(TRequest request); |
35 | 35 | ||
36 | public class RestDeserialiseHandler<TRequest, TResponse> : BaseRequestHandler, IStreamHandler | 36 | public class RestDeserialiseHandler<TRequest, TResponse> : BaseOutputStreamHandler, IStreamHandler |
37 | where TRequest : new() | 37 | where TRequest : new() |
38 | { | 38 | { |
39 | private RestDeserialiseMethod<TRequest, TResponse> m_method; | 39 | private RestDeserialiseMethod<TRequest, TResponse> m_method; |
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
48 | m_method = method; | 48 | m_method = method; |
49 | } | 49 | } |
50 | 50 | ||
51 | public void Handle(string path, Stream request, Stream responseStream, | 51 | protected override void ProcessRequest(string path, Stream request, Stream responseStream, |
52 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 52 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
53 | { | 53 | { |
54 | TRequest deserial; | 54 | TRequest deserial; |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs index edcd134..83c9848 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestSessionService.cs | |||
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
183 | 183 | ||
184 | public delegate bool CheckIdentityMethod(string sid, string aid); | 184 | public delegate bool CheckIdentityMethod(string sid, string aid); |
185 | 185 | ||
186 | public class RestDeserialiseSecureHandler<TRequest, TResponse> : BaseRequestHandler, IStreamHandler | 186 | public class RestDeserialiseSecureHandler<TRequest, TResponse> : BaseOutputStreamHandler, IStreamHandler |
187 | where TRequest : new() | 187 | where TRequest : new() |
188 | { | 188 | { |
189 | private static readonly ILog m_log | 189 | private static readonly ILog m_log |
@@ -201,7 +201,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
201 | m_method = method; | 201 | m_method = method; |
202 | } | 202 | } |
203 | 203 | ||
204 | public void Handle(string path, Stream request, Stream responseStream, | 204 | protected override void ProcessRequest(string path, Stream request, Stream responseStream, |
205 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 205 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
206 | { | 206 | { |
207 | RestSessionObject<TRequest> deserial = default(RestSessionObject<TRequest>); | 207 | RestSessionObject<TRequest> deserial = default(RestSessionObject<TRequest>); |
@@ -237,7 +237,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
237 | 237 | ||
238 | public delegate bool CheckTrustedSourceMethod(IPEndPoint peer); | 238 | public delegate bool CheckTrustedSourceMethod(IPEndPoint peer); |
239 | 239 | ||
240 | public class RestDeserialiseTrustedHandler<TRequest, TResponse> : BaseRequestHandler, IStreamHandler | 240 | public class RestDeserialiseTrustedHandler<TRequest, TResponse> : BaseOutputStreamHandler, IStreamHandler |
241 | where TRequest : new() | 241 | where TRequest : new() |
242 | { | 242 | { |
243 | private static readonly ILog m_log | 243 | private static readonly ILog m_log |
@@ -260,7 +260,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
260 | m_method = method; | 260 | m_method = method; |
261 | } | 261 | } |
262 | 262 | ||
263 | public void Handle(string path, Stream request, Stream responseStream, | 263 | protected override void ProcessRequest(string path, Stream request, Stream responseStream, |
264 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 264 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
265 | { | 265 | { |
266 | TRequest deserial = default(TRequest); | 266 | TRequest deserial = default(TRequest); |
@@ -292,6 +292,5 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
292 | serializer.Serialize(xmlWriter, response); | 292 | serializer.Serialize(xmlWriter, response); |
293 | } | 293 | } |
294 | } | 294 | } |
295 | } | 295 | } |
296 | 296 | } \ No newline at end of file | |
297 | } | ||
diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs index 1f17fee..0305dee 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs | |||
@@ -48,7 +48,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
48 | m_restMethod = restMethod; | 48 | m_restMethod = restMethod; |
49 | } | 49 | } |
50 | 50 | ||
51 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 51 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
52 | { | 52 | { |
53 | Encoding encoding = Encoding.UTF8; | 53 | Encoding encoding = Encoding.UTF8; |
54 | StreamReader streamReader = new StreamReader(request, encoding); | 54 | StreamReader streamReader = new StreamReader(request, encoding); |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 841069c..f0c088a 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -766,7 +766,7 @@ namespace OpenSim | |||
766 | { | 766 | { |
767 | public SimStatusHandler() : base("GET", "/simstatus", "SimStatus", "Simulator Status") {} | 767 | public SimStatusHandler() : base("GET", "/simstatus", "SimStatus", "Simulator Status") {} |
768 | 768 | ||
769 | public override byte[] Handle(string path, Stream request, | 769 | protected override byte[] ProcessRequest(string path, Stream request, |
770 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 770 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
771 | { | 771 | { |
772 | return Util.UTF8.GetBytes("OK"); | 772 | return Util.UTF8.GetBytes("OK"); |
@@ -792,7 +792,7 @@ namespace OpenSim | |||
792 | m_opensim = sim; | 792 | m_opensim = sim; |
793 | } | 793 | } |
794 | 794 | ||
795 | public override byte[] Handle(string path, Stream request, | 795 | protected override byte[] ProcessRequest(string path, Stream request, |
796 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 796 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
797 | { | 797 | { |
798 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 798 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
@@ -810,7 +810,7 @@ namespace OpenSim | |||
810 | /// If the request contains a key, "callback" the response will be wrappend in the | 810 | /// If the request contains a key, "callback" the response will be wrappend in the |
811 | /// associated value for jsonp used with ajax/javascript | 811 | /// associated value for jsonp used with ajax/javascript |
812 | /// </summary> | 812 | /// </summary> |
813 | public class UXSimStatusHandler : BaseStreamHandler | 813 | protected class UXSimStatusHandler : BaseStreamHandler |
814 | { | 814 | { |
815 | OpenSimBase m_opensim; | 815 | OpenSimBase m_opensim; |
816 | 816 | ||
@@ -820,7 +820,7 @@ namespace OpenSim | |||
820 | m_opensim = sim; | 820 | m_opensim = sim; |
821 | } | 821 | } |
822 | 822 | ||
823 | public override byte[] Handle(string path, Stream request, | 823 | protected override byte[] ProcessRequest(string path, Stream request, |
824 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 824 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
825 | { | 825 | { |
826 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); | 826 | return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index a46c24a..5c6bc1c 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -207,9 +207,15 @@ namespace OpenSim.Region.ClientStack.Linden | |||
207 | m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); | 207 | m_HostCapsObj.RegisterHandler("UpdateNotecardAgentInventory", req); |
208 | m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); | 208 | m_HostCapsObj.RegisterHandler("UpdateScriptAgentInventory", req); |
209 | m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); | 209 | m_HostCapsObj.RegisterHandler("UpdateScriptAgent", req); |
210 | IRequestHandler getObjectPhysicsDataHandler = new RestStreamHandler("POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData); | 210 | |
211 | IRequestHandler getObjectPhysicsDataHandler | ||
212 | = new RestStreamHandler( | ||
213 | "POST", capsBase + m_getObjectPhysicsDataPath, GetObjectPhysicsData, "GetObjectPhysicsData", null); | ||
211 | m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); | 214 | m_HostCapsObj.RegisterHandler("GetObjectPhysicsData", getObjectPhysicsDataHandler); |
212 | IRequestHandler UpdateAgentInformationHandler = new RestStreamHandler("POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation); | 215 | |
216 | IRequestHandler UpdateAgentInformationHandler | ||
217 | = new RestStreamHandler( | ||
218 | "POST", capsBase + m_UpdateAgentInformationPath, UpdateAgentInformation, "UpdateAgentInformation", null); | ||
213 | m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); | 219 | m_HostCapsObj.RegisterHandler("UpdateAgentInformation", UpdateAgentInformationHandler); |
214 | 220 | ||
215 | m_HostCapsObj.RegisterHandler( | 221 | m_HostCapsObj.RegisterHandler( |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index e73a04a..50bfda1 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -366,7 +366,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
366 | // EventQueueGet when it receive capability information, but then we replace the rest handler immediately | 366 | // EventQueueGet when it receive capability information, but then we replace the rest handler immediately |
367 | // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but | 367 | // afterwards with the poll service. So for now, we'll pass a null instead to simplify code reading, but |
368 | // really it should be possible to directly register the poll handler as a capability. | 368 | // really it should be possible to directly register the poll handler as a capability. |
369 | caps.RegisterHandler("EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null)); | 369 | caps.RegisterHandler( |
370 | "EventQueueGet", new RestHTTPHandler("POST", eventQueueGetPath, null, "EventQueueGet", null)); | ||
370 | // delegate(Hashtable m_dhttpMethod) | 371 | // delegate(Hashtable m_dhttpMethod) |
371 | // { | 372 | // { |
372 | // return ProcessQueue(m_dhttpMethod, agentID, caps); | 373 | // return ProcessQueue(m_dhttpMethod, agentID, caps); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs index 69dd76f..a133a69 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs | |||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
176 | m_isGod = m_scene.Permissions.IsGod(agentID); | 176 | m_isGod = m_scene.Permissions.IsGod(agentID); |
177 | } | 177 | } |
178 | 178 | ||
179 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 179 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
180 | { | 180 | { |
181 | StreamReader reader = new StreamReader(request); | 181 | StreamReader reader = new StreamReader(request); |
182 | string message = reader.ReadToEnd(); | 182 | string message = reader.ReadToEnd(); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 08196f1..2116605 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
54 | m_FriendsModule = fmodule; | 54 | m_FriendsModule = fmodule; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle( | 57 | protected override byte[] ProcessRequest( |
58 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 58 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | StreamReader sr = new StreamReader(requestData); | 60 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index a542d62..0cd495c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -122,9 +122,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
122 | { | 122 | { |
123 | string uri = "/CAPS/" + UUID.Random(); | 123 | string uri = "/CAPS/" + UUID.Random(); |
124 | 124 | ||
125 | caps.RegisterHandler("UntrustedSimulatorMessage", | 125 | caps.RegisterHandler( |
126 | new RestStreamHandler("POST", uri, | 126 | "UntrustedSimulatorMessage", |
127 | HandleUntrustedSimulatorMessage)); | 127 | new RestStreamHandler("POST", uri, HandleUntrustedSimulatorMessage, "UntrustedSimulatorMessage", null)); |
128 | } | 128 | } |
129 | 129 | ||
130 | private string HandleUntrustedSimulatorMessage(string request, | 130 | private string HandleUntrustedSimulatorMessage(string request, |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index 161f160..44edd7f 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -304,7 +304,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
304 | } | 304 | } |
305 | 305 | ||
306 | string serverURI = string.Empty; | 306 | string serverURI = string.Empty; |
307 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 307 | // bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
308 | UUID creatorId = UUID.Zero; | 308 | UUID creatorId = UUID.Zero; |
309 | 309 | ||
310 | OSDMap parameters= new OSDMap(); | 310 | OSDMap parameters= new OSDMap(); |
@@ -369,7 +369,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
369 | } | 369 | } |
370 | 370 | ||
371 | string serverURI = string.Empty; | 371 | string serverURI = string.Empty; |
372 | bool foreign = GetUserProfileServerURI(target, out serverURI); | 372 | // bool foreign = GetUserProfileServerURI(target, out serverURI); |
373 | 373 | ||
374 | object Ad = (object)ad; | 374 | object Ad = (object)ad; |
375 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) | 375 | if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString())) |
@@ -438,10 +438,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
438 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; | 438 | Vector3 pos = remoteClient.SceneAgent.AbsolutePosition; |
439 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); | 439 | ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y); |
440 | ScenePresence p = FindPresence(remoteClient.AgentId); | 440 | ScenePresence p = FindPresence(remoteClient.AgentId); |
441 | Vector3 avaPos = p.AbsolutePosition; | ||
442 | 441 | ||
443 | string serverURI = string.Empty; | 442 | string serverURI = string.Empty; |
444 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 443 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
445 | 444 | ||
446 | if (land == null) | 445 | if (land == null) |
447 | { | 446 | { |
@@ -488,7 +487,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
488 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) | 487 | public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient) |
489 | { | 488 | { |
490 | string serverURI = string.Empty; | 489 | string serverURI = string.Empty; |
491 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 490 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
492 | 491 | ||
493 | UUID classifiedId; | 492 | UUID classifiedId; |
494 | OSDMap parameters= new OSDMap(); | 493 | OSDMap parameters= new OSDMap(); |
@@ -538,7 +537,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
538 | } | 537 | } |
539 | 538 | ||
540 | string serverURI = string.Empty; | 539 | string serverURI = string.Empty; |
541 | bool foreign = GetUserProfileServerURI(targetId, out serverURI); | 540 | // bool foreign = GetUserProfileServerURI(targetId, out serverURI); |
542 | 541 | ||
543 | OSDMap parameters= new OSDMap(); | 542 | OSDMap parameters= new OSDMap(); |
544 | parameters.Add("creatorId", OSD.FromUUID(targetId)); | 543 | parameters.Add("creatorId", OSD.FromUUID(targetId)); |
@@ -589,7 +588,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
589 | UUID targetID; | 588 | UUID targetID; |
590 | UUID.TryParse(args[0], out targetID); | 589 | UUID.TryParse(args[0], out targetID); |
591 | string serverURI = string.Empty; | 590 | string serverURI = string.Empty; |
592 | bool foreign = GetUserProfileServerURI(targetID, out serverURI); | 591 | // bool foreign = GetUserProfileServerURI(targetID, out serverURI); |
593 | IClientAPI remoteClient = (IClientAPI)sender; | 592 | IClientAPI remoteClient = (IClientAPI)sender; |
594 | 593 | ||
595 | UserProfilePick pick = new UserProfilePick(); | 594 | UserProfilePick pick = new UserProfilePick(); |
@@ -657,7 +656,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
657 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); | 656 | m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString()); |
658 | UserProfilePick pick = new UserProfilePick(); | 657 | UserProfilePick pick = new UserProfilePick(); |
659 | string serverURI = string.Empty; | 658 | string serverURI = string.Empty; |
660 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 659 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
661 | ScenePresence p = FindPresence(remoteClient.AgentId); | 660 | ScenePresence p = FindPresence(remoteClient.AgentId); |
662 | 661 | ||
663 | Vector3 avaPos = p.AbsolutePosition; | 662 | Vector3 avaPos = p.AbsolutePosition; |
@@ -717,7 +716,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
717 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) | 716 | public void PickDelete(IClientAPI remoteClient, UUID queryPickID) |
718 | { | 717 | { |
719 | string serverURI = string.Empty; | 718 | string serverURI = string.Empty; |
720 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 719 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
721 | 720 | ||
722 | OSDMap parameters= new OSDMap(); | 721 | OSDMap parameters= new OSDMap(); |
723 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); | 722 | parameters.Add("pickId", OSD.FromUUID(queryPickID)); |
@@ -752,7 +751,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
752 | 751 | ||
753 | IClientAPI remoteClient = (IClientAPI)sender; | 752 | IClientAPI remoteClient = (IClientAPI)sender; |
754 | string serverURI = string.Empty; | 753 | string serverURI = string.Empty; |
755 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 754 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
756 | note.TargetId = remoteClient.AgentId; | 755 | note.TargetId = remoteClient.AgentId; |
757 | UUID.TryParse(args[0], out note.UserId); | 756 | UUID.TryParse(args[0], out note.UserId); |
758 | 757 | ||
@@ -788,7 +787,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
788 | note.Notes = queryNotes; | 787 | note.Notes = queryNotes; |
789 | 788 | ||
790 | string serverURI = string.Empty; | 789 | string serverURI = string.Empty; |
791 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 790 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
792 | 791 | ||
793 | object Note = note; | 792 | object Note = note; |
794 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) | 793 | if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString())) |
@@ -833,7 +832,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
833 | prop.Language = languages; | 832 | prop.Language = languages; |
834 | 833 | ||
835 | string serverURI = string.Empty; | 834 | string serverURI = string.Empty; |
836 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 835 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
837 | 836 | ||
838 | object Param = prop; | 837 | object Param = prop; |
839 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) | 838 | if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString())) |
@@ -955,7 +954,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
955 | prop.FirstLifeText = newProfile.FirstLifeAboutText; | 954 | prop.FirstLifeText = newProfile.FirstLifeAboutText; |
956 | 955 | ||
957 | string serverURI = string.Empty; | 956 | string serverURI = string.Empty; |
958 | bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); | 957 | // bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI); |
959 | 958 | ||
960 | object Prop = prop; | 959 | object Prop = prop; |
961 | 960 | ||
@@ -994,7 +993,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
994 | } | 993 | } |
995 | 994 | ||
996 | string serverURI = string.Empty; | 995 | string serverURI = string.Empty; |
997 | bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI); | 996 | // bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI); |
998 | 997 | ||
999 | // This is checking a friend on the home grid | 998 | // This is checking a friend on the home grid |
1000 | // Not HG friend | 999 | // Not HG friend |
@@ -1247,7 +1246,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1247 | return false; | 1246 | return false; |
1248 | } | 1247 | } |
1249 | 1248 | ||
1250 | byte[] buf = new byte[8192]; | ||
1251 | Stream rstream = webResponse.GetResponseStream(); | 1249 | Stream rstream = webResponse.GetResponseStream(); |
1252 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); | 1250 | OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream); |
1253 | 1251 | ||
@@ -1313,7 +1311,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1313 | return false; | 1311 | return false; |
1314 | } | 1312 | } |
1315 | 1313 | ||
1316 | byte[] buf = new byte[8192]; | ||
1317 | Stream rstream = webResponse.GetResponseStream(); | 1314 | Stream rstream = webResponse.GetResponseStream(); |
1318 | 1315 | ||
1319 | OSDMap response = new OSDMap(); | 1316 | OSDMap response = new OSDMap(); |
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs index 6ae9448..bd60611 100644 --- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Linq; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using System.Text; | 33 | using System.Text; |
33 | using log4net; | 34 | using log4net; |
@@ -37,6 +38,7 @@ using OpenMetaverse; | |||
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Console; | 39 | using OpenSim.Framework.Console; |
39 | using OpenSim.Framework.Servers; | 40 | using OpenSim.Framework.Servers; |
41 | using OpenSim.Framework.Servers.HttpServer; | ||
40 | using OpenSim.Region.Framework.Interfaces; | 42 | using OpenSim.Region.Framework.Interfaces; |
41 | using OpenSim.Region.Framework.Scenes; | 43 | using OpenSim.Region.Framework.Scenes; |
42 | using Caps=OpenSim.Framework.Capabilities.Caps; | 44 | using Caps=OpenSim.Framework.Capabilities.Caps; |
@@ -57,8 +59,9 @@ namespace OpenSim.Region.CoreModules.Framework | |||
57 | /// </summary> | 59 | /// </summary> |
58 | protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>(); | 60 | protected Dictionary<UUID, Caps> m_capsObjects = new Dictionary<UUID, Caps>(); |
59 | 61 | ||
60 | protected Dictionary<UUID, string> capsPaths = new Dictionary<UUID, string>(); | 62 | protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>(); |
61 | protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds | 63 | |
64 | protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds | ||
62 | = new Dictionary<UUID, Dictionary<ulong, string>>(); | 65 | = new Dictionary<UUID, Dictionary<ulong, string>>(); |
63 | 66 | ||
64 | public void Initialise(IConfigSource source) | 67 | public void Initialise(IConfigSource source) |
@@ -70,9 +73,24 @@ namespace OpenSim.Region.CoreModules.Framework | |||
70 | m_scene = scene; | 73 | m_scene = scene; |
71 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); | 74 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); |
72 | 75 | ||
73 | MainConsole.Instance.Commands.AddCommand("Comms", false, "show caps", | 76 | MainConsole.Instance.Commands.AddCommand( |
74 | "show caps", | 77 | "Comms", false, "show caps list", |
75 | "Shows all registered capabilities for users", HandleShowCapsCommand); | 78 | "show caps list", |
79 | "Shows list of registered capabilities for users.", HandleShowCapsListCommand); | ||
80 | |||
81 | MainConsole.Instance.Commands.AddCommand( | ||
82 | "Comms", false, "show caps stats by user", | ||
83 | "show caps stats [<first-name> <last-name>]", | ||
84 | "Shows statistics on capabilities use by user.", | ||
85 | "If a user name is given, then prints a detailed breakdown of caps use ordered by number of requests received.", | ||
86 | HandleShowCapsStatsByUserCommand); | ||
87 | |||
88 | MainConsole.Instance.Commands.AddCommand( | ||
89 | "Comms", false, "show caps stats by cap", | ||
90 | "show caps stats by cap [<cap-name>]", | ||
91 | "Shows statistics on capabilities use by capability.", | ||
92 | "If a capability name is given, then prints a detailed breakdown of use by each user.", | ||
93 | HandleShowCapsStatsByCapCommand); | ||
76 | } | 94 | } |
77 | 95 | ||
78 | public void RegionLoaded(Scene scene) | 96 | public void RegionLoaded(Scene scene) |
@@ -105,35 +123,42 @@ namespace OpenSim.Region.CoreModules.Framework | |||
105 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) | 123 | if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId)) |
106 | return; | 124 | return; |
107 | 125 | ||
126 | Caps caps; | ||
108 | String capsObjectPath = GetCapsPath(agentId); | 127 | String capsObjectPath = GetCapsPath(agentId); |
109 | 128 | ||
110 | if (m_capsObjects.ContainsKey(agentId)) | 129 | lock (m_capsObjects) |
111 | { | 130 | { |
112 | Caps oldCaps = m_capsObjects[agentId]; | 131 | if (m_capsObjects.ContainsKey(agentId)) |
113 | 132 | { | |
114 | m_log.DebugFormat( | 133 | Caps oldCaps = m_capsObjects[agentId]; |
115 | "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ", | 134 | |
116 | agentId, oldCaps.CapsObjectPath, capsObjectPath); | 135 | m_log.DebugFormat( |
117 | // This should not happen. The caller code is confused. We need to fix that. | 136 | "[CAPS]: Recreating caps for agent {0}. Old caps path {1}, new caps path {2}. ", |
118 | // CAPs can never be reregistered, or the client will be confused. | 137 | agentId, oldCaps.CapsObjectPath, capsObjectPath); |
119 | // Hence this return here. | 138 | // This should not happen. The caller code is confused. We need to fix that. |
120 | //return; | 139 | // CAPs can never be reregistered, or the client will be confused. |
121 | } | 140 | // Hence this return here. |
141 | //return; | ||
142 | } | ||
122 | 143 | ||
123 | Caps caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, | 144 | caps = new Caps(MainServer.Instance, m_scene.RegionInfo.ExternalHostName, |
124 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, | 145 | (MainServer.Instance == null) ? 0: MainServer.Instance.Port, |
125 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); | 146 | capsObjectPath, agentId, m_scene.RegionInfo.RegionName); |
126 | 147 | ||
127 | m_capsObjects[agentId] = caps; | 148 | m_capsObjects[agentId] = caps; |
149 | } | ||
128 | 150 | ||
129 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); | 151 | m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); |
130 | } | 152 | } |
131 | 153 | ||
132 | public void RemoveCaps(UUID agentId) | 154 | public void RemoveCaps(UUID agentId) |
133 | { | 155 | { |
134 | if (childrenSeeds.ContainsKey(agentId)) | 156 | lock (m_childrenSeeds) |
135 | { | 157 | { |
136 | childrenSeeds.Remove(agentId); | 158 | if (m_childrenSeeds.ContainsKey(agentId)) |
159 | { | ||
160 | m_childrenSeeds.Remove(agentId); | ||
161 | } | ||
137 | } | 162 | } |
138 | 163 | ||
139 | lock (m_capsObjects) | 164 | lock (m_capsObjects) |
@@ -168,16 +193,22 @@ namespace OpenSim.Region.CoreModules.Framework | |||
168 | 193 | ||
169 | public void SetAgentCapsSeeds(AgentCircuitData agent) | 194 | public void SetAgentCapsSeeds(AgentCircuitData agent) |
170 | { | 195 | { |
171 | capsPaths[agent.AgentID] = agent.CapsPath; | 196 | lock (m_capsPaths) |
172 | childrenSeeds[agent.AgentID] | 197 | m_capsPaths[agent.AgentID] = agent.CapsPath; |
173 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); | 198 | |
199 | lock (m_childrenSeeds) | ||
200 | m_childrenSeeds[agent.AgentID] | ||
201 | = ((agent.ChildrenCapSeeds == null) ? new Dictionary<ulong, string>() : agent.ChildrenCapSeeds); | ||
174 | } | 202 | } |
175 | 203 | ||
176 | public string GetCapsPath(UUID agentId) | 204 | public string GetCapsPath(UUID agentId) |
177 | { | 205 | { |
178 | if (capsPaths.ContainsKey(agentId)) | 206 | lock (m_capsPaths) |
179 | { | 207 | { |
180 | return capsPaths[agentId]; | 208 | if (m_capsPaths.ContainsKey(agentId)) |
209 | { | ||
210 | return m_capsPaths[agentId]; | ||
211 | } | ||
181 | } | 212 | } |
182 | 213 | ||
183 | return null; | 214 | return null; |
@@ -186,17 +217,24 @@ namespace OpenSim.Region.CoreModules.Framework | |||
186 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) | 217 | public Dictionary<ulong, string> GetChildrenSeeds(UUID agentID) |
187 | { | 218 | { |
188 | Dictionary<ulong, string> seeds = null; | 219 | Dictionary<ulong, string> seeds = null; |
189 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 220 | |
190 | return seeds; | 221 | lock (m_childrenSeeds) |
222 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) | ||
223 | return seeds; | ||
224 | |||
191 | return new Dictionary<ulong, string>(); | 225 | return new Dictionary<ulong, string>(); |
192 | } | 226 | } |
193 | 227 | ||
194 | public void DropChildSeed(UUID agentID, ulong handle) | 228 | public void DropChildSeed(UUID agentID, ulong handle) |
195 | { | 229 | { |
196 | Dictionary<ulong, string> seeds; | 230 | Dictionary<ulong, string> seeds; |
197 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 231 | |
232 | lock (m_childrenSeeds) | ||
198 | { | 233 | { |
199 | seeds.Remove(handle); | 234 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) |
235 | { | ||
236 | seeds.Remove(handle); | ||
237 | } | ||
200 | } | 238 | } |
201 | } | 239 | } |
202 | 240 | ||
@@ -204,53 +242,275 @@ namespace OpenSim.Region.CoreModules.Framework | |||
204 | { | 242 | { |
205 | Dictionary<ulong, string> seeds; | 243 | Dictionary<ulong, string> seeds; |
206 | string returnval; | 244 | string returnval; |
207 | if (childrenSeeds.TryGetValue(agentID, out seeds)) | 245 | |
246 | lock (m_childrenSeeds) | ||
208 | { | 247 | { |
209 | if (seeds.TryGetValue(handle, out returnval)) | 248 | if (m_childrenSeeds.TryGetValue(agentID, out seeds)) |
210 | return returnval; | 249 | { |
250 | if (seeds.TryGetValue(handle, out returnval)) | ||
251 | return returnval; | ||
252 | } | ||
211 | } | 253 | } |
254 | |||
212 | return null; | 255 | return null; |
213 | } | 256 | } |
214 | 257 | ||
215 | public void SetChildrenSeed(UUID agentID, Dictionary<ulong, string> seeds) | 258 | public void SetChildrenSeed(UUID agentID, Dictionary<ulong, string> seeds) |
216 | { | 259 | { |
217 | //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); | 260 | //m_log.DebugFormat(" !!! Setting child seeds in {0} to {1}", m_scene.RegionInfo.RegionName, seeds.Count); |
218 | childrenSeeds[agentID] = seeds; | 261 | |
262 | lock (m_childrenSeeds) | ||
263 | m_childrenSeeds[agentID] = seeds; | ||
219 | } | 264 | } |
220 | 265 | ||
221 | public void DumpChildrenSeeds(UUID agentID) | 266 | public void DumpChildrenSeeds(UUID agentID) |
222 | { | 267 | { |
223 | m_log.Info("================ ChildrenSeed "+m_scene.RegionInfo.RegionName+" ================"); | 268 | m_log.Info("================ ChildrenSeed "+m_scene.RegionInfo.RegionName+" ================"); |
224 | foreach (KeyValuePair<ulong, string> kvp in childrenSeeds[agentID]) | 269 | |
270 | lock (m_childrenSeeds) | ||
225 | { | 271 | { |
226 | uint x, y; | 272 | foreach (KeyValuePair<ulong, string> kvp in m_childrenSeeds[agentID]) |
227 | Utils.LongToUInts(kvp.Key, out x, out y); | 273 | { |
228 | x = x / Constants.RegionSize; | 274 | uint x, y; |
229 | y = y / Constants.RegionSize; | 275 | Utils.LongToUInts(kvp.Key, out x, out y); |
230 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); | 276 | x = x / Constants.RegionSize; |
277 | y = y / Constants.RegionSize; | ||
278 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); | ||
279 | } | ||
231 | } | 280 | } |
232 | } | 281 | } |
233 | 282 | ||
234 | private void HandleShowCapsCommand(string module, string[] cmdparams) | 283 | private void HandleShowCapsListCommand(string module, string[] cmdParams) |
235 | { | 284 | { |
285 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
286 | return; | ||
287 | |||
236 | StringBuilder caps = new StringBuilder(); | 288 | StringBuilder caps = new StringBuilder(); |
237 | caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); | 289 | caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); |
238 | 290 | ||
239 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) | 291 | lock (m_capsObjects) |
240 | { | 292 | { |
241 | caps.AppendFormat("** User {0}:\n", kvp.Key); | 293 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) |
294 | { | ||
295 | caps.AppendFormat("** User {0}:\n", kvp.Key); | ||
296 | |||
297 | for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) | ||
298 | { | ||
299 | Uri uri = new Uri(kvp2.Value.ToString()); | ||
300 | caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); | ||
301 | } | ||
302 | |||
303 | foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers) | ||
304 | caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value); | ||
305 | } | ||
306 | } | ||
242 | 307 | ||
243 | for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); ) | 308 | MainConsole.Instance.Output(caps.ToString()); |
309 | } | ||
310 | |||
311 | private void HandleShowCapsStatsByCapCommand(string module, string[] cmdParams) | ||
312 | { | ||
313 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
314 | return; | ||
315 | |||
316 | if (cmdParams.Length != 5 && cmdParams.Length != 6) | ||
317 | { | ||
318 | MainConsole.Instance.Output("Usage: show caps stats by cap [<cap-name>]"); | ||
319 | return; | ||
320 | } | ||
321 | |||
322 | StringBuilder sb = new StringBuilder(); | ||
323 | sb.AppendFormat("Region {0}:\n", m_scene.Name); | ||
324 | |||
325 | if (cmdParams.Length == 5) | ||
326 | { | ||
327 | BuildSummaryStatsByCapReport(sb); | ||
328 | } | ||
329 | else if (cmdParams.Length == 6) | ||
330 | { | ||
331 | BuildDetailedStatsByCapReport(sb, cmdParams[5]); | ||
332 | } | ||
333 | |||
334 | MainConsole.Instance.Output(sb.ToString()); | ||
335 | } | ||
336 | |||
337 | private void BuildDetailedStatsByCapReport(StringBuilder sb, string capName) | ||
338 | { | ||
339 | sb.AppendFormat("Capability name {0}\n", capName); | ||
340 | |||
341 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
342 | cdt.AddColumn("User Name", 34); | ||
343 | cdt.AddColumn("Req Received", 12); | ||
344 | cdt.AddColumn("Req Handled", 12); | ||
345 | cdt.Indent = 2; | ||
346 | |||
347 | Dictionary<string, int> receivedStats = new Dictionary<string, int>(); | ||
348 | Dictionary<string, int> handledStats = new Dictionary<string, int>(); | ||
349 | |||
350 | m_scene.ForEachScenePresence( | ||
351 | sp => | ||
244 | { | 352 | { |
245 | Uri uri = new Uri(kvp2.Value.ToString()); | 353 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); |
246 | caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery); | 354 | |
355 | if (caps == null) | ||
356 | return; | ||
357 | |||
358 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
359 | |||
360 | IRequestHandler reqHandler; | ||
361 | if (capsHandlers.TryGetValue(capName, out reqHandler)) | ||
362 | { | ||
363 | receivedStats[sp.Name] = reqHandler.RequestsReceived; | ||
364 | handledStats[sp.Name] = reqHandler.RequestsHandled; | ||
365 | } | ||
247 | } | 366 | } |
367 | ); | ||
248 | 368 | ||
249 | foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers) | 369 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) |
250 | caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value); | 370 | { |
371 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | ||
251 | } | 372 | } |
252 | 373 | ||
253 | MainConsole.Instance.Output(caps.ToString()); | 374 | sb.Append(cdt.ToString()); |
375 | } | ||
376 | |||
377 | private void BuildSummaryStatsByCapReport(StringBuilder sb) | ||
378 | { | ||
379 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
380 | cdt.AddColumn("Name", 34); | ||
381 | cdt.AddColumn("Req Received", 12); | ||
382 | cdt.AddColumn("Req Handled", 12); | ||
383 | cdt.Indent = 2; | ||
384 | |||
385 | Dictionary<string, int> receivedStats = new Dictionary<string, int>(); | ||
386 | Dictionary<string, int> handledStats = new Dictionary<string, int>(); | ||
387 | |||
388 | m_scene.ForEachScenePresence( | ||
389 | sp => | ||
390 | { | ||
391 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
392 | |||
393 | if (caps == null) | ||
394 | return; | ||
395 | |||
396 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
397 | |||
398 | foreach (IRequestHandler reqHandler in capsHandlers.Values) | ||
399 | { | ||
400 | string reqName = reqHandler.Name ?? ""; | ||
401 | |||
402 | if (!receivedStats.ContainsKey(reqName)) | ||
403 | { | ||
404 | receivedStats[reqName] = reqHandler.RequestsReceived; | ||
405 | handledStats[reqName] = reqHandler.RequestsHandled; | ||
406 | } | ||
407 | else | ||
408 | { | ||
409 | receivedStats[reqName] += reqHandler.RequestsReceived; | ||
410 | handledStats[reqName] += reqHandler.RequestsHandled; | ||
411 | } | ||
412 | } | ||
413 | } | ||
414 | ); | ||
415 | |||
416 | foreach (KeyValuePair<string, int> kvp in receivedStats.OrderByDescending(kp => kp.Value)) | ||
417 | cdt.AddRow(kvp.Key, kvp.Value, handledStats[kvp.Key]); | ||
418 | |||
419 | sb.Append(cdt.ToString()); | ||
420 | } | ||
421 | |||
422 | private void HandleShowCapsStatsByUserCommand(string module, string[] cmdParams) | ||
423 | { | ||
424 | if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene) | ||
425 | return; | ||
426 | |||
427 | if (cmdParams.Length != 5 && cmdParams.Length != 7) | ||
428 | { | ||
429 | MainConsole.Instance.Output("Usage: show caps stats by user [<first-name> <last-name>]"); | ||
430 | return; | ||
431 | } | ||
432 | |||
433 | StringBuilder sb = new StringBuilder(); | ||
434 | sb.AppendFormat("Region {0}:\n", m_scene.Name); | ||
435 | |||
436 | if (cmdParams.Length == 5) | ||
437 | { | ||
438 | BuildSummaryStatsByUserReport(sb); | ||
439 | } | ||
440 | else if (cmdParams.Length == 7) | ||
441 | { | ||
442 | string firstName = cmdParams[5]; | ||
443 | string lastName = cmdParams[6]; | ||
444 | |||
445 | ScenePresence sp = m_scene.GetScenePresence(firstName, lastName); | ||
446 | |||
447 | if (sp == null) | ||
448 | return; | ||
449 | |||
450 | BuildDetailedStatsByUserReport(sb, sp); | ||
451 | } | ||
452 | |||
453 | MainConsole.Instance.Output(sb.ToString()); | ||
454 | } | ||
455 | |||
456 | private void BuildDetailedStatsByUserReport(StringBuilder sb, ScenePresence sp) | ||
457 | { | ||
458 | sb.AppendFormat("Avatar name {0}, type {1}\n", sp.Name, sp.IsChildAgent ? "child" : "root"); | ||
459 | |||
460 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
461 | cdt.AddColumn("Cap Name", 34); | ||
462 | cdt.AddColumn("Req Received", 12); | ||
463 | cdt.AddColumn("Req Handled", 12); | ||
464 | cdt.Indent = 2; | ||
465 | |||
466 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
467 | |||
468 | if (caps == null) | ||
469 | return; | ||
470 | |||
471 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
472 | |||
473 | foreach (IRequestHandler reqHandler in capsHandlers.Values.OrderByDescending(rh => rh.RequestsReceived)) | ||
474 | { | ||
475 | cdt.AddRow(reqHandler.Name, reqHandler.RequestsReceived, reqHandler.RequestsHandled); | ||
476 | } | ||
477 | |||
478 | sb.Append(cdt.ToString()); | ||
479 | } | ||
480 | |||
481 | private void BuildSummaryStatsByUserReport(StringBuilder sb) | ||
482 | { | ||
483 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
484 | cdt.AddColumn("Name", 32); | ||
485 | cdt.AddColumn("Type", 5); | ||
486 | cdt.AddColumn("Req Received", 12); | ||
487 | cdt.AddColumn("Req Handled", 12); | ||
488 | cdt.Indent = 2; | ||
489 | |||
490 | m_scene.ForEachScenePresence( | ||
491 | sp => | ||
492 | { | ||
493 | Caps caps = m_scene.CapsModule.GetCapsForUser(sp.UUID); | ||
494 | |||
495 | if (caps == null) | ||
496 | return; | ||
497 | |||
498 | Dictionary<string, IRequestHandler> capsHandlers = caps.CapsHandlers.GetCapsHandlers(); | ||
499 | |||
500 | int totalRequestsReceived = 0; | ||
501 | int totalRequestsHandled = 0; | ||
502 | |||
503 | foreach (IRequestHandler reqHandler in capsHandlers.Values) | ||
504 | { | ||
505 | totalRequestsReceived += reqHandler.RequestsReceived; | ||
506 | totalRequestsHandled += reqHandler.RequestsHandled; | ||
507 | } | ||
508 | |||
509 | cdt.AddRow(sp.Name, sp.IsChildAgent ? "child" : "root", totalRequestsReceived, totalRequestsHandled); | ||
510 | } | ||
511 | ); | ||
512 | |||
513 | sb.Append(cdt.ToString()); | ||
254 | } | 514 | } |
255 | } | 515 | } |
256 | } | 516 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs index eb74cda..2366767 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
55 | m_EstateModule = fmodule; | 55 | m_EstateModule = fmodule; |
56 | } | 56 | } |
57 | 57 | ||
58 | public override byte[] Handle(string path, Stream requestData, | 58 | protected override byte[] ProcessRequest(string path, Stream requestData, |
59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | StreamReader sr = new StreamReader(requestData); | 61 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 8a40278..29652aa 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | |||
@@ -55,7 +55,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
55 | private object m_lockObject = new object(); | 55 | private object m_lockObject = new object(); |
56 | private object m_timerLock = new object(); | 56 | private object m_timerLock = new object(); |
57 | private const double m_tickDuration = 50.0; | 57 | private const double m_tickDuration = 50.0; |
58 | private Scene m_scene; | ||
59 | 58 | ||
60 | public double TickDuration | 59 | public double TickDuration |
61 | { | 60 | { |
@@ -69,8 +68,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
69 | m_timer.AutoReset = true; | 68 | m_timer.AutoReset = true; |
70 | m_timer.Elapsed += OnTimer; | 69 | m_timer.Elapsed += OnTimer; |
71 | 70 | ||
72 | m_scene = scene; | ||
73 | |||
74 | m_timer.Start(); | 71 | m_timer.Start(); |
75 | } | 72 | } |
76 | 73 | ||
@@ -94,13 +91,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
94 | { | 91 | { |
95 | m.OnTimer(TickDuration); | 92 | m.OnTimer(TickDuration); |
96 | } | 93 | } |
97 | catch (Exception inner) | 94 | catch (Exception) |
98 | { | 95 | { |
99 | // Don't stop processing | 96 | // Don't stop processing |
100 | } | 97 | } |
101 | } | 98 | } |
102 | } | 99 | } |
103 | catch (Exception e) | 100 | catch (Exception) |
104 | { | 101 | { |
105 | // Keep running no matter what | 102 | // Keep running no matter what |
106 | } | 103 | } |
@@ -157,7 +154,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
157 | [Serializable] | 154 | [Serializable] |
158 | public class KeyframeMotion | 155 | public class KeyframeMotion |
159 | { | 156 | { |
160 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 157 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
161 | 158 | ||
162 | public enum PlayMode : int | 159 | public enum PlayMode : int |
163 | { | 160 | { |
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs index 726becf..f208afb 100644 --- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs +++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
63 | osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); | 63 | osXStatsURI = Util.SHA1Hash(regionInfo.osSecret); |
64 | } | 64 | } |
65 | 65 | ||
66 | public override byte[] Handle( | 66 | protected override byte[] ProcessRequest( |
67 | string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 67 | string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | return Util.UTF8.GetBytes(Report()); | 69 | return Util.UTF8.GetBytes(Report()); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f287a34..f361acb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -354,8 +354,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
354 | private UUID m_collisionSound; | 354 | private UUID m_collisionSound; |
355 | private float m_collisionSoundVolume; | 355 | private float m_collisionSoundVolume; |
356 | 356 | ||
357 | private KeyframeMotion m_keyframeMotion = null; | ||
358 | |||
359 | public KeyframeMotion KeyframeMotion | 357 | public KeyframeMotion KeyframeMotion |
360 | { | 358 | { |
361 | get; set; | 359 | get; set; |
diff --git a/OpenSim/Region/OptionalModules/Materials/MaterialsDemoModule.cs b/OpenSim/Region/OptionalModules/Materials/MaterialsDemoModule.cs index 3a39971..0a0d65c 100644 --- a/OpenSim/Region/OptionalModules/Materials/MaterialsDemoModule.cs +++ b/OpenSim/Region/OptionalModules/Materials/MaterialsDemoModule.cs | |||
@@ -139,18 +139,21 @@ namespace OpenSim.Region.OptionalModules.MaterialsDemoModule | |||
139 | { | 139 | { |
140 | string capsBase = "/CAPS/" + caps.CapsObjectPath; | 140 | string capsBase = "/CAPS/" + caps.CapsObjectPath; |
141 | 141 | ||
142 | IRequestHandler renderMaterialsPostHandler = new RestStreamHandler("POST", capsBase + "/", RenderMaterialsPostCap); | 142 | IRequestHandler renderMaterialsPostHandler |
143 | caps.RegisterHandler("RenderMaterials", renderMaterialsPostHandler); | 143 | = new RestStreamHandler("POST", capsBase + "/", RenderMaterialsPostCap, "RenderMaterialsPost", null); |
144 | caps.RegisterHandler("RenderMaterialsPost", renderMaterialsPostHandler); | ||
144 | 145 | ||
145 | // OpenSimulator CAPs infrastructure seems to be somewhat hostile towards any CAP that requires both GET | 146 | // OpenSimulator CAPs infrastructure seems to be somewhat hostile towards any CAP that requires both GET |
146 | // and POST handlers, (at least at the time this was originally written), so we first set up a POST | 147 | // and POST handlers, (at least at the time this was originally written), so we first set up a POST |
147 | // handler normally and then add a GET handler via MainServer | 148 | // handler normally and then add a GET handler via MainServer |
148 | 149 | ||
149 | IRequestHandler renderMaterialsGetHandler = new RestStreamHandler("GET", capsBase + "/", RenderMaterialsGetCap); | 150 | IRequestHandler renderMaterialsGetHandler |
151 | = new RestStreamHandler("GET", capsBase + "/", RenderMaterialsGetCap, "RenderMaterialsGet", null); | ||
150 | MainServer.Instance.AddStreamHandler(renderMaterialsGetHandler); | 152 | MainServer.Instance.AddStreamHandler(renderMaterialsGetHandler); |
151 | 153 | ||
152 | // materials viewer seems to use either POST or PUT, so assign POST handler for PUT as well | 154 | // materials viewer seems to use either POST or PUT, so assign POST handler for PUT as well |
153 | IRequestHandler renderMaterialsPutHandler = new RestStreamHandler("PUT", capsBase + "/", RenderMaterialsPostCap); | 155 | IRequestHandler renderMaterialsPutHandler |
156 | = new RestStreamHandler("PUT", capsBase + "/", RenderMaterialsPostCap, "RenderMaterialsPut", null); | ||
154 | MainServer.Instance.AddStreamHandler(renderMaterialsPutHandler); | 157 | MainServer.Instance.AddStreamHandler(renderMaterialsPutHandler); |
155 | } | 158 | } |
156 | 159 | ||
@@ -394,7 +397,6 @@ namespace OpenSim.Region.OptionalModules.MaterialsDemoModule | |||
394 | m_log.Debug("[MaterialsDemoModule]: null SOP for localId: " + matLocalID.ToString()); | 397 | m_log.Debug("[MaterialsDemoModule]: null SOP for localId: " + matLocalID.ToString()); |
395 | else | 398 | else |
396 | { | 399 | { |
397 | //var te = sop.Shape.Textures; | ||
398 | var te = new Primitive.TextureEntry(sop.Shape.TextureEntry, 0, sop.Shape.TextureEntry.Length); | 400 | var te = new Primitive.TextureEntry(sop.Shape.TextureEntry, 0, sop.Shape.TextureEntry.Length); |
399 | 401 | ||
400 | if (te == null) | 402 | if (te == null) |
@@ -413,14 +415,7 @@ namespace OpenSim.Region.OptionalModules.MaterialsDemoModule | |||
413 | if (te.DefaultTexture == null) | 415 | if (te.DefaultTexture == null) |
414 | m_log.Debug("[MaterialsDemoModule]: te.DefaultTexture is null"); | 416 | m_log.Debug("[MaterialsDemoModule]: te.DefaultTexture is null"); |
415 | else | 417 | else |
416 | { | 418 | te.DefaultTexture.MaterialID = id; |
417 | if (te.DefaultTexture.MaterialID == null) | ||
418 | m_log.Debug("[MaterialsDemoModule]: te.DefaultTexture.MaterialID is null"); | ||
419 | else | ||
420 | { | ||
421 | te.DefaultTexture.MaterialID = id; | ||
422 | } | ||
423 | } | ||
424 | } | 419 | } |
425 | else | 420 | else |
426 | { | 421 | { |
diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs index 1ea1c20..6e0a80a 100644 --- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs | |||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport | |||
281 | m_module = module; | 281 | m_module = module; |
282 | } | 282 | } |
283 | 283 | ||
284 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 284 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
285 | { | 285 | { |
286 | StreamReader reader = new StreamReader(request); | 286 | StreamReader reader = new StreamReader(request); |
287 | string requestBody = reader.ReadToEnd(); | 287 | string requestBody = reader.ReadToEnd(); |
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index 550b5d4..8720cc7 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
55 | m_WorldViewModule = fmodule; | 55 | m_WorldViewModule = fmodule; |
56 | } | 56 | } |
57 | 57 | ||
58 | public override byte[] Handle(string path, Stream requestData, | 58 | protected override byte[] ProcessRequest(string path, Stream requestData, |
59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 59 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
60 | { | 60 | { |
61 | httpResponse.ContentType = "image/jpeg"; | 61 | httpResponse.ContentType = "image/jpeg"; |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 82fe267..0204967 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | |||
@@ -125,33 +125,12 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
125 | static readonly float PIOverFour = ((float)Math.PI) / 4f; | 125 | static readonly float PIOverFour = ((float)Math.PI) / 4f; |
126 | static readonly float PIOverTwo = ((float)Math.PI) / 2f; | 126 | static readonly float PIOverTwo = ((float)Math.PI) / 2f; |
127 | 127 | ||
128 | // For debugging, flags to turn on and off individual corrections. | ||
129 | public bool enableAngularVerticalAttraction; | ||
130 | public bool enableAngularDeflection; | ||
131 | public bool enableAngularBanking; | ||
132 | |||
133 | public BSDynamics(BSScene myScene, BSPrim myPrim, string actorName) | 128 | public BSDynamics(BSScene myScene, BSPrim myPrim, string actorName) |
134 | : base(myScene, myPrim, actorName) | 129 | : base(myScene, myPrim, actorName) |
135 | { | 130 | { |
136 | ControllingPrim = myPrim; | 131 | ControllingPrim = myPrim; |
137 | Type = Vehicle.TYPE_NONE; | 132 | Type = Vehicle.TYPE_NONE; |
138 | m_haveRegisteredForSceneEvents = false; | 133 | m_haveRegisteredForSceneEvents = false; |
139 | SetupVehicleDebugging(); | ||
140 | } | ||
141 | |||
142 | // Stopgap debugging enablement. Allows source level debugging but still checking | ||
143 | // in changes by making enablement of debugging flags from INI file. | ||
144 | public void SetupVehicleDebugging() | ||
145 | { | ||
146 | enableAngularVerticalAttraction = true; | ||
147 | enableAngularDeflection = true; | ||
148 | enableAngularBanking = true; | ||
149 | if (BSParam.VehicleDebuggingEnable) | ||
150 | { | ||
151 | enableAngularVerticalAttraction = true; | ||
152 | enableAngularDeflection = false; | ||
153 | enableAngularBanking = false; | ||
154 | } | ||
155 | } | 134 | } |
156 | 135 | ||
157 | // Return 'true' if this vehicle is doing vehicle things | 136 | // Return 'true' if this vehicle is doing vehicle things |
@@ -556,10 +535,10 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
556 | } | 535 | } |
557 | 536 | ||
558 | m_linearMotor = new BSVMotor("LinearMotor", m_linearMotorTimescale, m_linearMotorDecayTimescale, 1f); | 537 | m_linearMotor = new BSVMotor("LinearMotor", m_linearMotorTimescale, m_linearMotorDecayTimescale, 1f); |
559 | m_linearMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG DEBUG (enables detail logging) | 538 | // m_linearMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG DEBUG (enables detail logging) |
560 | 539 | ||
561 | m_angularMotor = new BSVMotor("AngularMotor", m_angularMotorTimescale, m_angularMotorDecayTimescale, 1f); | 540 | m_angularMotor = new BSVMotor("AngularMotor", m_angularMotorTimescale, m_angularMotorDecayTimescale, 1f); |
562 | m_angularMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG DEBUG (enables detail logging) | 541 | // m_angularMotor.PhysicsScene = m_physicsScene; // DEBUG DEBUG DEBUG (enables detail logging) |
563 | 542 | ||
564 | /* Not implemented | 543 | /* Not implemented |
565 | m_verticalAttractionMotor = new BSVMotor("VerticalAttraction", m_verticalAttractionTimescale, | 544 | m_verticalAttractionMotor = new BSVMotor("VerticalAttraction", m_verticalAttractionTimescale, |
@@ -926,6 +905,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
926 | return VehicleVelocity * Quaternion.Inverse(Quaternion.Normalize(VehicleOrientation)); | 905 | return VehicleVelocity * Quaternion.Inverse(Quaternion.Normalize(VehicleOrientation)); |
927 | } | 906 | } |
928 | } | 907 | } |
908 | |||
929 | private float VehicleForwardSpeed | 909 | private float VehicleForwardSpeed |
930 | { | 910 | { |
931 | get | 911 | get |
@@ -1061,26 +1041,37 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1061 | Vector3 linearDeflectionV = Vector3.Zero; | 1041 | Vector3 linearDeflectionV = Vector3.Zero; |
1062 | Vector3 velocityV = VehicleForwardVelocity; | 1042 | Vector3 velocityV = VehicleForwardVelocity; |
1063 | 1043 | ||
1064 | // Velocity in Y and Z dimensions is movement to the side or turning. | 1044 | if (BSParam.VehicleEnableLinearDeflection) |
1065 | // Compute deflection factor from the to the side and rotational velocity | 1045 | { |
1066 | linearDeflectionV.Y = SortedClampInRange(0, (velocityV.Y * m_linearDeflectionEfficiency) / m_linearDeflectionTimescale, velocityV.Y); | 1046 | // Velocity in Y and Z dimensions is movement to the side or turning. |
1067 | linearDeflectionV.Z = SortedClampInRange(0, (velocityV.Z * m_linearDeflectionEfficiency) / m_linearDeflectionTimescale, velocityV.Z); | 1047 | // Compute deflection factor from the to the side and rotational velocity |
1048 | linearDeflectionV.Y = SortedClampInRange(0, (velocityV.Y * m_linearDeflectionEfficiency) / m_linearDeflectionTimescale, velocityV.Y); | ||
1049 | linearDeflectionV.Z = SortedClampInRange(0, (velocityV.Z * m_linearDeflectionEfficiency) / m_linearDeflectionTimescale, velocityV.Z); | ||
1050 | |||
1051 | // Velocity to the side and around is corrected and moved into the forward direction | ||
1052 | linearDeflectionV.X += Math.Abs(linearDeflectionV.Y); | ||
1053 | linearDeflectionV.X += Math.Abs(linearDeflectionV.Z); | ||
1068 | 1054 | ||
1069 | // Velocity to the side and around is corrected and moved into the forward direction | 1055 | // Scale the deflection to the fractional simulation time |
1070 | linearDeflectionV.X += Math.Abs(linearDeflectionV.Y); | 1056 | linearDeflectionV *= pTimestep; |
1071 | linearDeflectionV.X += Math.Abs(linearDeflectionV.Z); | ||
1072 | 1057 | ||
1073 | // Scale the deflection to the fractional simulation time | 1058 | // Subtract the sideways and rotational velocity deflection factors while adding the correction forward |
1074 | linearDeflectionV *= pTimestep; | 1059 | linearDeflectionV *= new Vector3(1, -1, -1); |
1075 | 1060 | ||
1076 | // Subtract the sideways and rotational velocity deflection factors while adding the correction forward | 1061 | // Correction is vehicle relative. Convert to world coordinates. |
1077 | linearDeflectionV *= new Vector3(1,-1,-1); | 1062 | Vector3 linearDeflectionW = linearDeflectionV * VehicleOrientation; |
1078 | 1063 | ||
1079 | // Correciont is vehicle relative. Convert to world coordinates and add to the velocity | 1064 | // Optionally, if not colliding, don't effect world downward velocity. Let falling things fall. |
1080 | VehicleVelocity += linearDeflectionV * VehicleOrientation; | 1065 | if (BSParam.VehicleLinearDeflectionNotCollidingNoZ && !m_controllingPrim.IsColliding) |
1066 | { | ||
1067 | linearDeflectionW.Z = 0f; | ||
1068 | } | ||
1081 | 1069 | ||
1082 | VDetailLog("{0}, MoveLinear,LinearDeflection,linDefEff={1},linDefTS={2},linDeflectionV={3}", | 1070 | VehicleVelocity += linearDeflectionW; |
1083 | ControllingPrim.LocalID, m_linearDeflectionEfficiency, m_linearDeflectionTimescale, linearDeflectionV); | 1071 | |
1072 | VDetailLog("{0}, MoveLinear,LinearDeflection,linDefEff={1},linDefTS={2},linDeflectionV={3}", | ||
1073 | ControllingPrim.LocalID, m_linearDeflectionEfficiency, m_linearDeflectionTimescale, linearDeflectionV); | ||
1074 | } | ||
1084 | } | 1075 | } |
1085 | 1076 | ||
1086 | public void ComputeLinearTerrainHeightCorrection(float pTimestep) | 1077 | public void ComputeLinearTerrainHeightCorrection(float pTimestep) |
@@ -1393,116 +1384,134 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1393 | { | 1384 | { |
1394 | 1385 | ||
1395 | // If vertical attaction timescale is reasonable | 1386 | // If vertical attaction timescale is reasonable |
1396 | if (enableAngularVerticalAttraction && m_verticalAttractionTimescale < m_verticalAttractionCutoff) | 1387 | if (BSParam.VehicleEnableAngularVerticalAttraction && m_verticalAttractionTimescale < m_verticalAttractionCutoff) |
1397 | { | 1388 | { |
1398 | //Another formula to try got from : | 1389 | Vector3 vehicleUpAxis = Vector3.UnitZ * VehicleOrientation; |
1399 | //http://answers.unity3d.com/questions/10425/how-to-stabilize-angular-motion-alignment-of-hover.html | 1390 | switch (BSParam.VehicleAngularVerticalAttractionAlgorithm) |
1400 | |||
1401 | Vector3 VehicleUpAxis = Vector3.UnitZ * VehicleOrientation; | ||
1402 | |||
1403 | // Flipping what was originally a timescale into a speed variable and then multiplying it by 2 | ||
1404 | // since only computing half the distance between the angles. | ||
1405 | float VerticalAttractionSpeed = (1 / m_verticalAttractionTimescale) * 2.0f; | ||
1406 | |||
1407 | // Make a prediction of where the up axis will be when this is applied rather then where it is now as | ||
1408 | // this makes for a smoother adjustment and less fighting between the various forces. | ||
1409 | Vector3 predictedUp = VehicleUpAxis * Quaternion.CreateFromAxisAngle(VehicleRotationalVelocity, 0f); | ||
1410 | |||
1411 | // This is only half the distance to the target so it will take 2 seconds to complete the turn. | ||
1412 | Vector3 torqueVector = Vector3.Cross(predictedUp, Vector3.UnitZ); | ||
1413 | |||
1414 | // Scale vector by our timescale since it is an acceleration it is r/s^2 or radians a timescale squared | ||
1415 | Vector3 vertContributionV = torqueVector * VerticalAttractionSpeed * VerticalAttractionSpeed; | ||
1416 | |||
1417 | VehicleRotationalVelocity += vertContributionV; | ||
1418 | |||
1419 | VDetailLog("{0}, MoveAngular,verticalAttraction,UpAxis={1},PredictedUp={2},torqueVector={3},contrib={4}", | ||
1420 | ControllingPrim.LocalID, | ||
1421 | VehicleUpAxis, | ||
1422 | predictedUp, | ||
1423 | torqueVector, | ||
1424 | vertContributionV); | ||
1425 | //===================================================================== | ||
1426 | /* | ||
1427 | // Possible solution derived from a discussion at: | ||
1428 | // http://stackoverflow.com/questions/14939657/computing-vector-from-quaternion-works-computing-quaternion-from-vector-does-no | ||
1429 | |||
1430 | // Create a rotation that is only the vehicle's rotation around Z | ||
1431 | Vector3 currentEuler = Vector3.Zero; | ||
1432 | VehicleOrientation.GetEulerAngles(out currentEuler.X, out currentEuler.Y, out currentEuler.Z); | ||
1433 | Quaternion justZOrientation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, currentEuler.Z); | ||
1434 | |||
1435 | // Create the axis that is perpendicular to the up vector and the rotated up vector. | ||
1436 | Vector3 differenceAxis = Vector3.Cross(Vector3.UnitZ * justZOrientation, Vector3.UnitZ * VehicleOrientation); | ||
1437 | // Compute the angle between those to vectors. | ||
1438 | double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, Vector3.Normalize(Vector3.UnitZ * VehicleOrientation))); | ||
1439 | // 'differenceAngle' is the angle to rotate and 'differenceAxis' is the plane to rotate in to get the vehicle vertical | ||
1440 | |||
1441 | // Reduce the change by the time period it is to change in. Timestep is handled when velocity is applied. | ||
1442 | // TODO: add 'efficiency'. | ||
1443 | differenceAngle /= m_verticalAttractionTimescale; | ||
1444 | |||
1445 | // Create the quaterian representing the correction angle | ||
1446 | Quaternion correctionRotation = Quaternion.CreateFromAxisAngle(differenceAxis, (float)differenceAngle); | ||
1447 | |||
1448 | // Turn that quaternion into Euler values to make it into velocities to apply. | ||
1449 | Vector3 vertContributionV = Vector3.Zero; | ||
1450 | correctionRotation.GetEulerAngles(out vertContributionV.X, out vertContributionV.Y, out vertContributionV.Z); | ||
1451 | vertContributionV *= -1f; | ||
1452 | |||
1453 | VehicleRotationalVelocity += vertContributionV; | ||
1454 | |||
1455 | VDetailLog("{0}, MoveAngular,verticalAttraction,diffAxis={1},diffAng={2},corrRot={3},contrib={4}", | ||
1456 | ControllingPrim.LocalID, | ||
1457 | differenceAxis, | ||
1458 | differenceAngle, | ||
1459 | correctionRotation, | ||
1460 | vertContributionV); | ||
1461 | */ | ||
1462 | |||
1463 | // =================================================================== | ||
1464 | /* | ||
1465 | Vector3 vertContributionV = Vector3.Zero; | ||
1466 | Vector3 origRotVelW = VehicleRotationalVelocity; // DEBUG DEBUG | ||
1467 | |||
1468 | // Take a vector pointing up and convert it from world to vehicle relative coords. | ||
1469 | Vector3 verticalError = Vector3.Normalize(Vector3.UnitZ * VehicleOrientation); | ||
1470 | |||
1471 | // If vertical attraction correction is needed, the vector that was pointing up (UnitZ) | ||
1472 | // is now: | ||
1473 | // leaning to one side: rotated around the X axis with the Y value going | ||
1474 | // from zero (nearly straight up) to one (completely to the side)) or | ||
1475 | // leaning front-to-back: rotated around the Y axis with the value of X being between | ||
1476 | // zero and one. | ||
1477 | // The value of Z is how far the rotation is off with 1 meaning none and 0 being 90 degrees. | ||
1478 | |||
1479 | // Y error means needed rotation around X axis and visa versa. | ||
1480 | // Since the error goes from zero to one, the asin is the corresponding angle. | ||
1481 | vertContributionV.X = (float)Math.Asin(verticalError.Y); | ||
1482 | // (Tilt forward (positive X) needs to tilt back (rotate negative) around Y axis.) | ||
1483 | vertContributionV.Y = -(float)Math.Asin(verticalError.X); | ||
1484 | |||
1485 | // If verticalError.Z is negative, the vehicle is upside down. Add additional push. | ||
1486 | if (verticalError.Z < 0f) | ||
1487 | { | 1391 | { |
1488 | vertContributionV.X += Math.Sign(vertContributionV.X) * PIOverFour; | 1392 | case 0: |
1489 | // vertContribution.Y -= PIOverFour; | 1393 | { |
1394 | //Another formula to try got from : | ||
1395 | //http://answers.unity3d.com/questions/10425/how-to-stabilize-angular-motion-alignment-of-hover.html | ||
1396 | |||
1397 | // Flipping what was originally a timescale into a speed variable and then multiplying it by 2 | ||
1398 | // since only computing half the distance between the angles. | ||
1399 | float VerticalAttractionSpeed = (1 / m_verticalAttractionTimescale) * 2.0f; | ||
1400 | |||
1401 | // Make a prediction of where the up axis will be when this is applied rather then where it is now as | ||
1402 | // this makes for a smoother adjustment and less fighting between the various forces. | ||
1403 | Vector3 predictedUp = vehicleUpAxis * Quaternion.CreateFromAxisAngle(VehicleRotationalVelocity, 0f); | ||
1404 | |||
1405 | // This is only half the distance to the target so it will take 2 seconds to complete the turn. | ||
1406 | Vector3 torqueVector = Vector3.Cross(predictedUp, Vector3.UnitZ); | ||
1407 | |||
1408 | // Scale vector by our timescale since it is an acceleration it is r/s^2 or radians a timescale squared | ||
1409 | Vector3 vertContributionV = torqueVector * VerticalAttractionSpeed * VerticalAttractionSpeed; | ||
1410 | |||
1411 | VehicleRotationalVelocity += vertContributionV; | ||
1412 | |||
1413 | VDetailLog("{0}, MoveAngular,verticalAttraction,upAxis={1},PredictedUp={2},torqueVector={3},contrib={4}", | ||
1414 | ControllingPrim.LocalID, | ||
1415 | vehicleUpAxis, | ||
1416 | predictedUp, | ||
1417 | torqueVector, | ||
1418 | vertContributionV); | ||
1419 | break; | ||
1420 | } | ||
1421 | case 1: | ||
1422 | { | ||
1423 | // Possible solution derived from a discussion at: | ||
1424 | // http://stackoverflow.com/questions/14939657/computing-vector-from-quaternion-works-computing-quaternion-from-vector-does-no | ||
1425 | |||
1426 | // Create a rotation that is only the vehicle's rotation around Z | ||
1427 | Vector3 currentEuler = Vector3.Zero; | ||
1428 | VehicleOrientation.GetEulerAngles(out currentEuler.X, out currentEuler.Y, out currentEuler.Z); | ||
1429 | Quaternion justZOrientation = Quaternion.CreateFromAxisAngle(Vector3.UnitZ, currentEuler.Z); | ||
1430 | |||
1431 | // Create the axis that is perpendicular to the up vector and the rotated up vector. | ||
1432 | Vector3 differenceAxis = Vector3.Cross(Vector3.UnitZ * justZOrientation, Vector3.UnitZ * VehicleOrientation); | ||
1433 | // Compute the angle between those to vectors. | ||
1434 | double differenceAngle = Math.Acos((double)Vector3.Dot(Vector3.UnitZ, Vector3.Normalize(Vector3.UnitZ * VehicleOrientation))); | ||
1435 | // 'differenceAngle' is the angle to rotate and 'differenceAxis' is the plane to rotate in to get the vehicle vertical | ||
1436 | |||
1437 | // Reduce the change by the time period it is to change in. Timestep is handled when velocity is applied. | ||
1438 | // TODO: add 'efficiency'. | ||
1439 | differenceAngle /= m_verticalAttractionTimescale; | ||
1440 | |||
1441 | // Create the quaterian representing the correction angle | ||
1442 | Quaternion correctionRotation = Quaternion.CreateFromAxisAngle(differenceAxis, (float)differenceAngle); | ||
1443 | |||
1444 | // Turn that quaternion into Euler values to make it into velocities to apply. | ||
1445 | Vector3 vertContributionV = Vector3.Zero; | ||
1446 | correctionRotation.GetEulerAngles(out vertContributionV.X, out vertContributionV.Y, out vertContributionV.Z); | ||
1447 | vertContributionV *= -1f; | ||
1448 | |||
1449 | VehicleRotationalVelocity += vertContributionV; | ||
1450 | |||
1451 | VDetailLog("{0}, MoveAngular,verticalAttraction,upAxis={1},diffAxis={2},diffAng={3},corrRot={4},contrib={5}", | ||
1452 | ControllingPrim.LocalID, | ||
1453 | vehicleUpAxis, | ||
1454 | differenceAxis, | ||
1455 | differenceAngle, | ||
1456 | correctionRotation, | ||
1457 | vertContributionV); | ||
1458 | break; | ||
1459 | } | ||
1460 | case 2: | ||
1461 | { | ||
1462 | Vector3 vertContributionV = Vector3.Zero; | ||
1463 | Vector3 origRotVelW = VehicleRotationalVelocity; // DEBUG DEBUG | ||
1464 | |||
1465 | // Take a vector pointing up and convert it from world to vehicle relative coords. | ||
1466 | Vector3 verticalError = Vector3.Normalize(Vector3.UnitZ * VehicleOrientation); | ||
1467 | |||
1468 | // If vertical attraction correction is needed, the vector that was pointing up (UnitZ) | ||
1469 | // is now: | ||
1470 | // leaning to one side: rotated around the X axis with the Y value going | ||
1471 | // from zero (nearly straight up) to one (completely to the side)) or | ||
1472 | // leaning front-to-back: rotated around the Y axis with the value of X being between | ||
1473 | // zero and one. | ||
1474 | // The value of Z is how far the rotation is off with 1 meaning none and 0 being 90 degrees. | ||
1475 | |||
1476 | // Y error means needed rotation around X axis and visa versa. | ||
1477 | // Since the error goes from zero to one, the asin is the corresponding angle. | ||
1478 | vertContributionV.X = (float)Math.Asin(verticalError.Y); | ||
1479 | // (Tilt forward (positive X) needs to tilt back (rotate negative) around Y axis.) | ||
1480 | vertContributionV.Y = -(float)Math.Asin(verticalError.X); | ||
1481 | |||
1482 | // If verticalError.Z is negative, the vehicle is upside down. Add additional push. | ||
1483 | if (verticalError.Z < 0f) | ||
1484 | { | ||
1485 | vertContributionV.X += Math.Sign(vertContributionV.X) * PIOverFour; | ||
1486 | // vertContribution.Y -= PIOverFour; | ||
1487 | } | ||
1488 | |||
1489 | // 'vertContrbution' is now the necessary angular correction to correct tilt in one second. | ||
1490 | // Correction happens over a number of seconds. | ||
1491 | Vector3 unscaledContribVerticalErrorV = vertContributionV; // DEBUG DEBUG | ||
1492 | |||
1493 | // The correction happens over the user's time period | ||
1494 | vertContributionV /= m_verticalAttractionTimescale; | ||
1495 | |||
1496 | // Rotate the vehicle rotation to the world coordinates. | ||
1497 | VehicleRotationalVelocity += (vertContributionV * VehicleOrientation); | ||
1498 | |||
1499 | VDetailLog("{0}, MoveAngular,verticalAttraction,,upAxis={1},origRotVW={2},vertError={3},unscaledV={4},eff={5},ts={6},vertContribV={7}", | ||
1500 | ControllingPrim.LocalID, | ||
1501 | vehicleUpAxis, | ||
1502 | origRotVelW, | ||
1503 | verticalError, | ||
1504 | unscaledContribVerticalErrorV, | ||
1505 | m_verticalAttractionEfficiency, | ||
1506 | m_verticalAttractionTimescale, | ||
1507 | vertContributionV); | ||
1508 | break; | ||
1509 | } | ||
1510 | default: | ||
1511 | { | ||
1512 | break; | ||
1513 | } | ||
1490 | } | 1514 | } |
1491 | |||
1492 | // 'vertContrbution' is now the necessary angular correction to correct tilt in one second. | ||
1493 | // Correction happens over a number of seconds. | ||
1494 | Vector3 unscaledContribVerticalErrorV = vertContributionV; // DEBUG DEBUG | ||
1495 | |||
1496 | // The correction happens over the user's time period | ||
1497 | vertContributionV /= m_verticalAttractionTimescale; | ||
1498 | |||
1499 | // Rotate the vehicle rotation to the world coordinates. | ||
1500 | VehicleRotationalVelocity += (vertContributionV * VehicleOrientation); | ||
1501 | |||
1502 | VDetailLog("{0}, MoveAngular,verticalAttraction,,origRotVW={1},vertError={2},unscaledV={3},eff={4},ts={5},vertContribV={6}", | ||
1503 | Prim.LocalID, origRotVelW, verticalError, unscaledContribVerticalErrorV, | ||
1504 | m_verticalAttractionEfficiency, m_verticalAttractionTimescale, vertContributionV); | ||
1505 | */ | ||
1506 | } | 1515 | } |
1507 | } | 1516 | } |
1508 | 1517 | ||
@@ -1514,7 +1523,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1514 | public void ComputeAngularDeflection() | 1523 | public void ComputeAngularDeflection() |
1515 | { | 1524 | { |
1516 | 1525 | ||
1517 | if (enableAngularDeflection && m_angularDeflectionEfficiency != 0 && VehicleForwardSpeed > 0.2) | 1526 | if (BSParam.VehicleEnableAngularDeflection && m_angularDeflectionEfficiency != 0 && VehicleForwardSpeed > 0.2) |
1518 | { | 1527 | { |
1519 | Vector3 deflectContributionV = Vector3.Zero; | 1528 | Vector3 deflectContributionV = Vector3.Zero; |
1520 | 1529 | ||
@@ -1593,7 +1602,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin | |||
1593 | // make a sluggish vehicle by giving it a timescale of several seconds. | 1602 | // make a sluggish vehicle by giving it a timescale of several seconds. |
1594 | public void ComputeAngularBanking() | 1603 | public void ComputeAngularBanking() |
1595 | { | 1604 | { |
1596 | if (enableAngularBanking && m_bankingEfficiency != 0 && m_verticalAttractionTimescale < m_verticalAttractionCutoff) | 1605 | if (BSParam.VehicleEnableAngularBanking && m_bankingEfficiency != 0 && m_verticalAttractionTimescale < m_verticalAttractionCutoff) |
1597 | { | 1606 | { |
1598 | Vector3 bankingContributionV = Vector3.Zero; | 1607 | Vector3 bankingContributionV = Vector3.Zero; |
1599 | 1608 | ||
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 0f84bf7..dcf1e83 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -155,7 +155,12 @@ public static class BSParam | |||
155 | public static Vector3 VehicleInertiaFactor { get; private set; } | 155 | public static Vector3 VehicleInertiaFactor { get; private set; } |
156 | public static float VehicleGroundGravityFudge { get; private set; } | 156 | public static float VehicleGroundGravityFudge { get; private set; } |
157 | public static float VehicleAngularBankingTimescaleFudge { get; private set; } | 157 | public static float VehicleAngularBankingTimescaleFudge { get; private set; } |
158 | public static bool VehicleDebuggingEnable { get; private set; } | 158 | public static bool VehicleEnableLinearDeflection { get; private set; } |
159 | public static bool VehicleLinearDeflectionNotCollidingNoZ { get; private set; } | ||
160 | public static bool VehicleEnableAngularVerticalAttraction { get; private set; } | ||
161 | public static int VehicleAngularVerticalAttractionAlgorithm { get; private set; } | ||
162 | public static bool VehicleEnableAngularDeflection { get; private set; } | ||
163 | public static bool VehicleEnableAngularBanking { get; private set; } | ||
159 | 164 | ||
160 | // Convex Hulls | 165 | // Convex Hulls |
161 | public static int CSHullMaxDepthSplit { get; private set; } | 166 | public static int CSHullMaxDepthSplit { get; private set; } |
@@ -606,8 +611,18 @@ public static class BSParam | |||
606 | 0.2f ), | 611 | 0.2f ), |
607 | new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.", | 612 | new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.", |
608 | 60.0f ), | 613 | 60.0f ), |
609 | new ParameterDefn<bool>("VehicleDebuggingEnable", "Turn on/off vehicle debugging", | 614 | new ParameterDefn<bool>("VehicleEnableLinearDeflection", "Turn on/off vehicle linear deflection effect", |
610 | false ), | 615 | true ), |
616 | new ParameterDefn<bool>("VehicleLinearDeflectionNotCollidingNoZ", "Turn on/off linear deflection Z effect on non-colliding vehicles", | ||
617 | true ), | ||
618 | new ParameterDefn<bool>("VehicleEnableAngularVerticalAttraction", "Turn on/off vehicle angular vertical attraction effect", | ||
619 | true ), | ||
620 | new ParameterDefn<int>("VehicleAngularVerticalAttractionAlgorithm", "Select vertical attraction algo. You need to look at the source.", | ||
621 | 0 ), | ||
622 | new ParameterDefn<bool>("VehicleEnableAngularDeflection", "Turn on/off vehicle angular deflection effect", | ||
623 | true ), | ||
624 | new ParameterDefn<bool>("VehicleEnableAngularBanking", "Turn on/off vehicle angular banking effect", | ||
625 | true ), | ||
611 | 626 | ||
612 | new ParameterDefn<float>("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", | 627 | new ParameterDefn<float>("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", |
613 | 0f, | 628 | 0f, |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index e56a6f6..214271b 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -648,7 +648,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
648 | simTime = Util.EnvironmentTickCountSubtract(beforeTime); | 648 | simTime = Util.EnvironmentTickCountSubtract(beforeTime); |
649 | if (PhysicsLogging.Enabled) | 649 | if (PhysicsLogging.Enabled) |
650 | { | 650 | { |
651 | DetailLog("{0},DoPhysicsStep,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}, objWColl={7}", | 651 | DetailLog("{0},DoPhysicsStep,complete,frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}, objWColl={7}", |
652 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, | 652 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, |
653 | updatedEntityCount, collidersCount, ObjectsWithCollisions.Count); | 653 | updatedEntityCount, collidersCount, ObjectsWithCollisions.Count); |
654 | } | 654 | } |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs b/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs index 583c436..48d3742 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/Tests/BasicVehicles.cs | |||
@@ -57,6 +57,8 @@ public class BasicVehicles : OpenSimTestCase | |||
57 | public void Init() | 57 | public void Init() |
58 | { | 58 | { |
59 | Dictionary<string, string> engineParams = new Dictionary<string, string>(); | 59 | Dictionary<string, string> engineParams = new Dictionary<string, string>(); |
60 | engineParams.Add("VehicleEnableAngularVerticalAttraction", "true"); | ||
61 | engineParams.Add("VehicleAngularVerticalAttractionAlgorithm", "1"); | ||
60 | PhysicsScene = BulletSimTestsUtil.CreateBasicPhysicsEngine(engineParams); | 62 | PhysicsScene = BulletSimTestsUtil.CreateBasicPhysicsEngine(engineParams); |
61 | 63 | ||
62 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateSphere(); | 64 | PrimitiveBaseShape pbs = PrimitiveBaseShape.CreateSphere(); |
@@ -119,7 +121,7 @@ public class BasicVehicles : OpenSimTestCase | |||
119 | { | 121 | { |
120 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, efficiency); | 122 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_EFFICIENCY, efficiency); |
121 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, timeScale); | 123 | vehicleActor.ProcessFloatVehicleParam(Vehicle.VERTICAL_ATTRACTION_TIMESCALE, timeScale); |
122 | vehicleActor.enableAngularVerticalAttraction = true; | 124 | // vehicleActor.enableAngularVerticalAttraction = true; |
123 | 125 | ||
124 | TestVehicle.IsPhysical = true; | 126 | TestVehicle.IsPhysical = true; |
125 | PhysicsScene.ProcessTaints(); | 127 | PhysicsScene.ProcessTaints(); |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 0d66496..13c69d6 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -108,7 +108,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
108 | private Vector3 m_taintAngularLock = Vector3.One; | 108 | private Vector3 m_taintAngularLock = Vector3.One; |
109 | private IntPtr Amotor = IntPtr.Zero; | 109 | private IntPtr Amotor = IntPtr.Zero; |
110 | 110 | ||
111 | private object m_assetsLock = new object(); | ||
112 | private bool m_assetFailed = false; | 111 | private bool m_assetFailed = false; |
113 | 112 | ||
114 | private Vector3 m_PIDTarget; | 113 | private Vector3 m_PIDTarget; |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 07663b3..7e652fc 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
46 | /// </summary> | 46 | /// </summary> |
47 | public class OdePlugin : IPhysicsPlugin | 47 | public class OdePlugin : IPhysicsPlugin |
48 | { | 48 | { |
49 | private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 49 | // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
50 | 50 | ||
51 | private OdeScene m_scene; | 51 | private OdeScene m_scene; |
52 | 52 | ||
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index 986394b..941b97d 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
70 | m_allowedTypes = allowedTypes; | 70 | m_allowedTypes = allowedTypes; |
71 | } | 71 | } |
72 | 72 | ||
73 | public override byte[] Handle(string path, Stream request, | 73 | protected override byte[] ProcessRequest(string path, Stream request, |
74 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 74 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
75 | { | 75 | { |
76 | bool result = false; | 76 | bool result = false; |
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs index 8f7412b..8b23a83 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerGetHandler.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
54 | m_AssetService = service; | 54 | m_AssetService = service; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | protected override byte[] ProcessRequest(string path, Stream request, |
58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | byte[] result = new byte[0]; | 60 | byte[] result = new byte[0]; |
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs index a006fa8..8eebc61 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerPostHandler.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
54 | m_AssetService = service; | 54 | m_AssetService = service; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | protected override byte[] ProcessRequest(string path, Stream request, |
58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | AssetBase asset; | 60 | AssetBase asset; |
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 6b93cd9..16e011a 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
70 | } | 70 | } |
71 | } | 71 | } |
72 | 72 | ||
73 | public override byte[] Handle(string path, Stream request, | 73 | protected override byte[] ProcessRequest(string path, Stream request, |
74 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 74 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
75 | { | 75 | { |
76 | string[] p = SplitParams(path); | 76 | string[] p = SplitParams(path); |
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs index 18cef15..66a26fc 100644 --- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
147 | #endregion | 147 | #endregion |
148 | } | 148 | } |
149 | 149 | ||
150 | public class OpenIdStreamHandler : IStreamHandler | 150 | public class OpenIdStreamHandler : BaseOutputStreamHandler |
151 | { | 151 | { |
152 | #region HTML | 152 | #region HTML |
153 | 153 | ||
@@ -191,42 +191,34 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>. | |||
191 | 191 | ||
192 | #endregion HTML | 192 | #endregion HTML |
193 | 193 | ||
194 | public string Name { get { return "OpenId"; } } | ||
195 | public string Description { get { return null; } } | ||
196 | public string ContentType { get { return m_contentType; } } | ||
197 | public string HttpMethod { get { return m_httpMethod; } } | ||
198 | public string Path { get { return m_path; } } | ||
199 | |||
200 | string m_contentType; | ||
201 | string m_httpMethod; | ||
202 | string m_path; | ||
203 | IAuthenticationService m_authenticationService; | 194 | IAuthenticationService m_authenticationService; |
204 | IUserAccountService m_userAccountService; | 195 | IUserAccountService m_userAccountService; |
205 | ProviderMemoryStore m_openidStore = new ProviderMemoryStore(); | 196 | ProviderMemoryStore m_openidStore = new ProviderMemoryStore(); |
206 | 197 | ||
198 | public override string ContentType { get { return "text/html"; } } | ||
199 | |||
207 | /// <summary> | 200 | /// <summary> |
208 | /// Constructor | 201 | /// Constructor |
209 | /// </summary> | 202 | /// </summary> |
210 | public OpenIdStreamHandler(string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService) | 203 | public OpenIdStreamHandler( |
204 | string httpMethod, string path, IUserAccountService userService, IAuthenticationService authService) | ||
205 | : base(httpMethod, path, "OpenId", "OpenID stream handler") | ||
211 | { | 206 | { |
212 | m_authenticationService = authService; | 207 | m_authenticationService = authService; |
213 | m_userAccountService = userService; | 208 | m_userAccountService = userService; |
214 | m_httpMethod = httpMethod; | ||
215 | m_path = path; | ||
216 | |||
217 | m_contentType = "text/html"; | ||
218 | } | 209 | } |
219 | 210 | ||
220 | /// <summary> | 211 | /// <summary> |
221 | /// Handles all GET and POST requests for OpenID identifier pages and endpoint | 212 | /// Handles all GET and POST requests for OpenID identifier pages and endpoint |
222 | /// server communication | 213 | /// server communication |
223 | /// </summary> | 214 | /// </summary> |
224 | public void Handle(string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 215 | protected override void ProcessRequest( |
216 | string path, Stream request, Stream response, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
225 | { | 217 | { |
226 | Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath)); | 218 | Uri providerEndpoint = new Uri(String.Format("{0}://{1}{2}", httpRequest.Url.Scheme, httpRequest.Url.Authority, httpRequest.Url.AbsolutePath)); |
227 | 219 | ||
228 | // Defult to returning HTML content | 220 | // Defult to returning HTML content |
229 | m_contentType = "text/html"; | 221 | httpResponse.ContentType = ContentType; |
230 | 222 | ||
231 | try | 223 | try |
232 | { | 224 | { |
@@ -276,7 +268,7 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>. | |||
276 | 268 | ||
277 | string[] contentTypeValues = provider.Request.Response.Headers.GetValues("Content-Type"); | 269 | string[] contentTypeValues = provider.Request.Response.Headers.GetValues("Content-Type"); |
278 | if (contentTypeValues != null && contentTypeValues.Length == 1) | 270 | if (contentTypeValues != null && contentTypeValues.Length == 1) |
279 | m_contentType = contentTypeValues[0]; | 271 | httpResponse.ContentType = contentTypeValues[0]; |
280 | 272 | ||
281 | // Set the response code and document body based on the OpenID result | 273 | // Set the response code and document body based on the OpenID result |
282 | httpResponse.StatusCode = (int)provider.Request.Response.Code; | 274 | httpResponse.StatusCode = (int)provider.Request.Response.Code; |
@@ -344,4 +336,4 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>. | |||
344 | return false; | 336 | return false; |
345 | } | 337 | } |
346 | } | 338 | } |
347 | } | 339 | } \ No newline at end of file |
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs index bcf9d47..c9b4e9b 100644 --- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerPostHandler.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Authorization | |||
54 | m_AuthorizationService = service; | 54 | m_AuthorizationService = service; |
55 | } | 55 | } |
56 | 56 | ||
57 | public override byte[] Handle(string path, Stream request, | 57 | protected override byte[] ProcessRequest(string path, Stream request, |
58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 58 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
59 | { | 59 | { |
60 | XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest)); | 60 | XmlSerializer xs = new XmlSerializer(typeof (AuthorizationRequest)); |
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 8cd747e..d6bbb8f 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
56 | m_AvatarService = service; | 56 | m_AvatarService = service; |
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | protected override byte[] ProcessRequest(string path, Stream requestData, |
60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index 47a8558..ca0a24c 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Friends | |||
57 | m_FriendsService = service; | 57 | m_FriendsService = service; |
58 | } | 58 | } |
59 | 59 | ||
60 | public override byte[] Handle(string path, Stream requestData, | 60 | protected override byte[] ProcessRequest(string path, Stream requestData, |
61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index ef5f33e..89cba8a 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -57,7 +57,7 @@ namespace OpenSim.Server.Handlers.Grid | |||
57 | m_GridService = service; | 57 | m_GridService = service; |
58 | } | 58 | } |
59 | 59 | ||
60 | public override byte[] Handle(string path, Stream requestData, | 60 | protected override byte[] ProcessRequest(string path, Stream requestData, |
61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 7483395..0b98e9a 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.GridUser | |||
56 | m_GridUserService = service; | 56 | m_GridUserService = service; |
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | protected override byte[] ProcessRequest(string path, Stream requestData, |
60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 0aa2729..a2bdadb 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
68 | m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!"); | 68 | m_log.ErrorFormat("[HGFRIENDS HANDLER]: TheService is null!"); |
69 | } | 69 | } |
70 | 70 | ||
71 | public override byte[] Handle(string path, Stream requestData, | 71 | protected override byte[] ProcessRequest(string path, Stream requestData, |
72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
73 | { | 73 | { |
74 | StreamReader sr = new StreamReader(requestData); | 74 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index f306b1c..06eaf2e 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs | |||
@@ -91,7 +91,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
91 | m_HandlersType = handlersType; | 91 | m_HandlersType = handlersType; |
92 | } | 92 | } |
93 | 93 | ||
94 | public override byte[] Handle(string path, Stream requestData, | 94 | protected override byte[] ProcessRequest(string path, Stream requestData, |
95 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 95 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
96 | { | 96 | { |
97 | return OKResponse(httpResponse); | 97 | return OKResponse(httpResponse); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs index df875af..f37f2f1 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs | |||
@@ -68,6 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
68 | { | 68 | { |
69 | return new ExtendedAgentDestinationData(); | 69 | return new ExtendedAgentDestinationData(); |
70 | } | 70 | } |
71 | |||
71 | protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request) | 72 | protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request) |
72 | { | 73 | { |
73 | base.UnpackData(args, d, request); | 74 | base.UnpackData(args, d, request); |
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs index 231e32f..e2c50fe 100644 --- a/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs +++ b/OpenSim/Server/Handlers/Inventory/InventoryServerMoveItemsHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Inventory | |||
56 | m_InventoryService = service; | 56 | m_InventoryService = service; |
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream request, | 59 | protected override byte[] ProcessRequest(string path, Stream request, |
60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>)); | 62 | XmlSerializer xs = new XmlSerializer(typeof (List<InventoryItemBase>)); |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 9d28dc3..0d7c136 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
87 | m_InventoryService = service; | 87 | m_InventoryService = service; |
88 | } | 88 | } |
89 | 89 | ||
90 | public override byte[] Handle(string path, Stream requestData, | 90 | protected override byte[] ProcessRequest(string path, Stream requestData, |
91 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 91 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
92 | { | 92 | { |
93 | StreamReader sr = new StreamReader(requestData); | 93 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index 4a61969..d438fc7 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
99 | m_Proxy = proxy; | 99 | m_Proxy = proxy; |
100 | } | 100 | } |
101 | 101 | ||
102 | public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 102 | protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
103 | { | 103 | { |
104 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); | 104 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); |
105 | StreamReader sr = new StreamReader(requestData); | 105 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs index fb85d1c..7bb2f39 100644 --- a/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapGetServerConnector.cs | |||
@@ -80,7 +80,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
80 | m_MapService = service; | 80 | m_MapService = service; |
81 | } | 81 | } |
82 | 82 | ||
83 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 83 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
84 | { | 84 | { |
85 | byte[] result = new byte[0]; | 85 | byte[] result = new byte[0]; |
86 | 86 | ||
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs index 8a1f824..3525a01 100644 --- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs +++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
58 | // TODO: unused: m_AuthenticationService = authentication; | 58 | // TODO: unused: m_AuthenticationService = authentication; |
59 | } | 59 | } |
60 | 60 | ||
61 | public override byte[] Handle(string path, Stream request, | 61 | protected override byte[] ProcessRequest(string path, Stream request, |
62 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 62 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
63 | { | 63 | { |
64 | // Not implemented yet | 64 | // Not implemented yet |
@@ -83,7 +83,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
83 | // TODO: unused: m_AllowForeignGuests = foreignGuests; | 83 | // TODO: unused: m_AllowForeignGuests = foreignGuests; |
84 | } | 84 | } |
85 | 85 | ||
86 | public override byte[] Handle(string path, Stream request, | 86 | protected override byte[] ProcessRequest(string path, Stream request, |
87 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 87 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
88 | { | 88 | { |
89 | byte[] result = new byte[0]; | 89 | byte[] result = new byte[0]; |
@@ -176,7 +176,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
176 | // TODO: unused: m_AuthenticationService = authentication; | 176 | // TODO: unused: m_AuthenticationService = authentication; |
177 | } | 177 | } |
178 | 178 | ||
179 | public override byte[] Handle(string path, Stream request, | 179 | protected override byte[] ProcessRequest(string path, Stream request, |
180 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 180 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
181 | { | 181 | { |
182 | // Not implemented yet | 182 | // Not implemented yet |
@@ -197,7 +197,7 @@ namespace OpenSim.Server.Handlers.Neighbour | |||
197 | // TODO: unused: m_AuthenticationService = authentication; | 197 | // TODO: unused: m_AuthenticationService = authentication; |
198 | } | 198 | } |
199 | 199 | ||
200 | public override byte[] Handle(string path, Stream request, | 200 | protected override byte[] ProcessRequest(string path, Stream request, |
201 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 201 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
202 | { | 202 | { |
203 | // Not implemented yet | 203 | // Not implemented yet |
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs index 2d67c6d..abb4b19 100644 --- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs | |||
@@ -56,7 +56,7 @@ namespace OpenSim.Server.Handlers.Presence | |||
56 | m_PresenceService = service; | 56 | m_PresenceService = service; |
57 | } | 57 | } |
58 | 58 | ||
59 | public override byte[] Handle(string path, Stream requestData, | 59 | protected override byte[] ProcessRequest(string path, Stream requestData, |
60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 60 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
61 | { | 61 | { |
62 | StreamReader sr = new StreamReader(requestData); | 62 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs index b01de7a..40a34c6 100644 --- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs +++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs | |||
@@ -251,7 +251,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
251 | m_SimulationService = null; | 251 | m_SimulationService = null; |
252 | } | 252 | } |
253 | 253 | ||
254 | public override byte[] Handle(string path, Stream request, | 254 | protected override byte[] ProcessRequest(string path, Stream request, |
255 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 255 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
256 | { | 256 | { |
257 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); | 257 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); |
@@ -457,7 +457,7 @@ namespace OpenSim.Server.Handlers.Simulation | |||
457 | m_SimulationService = null; | 457 | m_SimulationService = null; |
458 | } | 458 | } |
459 | 459 | ||
460 | public override byte[] Handle(string path, Stream request, | 460 | protected override byte[] ProcessRequest(string path, Stream request, |
461 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 461 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
462 | { | 462 | { |
463 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); | 463 | // m_log.DebugFormat("[SIMULATION]: Stream handler called"); |
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 72551ef..24c9de6 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Server.Handlers.UserAccounts | |||
68 | } | 68 | } |
69 | } | 69 | } |
70 | 70 | ||
71 | public override byte[] Handle(string path, Stream requestData, | 71 | protected override byte[] ProcessRequest(string path, Stream requestData, |
72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
73 | { | 73 | { |
74 | StreamReader sr = new StreamReader(requestData); | 74 | StreamReader sr = new StreamReader(requestData); |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 410916f..2567c8f 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Services.HypergridService | |||
54 | LogManager.GetLogger( | 54 | LogManager.GetLogger( |
55 | MethodBase.GetCurrentMethod().DeclaringType); | 55 | MethodBase.GetCurrentMethod().DeclaringType); |
56 | 56 | ||
57 | private string m_HomeURL; | 57 | // private string m_HomeURL; |
58 | private IUserAccountService m_UserAccountService; | 58 | private IUserAccountService m_UserAccountService; |
59 | private IAvatarService m_AvatarService; | 59 | private IAvatarService m_AvatarService; |
60 | 60 | ||
@@ -96,8 +96,8 @@ namespace OpenSim.Services.HypergridService | |||
96 | if (m_AvatarService == null) | 96 | if (m_AvatarService == null) |
97 | throw new Exception(String.Format("Unable to create m_AvatarService from {0}", avatarDll)); | 97 | throw new Exception(String.Format("Unable to create m_AvatarService from {0}", avatarDll)); |
98 | 98 | ||
99 | m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI", | 99 | // m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI", |
100 | new string[] { "Startup", "Hypergrid", m_ConfigName }, String.Empty); | 100 | // new string[] { "Startup", "Hypergrid", m_ConfigName }, String.Empty); |
101 | 101 | ||
102 | // m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); | 102 | // m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); |
103 | } | 103 | } |