aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
authorMW2007-05-16 18:26:30 +0000
committerMW2007-05-16 18:26:30 +0000
commit7cc41b9e3864d59af6edc4a84c03987ee387f9e3 (patch)
tree318487f840762409d0054b78a0da7d759a1e2d9d /OpenSim.RegionServer
parenta bit more refactoring (diff)
downloadopensim-SC_OLD-7cc41b9e3864d59af6edc4a84c03987ee387f9e3.zip
opensim-SC_OLD-7cc41b9e3864d59af6edc4a84c03987ee387f9e3.tar.gz
opensim-SC_OLD-7cc41b9e3864d59af6edc4a84c03987ee387f9e3.tar.bz2
opensim-SC_OLD-7cc41b9e3864d59af6edc4a84c03987ee387f9e3.tar.xz
Added OpenSimApplication as a base class to OpenSimMain
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj1
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.dll.build177
-rw-r--r--OpenSim.RegionServer/OpenSimApplication.cs81
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs34
4 files changed, 173 insertions, 120 deletions
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index b5db7db..6457b9e 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -141,6 +141,7 @@
141 <Compile Include="Grid.cs"> 141 <Compile Include="Grid.cs">
142 <SubType>Code</SubType> 142 <SubType>Code</SubType>
143 </Compile> 143 </Compile>
144 <Compile Include="OpenSimApplication.cs" />
144 <Compile Include="OpenSimMain.cs"> 145 <Compile Include="OpenSimMain.cs">
145 <SubType>Code</SubType> 146 <SubType>Code</SubType>
146 </Compile> 147 </Compile>
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index bf28ec1..580772d 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -1,88 +1,89 @@
1<?xml version="1.0" ?> 1<?xml version="1.0" ?>
2<project name="OpenSim.RegionServer" default="build"> 2<project name="OpenSim.RegionServer" default="build">
3 <target name="build"> 3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> 4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" /> 5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}"> 6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}"> 7 <fileset basedir="${project::get-base-directory()}">
8 </fileset> 8 </fileset>
9 </copy> 9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> 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.RegionServer" dynamicprefix="true" > 11 <resources prefix="OpenSim.RegionServer" dynamicprefix="true" >
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AgentAssetUpload.cs" /> 14 <include name="AgentAssetUpload.cs" />
15 <include name="AuthenticateSessionsBase.cs" /> 15 <include name="AuthenticateSessionsBase.cs" />
16 <include name="AuthenticateSessionsLocal.cs" /> 16 <include name="AuthenticateSessionsLocal.cs" />
17 <include name="AuthenticateSessionsRemote.cs" /> 17 <include name="AuthenticateSessionsRemote.cs" />
18 <include name="Grid.cs" /> 18 <include name="Grid.cs" />
19 <include name="OpenSimMain.cs" /> 19 <include name="OpenSimApplication.cs" />
20 <include name="OpenSimNetworkHandler.cs" /> 20 <include name="OpenSimMain.cs" />
21 <include name="PacketServer.cs" /> 21 <include name="OpenSimNetworkHandler.cs" />
22 <include name="RegionInfo.cs" /> 22 <include name="PacketServer.cs" />
23 <include name="RegionInfoBase.cs" /> 23 <include name="RegionInfo.cs" />
24 <include name="SimClient.Grid.cs" /> 24 <include name="RegionInfoBase.cs" />
25 <include name="SimClient.PacketHandlers.cs" /> 25 <include name="SimClient.cs" />
26 <include name="SimClient.ProcessPackets.cs" /> 26 <include name="SimClient.Grid.cs" />
27 <include name="SimClient.cs" /> 27 <include name="SimClient.PacketHandlers.cs" />
28 <include name="SimClientBase.cs" /> 28 <include name="SimClient.ProcessPackets.cs" />
29 <include name="UDPServer.cs" /> 29 <include name="SimClientBase.cs" />
30 <include name="VersionInfo.cs" /> 30 <include name="UDPServer.cs" />
31 <include name="Assets/AssetCache.cs" /> 31 <include name="VersionInfo.cs" />
32 <include name="Assets/InventoryCache.cs" /> 32 <include name="Assets/AssetCache.cs" />
33 <include name="CAPS/AdminWebFront.cs" /> 33 <include name="Assets/InventoryCache.cs" />
34 <include name="types/Mesh.cs" /> 34 <include name="CAPS/AdminWebFront.cs" />
35 <include name="types/Triangle.cs" /> 35 <include name="types/Mesh.cs" />
36 <include name="world/Avatar.Client.cs" /> 36 <include name="types/Triangle.cs" />
37 <include name="world/Avatar.Update.cs" /> 37 <include name="world/Avatar.Client.cs" />
38 <include name="world/Avatar.cs" /> 38 <include name="world/Avatar.cs" />
39 <include name="world/AvatarAnimations.cs" /> 39 <include name="world/Avatar.Update.cs" />
40 <include name="world/Entity.cs" /> 40 <include name="world/AvatarAnimations.cs" />
41 <include name="world/Primitive.cs" /> 41 <include name="world/Entity.cs" />
42 <include name="world/Primitive2.cs" /> 42 <include name="world/Primitive.cs" />
43 <include name="world/SceneObject.cs" /> 43 <include name="world/Primitive2.cs" />
44 <include name="world/World.PacketHandlers.cs" /> 44 <include name="world/SceneObject.cs" />
45 <include name="world/World.Scripting.cs" /> 45 <include name="world/World.cs" />
46 <include name="world/World.cs" /> 46 <include name="world/World.PacketHandlers.cs" />
47 <include name="world/scripting/IScriptContext.cs" /> 47 <include name="world/World.Scripting.cs" />
48 <include name="world/scripting/IScriptEntity.cs" /> 48 <include name="world/scripting/IScriptContext.cs" />
49 <include name="world/scripting/IScriptHandler.cs" /> 49 <include name="world/scripting/IScriptEntity.cs" />
50 <include name="world/scripting/Script.cs" /> 50 <include name="world/scripting/IScriptHandler.cs" />
51 <include name="world/scripting/ScriptFactory.cs" /> 51 <include name="world/scripting/Script.cs" />
52 <include name="world/scripting/Scripts/FollowRandomAvatar.cs" /> 52 <include name="world/scripting/ScriptFactory.cs" />
53 </sources> 53 <include name="world/scripting/Scripts/FollowRandomAvatar.cs" />
54 <references basedir="${project::get-base-directory()}"> 54 </sources>
55 <lib> 55 <references basedir="${project::get-base-directory()}">
56 <include name="${project::get-base-directory()}" /> 56 <lib>
57 <include name="${project::get-base-directory()}/${build.dir}" /> 57 <include name="${project::get-base-directory()}" />
58 </lib> 58 <include name="${project::get-base-directory()}/${build.dir}" />
59 <include name="System.dll" /> 59 </lib>
60 <include name="System.Xml.dll" /> 60 <include name="System.dll" />
61 <include name="../bin/libsecondlife.dll" /> 61 <include name="System.Xml.dll" />
62 <include name="../bin/Axiom.MathLib.dll" /> 62 <include name="../bin/libsecondlife.dll" />
63 <include name="../bin/Db4objects.Db4o.dll" /> 63 <include name="../bin/Axiom.MathLib.dll" />
64 <include name="../bin/OpenSim.Terrain.BasicTerrain.dll" /> 64 <include name="../bin/Db4objects.Db4o.dll" />
65 <include name="../bin/OpenSim.Framework.dll" /> 65 <include name="../bin/OpenSim.Terrain.BasicTerrain.dll" />
66 <include name="../bin/OpenSim.Framework.Console.dll" /> 66 <include name="../bin/OpenSim.Framework.dll" />
67 <include name="../bin/OpenSim.GenericConfig.Xml.dll" /> 67 <include name="../bin/OpenSim.Framework.Console.dll" />
68 <include name="../bin/OpenSim.Physics.Manager.dll" /> 68 <include name="../bin/OpenSim.GenericConfig.Xml.dll" />
69 <include name="../bin/OpenSim.Servers.dll" /> 69 <include name="../bin/OpenSim.Physics.Manager.dll" />
70 <include name="../bin/XMLRPC.dll" /> 70 <include name="../bin/OpenSim.Servers.dll" />
71 </references> 71 <include name="../bin/XMLRPC.dll" />
72 </csc> 72 </references>
73 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" /> 73 </csc>
74 <mkdir dir="${project::get-base-directory()}/../bin/"/> 74 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
75 <copy todir="${project::get-base-directory()}/../bin/"> 75 <mkdir dir="${project::get-base-directory()}/../bin/"/>
76 <fileset basedir="${project::get-base-directory()}/${build.dir}/" > 76 <copy todir="${project::get-base-directory()}/../bin/">
77 <include name="*.dll"/> 77 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
78 <include name="*.exe"/> 78 <include name="*.dll"/>
79 </fileset> 79 <include name="*.exe"/>
80 </copy> 80 </fileset>
81 </target> 81 </copy>
82 <target name="clean"> 82 </target>
83 <delete dir="${bin.dir}" failonerror="false" /> 83 <target name="clean">
84 <delete dir="${obj.dir}" failonerror="false" /> 84 <delete dir="${bin.dir}" failonerror="false" />
85 </target> 85 <delete dir="${obj.dir}" failonerror="false" />
86 <target name="doc" description="Creates documentation."> 86 </target>
87 </target> 87 <target name="doc" description="Creates documentation.">
88</project> 88 </target>
89</project>
diff --git a/OpenSim.RegionServer/OpenSimApplication.cs b/OpenSim.RegionServer/OpenSimApplication.cs
new file mode 100644
index 0000000..f7bcd21
--- /dev/null
+++ b/OpenSim.RegionServer/OpenSimApplication.cs
@@ -0,0 +1,81 @@
1using System;
2using System.Text;
3using System.IO;
4using System.Threading;
5using System.Net;
6using System.Net.Sockets;
7using System.Timers;
8using System.Reflection;
9using System.Collections;
10using System.Collections.Generic;
11using libsecondlife;
12using libsecondlife.Packets;
13using OpenSim.world;
14using OpenSim.Terrain;
15using OpenSim.Framework.Interfaces;
16using OpenSim.Framework.Types;
17using OpenSim.UserServer;
18using OpenSim.Assets;
19using OpenSim.CAPS;
20using OpenSim.Framework.Console;
21using OpenSim.Physics.Manager;
22using Nwc.XmlRpc;
23using OpenSim.Servers;
24using OpenSim.GenericConfig;
25
26namespace OpenSim
27{
28 public class OpenSimApplication
29 {
30 protected IGenericConfig localConfig;
31 protected PhysicsManager physManager;
32 protected Grid GridServers;
33 protected AssetCache AssetCache;
34 protected InventoryCache InventoryCache;
35 protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
36 protected DateTime startuptime;
37 protected RegionInfo regionData;
38
39 protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
40 public string m_physicsEngine;
41 public bool m_sandbox = false;
42 public bool m_loginserver;
43 public bool user_accounts = false;
44 public bool gridLocalAsset = false;
45 protected bool configFileSetup = false;
46 public string m_config;
47
48 protected UDPServer m_udpServer;
49 protected BaseHttpServer httpServer;
50 protected AuthenticateSessionsBase AuthenticateSessionsHandler;
51
52 protected ConsoleBase m_console;
53
54 public OpenSimApplication()
55 {
56
57 }
58
59 public OpenSimApplication(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
60 {
61 this.configFileSetup = useConfigFile;
62 m_sandbox = sandBoxMode;
63 m_loginserver = startLoginServer;
64 m_physicsEngine = physicsEngine;
65 m_config = configFile;
66 }
67
68 protected World m_localWorld;
69 public World LocalWorld
70 {
71 get { return m_localWorld; }
72 }
73
74 /// <summary>
75 /// Performs initialisation of the world, such as loading configuration from disk.
76 /// </summary>
77 public virtual void StartUp()
78 {
79 }
80 }
81}
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index f78873d..a333074 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -54,32 +54,8 @@ using OpenSim.GenericConfig;
54namespace OpenSim 54namespace OpenSim
55{ 55{
56 56
57 public class OpenSimMain : conscmd_callback 57 public class OpenSimMain : OpenSimApplication , conscmd_callback
58 { 58 {
59 private IGenericConfig localConfig;
60 //private IGenericConfig remoteConfig;
61 private PhysicsManager physManager;
62 private Grid GridServers;
63 private AssetCache AssetCache;
64 private InventoryCache InventoryCache;
65 private Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
66 private DateTime startuptime;
67 private RegionInfo regionData;
68
69 private System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
70 public string m_physicsEngine;
71 public bool m_sandbox = false;
72 public bool m_loginserver;
73 public bool user_accounts = false;
74 public bool gridLocalAsset = false;
75 private bool configFileSetup = false;
76 public string m_config;
77
78 private UDPServer m_udpServer;
79 protected BaseHttpServer httpServer;
80 private AuthenticateSessionsBase AuthenticateSessionsHandler;
81
82 protected ConsoleBase m_console;
83 59
84 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile) 60 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
85 { 61 {
@@ -93,16 +69,10 @@ namespace OpenSim
93 OpenSim.Framework.Console.MainConsole.Instance = m_console; 69 OpenSim.Framework.Console.MainConsole.Instance = m_console;
94 } 70 }
95 71
96 private World m_localWorld;
97 public World LocalWorld
98 {
99 get { return m_localWorld; }
100 }
101
102 /// <summary> 72 /// <summary>
103 /// Performs initialisation of the world, such as loading configuration from disk. 73 /// Performs initialisation of the world, such as loading configuration from disk.
104 /// </summary> 74 /// </summary>
105 public virtual void StartUp() 75 public override void StartUp()
106 { 76 {
107 this.regionData = new RegionInfo(); 77 this.regionData = new RegionInfo();
108 try 78 try