aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs2
-rw-r--r--Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs53
-rw-r--r--Common/OpenSim.Framework/IRegionCommsHost.cs2
-rw-r--r--Common/OpenSim.Framework/OpenSim.Framework.csproj1
-rw-r--r--Common/OpenSim.Framework/RegionCommsHostBase.cs32
5 files changed, 68 insertions, 22 deletions
diff --git a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
index 9767185..2b8c5ca 100644
--- a/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications/RegionServerCommsManager.cs
@@ -31,7 +31,7 @@ namespace OpenGrid.Framework.Communications
31 /// </summary> 31 /// </summary>
32 /// <param name="regionInfo"></param> 32 /// <param name="regionInfo"></param>
33 /// <returns></returns> 33 /// <returns></returns>
34 public virtual IRegionCommsHost RegisterRegion(RegionInfo regionInfo) 34 public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
35 { 35 {
36 return null; 36 return null;
37 } 37 }
diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
index 32f4718..57049fc 100644
--- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
@@ -12,6 +12,7 @@ namespace OpenGrid.Framework.Communications
12 public class TestLocalCommsManager : RegionServerCommsManager 12 public class TestLocalCommsManager : RegionServerCommsManager
13 { 13 {
14 protected Dictionary<uint , RegionInfo> regions = new Dictionary<uint,RegionInfo>(); 14 protected Dictionary<uint , RegionInfo> regions = new Dictionary<uint,RegionInfo>();
15 protected Dictionary<uint, RegionCommsHostBase> regionHosts = new Dictionary<uint, RegionCommsHostBase>();
15 16
16 public TestLocalCommsManager() 17 public TestLocalCommsManager()
17 { 18 {
@@ -21,19 +22,20 @@ namespace OpenGrid.Framework.Communications
21 /// <summary> 22 /// <summary>
22 /// 23 ///
23 /// </summary> 24 /// </summary>
24 /// <returns></returns>
25 public override RegionInfo LoadRegionConfigFromGridServer(LLUUID regionID)
26 {
27 return null;
28 }
29
30 /// <summary>
31 ///
32 /// </summary>
33 /// <param name="regionInfo"></param> 25 /// <param name="regionInfo"></param>
34 /// <returns></returns> 26 /// <returns></returns>
35 public override IRegionCommsHost RegisterRegion(RegionInfo regionInfo) 27 public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
36 { 28 {
29 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
30 {
31 this.regions.Add((uint)regionInfo.RegionHandle, regionInfo);
32 RegionCommsHostBase regionHost = new RegionCommsHostBase();
33 this.regionHosts.Add((uint)regionInfo.RegionHandle, regionHost);
34
35 return regionHost;
36 }
37
38 //already in our list of regions so for now lets return null
37 return null; 39 return null;
38 } 40 }
39 41
@@ -59,19 +61,30 @@ namespace OpenGrid.Framework.Communications
59 /// <summary> 61 /// <summary>
60 /// 62 ///
61 /// </summary> 63 /// </summary>
64 /// <param name="regionHandle"></param>
65 /// <param name="loginData"></param>
62 /// <returns></returns> 66 /// <returns></returns>
63 public override bool AvatarCrossingToRegion() 67 public bool AddNewSession(uint regionHandle, Login loginData)
64 { 68 {
65 return false; 69 AgentCircuitData agent = new AgentCircuitData();
66 } 70 agent.AgentID = loginData.Agent;
71 agent.firstname = loginData.First;
72 agent.lastname = loginData.Last;
73 agent.SessionID = loginData.Session;
74 agent.SecureSessionID = loginData.SecureSession;
75 agent.circuitcode = loginData.CircuitCode;
76 agent.BaseFolder = loginData.BaseFolder;
77 agent.InventoryFolder = loginData.InventoryFolder;
78 agent.startpos = new LLVector3(128, 128, 70);
67 79
68 /// <summary> 80 if (this.regionHosts.ContainsKey((uint)regionHandle))
69 /// 81 {
70 /// </summary> 82 this.regionHosts[(uint)regionHandle].TriggerExpectUser(agent);
71 /// <returns></returns> 83 return true;
72 public override IList RequestMapBlocks() 84 }
73 { 85
74 return null; 86 // region not found
87 return false;
75 } 88 }
76 } 89 }
77} 90}
diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs
index 815bd8e..d115bb7 100644
--- a/Common/OpenSim.Framework/IRegionCommsHost.cs
+++ b/Common/OpenSim.Framework/IRegionCommsHost.cs
@@ -6,7 +6,7 @@ using OpenSim.Framework.Types;
6 6
7namespace OpenSim.Framework 7namespace OpenSim.Framework
8{ 8{
9 public delegate void ExpectUserDelegate(); 9 public delegate void ExpectUserDelegate(AgentCircuitData agent);
10 public delegate void UpdateNeighbours(List<RegionInfo> neighbours); 10 public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
11 11
12 public interface IRegionCommsHost 12 public interface IRegionCommsHost
diff --git a/Common/OpenSim.Framework/OpenSim.Framework.csproj b/Common/OpenSim.Framework/OpenSim.Framework.csproj
index f83cb9d..be17a23 100644
--- a/Common/OpenSim.Framework/OpenSim.Framework.csproj
+++ b/Common/OpenSim.Framework/OpenSim.Framework.csproj
@@ -107,6 +107,7 @@
107 <Compile Include="LoginService.cs"> 107 <Compile Include="LoginService.cs">
108 <SubType>Code</SubType> 108 <SubType>Code</SubType>
109 </Compile> 109 </Compile>
110 <Compile Include="RegionCommsHostBase.cs" />
110 <Compile Include="Remoting.cs"> 111 <Compile Include="Remoting.cs">
111 <SubType>Code</SubType> 112 <SubType>Code</SubType>
112 </Compile> 113 </Compile>
diff --git a/Common/OpenSim.Framework/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs
new file mode 100644
index 0000000..782755e
--- /dev/null
+++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs
@@ -0,0 +1,32 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Interfaces;
5using OpenSim.Framework.Types;
6
7namespace OpenSim.Framework
8{
9 public class RegionCommsHostBase :IRegionCommsHost
10 {
11 public event ExpectUserDelegate OnExpectUser;
12 public event GenericCall2 OnExpectChildAgent;
13 public event GenericCall2 OnAvatarCrossingIntoRegion;
14 public event UpdateNeighbours OnNeighboursUpdate;
15
16 /// <summary>
17 ///
18 /// </summary>
19 /// <param name="agent"></param>
20 /// <returns></returns>
21 public virtual bool TriggerExpectUser(AgentCircuitData agent)
22 {
23 if(OnExpectUser != null)
24 {
25 OnExpectUser(agent);
26 return true;
27 }
28
29 return false;
30 }
31 }
32}