RegionServerBase.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Copyright (c) Contributors, http://www.openmetaverse.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. *
  27. */
  28. using System;
  29. using System.Text;
  30. using System.IO;
  31. using System.Threading;
  32. using System.Net;
  33. using System.Net.Sockets;
  34. using System.Timers;
  35. using System.Reflection;
  36. using System.Collections;
  37. using System.Collections.Generic;
  38. using libsecondlife;
  39. using libsecondlife.Packets;
  40. using OpenSim.RegionServer.Simulator;
  41. using OpenSim.Terrain;
  42. using OpenSim.Framework.Interfaces;
  43. using OpenSim.Framework.Types;
  44. using OpenSim.UserServer;
  45. using OpenSim.RegionServer.Assets;
  46. using OpenSim.RegionServer.CAPS;
  47. using OpenSim.Framework.Console;
  48. using OpenSim.Physics.Manager;
  49. using Nwc.XmlRpc;
  50. using OpenSim.Servers;
  51. using OpenSim.GenericConfig;
  52. namespace OpenSim.RegionServer
  53. {
  54. public class RegionServerBase
  55. {
  56. protected IGenericConfig localConfig;
  57. protected PhysicsManager physManager;
  58. protected Grid GridServers;
  59. protected AssetCache AssetCache;
  60. protected InventoryCache InventoryCache;
  61. protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
  62. protected DateTime startuptime;
  63. protected RegionInfo regionData;
  64. protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
  65. public string m_physicsEngine;
  66. public bool m_sandbox = false;
  67. public bool m_loginserver;
  68. public bool user_accounts = false;
  69. public bool gridLocalAsset = false;
  70. protected bool configFileSetup = false;
  71. public string m_config;
  72. protected UDPServer m_udpServer;
  73. protected BaseHttpServer httpServer;
  74. protected AuthenticateSessionsBase AuthenticateSessionsHandler;
  75. protected ConsoleBase m_console;
  76. public RegionServerBase()
  77. {
  78. }
  79. public RegionServerBase(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
  80. {
  81. this.configFileSetup = useConfigFile;
  82. m_sandbox = sandBoxMode;
  83. m_loginserver = startLoginServer;
  84. m_physicsEngine = physicsEngine;
  85. m_config = configFile;
  86. }
  87. protected World m_localWorld;
  88. public World LocalWorld
  89. {
  90. get { return m_localWorld; }
  91. }
  92. /// <summary>
  93. /// Performs initialisation of the world, such as loading configuration from disk.
  94. /// </summary>
  95. public virtual void StartUp()
  96. {
  97. }
  98. protected virtual void SetupLocalGridServers()
  99. {
  100. }
  101. protected virtual void SetupRemoteGridServers()
  102. {
  103. }
  104. protected virtual void SetupLocalWorld()
  105. {
  106. }
  107. protected virtual void SetupHttpListener()
  108. {
  109. }
  110. protected virtual void ConnectToRemoteGridServer()
  111. {
  112. }
  113. }
  114. }