aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs4
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs4
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs52
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs5
4 files changed, 50 insertions, 15 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 9fddc7b..44466c6 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.ClientStack
76 private AssetCache m_assetCache; 76 private AssetCache m_assetCache;
77 private InventoryCache m_inventoryCache; 77 private InventoryCache m_inventoryCache;
78 private int cachedtextureserial = 0; 78 private int cachedtextureserial = 0;
79 protected AuthenticateSessionsBase m_authenticateSessionsHandler; 79 protected AgentCircuitManager m_authenticateSessionsHandler;
80 private Encoding enc = Encoding.ASCII; 80 private Encoding enc = Encoding.ASCII;
81 // Dead client detection vars 81 // Dead client detection vars
82 private Timer clientPingTimer; 82 private Timer clientPingTimer;
@@ -84,7 +84,7 @@ namespace OpenSim.Region.ClientStack
84 private int probesWithNoIngressPackets = 0; 84 private int probesWithNoIngressPackets = 0;
85 private int lastPacketsReceived = 0; 85 private int lastPacketsReceived = 0;
86 86
87 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions ) 87 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
88 { 88 {
89 m_world = world; 89 m_world = world;
90 m_clientThreads = clientThreads; 90 m_clientThreads = clientThreads;
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 466fdde..41aaf3a 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -133,7 +133,7 @@ namespace OpenSim.Region.ClientStack
133 /// <param name="inventoryCache"></param> 133 /// <param name="inventoryCache"></param>
134 /// <param name="authenSessions"></param> 134 /// <param name="authenSessions"></param>
135 /// <returns></returns> 135 /// <returns></returns>
136 protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions) 136 protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
137 { 137 {
138 return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions ); 138 return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions );
139 } 139 }
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ClientStack
147 /// <param name="inventoryCache"></param> 147 /// <param name="inventoryCache"></param>
148 /// <param name="authenticateSessionsClass"></param> 148 /// <param name="authenticateSessionsClass"></param>
149 /// <returns></returns> 149 /// <returns></returns>
150 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AuthenticateSessionsBase authenticateSessionsClass) 150 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass)
151 { 151 {
152 ClientView newuser = 152 ClientView newuser =
153 CreateNewClient(epSender, useCircuit, ClientThreads, _localWorld, assetCache, this, inventoryCache, 153 CreateNewClient(epSender, useCircuit, ClientThreads, _localWorld, assetCache, this, inventoryCache,
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 8467082..1bb383f 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -31,6 +31,7 @@ using System.Net;
31using OpenSim.Assets; 31using OpenSim.Assets;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
34using OpenSim.Framework.Data;
34using OpenSim.Framework.Interfaces; 35using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Servers; 36using OpenSim.Framework.Servers;
36using OpenSim.Framework.Types; 37using OpenSim.Framework.Types;
@@ -39,6 +40,7 @@ using OpenSim.Region.Caches;
39using OpenSim.Region.Environment; 40using OpenSim.Region.Environment;
40using libsecondlife; 41using libsecondlife;
41using OpenSim.Region.Environment.Scenes; 42using OpenSim.Region.Environment.Scenes;
43using OpenSim.Framework.Communications;
42 44
43namespace OpenSim.Region.ClientStack 45namespace OpenSim.Region.ClientStack
44{ 46{
@@ -50,14 +52,11 @@ namespace OpenSim.Region.ClientStack
50 protected DateTime m_startuptime; 52 protected DateTime m_startuptime;
51 protected NetworkServersInfo m_networkServersInfo; 53 protected NetworkServersInfo m_networkServersInfo;
52 54
53 protected List<UDPServer> m_udpServers = new List<UDPServer>();
54 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
55 protected List<IWorld> m_localWorld = new List<IWorld>();
56 protected BaseHttpServer m_httpServer; 55 protected BaseHttpServer m_httpServer;
57 protected int m_httpServerPort; 56 protected int m_httpServerPort;
58 protected List<AuthenticateSessionsBase> AuthenticateSessionsHandler = new List<AuthenticateSessionsBase>();
59 57
60 protected LogBase m_log; 58 protected LogBase m_log;
59 protected CommunicationsManager m_commsManager;
61 60
62 public RegionApplicationBase( ) 61 public RegionApplicationBase( )
63 { 62 {
@@ -72,19 +71,19 @@ namespace OpenSim.Region.ClientStack
72 71
73 Initialize(); 72 Initialize();
74 73
75 StartLog();
76
77 ScenePresence.LoadTextureFile("avatar-texture.dat"); 74 ScenePresence.LoadTextureFile("avatar-texture.dat");
78 75
79 m_httpServer = new BaseHttpServer( m_httpServerPort ); 76 m_httpServer = new BaseHttpServer( m_httpServerPort );
80 77
81 m_log.Verbose("Starting HTTP server"); 78 m_log.Verbose("Starting HTTP server");
82 m_httpServer.Start(); 79 m_httpServer.Start();
80
81 m_inventoryCache = new InventoryCache();
83 } 82 }
84 83
85 protected abstract void Initialize(); 84 protected abstract void Initialize();
86 85
87 private void StartLog() 86 protected void StartLog()
88 { 87 {
89 m_log = CreateLog(); 88 m_log = CreateLog();
90 MainLog.Instance = m_log; 89 MainLog.Instance = m_log;
@@ -92,7 +91,7 @@ namespace OpenSim.Region.ClientStack
92 91
93 protected abstract LogBase CreateLog(); 92 protected abstract LogBase CreateLog();
94 protected abstract PhysicsScene GetPhysicsScene( ); 93 protected abstract PhysicsScene GetPhysicsScene( );
95 protected abstract StorageManager GetStoreManager(RegionInfo regionInfo); 94 protected abstract StorageManager CreateStorageManager(RegionInfo regionInfo);
96 95
97 protected PhysicsScene GetPhysicsScene(string engine) 96 protected PhysicsScene GetPhysicsScene(string engine)
98 { 97 {
@@ -102,5 +101,42 @@ namespace OpenSim.Region.ClientStack
102 return physicsPluginManager.GetPhysicsScene( engine ); 101 return physicsPluginManager.GetPhysicsScene( engine );
103 } 102 }
104 103
104 protected Scene SetupScene(RegionInfo regionInfo, out UDPServer udpServer)
105 {
106 AgentCircuitManager authen = new AgentCircuitManager();
107 udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, m_assetCache, m_inventoryCache, m_log, authen);
108
109 StorageManager storageManager = CreateStorageManager(regionInfo);
110 Scene scene = CreateScene(regionInfo, storageManager, authen);
111
112 udpServer.LocalWorld = scene;
113
114 scene.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll");
115 scene.LoadWorldMap();
116
117 scene.PhysScene = GetPhysicsScene( );
118 scene.PhysScene.SetTerrain(scene.Terrain.getHeights1D());
119 scene.LoadPrimsFromStorage();
120
121 //Master Avatar Setup
122 UserProfileData masterAvatar = m_commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword);
123 if (masterAvatar != null)
124 {
125 m_log.Notice("Parcels - Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
126 scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
127 scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
128 }
129 else
130 {
131 m_log.Notice("Parcels - No master avatar found, using null.");
132 scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
133 scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
134 }
135 scene.performParcelPrimCountUpdate();
136 scene.StartTimer();
137 return scene;
138 }
139
140 protected abstract Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager);
105 } 141 }
106} 142}
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 781f96a..ac17720 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.ClientStack
56 protected AssetCache m_assetCache; 56 protected AssetCache m_assetCache;
57 protected InventoryCache m_inventoryCache; 57 protected InventoryCache m_inventoryCache;
58 protected LogBase m_log; 58 protected LogBase m_log;
59 protected AuthenticateSessionsBase m_authenticateSessionsClass; 59 protected AgentCircuitManager m_authenticateSessionsClass;
60 60
61 public PacketServer PacketServer 61 public PacketServer PacketServer
62 { 62 {
@@ -83,7 +83,7 @@ namespace OpenSim.Region.ClientStack
83 { 83 {
84 } 84 }
85 85
86 public UDPServer(int port, AssetCache assetCache, InventoryCache inventoryCache, LogBase console, AuthenticateSessionsBase authenticateClass) 86 public UDPServer(int port, AssetCache assetCache, InventoryCache inventoryCache, LogBase console, AgentCircuitManager authenticateClass)
87 { 87 {
88 listenPort = port; 88 listenPort = port;
89 this.m_assetCache = assetCache; 89 this.m_assetCache = assetCache;
@@ -91,7 +91,6 @@ namespace OpenSim.Region.ClientStack
91 this.m_log = console; 91 this.m_log = console;
92 this.m_authenticateSessionsClass = authenticateClass; 92 this.m_authenticateSessionsClass = authenticateClass;
93 this.CreatePacketServer(); 93 this.CreatePacketServer();
94
95 } 94 }
96 95
97 protected virtual void CreatePacketServer() 96 protected virtual void CreatePacketServer()