aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorMelanie2009-09-28 23:03:47 +0100
committerMelanie2009-09-28 23:03:47 +0100
commit07091493134341a316624d9a1f6a2ef1cfa2f2d8 (patch)
tree1d394e128be9766656a441058b2bdf141ba90269 /OpenSim/Framework
parentAllow the notation config_name@port/dll_name:class_name as a handler spec (diff)
parentForgot a return statement. (diff)
downloadopensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.zip
opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.gz
opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.bz2
opensim-SC_OLD-07091493134341a316624d9a1f6a2ef1cfa2f2d8.tar.xz
Merge branch 'grid-service-redux'
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/Clients/RegionClient.cs16
-rw-r--r--OpenSim/Framework/Communications/CommunicationsManager.cs5
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs92
-rw-r--r--OpenSim/Framework/Communications/IHyperlink.cs38
-rw-r--r--OpenSim/Framework/IRegionCommsListener.cs3
-rw-r--r--OpenSim/Framework/IScene.cs2
-rw-r--r--OpenSim/Framework/NetworkServersInfo.cs3
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs13
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs4
-rw-r--r--OpenSim/Framework/Util.cs26
10 files changed, 39 insertions, 163 deletions
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs
index 73e2db0..3419ce2 100644
--- a/OpenSim/Framework/Communications/Clients/RegionClient.cs
+++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs
@@ -35,6 +35,8 @@ using System.Text;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
37 37
38using GridRegion = OpenSim.Services.Interfaces.GridRegion;
39
38using log4net; 40using log4net;
39 41
40namespace OpenSim.Framework.Communications.Clients 42namespace OpenSim.Framework.Communications.Clients
@@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Clients
43 { 45 {
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 47
46 public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason) 48 public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, out string reason)
47 { 49 {
48 reason = String.Empty; 50 reason = String.Empty;
49 51
@@ -166,7 +168,7 @@ namespace OpenSim.Framework.Communications.Clients
166 168
167 } 169 }
168 170
169 public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData) 171 public bool DoChildAgentUpdateCall(GridRegion region, IAgentData cAgentData)
170 { 172 {
171 // Eventually, we want to use a caps url instead of the agentID 173 // Eventually, we want to use a caps url instead of the agentID
172 string uri = string.Empty; 174 string uri = string.Empty;
@@ -260,7 +262,7 @@ namespace OpenSim.Framework.Communications.Clients
260 return true; 262 return true;
261 } 263 }
262 264
263 public bool DoRetrieveRootAgentCall(RegionInfo region, UUID id, out IAgentData agent) 265 public bool DoRetrieveRootAgentCall(GridRegion region, UUID id, out IAgentData agent)
264 { 266 {
265 agent = null; 267 agent = null;
266 // Eventually, we want to use a caps url instead of the agentID 268 // Eventually, we want to use a caps url instead of the agentID
@@ -348,7 +350,7 @@ namespace OpenSim.Framework.Communications.Clients
348 } 350 }
349 351
350 352
351 public bool DoCloseAgentCall(RegionInfo region, UUID id) 353 public bool DoCloseAgentCall(GridRegion region, UUID id)
352 { 354 {
353 string uri = string.Empty; 355 string uri = string.Empty;
354 try 356 try
@@ -391,7 +393,7 @@ namespace OpenSim.Framework.Communications.Clients
391 return true; 393 return true;
392 } 394 }
393 395
394 public bool DoCreateObjectCall(RegionInfo region, ISceneObject sog, string sogXml2, bool allowScriptCrossing) 396 public bool DoCreateObjectCall(GridRegion region, ISceneObject sog, string sogXml2, bool allowScriptCrossing)
395 { 397 {
396 ulong regionHandle = GetRegionHandle(region.RegionHandle); 398 ulong regionHandle = GetRegionHandle(region.RegionHandle);
397 string uri 399 string uri
@@ -474,7 +476,7 @@ namespace OpenSim.Framework.Communications.Clients
474 476
475 } 477 }
476 478
477 public bool DoCreateObjectCall(RegionInfo region, UUID userID, UUID itemID) 479 public bool DoCreateObjectCall(GridRegion region, UUID userID, UUID itemID)
478 { 480 {
479 ulong regionHandle = GetRegionHandle(region.RegionHandle); 481 ulong regionHandle = GetRegionHandle(region.RegionHandle);
480 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/"; 482 string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/";
@@ -646,7 +648,7 @@ namespace OpenSim.Framework.Communications.Clients
646 return false; 648 return false;
647 } 649 }
648 650
649 public virtual void SendUserInformation(RegionInfo regInfo, AgentCircuitData aCircuit) 651 public virtual void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit)
650 { 652 {
651 } 653 }
652 654
diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs
index e9a6adb..9f377a6 100644
--- a/OpenSim/Framework/Communications/CommunicationsManager.cs
+++ b/OpenSim/Framework/Communications/CommunicationsManager.cs
@@ -59,11 +59,6 @@ namespace OpenSim.Framework.Communications
59 } 59 }
60 protected IMessagingService m_messageService; 60 protected IMessagingService m_messageService;
61 61
62 public IGridServices GridService
63 {
64 get { return m_gridService; }
65 }
66 protected IGridServices m_gridService;
67 62
68 public UserProfileCacheService UserProfileCacheService 63 public UserProfileCacheService UserProfileCacheService
69 { 64 {
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
deleted file mode 100644
index 6365919..0000000
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ /dev/null
@@ -1,92 +0,0 @@
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
28using System.Collections.Generic;
29using OpenMetaverse;
30
31namespace OpenSim.Framework.Communications
32{
33 public interface IGridServices
34 {
35 string gdebugRegionName { get; set; }
36
37 /// <summary>
38 /// If true, then regions will accept logins from the user service. If false, then they will not.
39 /// </summary>
40 bool RegionLoginsEnabled { get; set; }
41
42 /// <summary>
43 /// Register a region with the grid service.
44 /// </summary>
45 /// <param name="regionInfos"> </param>
46 /// <returns></returns>
47 /// <exception cref="System.Exception">Thrown if region registration failed</exception>
48 RegionCommsListener RegisterRegion(RegionInfo regionInfos);
49
50 /// <summary>
51 /// Deregister a region with the grid service.
52 /// </summary>
53 /// <param name="regionInfo"></param>
54 /// <returns></returns>
55 /// <exception cref="System.Exception">Thrown if region deregistration failed</exception>
56 bool DeregisterRegion(RegionInfo regionInfo);
57
58 /// <summary>
59 /// Get information about the regions neighbouring the given co-ordinates.
60 /// </summary>
61 /// <param name="x"></param>
62 /// <param name="y"></param>
63 /// <returns></returns>
64 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
65
66 RegionInfo RequestNeighbourInfo(ulong regionHandle);
67 RegionInfo RequestNeighbourInfo(UUID regionID);
68 RegionInfo RequestNeighbourInfo(string name);
69 RegionInfo RequestNeighbourInfo(string host, uint port);
70
71 RegionInfo RequestClosestRegion(string regionName);
72 Dictionary<string, string> GetGridSettings();
73 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
74 // not complete yet, only contains the fields needed for ParcelInfoReqeust
75 LandData RequestLandData(ulong regionHandle, uint x, uint y);
76
77 /// <summary>
78 /// Get information about regions starting with the provided name.
79 /// </summary>
80 /// <param name="name">
81 /// The name to match against.
82 /// </param>
83 /// <param name="maxNumber">
84 /// The maximum number of results to return.
85 /// </param>
86 /// <returns>
87 /// A list of <see cref="RegionInfo"/>s of regions with matching name. If the
88 /// grid-server couldn't be contacted or returned an error, return null.
89 /// </returns>
90 List<RegionInfo> RequestNamedRegions(string name, int maxNumber);
91 }
92}
diff --git a/OpenSim/Framework/Communications/IHyperlink.cs b/OpenSim/Framework/Communications/IHyperlink.cs
deleted file mode 100644
index 5057386..0000000
--- a/OpenSim/Framework/Communications/IHyperlink.cs
+++ /dev/null
@@ -1,38 +0,0 @@
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
28namespace OpenSim.Framework.Communications
29{
30 public interface IHyperlink
31 {
32 bool IsHyperlinkRegion(ulong handle);
33 RegionInfo GetHyperlinkRegion(ulong handle);
34 ulong FindRegionHandle(ulong handle);
35 bool SendUserInformation(RegionInfo region, AgentCircuitData aCircuit);
36 void AdjustUserInformation(AgentCircuitData aCircuit);
37 }
38}
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs
index ba4c616..307c6bc 100644
--- a/OpenSim/Framework/IRegionCommsListener.cs
+++ b/OpenSim/Framework/IRegionCommsListener.cs
@@ -46,8 +46,6 @@ namespace OpenSim.Framework
46 46
47 public delegate bool CloseAgentConnection(UUID agentID); 47 public delegate bool CloseAgentConnection(UUID agentID);
48 48
49 public delegate bool RegionUp(RegionInfo region);
50
51 public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData); 49 public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData);
52 50
53 public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message); 51 public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message);
@@ -65,7 +63,6 @@ namespace OpenSim.Framework
65 event AcknowledgePrimCross OnAcknowledgePrimCrossed; 63 event AcknowledgePrimCross OnAcknowledgePrimCrossed;
66 event UpdateNeighbours OnNeighboursUpdate; 64 event UpdateNeighbours OnNeighboursUpdate;
67 event CloseAgentConnection OnCloseAgentConnection; 65 event CloseAgentConnection OnCloseAgentConnection;
68 event RegionUp OnRegionUp;
69 event ChildAgentUpdate OnChildAgentUpdate; 66 event ChildAgentUpdate OnChildAgentUpdate;
70 event LogOffUser OnLogOffUser; 67 event LogOffUser OnLogOffUser;
71 event GetLandData OnGetLandData; 68 event GetLandData OnGetLandData;
diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs
index 2e2c703..d61e08c 100644
--- a/OpenSim/Framework/IScene.cs
+++ b/OpenSim/Framework/IScene.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Framework
74 void CloseAllAgents(uint circuitcode); 74 void CloseAllAgents(uint circuitcode);
75 75
76 void Restart(int seconds); 76 void Restart(int seconds);
77 bool OtherRegionUp(RegionInfo thisRegion); 77 //RegionInfo OtherRegionUp(RegionInfo thisRegion);
78 78
79 string GetSimulatorVersion(); 79 string GetSimulatorVersion();
80 80
diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs
index 3b00af3..7e66742 100644
--- a/OpenSim/Framework/NetworkServersInfo.cs
+++ b/OpenSim/Framework/NetworkServersInfo.cs
@@ -102,8 +102,7 @@ namespace OpenSim.Framework
102 ConfigSettings.DefaultInventoryServerHttpPort.ToString()); 102 ConfigSettings.DefaultInventoryServerHttpPort.ToString());
103 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); 103 secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true);
104 104
105 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", 105 MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty);
106 "http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort);
107 } 106 }
108 } 107 }
109} 108}
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 016c78c..90200d6 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -47,7 +47,6 @@ namespace OpenSim.Framework
47 private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser 47 private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser
48 private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; 48 private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate;
49 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; 49 private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion;
50 private RegionUp handlerRegionUp = null; // OnRegionUp;
51 private LogOffUser handlerLogOffUser = null; 50 private LogOffUser handlerLogOffUser = null;
52 private GetLandData handlerGetLandData = null; 51 private GetLandData handlerGetLandData = null;
53 52
@@ -62,7 +61,6 @@ namespace OpenSim.Framework
62 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; 61 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
63 public event AcknowledgePrimCross OnAcknowledgePrimCrossed; 62 public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
64 public event CloseAgentConnection OnCloseAgentConnection; 63 public event CloseAgentConnection OnCloseAgentConnection;
65 public event RegionUp OnRegionUp;
66 public event ChildAgentUpdate OnChildAgentUpdate; 64 public event ChildAgentUpdate OnChildAgentUpdate;
67 public event LogOffUser OnLogOffUser; 65 public event LogOffUser OnLogOffUser;
68 public event GetLandData OnGetLandData; 66 public event GetLandData OnGetLandData;
@@ -108,17 +106,6 @@ namespace OpenSim.Framework
108 return false; 106 return false;
109 } 107 }
110 108
111 public virtual bool TriggerRegionUp(RegionInfo region)
112 {
113 handlerRegionUp = OnRegionUp;
114 if (handlerRegionUp != null)
115 {
116 handlerRegionUp(region);
117 return true;
118 }
119 return false;
120 }
121
122 public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData) 109 public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData)
123 { 110 {
124 handlerChildAgentUpdate = OnChildAgentUpdate; 111 handlerChildAgentUpdate = OnChildAgentUpdate;
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
index ebb2691..a0d4008 100644
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs
@@ -59,11 +59,11 @@ namespace OpenSim.Framework.Servers.HttpServer
59 int length = 0; 59 int length = 0;
60 using (StreamWriter writer = new StreamWriter(buffer)) 60 using (StreamWriter writer = new StreamWriter(buffer))
61 { 61 {
62 writer.WriteLine(obj); 62 writer.Write(obj);
63 writer.Flush(); 63 writer.Flush();
64 length = (int)buffer.Length;
65 } 64 }
66 65
66 length = (int)obj.Length;
67 request.ContentLength = length; 67 request.ContentLength = length;
68 68
69 Stream requestStream = request.GetRequestStream(); 69 Stream requestStream = request.GetRequestStream();
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 45b5a10..a28a617 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1203,6 +1203,32 @@ namespace OpenSim.Framework
1203 return found.ToArray(); 1203 return found.ToArray();
1204 } 1204 }
1205 1205
1206 public static string ServerURI(string uri)
1207 {
1208 if (uri == string.Empty)
1209 return string.Empty;
1210
1211 // Get rid of eventual slashes at the end
1212 uri = uri.TrimEnd('/');
1213
1214 IPAddress ipaddr1 = null;
1215 string port1 = "";
1216 try
1217 {
1218 ipaddr1 = Util.GetHostFromURL(uri);
1219 }
1220 catch { }
1221
1222 try
1223 {
1224 port1 = uri.Split(new char[] { ':' })[2];
1225 }
1226 catch { }
1227
1228 // We tried our best to convert the domain names to IP addresses
1229 return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri;
1230 }
1231
1206 #region FireAndForget Threading Pattern 1232 #region FireAndForget Threading Pattern
1207 1233
1208 public static void FireAndForget(System.Threading.WaitCallback callback) 1234 public static void FireAndForget(System.Threading.WaitCallback callback)