aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
authorlbsa712007-06-29 13:51:21 +0000
committerlbsa712007-06-29 13:51:21 +0000
commitf6deaf8a65693d022f58961a007f2492c9ac97fa (patch)
tree7428eccc93a3f64f46e08d7269bc337f3d26d8a8 /OpenSim/Region/Application
parentDeleted some files that are no longer in use. (I am sure I deleted these yest... (diff)
parent*Hopefully fixed the empty dialog box error on client when logging in on sand... (diff)
downloadopensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.zip
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.gz
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.bz2
opensim-SC_OLD-f6deaf8a65693d022f58961a007f2492c9ac97fa.tar.xz
Switched in NameSpaceChanges
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/Application.cs122
-rw-r--r--OpenSim/Region/Application/OpenSim.csproj190
-rw-r--r--OpenSim/Region/Application/OpenSim.exe.build60
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs485
-rw-r--r--OpenSim/Region/Application/VersionInfo.cs38
5 files changed, 895 insertions, 0 deletions
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
new file mode 100644
index 0000000..1dcd99b
--- /dev/null
+++ b/OpenSim/Region/Application/Application.cs
@@ -0,0 +1,122 @@
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*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using OpenSim.Framework.Console;
32using OpenSim.Region.ClientStack;
33
34namespace OpenSim
35{
36 public class Application
37 {
38 //could move our main function into OpenSimMain and kill this class
39 [STAThread]
40 public static void Main(string[] args)
41 {
42 Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
43 Console.WriteLine("Starting...\n");
44
45 bool sandBoxMode = false;
46 bool startLoginServer = false;
47 string physicsEngine = "basicphysics";
48 bool allowFlying = false;
49 bool userAccounts = false;
50 bool gridLocalAsset = false;
51 bool useConfigFile = false;
52 bool silent = false;
53 string configFile = "simconfig.xml";
54
55 for (int i = 0; i < args.Length; i++)
56 {
57 if (args[i] == "-sandbox")
58 {
59 sandBoxMode = true;
60 startLoginServer = true;
61 }
62 /*
63 if (args[i] == "-loginserver")
64 {
65 startLoginServer = true;
66 }*/
67 if (args[i] == "-accounts")
68 {
69 userAccounts = true;
70 }
71 if (args[i] == "-realphysx")
72 {
73 physicsEngine = "RealPhysX";
74 allowFlying = true;
75 }
76 if (args[i] == "-ode")
77 {
78 physicsEngine = "OpenDynamicsEngine";
79 allowFlying = true;
80 }
81 if (args[i] == "-localasset")
82 {
83 gridLocalAsset = true;
84 }
85 if (args[i] == "-configfile")
86 {
87 useConfigFile = true;
88 }
89 if (args[i] == "-noverbose")
90 {
91 silent = true;
92 }
93 if (args[i] == "-config")
94 {
95 try
96 {
97 i++;
98 configFile = args[i];
99 }
100 catch (Exception e)
101 {
102 Console.WriteLine("-config: Please specify a config file. (" + e.ToString() + ")");
103 }
104 }
105 }
106
107 OpenSimMain sim = new OpenSimMain(sandBoxMode, startLoginServer, physicsEngine, useConfigFile, silent, configFile);
108 // OpenSimRoot.Instance.Application = sim;
109 sim.m_sandbox = sandBoxMode;
110 sim.user_accounts = userAccounts;
111 sim.gridLocalAsset = gridLocalAsset;
112 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = allowFlying;
113
114 sim.StartUp();
115
116 while (true)
117 {
118 OpenSim.Framework.Console.MainLog.Instance.MainLogPrompt();
119 }
120 }
121 }
122}
diff --git a/OpenSim/Region/Application/OpenSim.csproj b/OpenSim/Region/Application/OpenSim.csproj
new file mode 100644
index 0000000..bec85cc
--- /dev/null
+++ b/OpenSim/Region/Application/OpenSim.csproj
@@ -0,0 +1,190 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{438A9556-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Exe</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="Axiom.MathLib.dll" >
62 <HintPath>..\..\..\bin\Axiom.MathLib.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="Db4objects.Db4o.dll" >
66 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="libsecondlife.dll" >
70 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="System" >
74 <HintPath>System.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="System.Xml" >
78 <HintPath>System.Xml.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 <Reference Include="XMLRPC.dll" >
82 <HintPath>..\..\..\bin\XMLRPC.dll</HintPath>
83 <Private>False</Private>
84 </Reference>
85 </ItemGroup>
86 <ItemGroup>
87 <ProjectReference Include="..\..\Framework\General\OpenSim.Framework.csproj">
88 <Name>OpenSim.Framework</Name>
89 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
90 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
91 <Private>False</Private>
92 </ProjectReference>
93 <ProjectReference Include="..\..\Framework\Communications\OpenSim.Framework.Communications.csproj">
94 <Name>OpenSim.Framework.Communications</Name>
95 <Project>{CB52B7E7-0000-0000-0000-000000000000}</Project>
96 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
97 <Private>False</Private>
98 </ProjectReference>
99 <ProjectReference Include="..\..\Framework\Console\OpenSim.Framework.Console.csproj">
100 <Name>OpenSim.Framework.Console</Name>
101 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
102 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
103 <Private>False</Private>
104 </ProjectReference>
105 <ProjectReference Include="..\..\Framework\Data\OpenSim.Framework.Data.csproj">
106 <Name>OpenSim.Framework.Data</Name>
107 <Project>{36B72A9B-0000-0000-0000-000000000000}</Project>
108 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
109 <Private>False</Private>
110 </ProjectReference>
111 <ProjectReference Include="..\..\Framework\GenericConfig\Xml\OpenSim.Framework.GenericConfig.Xml.csproj">
112 <Name>OpenSim.Framework.GenericConfig.Xml</Name>
113 <Project>{C74E4A30-0000-0000-0000-000000000000}</Project>
114 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
115 <Private>False</Private>
116 </ProjectReference>
117 <ProjectReference Include="..\..\Framework\Servers\OpenSim.Framework.Servers.csproj">
118 <Name>OpenSim.Framework.Servers</Name>
119 <Project>{2CC71860-0000-0000-0000-000000000000}</Project>
120 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
121 <Private>False</Private>
122 </ProjectReference>
123 <ProjectReference Include="..\..\Framework\UserManager\OpenSim.Framework.UserManagement.csproj">
124 <Name>OpenSim.Framework.UserManagement</Name>
125 <Project>{586E2916-0000-0000-0000-000000000000}</Project>
126 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
127 <Private>False</Private>
128 </ProjectReference>
129 <ProjectReference Include="..\Caches\OpenSim.Region.Caches.csproj">
130 <Name>OpenSim.Region.Caches</Name>
131 <Project>{61FCCDB3-0000-0000-0000-000000000000}</Project>
132 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
133 <Private>False</Private>
134 </ProjectReference>
135 <ProjectReference Include="..\ClientStack\OpenSim.Region.ClientStack.csproj">
136 <Name>OpenSim.Region.ClientStack</Name>
137 <Project>{DC3698B2-0000-0000-0000-000000000000}</Project>
138 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
139 <Private>False</Private>
140 </ProjectReference>
141 <ProjectReference Include="..\Communications\Local\OpenSim.Region.Communications.Local.csproj">
142 <Name>OpenSim.Region.Communications.Local</Name>
143 <Project>{BFB5D807-0000-0000-0000-000000000000}</Project>
144 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
145 <Private>False</Private>
146 </ProjectReference>
147 <ProjectReference Include="..\Communications\OGS1\OpenSim.Region.Communications.OGS1.csproj">
148 <Name>OpenSim.Region.Communications.OGS1</Name>
149 <Project>{4806E378-0000-0000-0000-000000000000}</Project>
150 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
151 <Private>False</Private>
152 </ProjectReference>
153 <ProjectReference Include="..\Environment\OpenSim.Region.Environment.csproj">
154 <Name>OpenSim.Region.Environment</Name>
155 <Project>{DCBA491C-0000-0000-0000-000000000000}</Project>
156 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
157 <Private>False</Private>
158 </ProjectReference>
159 <ProjectReference Include="..\Physics\Manager\OpenSim.Region.Physics.Manager.csproj">
160 <Name>OpenSim.Region.Physics.Manager</Name>
161 <Project>{F4FF31EB-0000-0000-0000-000000000000}</Project>
162 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
163 <Private>False</Private>
164 </ProjectReference>
165 <ProjectReference Include="..\Terrain.BasicTerrain\OpenSim.Region.Terrain.BasicTerrain.csproj">
166 <Name>OpenSim.Region.Terrain.BasicTerrain</Name>
167 <Project>{C9E0F891-0000-0000-0000-000000000000}</Project>
168 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
169 <Private>False</Private>
170 </ProjectReference>
171 </ItemGroup>
172 <ItemGroup>
173 <Compile Include="Application.cs">
174 <SubType>Code</SubType>
175 </Compile>
176 <Compile Include="OpenSimMain.cs">
177 <SubType>Code</SubType>
178 </Compile>
179 <Compile Include="VersionInfo.cs">
180 <SubType>Code</SubType>
181 </Compile>
182 </ItemGroup>
183 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
184 <PropertyGroup>
185 <PreBuildEvent>
186 </PreBuildEvent>
187 <PostBuildEvent>
188 </PostBuildEvent>
189 </PropertyGroup>
190</Project>
diff --git a/OpenSim/Region/Application/OpenSim.exe.build b/OpenSim/Region/Application/OpenSim.exe.build
new file mode 100644
index 0000000..6c7d7ac
--- /dev/null
+++ b/OpenSim/Region/Application/OpenSim.exe.build
@@ -0,0 +1,60 @@
1<?xml version="1.0" ?>
2<project name="OpenSim" 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="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
11 <resources prefix="OpenSim" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="Application.cs" />
15 <include name="OpenSimMain.cs" />
16 <include name="VersionInfo.cs" />
17 </sources>
18 <references basedir="${project::get-base-directory()}">
19 <lib>
20 <include name="${project::get-base-directory()}" />
21 <include name="${project::get-base-directory()}/${build.dir}" />
22 </lib>
23 <include name="../../../bin/Axiom.MathLib.dll" />
24 <include name="../../../bin/Db4objects.Db4o.dll" />
25 <include name="../../../bin/libsecondlife.dll" />
26 <include name="../../../bin/OpenSim.Framework.dll" />
27 <include name="../../../bin/OpenSim.Framework.Communications.dll" />
28 <include name="../../../bin/OpenSim.Framework.Console.dll" />
29 <include name="../../../bin/OpenSim.Framework.Data.dll" />
30 <include name="../../../bin/OpenSim.Framework.GenericConfig.Xml.dll" />
31 <include name="../../../bin/OpenSim.Framework.Servers.dll" />
32 <include name="../../../bin/OpenSim.Framework.UserManagement.dll" />
33 <include name="../../../bin/OpenSim.Region.Caches.dll" />
34 <include name="../../../bin/OpenSim.Region.ClientStack.dll" />
35 <include name="../../../bin/OpenSim.Region.Communications.Local.dll" />
36 <include name="../../../bin/OpenSim.Region.Communications.OGS1.dll" />
37 <include name="../../../bin/OpenSim.Region.Environment.dll" />
38 <include name="../../../bin/OpenSim.Region.Physics.Manager.dll" />
39 <include name="../../../bin/OpenSim.Region.Terrain.BasicTerrain.dll" />
40 <include name="System.dll" />
41 <include name="System.Xml.dll" />
42 <include name="../../../bin/XMLRPC.dll" />
43 </references>
44 </csc>
45 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
46 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
47 <copy todir="${project::get-base-directory()}/../../../bin/">
48 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
49 <include name="*.dll"/>
50 <include name="*.exe"/>
51 </fileset>
52 </copy>
53 </target>
54 <target name="clean">
55 <delete dir="${bin.dir}" failonerror="false" />
56 <delete dir="${obj.dir}" failonerror="false" />
57 </target>
58 <target name="doc" description="Creates documentation.">
59 </target>
60</project>
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
new file mode 100644
index 0000000..fcb2493
--- /dev/null
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -0,0 +1,485 @@
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
29using System;
30using System.Text;
31using System.IO;
32using System.Threading;
33using System.Net;
34using System.Net.Sockets;
35using System.Timers;
36using System.Reflection;
37using System.Collections;
38using System.Collections.Generic;
39using libsecondlife;
40using libsecondlife.Packets;
41using OpenSim.Region.Environment;
42using OpenSim.Region.Environment.Scenes;
43using OpenSim.Region.Terrain;
44using OpenSim.Framework.Interfaces;
45using OpenSim.Framework.Data;
46
47using OpenSim.Framework.Types;
48using OpenSim.Framework;
49using OpenSim.Assets;
50using OpenSim.Region.Caches;
51using OpenSim.Framework.Console;
52using OpenSim.Physics.Manager;
53using Nwc.XmlRpc;
54using OpenSim.Framework.Servers;
55using OpenSim.GenericConfig;
56using OpenSim.Framework.Communications;
57using OpenSim.Region.Communications.OGS1;
58using OpenSim.Region.Communications.Local;
59
60using OpenSim.Region.ClientStack;
61
62namespace OpenSim
63{
64
65 public class OpenSimMain : RegionApplicationBase, conscmd_callback
66 {
67 protected CommunicationsManager commsManager;
68 // private CheckSumServer checkServer;
69
70 private bool m_silent;
71 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
72
73 public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
74 {
75 this.configFileSetup = useConfigFile;
76 m_sandbox = sandBoxMode;
77 m_loginserver = startLoginServer;
78 m_physicsEngine = physicsEngine;
79 m_config = configFile;
80 m_silent = silent;
81 }
82
83 /// <summary>
84 /// Performs initialisation of the world, such as loading configuration from disk.
85 /// </summary>
86 public override void StartUp()
87 {
88 this.serversData = new NetworkServersInfo();
89
90 this.localConfig = new XmlConfig(m_config);
91 this.localConfig.LoadData();
92
93 if (this.configFileSetup)
94 {
95 this.SetupFromConfigFile(this.localConfig);
96 }
97
98 m_log = new LogBase(m_logFilename, "Region", this, m_silent);
99 OpenSim.Framework.Console.MainLog.Instance = m_log;
100
101 m_log.Verbose( "Main.cs:Startup() - Loading configuration");
102 this.serversData.InitConfig(this.m_sandbox, this.localConfig);
103 this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
104
105 ScenePresence.LoadTextureFile("avatar-texture.dat");
106
107 ClientView.TerrainManager = new TerrainManager(new SecondLife());
108
109 if (m_sandbox)
110 {
111 this.SetupLocalGridServers();
112 // this.checkServer = new CheckSumServer(12036);
113 // this.checkServer.ServerListener();
114 this.commsManager = new CommunicationsLocal(this.serversData);
115 }
116 else
117 {
118 this.SetupRemoteGridServers();
119 this.commsManager = new CommunicationsOGS1(this.serversData);
120 }
121
122 startuptime = DateTime.Now;
123
124 this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
125 this.physManager.LoadPlugins();
126
127 this.SetupHttpListener();
128
129 this.SetupWorld();
130
131 m_log.Verbose( "Main.cs:Startup() - Initialising HTTP server");
132
133
134
135 if (m_sandbox)
136 {
137 httpServer.AddXmlRPCHandler("login_to_simulator", ((CommunicationsLocal)this.commsManager).UserServices.XmlRpcLoginMethod);
138 }
139
140 //Start http server
141 m_log.Verbose( "Main.cs:Startup() - Starting HTTP server");
142 httpServer.Start();
143
144 // Start UDP servers
145 for (int i = 0; i < m_udpServer.Count; i++)
146 {
147 this.m_udpServer[i].ServerListener();
148 }
149
150 }
151
152 # region Setup methods
153 protected override void SetupLocalGridServers()
154 {
155 try
156 {
157 AssetCache = new AssetCache("OpenSim.Region.GridInterfaces.Local.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
158 InventoryCache = new InventoryCache();
159 }
160 catch (Exception e)
161 {
162 m_log.Error( e.Message + "\nSorry, could not setup local cache");
163 Environment.Exit(1);
164 }
165
166 }
167
168 protected override void SetupRemoteGridServers()
169 {
170 try
171 {
172 AssetCache = new AssetCache("OpenSim.Region.GridInterfaces.Remote.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
173 InventoryCache = new InventoryCache();
174 }
175 catch (Exception e)
176 {
177 m_log.Error( e.Message + "\nSorry, could not setup remote cache");
178 Environment.Exit(1);
179 }
180 }
181
182 protected override void SetupWorld()
183 {
184 IGenericConfig regionConfig;
185 Scene LocalWorld;
186 UDPServer udpServer;
187 RegionInfo regionDat = new RegionInfo();
188 AuthenticateSessionsBase authenBase;
189
190 string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
191 string[] configFiles = Directory.GetFiles(path, "*.xml");
192
193 if (configFiles.Length == 0)
194 {
195 string path2 = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
196 string path3 = Path.Combine(path2, "default.xml");
197 Console.WriteLine("Creating default region config file");
198 //TODO create default region
199 IGenericConfig defaultConfig = new XmlConfig(path3);
200 defaultConfig.LoadData();
201 defaultConfig.Commit();
202 defaultConfig.Close();
203 defaultConfig = null;
204 configFiles = Directory.GetFiles(path, "*.xml");
205 }
206
207 for (int i = 0; i < configFiles.Length; i++)
208 {
209 regionDat = new RegionInfo();
210 if (m_sandbox)
211 {
212 AuthenticateSessionsBase authen = new AuthenticateSessionsBase(); // new AuthenticateSessionsLocal();
213 this.AuthenticateSessionsHandler.Add(authen);
214 authenBase = authen;
215 }
216 else
217 {
218 AuthenticateSessionsBase authen = new AuthenticateSessionsBase(); //new AuthenticateSessionsRemote();
219 this.AuthenticateSessionsHandler.Add(authen);
220 authenBase = authen;
221 }
222 Console.WriteLine("Loading region config file");
223 regionConfig = new XmlConfig(configFiles[i]);
224 regionConfig.LoadData();
225 regionDat.InitConfig(this.m_sandbox, regionConfig);
226 regionConfig.Close();
227
228 udpServer = new UDPServer(regionDat.CommsIPListenPort, this.AssetCache, this.InventoryCache, this.m_log, authenBase);
229
230 m_udpServer.Add(udpServer);
231 this.regionData.Add(regionDat);
232
233 /*
234 m_log.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
235 m_log.Verbose( "Initialising world");
236 m_log.componentname = "Region " + regionData.RegionName;
237 */
238
239 LocalWorld = new Scene(udpServer.PacketServer.ClientAPIs, regionDat, authenBase, commsManager, this.AssetCache, httpServer);
240 this.m_localWorld.Add(LocalWorld);
241 //LocalWorld.InventoryCache = InventoryCache;
242 //LocalWorld.AssetCache = AssetCache;
243
244 udpServer.LocalWorld = LocalWorld;
245
246 LocalWorld.LoadStorageDLL("OpenSim.Region.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
247 LocalWorld.LoadWorldMap();
248
249 m_log.Verbose( "Main.cs:Startup() - Starting up messaging system");
250 LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
251 LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
252 LocalWorld.LoadPrimsFromStorage();
253
254 //Master Avatar Setup
255 UserProfileData masterAvatar = commsManager.UserServer.SetupMasterUser(LocalWorld.RegionInfo.MasterAvatarFirstName, LocalWorld.RegionInfo.MasterAvatarLastName, LocalWorld.RegionInfo.MasterAvatarSandboxPassword);
256 if (masterAvatar != null)
257 {
258 LocalWorld.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
259 LocalWorld.localStorage.LoadParcels((ILocalStorageParcelReceiver)LocalWorld.parcelManager);
260 }
261
262
263 LocalWorld.StartTimer();
264 }
265 }
266
267 protected override void SetupHttpListener()
268 {
269 httpServer = new BaseHttpServer(this.serversData.HttpListenerPort); //regionData[0].IPListenPort);
270
271 if (!this.m_sandbox)
272 {
273
274 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
275
276
277 httpServer.AddRestHandler("GET", "/simstatus/",
278 delegate(string request, string path, string param)
279 {
280 return "OK";
281 });
282 }
283 }
284
285 protected override void ConnectToRemoteGridServer()
286 {
287
288 }
289
290 #endregion
291
292 private void SetupFromConfigFile(IGenericConfig configData)
293 {
294 // Log filename
295 string attri = "";
296 attri = configData.GetAttribute("LogFilename");
297 if (String.IsNullOrEmpty(attri))
298 {
299 }
300 else
301 {
302 m_logFilename = attri;
303 }
304
305 // SandBoxMode
306 attri = "";
307 attri = configData.GetAttribute("SandBox");
308 if ((attri == "") || ((attri != "false") && (attri != "true")))
309 {
310 this.m_sandbox = false;
311 configData.SetAttribute("SandBox", "false");
312 }
313 else
314 {
315 this.m_sandbox = Convert.ToBoolean(attri);
316 }
317
318 // LoginServer
319 attri = "";
320 attri = configData.GetAttribute("LoginServer");
321 if ((attri == "") || ((attri != "false") && (attri != "true")))
322 {
323 this.m_loginserver = false;
324 configData.SetAttribute("LoginServer", "false");
325 }
326 else
327 {
328 this.m_loginserver = Convert.ToBoolean(attri);
329 }
330
331 // Sandbox User accounts
332 attri = "";
333 attri = configData.GetAttribute("UserAccount");
334 if ((attri == "") || ((attri != "false") && (attri != "true")))
335 {
336 this.user_accounts = false;
337 configData.SetAttribute("UserAccounts", "false");
338 }
339 else if (attri == "true")
340 {
341 this.user_accounts = Convert.ToBoolean(attri);
342 }
343
344 // Grid mode hack to use local asset server
345 attri = "";
346 attri = configData.GetAttribute("LocalAssets");
347 if ((attri == "") || ((attri != "false") && (attri != "true")))
348 {
349 this.gridLocalAsset = false;
350 configData.SetAttribute("LocalAssets", "false");
351 }
352 else if (attri == "true")
353 {
354 this.gridLocalAsset = Convert.ToBoolean(attri);
355 }
356
357
358 attri = "";
359 attri = configData.GetAttribute("PhysicsEngine");
360 switch (attri)
361 {
362 default:
363 m_log.Warn( "Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
364 Environment.Exit(1);
365 break;
366
367 case "":
368 this.m_physicsEngine = "basicphysics";
369 configData.SetAttribute("PhysicsEngine", "basicphysics");
370 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = false;
371 break;
372
373 case "basicphysics":
374 this.m_physicsEngine = "basicphysics";
375 configData.SetAttribute("PhysicsEngine", "basicphysics");
376 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = false;
377 break;
378
379 case "RealPhysX":
380 this.m_physicsEngine = "RealPhysX";
381 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = true;
382 break;
383
384 case "OpenDynamicsEngine":
385 this.m_physicsEngine = "OpenDynamicsEngine";
386 OpenSim.Region.Environment.Scenes.ScenePresence.PhysicsEngineFlying = true;
387 break;
388 }
389
390 configData.Commit();
391
392 }
393
394 /// <summary>
395 /// Performs any last-minute sanity checking and shuts down the region server
396 /// </summary>
397 public virtual void Shutdown()
398 {
399 m_log.Verbose( "Main.cs:Shutdown() - Closing all threads");
400 m_log.Verbose( "Main.cs:Shutdown() - Killing listener thread");
401 m_log.Verbose( "Main.cs:Shutdown() - Killing clients");
402 // IMPLEMENT THIS
403 m_log.Verbose( "Main.cs:Shutdown() - Closing console and terminating");
404 for (int i = 0; i < m_localWorld.Count; i++)
405 {
406 ((Scene)m_localWorld[i]).Close();
407 }
408 m_log.Close();
409 Environment.Exit(0);
410 }
411
412 #region Console Commands
413 /// <summary>
414 /// Runs commands issued by the server console from the operator
415 /// </summary>
416 /// <param name="command">The first argument of the parameter (the command)</param>
417 /// <param name="cmdparams">Additional arguments passed to the command</param>
418 public void RunCmd(string command, string[] cmdparams)
419 {
420 switch (command)
421 {
422 case "help":
423 m_log.Error( "show users - show info about connected users");
424 m_log.Error( "shutdown - disconnect all clients and shutdown");
425 break;
426
427 case "show":
428 if (cmdparams.Length > 0)
429 {
430 Show(cmdparams[0]);
431 }
432 break;
433
434 case "terrain":
435 string result = "";
436 for (int i = 0; i < m_localWorld.Count; i++)
437 {
438 if (!((Scene)m_localWorld[i]).Terrain.RunTerrainCmd(cmdparams, ref result))
439 {
440 m_log.Error(result);
441 }
442 }
443 break;
444
445 case "shutdown":
446 Shutdown();
447 break;
448
449 default:
450 m_log.Error( "Unknown command");
451 break;
452 }
453 }
454
455 /// <summary>
456 /// Outputs to the console information about the region
457 /// </summary>
458 /// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>
459 public void Show(string ShowWhat)
460 {
461 switch (ShowWhat)
462 {
463 case "uptime":
464 m_log.Error( "OpenSim has been running since " + startuptime.ToString());
465 m_log.Error( "That is " + (DateTime.Now - startuptime).ToString());
466 break;
467 case "users":
468 OpenSim.Region.Environment.Scenes.ScenePresence TempAv;
469 m_log.Error( String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
470 /* foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
471 {
472 if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
473 {
474 TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
475 m_log.Error( String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
476 }
477 }*/
478 break;
479 }
480 }
481 #endregion
482 }
483
484
485} \ No newline at end of file
diff --git a/OpenSim/Region/Application/VersionInfo.cs b/OpenSim/Region/Application/VersionInfo.cs
new file mode 100644
index 0000000..5d1354e
--- /dev/null
+++ b/OpenSim/Region/Application/VersionInfo.cs
@@ -0,0 +1,38 @@
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*/
28using System;
29
30namespace OpenSim
31{
32 /// <summary>
33 /// </summary>
34 public class VersionInfo
35 {
36 public static string Version = "0.3, SVN build ";
37 }
38}