aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorAdam Frisby2007-04-06 18:48:23 +0000
committerAdam Frisby2007-04-06 18:48:23 +0000
commitfb0dffbf13a79aabe9537f16b7bb151af62c75bf (patch)
tree28a8d468e5499a7af1e33eec7bbdeb9e82ae8732 /OpenSim.RegionServer
parentAnd now for some solution files... (diff)
downloadopensim-SC_OLD-fb0dffbf13a79aabe9537f16b7bb151af62c75bf.zip
opensim-SC_OLD-fb0dffbf13a79aabe9537f16b7bb151af62c75bf.tar.gz
opensim-SC_OLD-fb0dffbf13a79aabe9537f16b7bb151af62c75bf.tar.bz2
opensim-SC_OLD-fb0dffbf13a79aabe9537f16b7bb151af62c75bf.tar.xz
**BREAKING CHANGE** Changing the way terrain is stored and used internally.
Diffstat (limited to 'OpenSim.RegionServer')
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj49
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs2
-rw-r--r--OpenSim.RegionServer/world/Avatar.cs4
-rw-r--r--OpenSim.RegionServer/world/World.cs30
-rw-r--r--OpenSim.RegionServer/world/WorldPacketHandlers.cs26
5 files changed, 53 insertions, 58 deletions
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 73f523a..44d2635 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid> 6 <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.RegionServer</AssemblyName> 13 <AssemblyName>OpenSim.RegionServer</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenSim.RegionServer</RootNamespace> 21 <RootNamespace>OpenSim.RegionServer</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,26 +61,27 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="System" > 68 <Reference Include="System">
62 <HintPath>System.dll</HintPath> 69 <HintPath>System.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="System.Xml" > 72 <Reference Include="System.Xml">
66 <HintPath>System.Xml.dll</HintPath> 73 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private> 74 <Private>False</Private>
68 </Reference> 75 </Reference>
69 <Reference Include="libsecondlife.dll" > 76 <Reference Include="libsecondlife.dll">
70 <HintPath>..\bin\libsecondlife.dll</HintPath> 77 <HintPath>..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private> 78 <Private>False</Private>
72 </Reference> 79 </Reference>
73 <Reference Include="Axiom.MathLib.dll" > 80 <Reference Include="Axiom.MathLib.dll">
74 <HintPath>..\bin\Axiom.MathLib.dll</HintPath> 81 <HintPath>..\bin\Axiom.MathLib.dll</HintPath>
75 <Private>False</Private> 82 <Private>False</Private>
76 </Reference> 83 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" > 84 <Reference Include="Db4objects.Db4o.dll">
78 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath> 85 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private> 86 <Private>False</Private>
80 </Reference> 87 </Reference>
@@ -84,31 +91,35 @@
84 <Name>OpenSim.Framework</Name> 91 <Name>OpenSim.Framework</Name>
85 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> 92 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 93 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private> 94 <Private>False</Private>
88 </ProjectReference> 95 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> 96 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
90 <Name>OpenSim.Framework.Console</Name> 97 <Name>OpenSim.Framework.Console</Name>
91 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> 98 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 99 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private> 100 <Private>False</Private>
94 </ProjectReference> 101 </ProjectReference>
95 <ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> 102 <ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
96 <Name>OpenSim.GenericConfig.Xml</Name> 103 <Name>OpenSim.GenericConfig.Xml</Name>
97 <Project>{E88EF749-0000-0000-0000-000000000000}</Project> 104 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 105 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private> 106 <Private>False</Private>
100 </ProjectReference> 107 </ProjectReference>
101 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> 108 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
102 <Name>OpenSim.Physics.Manager</Name> 109 <Name>OpenSim.Physics.Manager</Name>
103 <Project>{8BE16150-0000-0000-0000-000000000000}</Project> 110 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 111 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private> 112 <Private>False</Private>
113 </ProjectReference>
114 <ProjectReference Include="..\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj">
115 <Project>{FFD5951C-4002-4ACA-9ADF-68852357B94A}</Project>
116 <Name>OpenSim.Terrain.BasicTerrain</Name>
106 </ProjectReference> 117 </ProjectReference>
107 <ProjectReference Include="..\Servers\OpenSim.Servers.csproj"> 118 <ProjectReference Include="..\Servers\OpenSim.Servers.csproj">
108 <Name>OpenSim.Servers</Name> 119 <Name>OpenSim.Servers</Name>
109 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> 120 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 121 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private> 122 <Private>False</Private>
112 </ProjectReference> 123 </ProjectReference>
113 </ItemGroup> 124 </ItemGroup>
114 <ItemGroup> 125 <ItemGroup>
@@ -222,4 +233,4 @@
222 <PostBuildEvent> 233 <PostBuildEvent>
223 </PostBuildEvent> 234 </PostBuildEvent>
224 </PropertyGroup> 235 </PropertyGroup>
225</Project> 236</Project> \ No newline at end of file
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 7b0bd4b..b159af0 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -156,7 +156,7 @@ namespace OpenSim
156 156
157 m_console.WriteLine("Main.cs:Startup() - Starting up messaging system"); 157 m_console.WriteLine("Main.cs:Startup() - Starting up messaging system");
158 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use 158 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine); //should be reading from the config file what physics engine to use
159 LocalWorld.PhysScene.SetTerrain(LocalWorld.LandMap); 159 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.map);
160 160
161 //should be passing a IGenericConfig object to these so they can read the config data they want from it 161 //should be passing a IGenericConfig object to these so they can read the config data they want from it
162 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); 162 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs
index 186fb5c..f507797 100644
--- a/OpenSim.RegionServer/world/Avatar.cs
+++ b/OpenSim.RegionServer/world/Avatar.cs
@@ -44,7 +44,7 @@ namespace OpenSim.world
44 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); 44 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)");
45 ControllingClient = TheClient; 45 ControllingClient = TheClient;
46 localid = 8880000 + (this.m_world._localNumber++); 46 localid = 8880000 + (this.m_world._localNumber++);
47 Pos = new LLVector3(100.0f, 100.0f, m_world.LandMap[(int)Pos.Y * 256 + (int)Pos.X] + 1); 47 Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain.map[(int)Pos.X, (int)Pos.Y] + 1.0f);
48 visualParams = new byte[218]; 48 visualParams = new byte[218];
49 for (int i = 0; i < 218; i++) 49 for (int i = 0; i < 218; i++)
50 { 50 {
@@ -332,7 +332,7 @@ namespace OpenSim.world
332 332
333 public override void LandRenegerated() 333 public override void LandRenegerated()
334 { 334 {
335 Pos = new LLVector3(100.0f, 100.0f, this.m_world.LandMap[(int)Pos.Y * 256 + (int)Pos.X] + 50); 335 Pos = new LLVector3(100.0f, 100.0f, m_world.Terrain.map[(int)Pos.X, (int)Pos.Y] + 50.0f);
336 } 336 }
337 } 337 }
338 338
diff --git a/OpenSim.RegionServer/world/World.cs b/OpenSim.RegionServer/world/World.cs
index 5b7b3a1..c23ac2d 100644
--- a/OpenSim.RegionServer/world/World.cs
+++ b/OpenSim.RegionServer/world/World.cs
@@ -14,6 +14,7 @@ using OpenSim.Assets;
14using OpenSim.world.scripting; 14using OpenSim.world.scripting;
15using OpenSim.RegionServer.world.scripting; 15using OpenSim.RegionServer.world.scripting;
16using OpenSim.RegionServer.world.scripting.Scripts; 16using OpenSim.RegionServer.world.scripting.Scripts;
17using OpenSim.Terrain;
17 18
18namespace OpenSim.world 19namespace OpenSim.world
19{ 20{
@@ -23,8 +24,9 @@ namespace OpenSim.world
23 public Dictionary<libsecondlife.LLUUID, Entity> Entities; 24 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
24 public Dictionary<libsecondlife.LLUUID, Avatar> Avatars; 25 public Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
25 public Dictionary<libsecondlife.LLUUID, Primitive> Prims; 26 public Dictionary<libsecondlife.LLUUID, Primitive> Prims;
26 public float[] LandMap; 27// public float[] LandMap;
27 public ScriptEngine Scripts; 28 public ScriptEngine Scripts;
29 public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
28 public uint _localNumber = 0; 30 public uint _localNumber = 0;
29 private PhysicsScene phyScene; 31 private PhysicsScene phyScene;
30 private float timeStep = 0.1f; 32 private float timeStep = 0.1f;
@@ -189,13 +191,13 @@ namespace OpenSim.world
189 191
190 public void RegenerateTerrain() 192 public void RegenerateTerrain()
191 { 193 {
192 HeightmapGenHills hills = new HeightmapGenHills(); 194 Terrain.hills();
193 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false); 195
194 lock (this.LockPhysicsEngine) 196 lock (this.LockPhysicsEngine)
195 { 197 {
196 this.phyScene.SetTerrain(this.LandMap); 198 this.phyScene.SetTerrain(Terrain.map);
197 } 199 }
198 this.localStorage.SaveMap(this.LandMap); 200 this.localStorage.SaveMap(this.Terrain.map);
199 201
200 foreach (SimClient client in m_clientThreads.Values) 202 foreach (SimClient client in m_clientThreads.Values)
201 { 203 {
@@ -208,14 +210,14 @@ namespace OpenSim.world
208 } 210 }
209 } 211 }
210 212
211 public void RegenerateTerrain(float[] newMap) 213 public void RegenerateTerrain(float[,] newMap)
212 { 214 {
213 this.LandMap = newMap; 215 this.Terrain.map = newMap;
214 lock (this.LockPhysicsEngine) 216 lock (this.LockPhysicsEngine)
215 { 217 {
216 this.phyScene.SetTerrain(this.LandMap); 218 this.phyScene.SetTerrain(this.Terrain.map);
217 } 219 }
218 this.localStorage.SaveMap(this.LandMap); 220 this.localStorage.SaveMap(this.Terrain.map);
219 221
220 foreach (SimClient client in m_clientThreads.Values) 222 foreach (SimClient client in m_clientThreads.Values)
221 { 223 {
@@ -234,9 +236,9 @@ namespace OpenSim.world
234 { 236 {
235 lock (this.LockPhysicsEngine) 237 lock (this.LockPhysicsEngine)
236 { 238 {
237 this.phyScene.SetTerrain(this.LandMap); 239 this.phyScene.SetTerrain(this.Terrain.map);
238 } 240 }
239 this.localStorage.SaveMap(this.LandMap); 241 this.localStorage.SaveMap(this.Terrain.map);
240 242
241 foreach (SimClient client in m_clientThreads.Values) 243 foreach (SimClient client in m_clientThreads.Values)
242 { 244 {
@@ -249,7 +251,7 @@ namespace OpenSim.world
249 251
250 public void LoadWorldMap() 252 public void LoadWorldMap()
251 { 253 {
252 LandMap = this.localStorage.LoadWorld(); 254 Terrain.map = this.localStorage.LoadWorld();
253 } 255 }
254 256
255 public void LoadPrimsFromStorage() 257 public void LoadPrimsFromStorage()
@@ -288,7 +290,7 @@ namespace OpenSim.world
288 patches[2] = x + 2 + y * 16; 290 patches[2] = x + 2 + y * 16;
289 patches[3] = x + 3 + y * 16; 291 patches[3] = x + 3 + y * 16;
290 292
291 Packet layerpack = TerrainManager.CreateLandPacket(LandMap, patches); 293 Packet layerpack = TerrainManager.CreateLandPacket(Terrain.map, patches);
292 RemoteClient.OutPacket(layerpack); 294 RemoteClient.OutPacket(layerpack);
293 } 295 }
294 } 296 }
@@ -310,7 +312,7 @@ namespace OpenSim.world
310 //patches[2] = patchx + 2 + patchy * 16; 312 //patches[2] = patchx + 2 + patchy * 16;
311 //patches[3] = patchx + 3 + patchy * 16; 313 //patches[3] = patchx + 3 + patchy * 16;
312 314
313 Packet layerpack = TerrainManager.CreateLandPacket(LandMap, patches); 315 Packet layerpack = TerrainManager.CreateLandPacket(Terrain.map, patches);
314 RemoteClient.OutPacket(layerpack); 316 RemoteClient.OutPacket(layerpack);
315 } 317 }
316 318
diff --git a/OpenSim.RegionServer/world/WorldPacketHandlers.cs b/OpenSim.RegionServer/world/WorldPacketHandlers.cs
index a155ffe..0643a4e 100644
--- a/OpenSim.RegionServer/world/WorldPacketHandlers.cs
+++ b/OpenSim.RegionServer/world/WorldPacketHandlers.cs
@@ -24,34 +24,16 @@ namespace OpenSim.world
24 // raise terrain 24 // raise terrain
25 if (modify.ParcelData.Length > 0) 25 if (modify.ParcelData.Length > 0)
26 { 26 {
27 int mody = (int)modify.ParcelData[0].North; 27 Terrain.raise(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
28 int modx = (int)modify.ParcelData[0].West; 28 RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
29 lock (LandMap)
30 {
31 LandMap[(mody * 256) + modx - 1] += 0.05f;
32 LandMap[(mody * 256) + modx] += 0.1f;
33 LandMap[(mody * 256) + modx + 1] += 0.05f;
34 LandMap[((mody + 1) * 256) + modx] += 0.05f;
35 LandMap[((mody - 1) * 256) + modx] += 0.05f;
36 }
37 RegenerateTerrain(true, modx, mody);
38 } 29 }
39 break; 30 break;
40 case 2: 31 case 2:
41 //lower terrain 32 //lower terrain
42 if (modify.ParcelData.Length > 0) 33 if (modify.ParcelData.Length > 0)
43 { 34 {
44 int mody = (int)modify.ParcelData[0].North; 35 Terrain.lower(modify.ParcelData[0].North, modify.ParcelData[0].West, 10.0, 0.1);
45 int modx = (int)modify.ParcelData[0].West; 36 RegenerateTerrain(true, (int)modify.ParcelData[0].North, (int)modify.ParcelData[0].West);
46 lock (LandMap)
47 {
48 LandMap[(mody * 256) + modx - 1] -= 0.05f;
49 LandMap[(mody * 256) + modx] -= 0.1f;
50 LandMap[(mody * 256) + modx + 1] -= 0.05f;
51 LandMap[((mody + 1) * 256) + modx] -= 0.05f;
52 LandMap[((mody - 1) * 256) + modx] -= 0.05f;
53 }
54 RegenerateTerrain(true, modx, mody);
55 } 37 }
56 break; 38 break;
57 } 39 }