aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Reg/WorldBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/OpenSim.Reg/WorldBase.cs111
1 files changed, 111 insertions, 0 deletions
diff --git a/OpenSim/OpenSim.Reg/WorldBase.cs b/OpenSim/OpenSim.Reg/WorldBase.cs
new file mode 100644
index 0000000..727d1e8
--- /dev/null
+++ b/OpenSim/OpenSim.Reg/WorldBase.cs
@@ -0,0 +1,111 @@
1using System;
2using libsecondlife;
3using libsecondlife.Packets;
4using System.Collections.Generic;
5using System.Text;
6using System.Reflection;
7using System.IO;
8using System.Threading;
9using OpenSim.Physics.Manager;
10using OpenSim.Framework.Interfaces;
11using OpenSim.Framework.Types;
12using OpenSim.Framework.Inventory;
13using OpenSim.Region.Scripting;
14using OpenSim.Terrain;
15
16namespace OpenSim.Region
17{
18 public abstract class WorldBase : IWorld
19 {
20 public Dictionary<libsecondlife.LLUUID, Entity> Entities;
21 protected Dictionary<uint, IClientAPI> m_clientThreads;
22 protected ulong m_regionHandle;
23 protected string m_regionName;
24 protected RegionInfo m_regInfo;
25
26 public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
27 protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
28 protected object m_syncRoot = new object();
29 private uint m_nextLocalId = 8880000;
30
31 #region Update Methods
32 /// <summary>
33 /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
34 /// </summary>
35 public abstract void Update();
36
37 #endregion
38
39 #region Terrain Methods
40
41 /// <summary>
42 /// Loads the World heightmap
43 /// </summary>
44 public abstract void LoadWorldMap();
45
46 /// <summary>
47 /// Send the region heightmap to the client
48 /// </summary>
49 /// <param name="RemoteClient">Client to send to</param>
50 public virtual void SendLayerData(IClientAPI RemoteClient)
51 {
52 RemoteClient.SendLayerData(Terrain.getHeights1D());
53 }
54
55 /// <summary>
56 /// Sends a specified patch to a client
57 /// </summary>
58 /// <param name="px">Patch coordinate (x) 0..16</param>
59 /// <param name="py">Patch coordinate (y) 0..16</param>
60 /// <param name="RemoteClient">The client to send to</param>
61 public abstract void SendLayerData(int px, int py, IClientAPI RemoteClient);
62
63 #endregion
64
65 #region Add/Remove Agent/Avatar
66 /// <summary>
67 ///
68 /// </summary>
69 /// <param name="remoteClient"></param>
70 /// <param name="agentID"></param>
71 /// <param name="child"></param>
72 public abstract void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child);
73
74 /// <summary>
75 ///
76 /// </summary>
77 /// <param name="agentID"></param>
78 public abstract void RemoveAvatar(LLUUID agentID);
79
80 #endregion
81
82 /// <summary>
83 ///
84 /// </summary>
85 /// <returns></returns>
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
97 {
98 get { return m_nextLocalId++; }
99 }
100
101 #region Shutdown
102 /// <summary>
103 /// Tidy before shutdown
104 /// </summary>
105 public abstract void Close();
106
107 #endregion
108
109
110 }
111}