aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.World
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.World/Avatar.cs11
-rw-r--r--OpenSim/OpenSim.World/Entity.cs2
-rw-r--r--OpenSim/OpenSim.World/OpenSim.World.csproj32
-rw-r--r--OpenSim/OpenSim.World/OpenSim.World.csproj.user12
-rw-r--r--OpenSim/OpenSim.World/OpenSim.World.dll.build71
-rw-r--r--OpenSim/OpenSim.World/World.cs18
-rw-r--r--OpenSim/OpenSim.World/WorldBase.cs91
7 files changed, 129 insertions, 108 deletions
diff --git a/OpenSim/OpenSim.World/Avatar.cs b/OpenSim/OpenSim.World/Avatar.cs
index c251d57..4ab576c 100644
--- a/OpenSim/OpenSim.World/Avatar.cs
+++ b/OpenSim/OpenSim.World/Avatar.cs
@@ -55,21 +55,16 @@ namespace OpenSim.world
55 ControllingClient = theClient; 55 ControllingClient = theClient;
56 this.firstname = ControllingClient.FirstName; 56 this.firstname = ControllingClient.FirstName;
57 this.lastname = ControllingClient.LastName; 57 this.lastname = ControllingClient.LastName;
58 localid = 8880000 + (this.m_world._localNumber++); 58 localid = this.m_world.NextLocalId;
59 Pos = ControllingClient.StartPos; 59 Pos = ControllingClient.StartPos;
60 visualParams = new byte[218]; 60 visualParams = new byte[218];
61 for (int i = 0; i < 218; i++) 61 for (int i = 0; i < 218; i++)
62 { 62 {
63 visualParams[i] = 100; 63 visualParams[i] = 100;
64 } 64 }
65 Wearables = new AvatarWearable[13]; //should be 13 of these
66 for (int i = 0; i < 13; i++)
67 {
68 Wearables[i] = new AvatarWearable();
69 }
70 this.Wearables[0].AssetID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
71 this.Wearables[0].ItemID = LLUUID.Random();
72 65
66 Wearables = AvatarWearable.DefaultWearables;
67
73 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); 68 this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
74 Console.WriteLine("avatar point 4"); 69 Console.WriteLine("avatar point 4");
75 70
diff --git a/OpenSim/OpenSim.World/Entity.cs b/OpenSim/OpenSim.World/Entity.cs
index b14beed..dd5f9a6 100644
--- a/OpenSim/OpenSim.World/Entity.cs
+++ b/OpenSim/OpenSim.World/Entity.cs
@@ -51,7 +51,7 @@ namespace OpenSim.world
51 { 51 {
52 try 52 try
53 { 53 {
54 lock (this.m_world.LockPhysicsEngine) 54 lock (this.m_world.SyncRoot)
55 { 55 {
56 56
57 this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z); 57 this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
diff --git a/OpenSim/OpenSim.World/OpenSim.World.csproj b/OpenSim/OpenSim.World/OpenSim.World.csproj
index f2fb596..46803d6 100644
--- a/OpenSim/OpenSim.World/OpenSim.World.csproj
+++ b/OpenSim/OpenSim.World/OpenSim.World.csproj
@@ -130,58 +130,58 @@
130 </ProjectReference> 130 </ProjectReference>
131 </ItemGroup> 131 </ItemGroup>
132 <ItemGroup> 132 <ItemGroup>
133 <Compile Include="Entity.cs"> 133 <Compile Include="Avatar.Client.cs">
134 <SubType>Code</SubType> 134 <SubType>Code</SubType>
135 </Compile> 135 </Compile>
136 <Compile Include="World.PacketHandlers.cs"> 136 <Compile Include="Avatar.cs">
137 <SubType>Code</SubType> 137 <SubType>Code</SubType>
138 </Compile> 138 </Compile>
139 <Compile Include="WorldBase.cs"> 139 <Compile Include="Avatar.Update.cs">
140 <SubType>Code</SubType> 140 <SubType>Code</SubType>
141 </Compile> 141 </Compile>
142 <Compile Include="SceneObject.cs"> 142 <Compile Include="AvatarAnimations.cs">
143 <SubType>Code</SubType> 143 <SubType>Code</SubType>
144 </Compile> 144 </Compile>
145 <Compile Include="World.Scripting.cs"> 145 <Compile Include="Entity.cs">
146 <SubType>Code</SubType> 146 <SubType>Code</SubType>
147 </Compile> 147 </Compile>
148 <Compile Include="Avatar.Client.cs"> 148 <Compile Include="ParcelManager.cs">
149 <SubType>Code</SubType> 149 <SubType>Code</SubType>
150 </Compile> 150 </Compile>
151 <Compile Include="Avatar.Update.cs"> 151 <Compile Include="Primitive.cs">
152 <SubType>Code</SubType> 152 <SubType>Code</SubType>
153 </Compile> 153 </Compile>
154 <Compile Include="AvatarAnimations.cs"> 154 <Compile Include="SceneObject.cs">
155 <SubType>Code</SubType> 155 <SubType>Code</SubType>
156 </Compile> 156 </Compile>
157 <Compile Include="Primitive.cs"> 157 <Compile Include="World.cs">
158 <SubType>Code</SubType> 158 <SubType>Code</SubType>
159 </Compile> 159 </Compile>
160 <Compile Include="Avatar.cs"> 160 <Compile Include="World.PacketHandlers.cs">
161 <SubType>Code</SubType> 161 <SubType>Code</SubType>
162 </Compile> 162 </Compile>
163 <Compile Include="ParcelManager.cs"> 163 <Compile Include="World.Scripting.cs">
164 <SubType>Code</SubType> 164 <SubType>Code</SubType>
165 </Compile> 165 </Compile>
166 <Compile Include="World.cs"> 166 <Compile Include="WorldBase.cs">
167 <SubType>Code</SubType> 167 <SubType>Code</SubType>
168 </Compile> 168 </Compile>
169 <Compile Include="Estate\EstateManager.cs"> 169 <Compile Include="Estate\EstateManager.cs">
170 <SubType>Code</SubType> 170 <SubType>Code</SubType>
171 </Compile> 171 </Compile>
172 <Compile Include="scripting\IScriptHandler.cs"> 172 <Compile Include="scripting\IScriptContext.cs">
173 <SubType>Code</SubType> 173 <SubType>Code</SubType>
174 </Compile> 174 </Compile>
175 <Compile Include="scripting\ScriptFactory.cs"> 175 <Compile Include="scripting\IScriptEntity.cs">
176 <SubType>Code</SubType> 176 <SubType>Code</SubType>
177 </Compile> 177 </Compile>
178 <Compile Include="scripting\IScriptContext.cs"> 178 <Compile Include="scripting\IScriptHandler.cs">
179 <SubType>Code</SubType> 179 <SubType>Code</SubType>
180 </Compile> 180 </Compile>
181 <Compile Include="scripting\Script.cs"> 181 <Compile Include="scripting\Script.cs">
182 <SubType>Code</SubType> 182 <SubType>Code</SubType>
183 </Compile> 183 </Compile>
184 <Compile Include="scripting\IScriptEntity.cs"> 184 <Compile Include="scripting\ScriptFactory.cs">
185 <SubType>Code</SubType> 185 <SubType>Code</SubType>
186 </Compile> 186 </Compile>
187 <Compile Include="scripting\Scripts\FollowRandomAvatar.cs"> 187 <Compile Include="scripting\Scripts\FollowRandomAvatar.cs">
diff --git a/OpenSim/OpenSim.World/OpenSim.World.csproj.user b/OpenSim/OpenSim.World/OpenSim.World.csproj.user
deleted file mode 100644
index 082d673..0000000
--- a/OpenSim/OpenSim.World/OpenSim.World.csproj.user
+++ /dev/null
@@ -1,12 +0,0 @@
1<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5 <ReferencePath>C:\sugilite\bin\</ReferencePath>
6 <LastOpenVersion>8.0.50727</LastOpenVersion>
7 <ProjectView>ProjectFiles</ProjectView>
8 <ProjectTrust>0</ProjectTrust>
9 </PropertyGroup>
10 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
11 <PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
12</Project>
diff --git a/OpenSim/OpenSim.World/OpenSim.World.dll.build b/OpenSim/OpenSim.World/OpenSim.World.dll.build
new file mode 100644
index 0000000..3fa534e
--- /dev/null
+++ b/OpenSim/OpenSim.World/OpenSim.World.dll.build
@@ -0,0 +1,71 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.World" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.World" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Avatar.Client.cs" />
15 <include name="Avatar.cs" />
16 <include name="Avatar.Update.cs" />
17 <include name="AvatarAnimations.cs" />
18 <include name="Entity.cs" />
19 <include name="ParcelManager.cs" />
20 <include name="Primitive.cs" />
21 <include name="SceneObject.cs" />
22 <include name="World.cs" />
23 <include name="World.PacketHandlers.cs" />
24 <include name="World.Scripting.cs" />
25 <include name="WorldBase.cs" />
26 <include name="Estate/EstateManager.cs" />
27 <include name="scripting/IScriptContext.cs" />
28 <include name="scripting/IScriptEntity.cs" />
29 <include name="scripting/IScriptHandler.cs" />
30 <include name="scripting/Script.cs" />
31 <include name="scripting/ScriptFactory.cs" />
32 <include name="scripting/Scripts/FollowRandomAvatar.cs" />
33 <include name="types/Mesh.cs" />
34 <include name="types/Triangle.cs" />
35 </sources>
36 <references basedir="${project::get-base-directory()}">
37 <lib>
38 <include name="${project::get-base-directory()}" />
39 <include name="${project::get-base-directory()}/${build.dir}" />
40 </lib>
41 <include name="System.dll" />
42 <include name="System.Xml.dll" />
43 <include name="../../bin/libsecondlife.dll" />
44 <include name="../../bin/Axiom.MathLib.dll" />
45 <include name="../../bin/Db4objects.Db4o.dll" />
46 <include name="../../bin/OpenSim.Terrain.BasicTerrain.dll" />
47 <include name="../../bin/OpenSim.Framework.dll" />
48 <include name="../../bin/OpenSim.Framework.Console.dll" />
49 <include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
50 <include name="../../bin/OpenSim.Physics.Manager.dll" />
51 <include name="../../bin/OpenSim.Servers.dll" />
52 <include name="../../bin/XMLRPC.dll" />
53 <include name="../../bin/OpenGrid.Framework.Communications.dll" />
54 </references>
55 </csc>
56 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
57 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
58 <copy todir="${project::get-base-directory()}/../../bin/">
59 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
60 <include name="*.dll"/>
61 <include name="*.exe"/>
62 </fileset>
63 </copy>
64 </target>
65 <target name="clean">
66 <delete dir="${bin.dir}" failonerror="false" />
67 <delete dir="${obj.dir}" failonerror="false" />
68 </target>
69 <target name="doc" description="Creates documentation.">
70 </target>
71</project>
diff --git a/OpenSim/OpenSim.World/World.cs b/OpenSim/OpenSim.World/World.cs
index 011e39a..7ef06e2 100644
--- a/OpenSim/OpenSim.World/World.cs
+++ b/OpenSim/OpenSim.World/World.cs
@@ -23,10 +23,8 @@ namespace OpenSim.world
23 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI 23 public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
24 { 24 {
25 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer(); 25 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
26 public object LockPhysicsEngine = new object();
27 protected Dictionary<libsecondlife.LLUUID, Avatar> Avatars; 26 protected Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
28 protected Dictionary<libsecondlife.LLUUID, Primitive> Prims; 27 protected Dictionary<libsecondlife.LLUUID, Primitive> Prims;
29 public uint _localNumber = 0;
30 private PhysicsScene phyScene; 28 private PhysicsScene phyScene;
31 private float timeStep = 0.1f; 29 private float timeStep = 0.1f;
32 public ILocalStorage localStorage; 30 public ILocalStorage localStorage;
@@ -59,6 +57,7 @@ namespace OpenSim.world
59 return (this.phyScene); 57 return (this.phyScene);
60 } 58 }
61 } 59 }
60
62 #endregion 61 #endregion
63 62
64 #region Constructors 63 #region Constructors
@@ -155,7 +154,7 @@ namespace OpenSim.world
155 Entities[UUID].addForces(); 154 Entities[UUID].addForces();
156 } 155 }
157 156
158 lock (this.LockPhysicsEngine) 157 lock (this.m_syncRoot)
159 { 158 {
160 this.phyScene.Simulate(timeStep); 159 this.phyScene.Simulate(timeStep);
161 } 160 }
@@ -203,7 +202,7 @@ namespace OpenSim.world
203 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain tainted, saving."); 202 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain tainted, saving.");
204 localStorage.SaveMap(Terrain.getHeights1D()); 203 localStorage.SaveMap(Terrain.getHeights1D());
205 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain saved, informing Physics."); 204 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: Backup() - Terrain saved, informing Physics.");
206 lock (this.LockPhysicsEngine) 205 lock (this.m_syncRoot)
207 { 206 {
208 phyScene.SetTerrain(Terrain.getHeights1D()); 207 phyScene.SetTerrain(Terrain.getHeights1D());
209 } 208 }
@@ -297,7 +296,7 @@ namespace OpenSim.world
297 { 296 {
298 Terrain.hills(); 297 Terrain.hills();
299 298
300 lock (this.LockPhysicsEngine) 299 lock (this.m_syncRoot)
301 { 300 {
302 this.phyScene.SetTerrain(Terrain.getHeights1D()); 301 this.phyScene.SetTerrain(Terrain.getHeights1D());
303 } 302 }
@@ -328,7 +327,7 @@ namespace OpenSim.world
328 try 327 try
329 { 328 {
330 this.Terrain.setHeights2D(newMap); 329 this.Terrain.setHeights2D(newMap);
331 lock (this.LockPhysicsEngine) 330 lock (this.m_syncRoot)
332 { 331 {
333 this.phyScene.SetTerrain(this.Terrain.getHeights1D()); 332 this.phyScene.SetTerrain(this.Terrain.getHeights1D());
334 } 333 }
@@ -483,7 +482,7 @@ namespace OpenSim.world
483 this.estateManager.sendRegionHandshake(remoteClient); 482 this.estateManager.sendRegionHandshake(remoteClient);
484 483
485 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); 484 PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z);
486 lock (this.LockPhysicsEngine) 485 lock (this.m_syncRoot)
487 { 486 {
488 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); 487 newAvatar.PhysActor = this.phyScene.AddAvatar(pVec);
489 } 488 }
@@ -612,5 +611,10 @@ namespace OpenSim.world
612 } 611 }
613 612
614 #endregion 613 #endregion
614
615 public override void SendLayerData(int px, int py, IClientAPI RemoteClient)
616 {
617 RemoteClient.SendLayerData( Terrain.getHeights1D() );
618 }
615 } 619 }
616} 620}
diff --git a/OpenSim/OpenSim.World/WorldBase.cs b/OpenSim/OpenSim.World/WorldBase.cs
index 19a8fb5..92bc6a3 100644
--- a/OpenSim/OpenSim.World/WorldBase.cs
+++ b/OpenSim/OpenSim.World/WorldBase.cs
@@ -15,61 +15,25 @@ using OpenSim.Terrain;
15 15
16namespace OpenSim.world 16namespace OpenSim.world
17{ 17{
18 public class WorldBase : IWorld 18 public abstract class WorldBase : IWorld
19 { 19 {
20 public Dictionary<libsecondlife.LLUUID, Entity> Entities; 20 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
21 protected Dictionary<uint, IClientAPI> m_clientThreads; 21 protected Dictionary<uint, IClientAPI> m_clientThreads;
22 protected ulong m_regionHandle; 22 protected ulong m_regionHandle;
23 protected string m_regionName; 23 protected string m_regionName;
24 // protected InventoryCache _inventoryCache;
25 // protected AssetCache _assetCache;
26 protected RegionInfo m_regInfo; 24 protected RegionInfo m_regInfo;
27 25
28 public TerrainEngine Terrain; //TODO: Replace TerrainManager with this. 26 public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
29 protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine 27 protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
30 28 protected object m_syncRoot = new object();
31 #region Properties 29 private uint m_nextLocalId = 8880000;
32 /*
33 public InventoryCache InventoryCache
34 {
35 set
36 {
37 this._inventoryCache = value;
38 }
39 }
40
41 public AssetCache AssetCache
42 {
43 set
44 {
45 this._assetCache = value;
46 }
47 }
48 */
49 #endregion
50
51 #region Constructors
52 /// <summary>
53 ///
54 /// </summary>
55 public WorldBase()
56 {
57
58 }
59 #endregion
60
61 #region Setup Methods
62
63 #endregion
64 30
65 #region Update Methods 31 #region Update Methods
66 /// <summary> 32 /// <summary>
67 /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation) 33 /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
68 /// </summary> 34 /// </summary>
69 public virtual void Update() 35 public abstract void Update();
70 {
71 36
72 }
73 #endregion 37 #endregion
74 38
75 #region Terrain Methods 39 #region Terrain Methods
@@ -77,11 +41,8 @@ namespace OpenSim.world
77 /// <summary> 41 /// <summary>
78 /// Loads the World heightmap 42 /// Loads the World heightmap
79 /// </summary> 43 /// </summary>
80 public virtual void LoadWorldMap() 44 public abstract void LoadWorldMap();
81 { 45
82
83 }
84
85 /// <summary> 46 /// <summary>
86 /// Send the region heightmap to the client 47 /// Send the region heightmap to the client
87 /// </summary> 48 /// </summary>
@@ -97,10 +58,8 @@ namespace OpenSim.world
97 /// <param name="px">Patch coordinate (x) 0..16</param> 58 /// <param name="px">Patch coordinate (x) 0..16</param>
98 /// <param name="py">Patch coordinate (y) 0..16</param> 59 /// <param name="py">Patch coordinate (y) 0..16</param>
99 /// <param name="RemoteClient">The client to send to</param> 60 /// <param name="RemoteClient">The client to send to</param>
100 public void SendLayerData(int px, int py, IClientAPI RemoteClient) 61 public abstract void SendLayerData(int px, int py, IClientAPI RemoteClient);
101 { 62
102
103 }
104 #endregion 63 #endregion
105 64
106 #region Add/Remove Agent/Avatar 65 #region Add/Remove Agent/Avatar
@@ -110,39 +69,43 @@ namespace OpenSim.world
110 /// <param name="remoteClient"></param> 69 /// <param name="remoteClient"></param>
111 /// <param name="agentID"></param> 70 /// <param name="agentID"></param>
112 /// <param name="child"></param> 71 /// <param name="child"></param>
113 public virtual void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child) 72 public abstract void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child);
114 { 73
115 return ;
116 }
117
118 /// <summary> 74 /// <summary>
119 /// 75 ///
120 /// </summary> 76 /// </summary>
121 /// <param name="agentID"></param> 77 /// <param name="agentID"></param>
122 public virtual void RemoveAvatar(LLUUID agentID) 78 public abstract void RemoveAvatar(LLUUID agentID);
123 { 79
124 return ;
125 }
126
127 #endregion 80 #endregion
128 81
129 /// <summary> 82 /// <summary>
130 /// 83 ///
131 /// </summary> 84 /// </summary>
132 /// <returns></returns> 85 /// <returns></returns>
133 public virtual RegionInfo GetRegionInfo() 86 public virtual RegionInfo RegionInfo
87 {
88 get { return null; }
89 }
90
91 public object SyncRoot
92 {
93 get { return m_syncRoot; }
94 }
95
96 public uint NextLocalId
134 { 97 {
135 return null; 98 get { return m_nextLocalId++; }
136 } 99 }
137 100
138 #region Shutdown 101 #region Shutdown
139 /// <summary> 102 /// <summary>
140 /// Tidy before shutdown 103 /// Tidy before shutdown
141 /// </summary> 104 /// </summary>
142 public virtual void Close() 105 public abstract void Close();
143 {
144 106
145 }
146 #endregion 107 #endregion
108
109
147 } 110 }
148} 111}