From a575bc38d61ac5cb74f60e0eee503ca7f3e99803 Mon Sep 17 00:00:00 2001
From: MW
Date: Thu, 31 May 2007 14:22:14 +0000
Subject: More work on OpenGrid.Framework.Communications
---
.../RegionServerCommsManager.cs | 2 +-
.../TestLocalCommsManager.cs | 53 ++++++++++++++--------
2 files changed, 34 insertions(+), 21 deletions(-)
(limited to 'Common/OpenGrid.Framework.Communications')
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
///
///
///
- public virtual IRegionCommsHost RegisterRegion(RegionInfo regionInfo)
+ public virtual RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
{
return null;
}
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
public class TestLocalCommsManager : RegionServerCommsManager
{
protected Dictionary regions = new Dictionary();
+ protected Dictionary regionHosts = new Dictionary();
public TestLocalCommsManager()
{
@@ -21,19 +22,20 @@ namespace OpenGrid.Framework.Communications
///
///
///
- ///
- public override RegionInfo LoadRegionConfigFromGridServer(LLUUID regionID)
- {
- return null;
- }
-
- ///
- ///
- ///
///
///
- public override IRegionCommsHost RegisterRegion(RegionInfo regionInfo)
+ public override RegionCommsHostBase RegisterRegion(RegionInfo regionInfo)
{
+ if (!this.regions.ContainsKey((uint)regionInfo.RegionHandle))
+ {
+ this.regions.Add((uint)regionInfo.RegionHandle, regionInfo);
+ RegionCommsHostBase regionHost = new RegionCommsHostBase();
+ this.regionHosts.Add((uint)regionInfo.RegionHandle, regionHost);
+
+ return regionHost;
+ }
+
+ //already in our list of regions so for now lets return null
return null;
}
@@ -59,19 +61,30 @@ namespace OpenGrid.Framework.Communications
///
///
///
+ ///
+ ///
///
- public override bool AvatarCrossingToRegion()
+ public bool AddNewSession(uint regionHandle, Login loginData)
{
- return false;
- }
+ AgentCircuitData agent = new AgentCircuitData();
+ agent.AgentID = loginData.Agent;
+ agent.firstname = loginData.First;
+ agent.lastname = loginData.Last;
+ agent.SessionID = loginData.Session;
+ agent.SecureSessionID = loginData.SecureSession;
+ agent.circuitcode = loginData.CircuitCode;
+ agent.BaseFolder = loginData.BaseFolder;
+ agent.InventoryFolder = loginData.InventoryFolder;
+ agent.startpos = new LLVector3(128, 128, 70);
- ///
- ///
- ///
- ///
- public override IList RequestMapBlocks()
- {
- return null;
+ if (this.regionHosts.ContainsKey((uint)regionHandle))
+ {
+ this.regionHosts[(uint)regionHandle].TriggerExpectUser(agent);
+ return true;
+ }
+
+ // region not found
+ return false;
}
}
}
--
cgit v1.1