aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common
diff options
context:
space:
mode:
authorMW2007-05-31 15:31:31 +0000
committerMW2007-05-31 15:31:31 +0000
commit564a97b508fd23601cd41075aa6a1f7de0800b41 (patch)
treee2cd67317ac84a1468b3a425b011e8df7b7b7d5b /Common
parentMore work on OpenGrid.Framework.Communications (diff)
downloadopensim-SC-564a97b508fd23601cd41075aa6a1f7de0800b41.zip
opensim-SC-564a97b508fd23601cd41075aa6a1f7de0800b41.tar.gz
opensim-SC-564a97b508fd23601cd41075aa6a1f7de0800b41.tar.bz2
opensim-SC-564a97b508fd23601cd41075aa6a1f7de0800b41.tar.xz
Implementing a test Communications manager to test some of the interfaces (likely this test version will morph into the sandbox version)
Diffstat (limited to '')
-rw-r--r--Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs17
-rw-r--r--Common/OpenSim.Framework/IRegionCommsHost.cs2
-rw-r--r--Common/OpenSim.Framework/RegionCommsHostBase.cs4
-rw-r--r--Common/OpenSim.Servers/LocalUserProfileManager.cs4
-rw-r--r--Common/OpenSim.Servers/LoginServer.cs5
5 files changed, 17 insertions, 15 deletions
diff --git a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
index 57049fc..b4fe696 100644
--- a/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
+++ b/Common/OpenGrid.Framework.Communications/TestLocalCommsManager.cs
@@ -11,8 +11,8 @@ namespace OpenGrid.Framework.Communications
11{ 11{
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<ulong, RegionInfo> regions = new Dictionary<ulong,RegionInfo>();
15 protected Dictionary<uint, RegionCommsHostBase> regionHosts = new Dictionary<uint, RegionCommsHostBase>(); 15 protected Dictionary<ulong, RegionCommsHostBase> regionHosts = new Dictionary<ulong, RegionCommsHostBase>();
16 16
17 public TestLocalCommsManager() 17 public TestLocalCommsManager()
18 { 18 {
@@ -28,9 +28,9 @@ namespace OpenGrid.Framework.Communications
28 { 28 {
29 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle)) 29 if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
30 { 30 {
31 this.regions.Add((uint)regionInfo.RegionHandle, regionInfo); 31 this.regions.Add(regionInfo.RegionHandle, regionInfo);
32 RegionCommsHostBase regionHost = new RegionCommsHostBase(); 32 RegionCommsHostBase regionHost = new RegionCommsHostBase();
33 this.regionHosts.Add((uint)regionInfo.RegionHandle, regionHost); 33 this.regionHosts.Add(regionInfo.RegionHandle, regionHost);
34 34
35 return regionHost; 35 return regionHost;
36 } 36 }
@@ -59,13 +59,14 @@ namespace OpenGrid.Framework.Communications
59 } 59 }
60 60
61 /// <summary> 61 /// <summary>
62 /// 62 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
63 /// </summary> 63 /// </summary>
64 /// <param name="regionHandle"></param> 64 /// <param name="regionHandle"></param>
65 /// <param name="loginData"></param> 65 /// <param name="loginData"></param>
66 /// <returns></returns> 66 /// <returns></returns>
67 public bool AddNewSession(uint regionHandle, Login loginData) 67 public bool AddNewSession(ulong regionHandle, Login loginData)
68 { 68 {
69 Console.WriteLine(" comms manager been told to expect new user");
69 AgentCircuitData agent = new AgentCircuitData(); 70 AgentCircuitData agent = new AgentCircuitData();
70 agent.AgentID = loginData.Agent; 71 agent.AgentID = loginData.Agent;
71 agent.firstname = loginData.First; 72 agent.firstname = loginData.First;
@@ -77,9 +78,9 @@ namespace OpenGrid.Framework.Communications
77 agent.InventoryFolder = loginData.InventoryFolder; 78 agent.InventoryFolder = loginData.InventoryFolder;
78 agent.startpos = new LLVector3(128, 128, 70); 79 agent.startpos = new LLVector3(128, 128, 70);
79 80
80 if (this.regionHosts.ContainsKey((uint)regionHandle)) 81 if (this.regionHosts.ContainsKey(regionHandle))
81 { 82 {
82 this.regionHosts[(uint)regionHandle].TriggerExpectUser(agent); 83 this.regionHosts[regionHandle].TriggerExpectUser(regionHandle, agent);
83 return true; 84 return true;
84 } 85 }
85 86
diff --git a/Common/OpenSim.Framework/IRegionCommsHost.cs b/Common/OpenSim.Framework/IRegionCommsHost.cs
index d115bb7..c56383e 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(AgentCircuitData agent); 9 public delegate void ExpectUserDelegate(ulong regionHandle, 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/RegionCommsHostBase.cs b/Common/OpenSim.Framework/RegionCommsHostBase.cs
index 782755e..41babe7 100644
--- a/Common/OpenSim.Framework/RegionCommsHostBase.cs
+++ b/Common/OpenSim.Framework/RegionCommsHostBase.cs
@@ -18,11 +18,11 @@ namespace OpenSim.Framework
18 /// </summary> 18 /// </summary>
19 /// <param name="agent"></param> 19 /// <param name="agent"></param>
20 /// <returns></returns> 20 /// <returns></returns>
21 public virtual bool TriggerExpectUser(AgentCircuitData agent) 21 public virtual bool TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
22 { 22 {
23 if(OnExpectUser != null) 23 if(OnExpectUser != null)
24 { 24 {
25 OnExpectUser(agent); 25 OnExpectUser(regionHandle, agent);
26 return true; 26 return true;
27 } 27 }
28 28
diff --git a/Common/OpenSim.Servers/LocalUserProfileManager.cs b/Common/OpenSim.Servers/LocalUserProfileManager.cs
index a8b5f1f..99c640a 100644
--- a/Common/OpenSim.Servers/LocalUserProfileManager.cs
+++ b/Common/OpenSim.Servers/LocalUserProfileManager.cs
@@ -116,8 +116,8 @@ namespace OpenSim.UserServer
116 Console.WriteLine("adding login data to gridserver"); 116 Console.WriteLine("adding login data to gridserver");
117 ((LocalGridBase)this.m_gridServer).AddNewSession(_login); 117 ((LocalGridBase)this.m_gridServer).AddNewSession(_login);
118 }*/ 118 }*/
119 119 ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256));
120 this.AddSession(_login); 120 this.AddSession(reghand, _login);
121 } 121 }
122 } 122 }
123} 123}
diff --git a/Common/OpenSim.Servers/LoginServer.cs b/Common/OpenSim.Servers/LoginServer.cs
index 6fd174b..d02c41e 100644
--- a/Common/OpenSim.Servers/LoginServer.cs
+++ b/Common/OpenSim.Servers/LoginServer.cs
@@ -47,7 +47,7 @@ using OpenSim.Framework.Types;
47 47
48namespace OpenSim.UserServer 48namespace OpenSim.UserServer
49{ 49{
50 public delegate void AddNewSessionHandler(Login loginData); 50 public delegate bool AddNewSessionHandler(ulong regionHandle, Login loginData);
51 /// <summary> 51 /// <summary>
52 /// When running in local (default) mode , handles client logins. 52 /// When running in local (default) mode , handles client logins.
53 /// </summary> 53 /// </summary>
@@ -196,7 +196,8 @@ namespace OpenSim.UserServer
196 { 196 {
197 ((LocalGridBase)m_gridServer).AddNewSession(_login); 197 ((LocalGridBase)m_gridServer).AddNewSession(_login);
198 }*/ 198 }*/
199 AddSession(_login); 199 ulong reghand = Helpers.UIntsToLong((regionX * 256), (regionY * 256));
200 AddSession(reghand,_login);
200 201
201 return response; 202 return response;
202 } 203 }