aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorlbsa712007-07-16 23:25:35 +0000
committerlbsa712007-07-16 23:25:35 +0000
commit497ab5d7abec3c644a6340c1c64a2557dbade0ef (patch)
tree6ff6d849c724db80116205c3bbad6b704c73126d /OpenSim/Region/Application
parent* Trimmed a few hundred warnings off SimpleApp. (diff)
downloadopensim-SC-497ab5d7abec3c644a6340c1c64a2557dbade0ef.zip
opensim-SC-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.gz
opensim-SC-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.bz2
opensim-SC-497ab5d7abec3c644a6340c1c64a2557dbade0ef.tar.xz
* RegionApplicationBase restructuring now complete
* Still has some weird bug in SimpleApp though.
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs80
1 files changed, 20 insertions, 60 deletions
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()