WorldBase.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. using System;
  2. using libsecondlife;
  3. using libsecondlife.Packets;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Reflection;
  7. using System.IO;
  8. using System.Threading;
  9. using OpenSim.Physics.Manager;
  10. using OpenSim.Framework.Interfaces;
  11. using OpenSim.Framework.Types;
  12. using OpenSim.Framework.Inventory;
  13. using OpenSim.RegionServer.world.scripting;
  14. using OpenSim.Terrain;
  15. namespace OpenSim.world
  16. {
  17. public class WorldBase : IWorld
  18. {
  19. public Dictionary<libsecondlife.LLUUID, Entity> Entities;
  20. protected Dictionary<uint, IClientAPI> m_clientThreads;
  21. protected ulong m_regionHandle;
  22. protected string m_regionName;
  23. // protected InventoryCache _inventoryCache;
  24. // protected AssetCache _assetCache;
  25. protected RegionInfo m_regInfo;
  26. public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
  27. protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
  28. #region Properties
  29. /*
  30. public InventoryCache InventoryCache
  31. {
  32. set
  33. {
  34. this._inventoryCache = value;
  35. }
  36. }
  37. public AssetCache AssetCache
  38. {
  39. set
  40. {
  41. this._assetCache = value;
  42. }
  43. }
  44. */
  45. #endregion
  46. #region Constructors
  47. /// <summary>
  48. ///
  49. /// </summary>
  50. public WorldBase()
  51. {
  52. }
  53. #endregion
  54. #region Setup Methods
  55. #endregion
  56. #region Update Methods
  57. /// <summary>
  58. /// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
  59. /// </summary>
  60. public virtual void Update()
  61. {
  62. }
  63. #endregion
  64. #region Terrain Methods
  65. /// <summary>
  66. /// Loads the World heightmap
  67. /// </summary>
  68. public virtual void LoadWorldMap()
  69. {
  70. }
  71. /// <summary>
  72. /// Send the region heightmap to the client
  73. /// </summary>
  74. /// <param name="RemoteClient">Client to send to</param>
  75. public virtual void SendLayerData(IClientAPI RemoteClient)
  76. {
  77. RemoteClient.SendLayerData(Terrain.getHeights1D());
  78. }
  79. /// <summary>
  80. /// Sends a specified patch to a client
  81. /// </summary>
  82. /// <param name="px">Patch coordinate (x) 0..16</param>
  83. /// <param name="py">Patch coordinate (y) 0..16</param>
  84. /// <param name="RemoteClient">The client to send to</param>
  85. public void SendLayerData(int px, int py, IClientAPI RemoteClient)
  86. {
  87. }
  88. #endregion
  89. #region Add/Remove Agent/Avatar
  90. /// <summary>
  91. ///
  92. /// </summary>
  93. /// <param name="remoteClient"></param>
  94. /// <param name="agentID"></param>
  95. /// <param name="child"></param>
  96. public virtual void AddNewAvatar(IClientAPI remoteClient, LLUUID agentID, bool child)
  97. {
  98. return ;
  99. }
  100. /// <summary>
  101. ///
  102. /// </summary>
  103. /// <param name="agentID"></param>
  104. public virtual void RemoveAvatar(LLUUID agentID)
  105. {
  106. return ;
  107. }
  108. #endregion
  109. /// <summary>
  110. ///
  111. /// </summary>
  112. /// <returns></returns>
  113. public virtual RegionInfo GetRegionInfo()
  114. {
  115. return null;
  116. }
  117. #region Shutdown
  118. /// <summary>
  119. /// Tidy before shutdown
  120. /// </summary>
  121. public virtual void Close()
  122. {
  123. }
  124. #endregion
  125. }
  126. }