aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/RegionApplicationBase.cs
diff options
context:
space:
mode:
authorlbsa712007-07-16 23:25:35 +0000
committerlbsa712007-07-16 23:25:35 +0000
commit497ab5d7abec3c644a6340c1c64a2557dbade0ef (patch)
tree6ff6d849c724db80116205c3bbad6b704c73126d /OpenSim/Region/ClientStack/RegionApplicationBase.cs
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/ClientStack/RegionApplicationBase.cs')
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs52
1 files changed, 44 insertions, 8 deletions
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}