aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorlbsa712007-07-16 23:25:35 +0000
committerlbsa712007-07-16 23:25:35 +0000
commit497ab5d7abec3c644a6340c1c64a2557dbade0ef (patch)
tree6ff6d849c724db80116205c3bbad6b704c73126d /OpenSim
parent* Trimmed a few hundred warnings off SimpleApp. (diff)
downloadopensim-SC_OLD-497ab5d7abec3c644a6340c1c64a2557dbade0ef.zip
opensim-SC_OLD-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.gz
opensim-SC_OLD-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.bz2
opensim-SC_OLD-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.xz
* RegionApplicationBase restructuring now complete
* Still has some weird bug in SimpleApp though.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/General/AgentCircuitManager.cs (renamed from OpenSim/Framework/General/AuthenticateSessionBase.cs)4
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs80
-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
-rw-r--r--OpenSim/Region/Environment/RegionManager.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs69
10 files changed, 99 insertions, 127 deletions
diff --git a/OpenSim/Framework/General/AuthenticateSessionBase.cs b/OpenSim/Framework/General/AgentCircuitManager.cs
index 2d02286..c19d6b1 100644
--- a/OpenSim/Framework/General/AuthenticateSessionBase.cs
+++ b/OpenSim/Framework/General/AgentCircuitManager.cs
@@ -32,11 +32,11 @@ using OpenSim.Framework.Types;
32 32
33namespace OpenSim.Framework 33namespace OpenSim.Framework
34{ 34{
35 public class AuthenticateSessionsBase 35 public class AgentCircuitManager
36 { 36 {
37 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>(); 37 public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
38 38
39 public AuthenticateSessionsBase() 39 public AgentCircuitManager()
40 { 40 {
41 41
42 } 42 }
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 074b34b..61541cc 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -46,6 +46,7 @@ using OpenSim.Region.Communications.OGS1;
46using OpenSim.Region.Environment.Scenes; 46using OpenSim.Region.Environment.Scenes;
47using OpenSim.Region.Environment; 47using OpenSim.Region.Environment;
48using System.Text; 48using System.Text;
49using System.Collections.Generic;
49 50
50namespace OpenSim 51namespace OpenSim
51{ 52{
@@ -60,7 +61,9 @@ namespace OpenSim
60 protected bool m_useConfigFile; 61 protected bool m_useConfigFile;
61 public string m_configFileName; 62 public string m_configFileName;
62 63
63 protected CommunicationsManager commsManager; 64 protected List<UDPServer> m_udpServers = new List<UDPServer>();
65 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
66 protected List<IWorld> m_localWorld = new List<IWorld>();
64 67
65 private bool m_silent; 68 private bool m_silent;
66 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log"; 69 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
@@ -89,17 +92,13 @@ namespace OpenSim
89 m_httpServer.AddStreamHandler(new SimStatusHandler()); 92 m_httpServer.AddStreamHandler(new SimStatusHandler());
90 } 93 }
91 94
92 AssetCache assetCache = m_assetCache;
93 assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
94 m_inventoryCache = new InventoryCache();
95
96 if (m_sandbox) 95 if (m_sandbox)
97 { 96 {
98 this.commsManager = new CommunicationsLocal( m_networkServersInfo, m_httpServer); 97 m_commsManager = new CommunicationsLocal( m_networkServersInfo, m_httpServer);
99 } 98 }
100 else 99 else
101 { 100 {
102 this.commsManager = new CommunicationsOGS1( m_networkServersInfo, m_httpServer ); 101 m_commsManager = new CommunicationsOGS1( m_networkServersInfo, m_httpServer );
103 } 102 }
104 103
105 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions"); 104 string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Regions");
@@ -129,60 +128,15 @@ namespace OpenSim
129 regionInfo.InitConfig(this.m_sandbox, regionConfig); 128 regionInfo.InitConfig(this.m_sandbox, regionConfig);
130 regionConfig.Close(); 129 regionConfig.Close();
131 130
131
132 UDPServer udpServer;
133 Scene scene = SetupScene(regionInfo, out udpServer);
134
135 m_localWorld.Add(scene);
132 136
133 137
134 AuthenticateSessionsBase authenBase;
135
136 if (m_sandbox)
137 {
138 AuthenticateSessionsBase authen = new AuthenticateSessionsBase(); // new AuthenticateSessionsLocal();
139 this.AuthenticateSessionsHandler.Add(authen);
140 authenBase = authen;
141 }
142 else
143 {
144 AuthenticateSessionsBase authen = new AuthenticateSessionsBase(); //new AuthenticateSessionsRemote();
145 this.AuthenticateSessionsHandler.Add(authen);
146 authenBase = authen;
147 }
148
149 UDPServer udpServer = new UDPServer(regionInfo.InternalEndPoint.Port, assetCache, this.m_inventoryCache, this.m_log, authenBase);
150
151 m_udpServers.Add(udpServer); 138 m_udpServers.Add(udpServer);
152 m_regionData.Add(regionInfo); 139 m_regionData.Add(regionInfo);
153
154 StorageManager tmpStoreManager = GetStoreManager(regionInfo);
155
156 Scene scene = new Scene(regionInfo, authenBase, commsManager, assetCache, tmpStoreManager, m_httpServer);
157 m_localWorld.Add(scene);
158
159 udpServer.LocalWorld = scene;
160
161 scene.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
162 scene.LoadWorldMap();
163
164 PhysicsScene physicsScene = GetPhysicsScene(m_physicsEngine);
165
166 scene.PhysScene = physicsScene;
167 scene.PhysScene.SetTerrain(scene.Terrain.getHeights1D());
168 scene.LoadPrimsFromStorage();
169
170 //Master Avatar Setup
171 UserProfileData masterAvatar = commsManager.UserServer.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName, scene.RegionInfo.MasterAvatarLastName, scene.RegionInfo.MasterAvatarSandboxPassword);
172 if (masterAvatar != null)
173 {
174 m_log.Notice("Parcels - Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
175 scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
176 scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
177 }
178 else
179 {
180 m_log.Notice("Parcels - No master avatar found, using null.");
181 scene.RegionInfo.MasterAvatarAssignedUUID = libsecondlife.LLUUID.Zero;
182 scene.localStorage.LoadLandObjects((ILocalStorageLandObjectReceiver)scene.LandManager);
183 }
184 scene.performParcelPrimCountUpdate();
185 scene.StartTimer();
186 } 140 }
187 141
188 // Start UDP servers 142 // Start UDP servers
@@ -193,15 +147,18 @@ namespace OpenSim
193 147
194 } 148 }
195 149
196 protected override StorageManager GetStoreManager(RegionInfo regionInfo) 150 protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
197 { 151 {
198 return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName); 152 return new StorageManager("OpenSim.DataStore.NullStorage.dll", regionInfo.DataStore, regionInfo.RegionName);
199 } 153 }
200 154
155 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
156 {
157 return new Scene(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer);
158 }
159
201 protected override void Initialize() 160 protected override void Initialize()
202 { 161 {
203 m_log.Verbose("Loading Configuration [{0}]", m_configFileName);
204
205 IGenericConfig localConfig = new XmlConfig(m_configFileName); 162 IGenericConfig localConfig = new XmlConfig(m_configFileName);
206 localConfig.LoadData(); 163 localConfig.LoadData();
207 164
@@ -210,11 +167,14 @@ namespace OpenSim
210 SetupFromConfigFile(localConfig); 167 SetupFromConfigFile(localConfig);
211 } 168 }
212 169
170 StartLog();
171
213 m_networkServersInfo.InitConfig(m_sandbox, localConfig); 172 m_networkServersInfo.InitConfig(m_sandbox, localConfig);
214 m_httpServerPort = m_networkServersInfo.HttpListenerPort; 173 m_httpServerPort = m_networkServersInfo.HttpListenerPort;
215 174
216 localConfig.Close(); 175 localConfig.Close();
217 176
177 m_assetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
218 } 178 }
219 179
220 protected override LogBase CreateLog() 180 protected override LogBase CreateLog()
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()
diff --git a/OpenSim/Region/Environment/RegionManager.cs b/OpenSim/Region/Environment/RegionManager.cs
index f951701..e75ee60 100644
--- a/OpenSim/Region/Environment/RegionManager.cs
+++ b/OpenSim/Region/Environment/RegionManager.cs
@@ -10,7 +10,7 @@ namespace OpenSim.Region.Environment
10{ 10{
11 public class RegionManager 11 public class RegionManager
12 { 12 {
13 protected AuthenticateSessionsBase authenticateHandler; 13 protected AgentCircuitManager authenticateHandler;
14 protected RegionCommsListener regionCommsHost; 14 protected RegionCommsListener regionCommsHost;
15 protected CommunicationsManager commsManager; 15 protected CommunicationsManager commsManager;
16 protected List<Caps> capsHandlers = new List<Caps>(); 16 protected List<Caps> capsHandlers = new List<Caps>();
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index d2bb030..671b222 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Environment.Scenes
66 private int landPrimCheckCount; 66 private int landPrimCheckCount;
67 private Mutex updateLock; 67 private Mutex updateLock;
68 68
69 protected AuthenticateSessionsBase authenticateHandler; 69 protected AgentCircuitManager authenticateHandler;
70 protected RegionCommsListener regionCommsHost; 70 protected RegionCommsListener regionCommsHost;
71 protected CommunicationsManager commsManager; 71 protected CommunicationsManager commsManager;
72 protected StorageManager storageManager; 72 protected StorageManager storageManager;
@@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment.Scenes
128 /// <param name="clientThreads">Dictionary to contain client threads</param> 128 /// <param name="clientThreads">Dictionary to contain client threads</param>
129 /// <param name="regionHandle">Region Handle for this region</param> 129 /// <param name="regionHandle">Region Handle for this region</param>
130 /// <param name="regionName">Region Name for this region</param> 130 /// <param name="regionName">Region Name for this region</param>
131 public Scene(RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer) 131 public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer)
132 { 132 {
133 updateLock = new Mutex(false); 133 updateLock = new Mutex(false);
134 this.authenticateHandler = authen; 134 this.authenticateHandler = authen;
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index 4fe3c7a..cd69225 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -18,7 +18,7 @@ namespace SimpleApp
18 { 18 {
19 private List<ScenePresence> m_avatars; 19 private List<ScenePresence> m_avatars;
20 20
21 public MyWorld( RegionInfo regionInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer) 21 public MyWorld( RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer)
22 : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer) 22 : base( regionInfo, authen, commsMan, assetCach, storeMan, httpServer)
23 { 23 {
24 m_avatars = new List<Avatar>(); 24 m_avatars = new List<Avatar>();
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index fe8c11a..c945d39 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -22,9 +22,7 @@ namespace SimpleApp
22{ 22{
23 class Program : RegionApplicationBase, conscmd_callback 23 class Program : RegionApplicationBase, conscmd_callback
24 { 24 {
25 AuthenticateSessionsBase m_circuitManager; 25 public MyWorld m_scene;
26
27 public MyWorld m_world;
28 private SceneObject m_sceneObject; 26 private SceneObject m_sceneObject;
29 public MyNpcCharacter m_character; 27 public MyNpcCharacter m_character;
30 28
@@ -36,73 +34,52 @@ namespace SimpleApp
36 protected override void Initialize() 34 protected override void Initialize()
37 { 35 {
38 m_httpServerPort = 9000; 36 m_httpServerPort = 9000;
37
38 StartLog();
39
40 LocalAssetServer assetServer = new LocalAssetServer();
41 assetServer.SetServerInfo("http://localhost:8003/", "");
42
43 AssetCache m_assetCache = new AssetCache(assetServer);
39 } 44 }
40 45
41 public void Run() 46 public void Run()
42 { 47 {
43 base.StartUp(); 48 base.StartUp();
44 49
45 m_circuitManager = new AuthenticateSessionsBase(); 50 CommunicationsLocal m_commsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
46
47 InventoryCache inventoryCache = new InventoryCache();
48 51
49 LocalAssetServer assetServer = new LocalAssetServer();
50 assetServer.SetServerInfo("http://localhost:8003/", "");
51
52 AssetCache assetCache = new AssetCache(assetServer);
53
54 ScenePresence.LoadTextureFile("avatar-texture.dat");
55 ScenePresence.PhysicsEngineFlying = true; 52 ScenePresence.PhysicsEngineFlying = true;
56 53
57 IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000); 54 IPEndPoint internalEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9000);
58 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost"); 55 RegionInfo regionInfo = new RegionInfo(1000, 1000, internalEndPoint, "localhost");
59 56
60 UDPServer udpServer = new UDPServer(internalEndPoint.Port, assetCache, inventoryCache, m_log, m_circuitManager); 57 UDPServer udpServer;
61 PacketServer packetServer = new PacketServer(udpServer);
62
63 CommunicationsLocal communicationsManager = new CommunicationsLocal(m_networkServersInfo, m_httpServer);
64
65 StorageManager storeMan = GetStoreManager(regionInfo);
66 58
67 59 Scene scene = SetupScene(regionInfo, out udpServer);
68 60
69 m_world = new MyWorld( regionInfo, m_circuitManager, communicationsManager, assetCache, storeMan, m_httpServer);
70 m_world.PhysScene = GetPhysicsScene( );
71
72 m_world.LoadWorldMap();
73 m_world.PhysScene.SetTerrain(m_world.Terrain.getHeights1D());
74 m_world.performParcelPrimCountUpdate();
75
76 udpServer.LocalWorld = m_world;
77
78 m_httpServer.Start();
79 udpServer.ServerListener(); 61 udpServer.ServerListener();
80 62
81 UserProfileData masterAvatar = communicationsManager.UserServer.SetupMasterUser("Test", "User", "test");
82 if (masterAvatar != null)
83 {
84 m_world.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
85 m_world.LandManager.NoLandDataFromStorage();
86 }
87
88 m_world.StartTimer();
89
90 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox(); 63 PrimitiveBaseShape shape = PrimitiveBaseShape.DefaultBox();
91 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f); 64 shape.Scale = new LLVector3(0.5f, 0.5f, 0.5f);
92 LLVector3 pos = new LLVector3(138, 129, 27); 65 LLVector3 pos = new LLVector3(138, 129, 27);
93 66
94 m_sceneObject = new MySceneObject(m_world, m_world.EventManager, LLUUID.Zero, m_world.PrimIDAllocate(), pos, shape); 67 m_sceneObject = new MySceneObject(scene, scene.EventManager, LLUUID.Zero, scene.PrimIDAllocate(), pos, shape);
95 m_world.AddEntity(m_sceneObject); 68 scene.AddEntity(m_sceneObject);
96 69
97 m_character = new MyNpcCharacter(); 70 m_character = new MyNpcCharacter();
98 m_world.AddNewClient(m_character, false); 71 scene.AddNewClient(m_character, false);
99 72
100 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit."); 73 m_log.WriteLine(LogPriority.NORMAL, "Press enter to quit.");
101 m_log.ReadLine(); 74 m_log.ReadLine();
102 75 }
76
77 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, AgentCircuitManager circuitManager)
78 {
79 return new MyWorld(regionInfo, circuitManager, m_commsManager, m_assetCache, storageManager, m_httpServer);
103 } 80 }
104 81
105 protected override StorageManager GetStoreManager(RegionInfo regionInfo) 82 protected override StorageManager CreateStorageManager(RegionInfo regionInfo)
106 { 83 {
107 return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp"); 84 return new StorageManager("OpenSim.DataStore.NullStorage.dll", "simpleapp.yap", "simpleapp");
108 } 85 }