aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenGrid.Framework.Communications.OGS1
diff options
context:
space:
mode:
authorMW2007-06-27 15:03:54 +0000
committerMW2007-06-27 15:03:54 +0000
commit223550b7e4f9eb534728e7763642a2ba6154be96 (patch)
treecd6ebbefd3c06487f40c3c30b344d6c2fccb1df5 /Common/OpenGrid.Framework.Communications.OGS1
parent* Begun reimplementing scripting. (diff)
downloadopensim-SC_OLD-223550b7e4f9eb534728e7763642a2ba6154be96.zip
opensim-SC_OLD-223550b7e4f9eb534728e7763642a2ba6154be96.tar.gz
opensim-SC_OLD-223550b7e4f9eb534728e7763642a2ba6154be96.tar.bz2
opensim-SC_OLD-223550b7e4f9eb534728e7763642a2ba6154be96.tar.xz
Some very Preliminary work on .net remoting for interregion comms.
a few more classes for CAPS LLSD types.
Diffstat (limited to 'Common/OpenGrid.Framework.Communications.OGS1')
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs5
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs77
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs53
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj46
4 files changed, 151 insertions, 30 deletions
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs b/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs
index 308e00f..563eaf7 100644
--- a/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications.OGS1/GridCommsManager.cs
@@ -7,10 +7,11 @@ namespace OpenGrid.Framework.Communications.OGS1
7{ 7{
8 public class GridCommsManager : CommunicationsManager 8 public class GridCommsManager : CommunicationsManager
9 { 9 {
10 private OGS1GridServices gridInterComms = new OGS1GridServices();
10 public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo) 11 public GridCommsManager(NetworkServersInfo serversInfo) :base(serversInfo)
11 { 12 {
12 GridServer = new OGS1GridServices(); 13 GridServer = gridInterComms;
13 InterRegion = new OGSInterSimComms(); 14 InterRegion = gridInterComms;
14 UserServer = new OGSUserServices(); 15 UserServer = new OGSUserServices();
15 } 16 }
16 } 17 }
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
index a67f55d..db64f0c 100644
--- a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
+++ b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
@@ -2,9 +2,11 @@ using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Collections; 3using System.Collections;
4using System.Text; 4using System.Text;
5using System.Runtime.Remoting;
6using System.Runtime.Remoting.Channels;
7using System.Runtime.Remoting.Channels.Tcp;
5 8
6using OpenSim.Servers; 9using OpenSim.Servers;
7
8using OpenSim.Framework; 10using OpenSim.Framework;
9using OpenSim.Framework.Types; 11using OpenSim.Framework.Types;
10using OpenGrid.Framework.Communications; 12using OpenGrid.Framework.Communications;
@@ -14,7 +16,7 @@ using libsecondlife;
14 16
15namespace OpenGrid.Framework.Communications.OGS1 17namespace OpenGrid.Framework.Communications.OGS1
16{ 18{
17 public class OGS1GridServices : IGridServices 19 public class OGS1GridServices : IGridServices, IInterRegionCommunications
18 { 20 {
19 public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>(); 21 public Dictionary<ulong, RegionCommsListener> listeners = new Dictionary<ulong, RegionCommsListener>();
20 public GridInfo grid; 22 public GridInfo grid;
@@ -49,19 +51,19 @@ namespace OpenGrid.Framework.Communications.OGS1
49 string errorstring = (string)GridRespData["error"]; 51 string errorstring = (string)GridRespData["error"];
50 OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); 52 OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
51 return null; 53 return null;
52 } 54 }
53
54 // Initialise the background listeners
55 listeners[regionInfo.RegionHandle] = new RegionCommsListener();
56 55
57 if (!initialised) 56 if (!this.listeners.ContainsKey(regionInfo.RegionHandle))
58 { 57 {
59 initialised = true; 58 // initialised = true;
60 httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); 59 httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort);
61 httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); 60 httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser);
62 httpListener.Start(); 61 httpListener.Start();
63 } 62 }
64 63
64 // Initialise the background listeners
65 listeners[regionInfo.RegionHandle] = new RegionCommsListener();
66
65 return listeners[regionInfo.RegionHandle]; 67 return listeners[regionInfo.RegionHandle];
66 } 68 }
67 69
@@ -182,6 +184,65 @@ namespace OpenGrid.Framework.Communications.OGS1
182 return new XmlRpcResponse(); 184 return new XmlRpcResponse();
183 } 185 }
184 186
187 #region InterRegion Comms
188 private void StartRemoting()
189 {
190 TcpChannel ch = new TcpChannel(8895);
191 ChannelServices.RegisterChannel(ch);
192
193 WellKnownServiceTypeEntry wellType = new WellKnownServiceTypeEntry( Type.GetType("OGS1InterRegionRemoting"), "InterRegions", WellKnownObjectMode.Singleton);
194 RemotingConfiguration.RegisterWellKnownServiceType(wellType);
195 InterRegionSingleton.Instance.OnArrival += this.IncomingArrival;
196 InterRegionSingleton.Instance.OnChildAgent += this.IncomingChildAgent;
197 }
198
199 #region Methods called by regions in this instance
200 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
201 {
202 if (this.listeners.ContainsKey(regionHandle))
203 {
204 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
205 return true;
206 }
207 //TODO need to see if we know about where this region is and use .net remoting
208 // to inform it.
209 return false;
210 }
185 211
212 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
213 {
214 if (this.listeners.ContainsKey(regionHandle))
215 {
216 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
217 return true;
218 }
219 //TODO need to see if we know about where this region is and use .net remoting
220 // to inform it.
221 return false;
222 }
223 #endregion
224
225 #region Methods triggered by calls from external instances
226 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
227 {
228 if (this.listeners.ContainsKey(regionHandle))
229 {
230 this.listeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
231 return true;
232 }
233 return false;
234 }
235
236 public bool IncomingArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
237 {
238 if (this.listeners.ContainsKey(regionHandle))
239 {
240 this.listeners[regionHandle].TriggerExpectAvatarCrossing(regionHandle, agentID, position);
241 return true;
242 }
243 return false;
244 }
245 #endregion
246 #endregion
186 } 247 }
187} 248}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs
index 0024d14..3d74e2f 100644
--- a/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs
+++ b/Common/OpenGrid.Framework.Communications.OGS1/OGSInterSimComms.cs
@@ -5,15 +5,66 @@ using OpenSim.Framework.Types;
5using OpenGrid.Framework.Communications; 5using OpenGrid.Framework.Communications;
6namespace OpenGrid.Framework.Communications.OGS1 6namespace OpenGrid.Framework.Communications.OGS1
7{ 7{
8 public class OGSInterSimComms : IInterRegionCommunications 8 public delegate bool InformRegionChild(ulong regionHandle, AgentCircuitData agentData);
9 public delegate bool ExpectArrival(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position);
10
11 public sealed class InterRegionSingleton
9 { 12 {
13 static readonly InterRegionSingleton instance = new InterRegionSingleton();
14
15 public event InformRegionChild OnChildAgent;
16 public event ExpectArrival OnArrival;
17
18 static InterRegionSingleton()
19 {
20 }
21
22 InterRegionSingleton()
23 {
24 }
25
26 public static InterRegionSingleton Instance
27 {
28 get
29 {
30 return instance;
31 }
32 }
33
10 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 34 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
11 { 35 {
36 if (OnChildAgent != null)
37 {
38 return OnChildAgent(regionHandle, agentData);
39 }
12 return false; 40 return false;
13 } 41 }
42
14 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position) 43 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
15 { 44 {
45 if (OnArrival != null)
46 {
47 return OnArrival(regionHandle, agentID, position);
48 }
16 return false; 49 return false;
17 } 50 }
18 } 51 }
52
53 public class OGS1InterRegionRemoting : MarshalByRefObject
54 {
55
56 public OGS1InterRegionRemoting()
57 {
58 }
59
60 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
61 {
62 return InterRegionSingleton.Instance.InformRegionOfChildAgent(regionHandle, agentData);
63 }
64
65 public bool ExpectAvatarCrossing(ulong regionHandle, libsecondlife.LLUUID agentID, libsecondlife.LLVector3 position)
66 {
67 return InterRegionSingleton.Instance.ExpectAvatarCrossing(regionHandle, agentID, position);
68 }
69 }
19} 70}
diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj
index 3f4f22d..00246e1 100644
--- a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj
+++ b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{17442AF1-0000-0000-0000-000000000000}</ProjectGuid> 6 <ProjectGuid>{17442AF1-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenGrid.Framework.Communications.OGS1</AssemblyName> 13 <AssemblyName>OpenGrid.Framework.Communications.OGS1</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenGrid.Framework.Communications.OGS1</RootNamespace> 21 <RootNamespace>OpenGrid.Framework.Communications.OGS1</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,22 +61,24 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="libsecondlife.dll" > 68 <Reference Include="libsecondlife.dll">
62 <HintPath>..\..\bin\libsecondlife.dll</HintPath> 69 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="System" > 72 <Reference Include="System">
66 <HintPath>System.dll</HintPath> 73 <HintPath>System.dll</HintPath>
67 <Private>False</Private> 74 <Private>False</Private>
68 </Reference> 75 </Reference>
69 <Reference Include="System.Data" > 76 <Reference Include="System.Data">
70 <HintPath>System.Data.dll</HintPath> 77 <HintPath>System.Data.dll</HintPath>
71 <Private>False</Private> 78 <Private>False</Private>
72 </Reference> 79 </Reference>
73 <Reference Include="System.Xml" > 80 <Reference Include="System.Runtime.Remoting" />
81 <Reference Include="System.Xml">
74 <HintPath>System.Xml.dll</HintPath> 82 <HintPath>System.Xml.dll</HintPath>
75 <Private>False</Private> 83 <Private>False</Private>
76 </Reference> 84 </Reference>
@@ -80,37 +88,37 @@
80 <Name>OpenGrid.Framework.Communications</Name> 88 <Name>OpenGrid.Framework.Communications</Name>
81 <Project>{683344D5-0000-0000-0000-000000000000}</Project> 89 <Project>{683344D5-0000-0000-0000-000000000000}</Project>
82 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 90 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
83 <Private>False</Private> 91 <Private>False</Private>
84 </ProjectReference> 92 </ProjectReference>
85 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj"> 93 <ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
86 <Name>OpenGrid.Framework.Data</Name> 94 <Name>OpenGrid.Framework.Data</Name>
87 <Project>{62CDF671-0000-0000-0000-000000000000}</Project> 95 <Project>{62CDF671-0000-0000-0000-000000000000}</Project>
88 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 96 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
89 <Private>False</Private> 97 <Private>False</Private>
90 </ProjectReference> 98 </ProjectReference>
91 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> 99 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
92 <Name>OpenSim.Framework</Name> 100 <Name>OpenSim.Framework</Name>
93 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> 101 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
94 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 102 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
95 <Private>False</Private> 103 <Private>False</Private>
96 </ProjectReference> 104 </ProjectReference>
97 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> 105 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
98 <Name>OpenSim.Framework.Console</Name> 106 <Name>OpenSim.Framework.Console</Name>
99 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> 107 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
100 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 108 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
101 <Private>False</Private> 109 <Private>False</Private>
102 </ProjectReference> 110 </ProjectReference>
103 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj"> 111 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
104 <Name>OpenSim.Servers</Name> 112 <Name>OpenSim.Servers</Name>
105 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> 113 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 114 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
107 <Private>False</Private> 115 <Private>False</Private>
108 </ProjectReference> 116 </ProjectReference>
109 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> 117 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
110 <Name>XMLRPC</Name> 118 <Name>XMLRPC</Name>
111 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> 119 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 120 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
113 <Private>False</Private> 121 <Private>False</Private>
114 </ProjectReference> 122 </ProjectReference>
115 </ItemGroup> 123 </ItemGroup>
116 <ItemGroup> 124 <ItemGroup>
@@ -137,4 +145,4 @@
137 <PostBuildEvent> 145 <PostBuildEvent>
138 </PostBuildEvent> 146 </PostBuildEvent>
139 </PropertyGroup> 147 </PropertyGroup>
140</Project> 148</Project> \ No newline at end of file