aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.World/World.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.World/World.cs29
1 files changed, 28 insertions, 1 deletions
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index c731dbc..69d4646 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -14,6 +14,7 @@ using OpenSim.Framework.Inventory;
14using OpenSim.Framework; 14using OpenSim.Framework;
15using OpenSim.RegionServer.world.scripting; 15using OpenSim.RegionServer.world.scripting;
16using OpenSim.Terrain; 16using OpenSim.Terrain;
17using OpenGrid.Framework.Communications;
17 18
18namespace OpenSim.world 19namespace OpenSim.world
19{ 20{
@@ -36,6 +37,8 @@ namespace OpenSim.world
36 private Mutex updateLock; 37 private Mutex updateLock;
37 public string m_datastore; 38 public string m_datastore;
38 protected AuthenticateSessionsBase authenticateHandler; 39 protected AuthenticateSessionsBase authenticateHandler;
40 protected RegionCommsHostBase regionCommsHost;
41 protected RegionServerCommsManager commsManager;
39 42
40 #region Properties 43 #region Properties
41 /// <summary> 44 /// <summary>
@@ -61,17 +64,19 @@ namespace OpenSim.world
61 /// <param name="clientThreads">Dictionary to contain client threads</param> 64 /// <param name="clientThreads">Dictionary to contain client threads</param>
62 /// <param name="regionHandle">Region Handle for this region</param> 65 /// <param name="regionHandle">Region Handle for this region</param>
63 /// <param name="regionName">Region Name for this region</param> 66 /// <param name="regionName">Region Name for this region</param>
64 public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen) 67 public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen, RegionServerCommsManager commsMan)
65 { 68 {
66 try 69 try
67 { 70 {
68 updateLock = new Mutex(false); 71 updateLock = new Mutex(false);
69 this.authenticateHandler = authen; 72 this.authenticateHandler = authen;
73 this.commsManager = commsMan;
70 m_clientThreads = clientThreads; 74 m_clientThreads = clientThreads;
71 m_regInfo = regInfo; 75 m_regInfo = regInfo;
72 m_regionHandle = m_regInfo.RegionHandle; 76 m_regionHandle = m_regInfo.RegionHandle;
73 m_regionName = m_regInfo.RegionName; 77 m_regionName = m_regInfo.RegionName;
74 this.m_datastore = m_regInfo.DataStore; 78 this.m_datastore = m_regInfo.DataStore;
79 this.RegisterRegionWithComms();
75 80
76 m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>(); 81 m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
77 m_scripts = new Dictionary<string, ScriptFactory>(); 82 m_scripts = new Dictionary<string, ScriptFactory>();
@@ -540,5 +545,27 @@ namespace OpenSim.world
540 } 545 }
541 #endregion 546 #endregion
542 547
548 #region RegionCommsHost
549
550 public void RegisterRegionWithComms()
551 {
552 this.regionCommsHost = this.commsManager.RegisterRegion(this.m_regInfo);
553 if (this.regionCommsHost != null)
554 {
555 this.regionCommsHost.OnExpectUser += new ExpectUserDelegate(this.NewUserConnection);
556 }
557 }
558
559 public void NewUserConnection(ulong regionHandle,AgentCircuitData agent)
560 {
561 Console.WriteLine("World.cs - add new user connection");
562 //should just check that its meant for this region
563 if (regionHandle == this.m_regInfo.RegionHandle)
564 {
565 this.authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
566 }
567 }
568
569 #endregion
543 } 570 }
544} 571}