aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorgareth2007-04-02 02:11:51 +0000
committergareth2007-04-02 02:11:51 +0000
commit843f547684ef8a084e336361a440b72090370dd1 (patch)
treeb468bc22188c1cbed2be9c0124d6995efae8b8f9
parentditto (diff)
downloadopensim-SC_OLD-843f547684ef8a084e336361a440b72090370dd1.zip
opensim-SC_OLD-843f547684ef8a084e336361a440b72090370dd1.tar.gz
opensim-SC_OLD-843f547684ef8a084e336361a440b72090370dd1.tar.bz2
opensim-SC_OLD-843f547684ef8a084e336361a440b72090370dd1.tar.xz
Moved grid configuration to Db4o database
-rw-r--r--OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs148
-rw-r--r--OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj111
-rw-r--r--OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build46
-rw-r--r--OpenGridServices.GridServer/Main.cs50
-rw-r--r--OpenGridServices.GridServer/OpenGridServices.GridServer.csproj4
-rw-r--r--OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build1
-rw-r--r--OpenSim.Framework/OpenSim.Framework.csproj3
-rw-r--r--OpenSim.Framework/OpenSim.Framework.dll.build1
-rw-r--r--OpenSim.build3
-rw-r--r--OpenSim.sln10
-rw-r--r--prebuild.xml27
11 files changed, 282 insertions, 122 deletions
diff --git a/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs b/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs
index 250f3fd..f3ad2cb 100644
--- a/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs
+++ b/OpenGrid.Config/GridConfigDb4o/DbGridConfig.cs
@@ -26,70 +26,58 @@
26*/ 26*/
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using OpenSim; 29using OpenSim.Framework.Console;
30using OpenSim.Framework.Utilities;
31using OpenSim.Framework.Interfaces; 30using OpenSim.Framework.Interfaces;
32using OpenSim.Framework.Terrain;
33//using OpenSim.world;
34using Db4objects.Db4o; 31using Db4objects.Db4o;
35 32
36namespace OpenSim.Config.SimConfigDb4o 33namespace OpenGrid.Config.GridConfigDb4o
37{ 34{
38 public class Db40ConfigPlugin: ISimConfig 35 public class Db40ConfigPlugin: IGridConfig
39 { 36 {
40 public SimConfig GetConfigObject() 37 public GridConfig GetConfigObject()
41 { 38 {
42 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Loading Db40Config dll"); 39 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Loading Db40Config dll");
43 return ( new DbSimConfig()); 40 return ( new DbGridConfig());
44 } 41 }
45 } 42 }
46 43
47 public class DbSimConfig : SimConfig 44 public class DbGridConfig : GridConfig
48 { 45 {
49 private bool isSandbox;
50 private IObjectContainer db; 46 private IObjectContainer db;
51 47
52 public void LoadDefaults() { 48 public void LoadDefaults() {
53 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings"); 49 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
54 50
55 this.RegionName=OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Name [OpenSim test]: ","OpenSim test"); 51 this.GridOwner = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid owner [OGS development team]: ", "OGS development team");
56 this.RegionLocX=(uint)Convert.ToInt32(OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X [997]: ","997")); 52
57 this.RegionLocY=(uint)Convert.ToInt32(OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y [996]: ","996")); 53 this.DefaultAssetServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default asset server [no default]: ");
58 this.IPListenPort=Convert.ToInt32(OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("UDP port for client connections [9000]: ","9000")); 54 this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server: ");
59 this.IPListenAddr=OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections [127.0.0.1]: ","127.0.0.1"); 55 this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server: ");
60 56
61 if(!isSandbox) 57 this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server [no default]: ");
62 { 58 this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server: ");
63 this.AssetURL=OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL: "); 59 this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server: ");
64 this.AssetSendKey=OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server key: "); 60
65 this.GridURL=OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL: "); 61 this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims: ");
66 this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server: "); 62 this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims: ");
67 this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server: ");
68 this.UserURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("User server URL: ");
69 this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server: ");
70 this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server: ");
71 }
72 this.RegionHandle = Util.UIntsToLong((RegionLocX*256), (RegionLocY*256));
73 } 63 }
74 64
75 public override void InitConfig(bool sandboxMode) { 65 public override void InitConfig() {
76 this.isSandbox = sandboxMode;
77 try { 66 try {
78 db = Db4oFactory.OpenFile("opensim.yap"); 67 db = Db4oFactory.OpenFile("opengrid.yap");
79 IObjectSet result = db.Get(typeof(DbSimConfig)); 68 IObjectSet result = db.Get(typeof(DbGridConfig));
80 if(result.Count==1) { 69 if(result.Count==1) {
81 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Found a SimConfig object in the local database, loading"); 70 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Found a GridConfig object in the local database, loading");
82 foreach (DbSimConfig cfg in result) { 71 foreach (DbGridConfig cfg in result) {
83 this.RegionName = cfg.RegionName; 72 this.GridOwner=cfg.GridOwner;
84 this.RegionLocX = cfg.RegionLocX; 73 this.DefaultAssetServer=cfg.DefaultAssetServer;
85 this.RegionLocY = cfg.RegionLocY; 74 this.AssetSendKey=cfg.AssetSendKey;
86 this.RegionHandle = Util.UIntsToLong((RegionLocX*256), (RegionLocY*256)); 75 this.AssetRecvKey=cfg.AssetRecvKey;
87 this.IPListenPort = cfg.IPListenPort; 76 this.DefaultUserServer=cfg.DefaultUserServer;
88 this.IPListenAddr = cfg.IPListenAddr; 77 this.UserSendKey=cfg.UserSendKey;
89 this.AssetURL = cfg.AssetURL; 78 this.UserRecvKey=cfg.UserRecvKey;
90 this.AssetSendKey = cfg.AssetSendKey; 79 this.SimSendKey=cfg.SimSendKey;
91 this.GridURL = cfg.GridURL; 80 this.SimRecvKey=cfg.SimRecvKey;
92 this.GridSendKey = cfg.GridSendKey;
93 } 81 }
94 } else { 82 } else {
95 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults"); 83 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
@@ -103,70 +91,18 @@ namespace OpenSim.Config.SimConfigDb4o
103 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString()); 91 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString());
104 } 92 }
105 93
106 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sim settings loaded:"); 94 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid settings loaded:");
107 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Name: " + this.RegionName); 95 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid owner: " + this.GridOwner);
108 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]"); 96 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Default asset server: " + this.DefaultAssetServer);
109 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Region Handle: " + this.RegionHandle.ToString()); 97 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to send to asset server: " + this.AssetSendKey);
110 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort); 98 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to expect from asset server: " + this.AssetRecvKey);
111 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Sandbox Mode? " + isSandbox.ToString()); 99 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Default user server: " + this.DefaultUserServer);
112 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Asset URL: " + this.AssetURL); 100 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to send to user server: " + this.UserSendKey);
113 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Asset key: " + this.AssetSendKey); 101 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to expect from user server: " + this.UserRecvKey);
114 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid URL: " + this.GridURL); 102 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to send to sims: " + this.SimSendKey);
115 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Grid key: " + this.GridSendKey); 103 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Key to expect from sims: " + this.SimRecvKey);
116 } 104 }
117 105
118 public override float[] LoadWorld()
119 {
120 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Loading world....");
121 //World blank = new World();
122 float[] heightmap = null;
123 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Looking for a heightmap in local DB");
124 IObjectSet world_result = db.Get(typeof(MapStorage));
125 if(world_result.Count>0) {
126 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Found a heightmap in local database, loading");
127 MapStorage map=(MapStorage)world_result.Next();
128 //blank.LandMap = map.Map;
129 heightmap = map.Map;
130 } else {
131 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - No heightmap found, generating new one");
132 HeightmapGenHills hills = new HeightmapGenHills();
133 // blank.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
134 heightmap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
135 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - Saving heightmap to local database");
136 MapStorage map= new MapStorage();
137 map.Map = heightmap; //blank.LandMap;
138 db.Set(map);
139 db.Commit();
140 }
141 return heightmap;
142 }
143
144 public override void SaveMap(float[] heightmap)
145 {
146 IObjectSet world_result = db.Get(typeof(MapStorage));
147 if(world_result.Count>0) {
148 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - updating saved copy of heightmap in local database");
149 MapStorage map=(MapStorage)world_result.Next();
150 db.Delete(map);
151 }
152 MapStorage map1= new MapStorage();
153 map1.Map = heightmap; //OpenSim_Main.local_world.LandMap;
154 db.Set(map1);
155 db.Commit();
156 }
157
158 public override void LoadFromGrid() {
159 OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!");
160 // TODO: Make this crap work
161 /* WebRequest GridLogin = WebRequest.Create(this.GridURL + "regions/" + this.RegionHandle.ToString() + "/login");
162 WebResponse GridResponse = GridLogin.GetResponse();
163 byte[] idata = new byte[(int)GridResponse.ContentLength];
164 BinaryReader br = new BinaryReader(GridResponse.GetResponseStream());
165
166 br.Close();
167 GridResponse.Close();
168 */
169 }
170 106
171 public void Shutdown() { 107 public void Shutdown() {
172 db.Close(); 108 db.Close();
diff --git a/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj
new file mode 100644
index 0000000..ecad2a2
--- /dev/null
+++ b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj
@@ -0,0 +1,111 @@
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>{0E19DF8F-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>OpenGrid.Config.GridConfigDb4o</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenGrid.Config.GridConfigDb4o</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>False</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>True</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)' == 'Debug|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE;DEBUG</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>True</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>False</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="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Data.dll" >
66 <HintPath>..\..\bin\System.Data.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 <Reference Include="System.Xml" >
70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private>
72 </Reference>
73 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" >
78 <HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private>
80 </Reference>
81 </ItemGroup>
82 <ItemGroup>
83 <ProjectReference Include="../../OpenSim.Framework/OpenSim.Framework.csproj">
84 <Name>OpenSim.Framework</Name>
85 <Project>{7404933D-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private>
88 </ProjectReference>
89 <ProjectReference Include="../../OpenSim.Framework.Console/OpenSim.Framework.Console.csproj">
90 <Name>OpenSim.Framework.Console</Name>
91 <Project>{16759386-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private>
94 </ProjectReference>
95 </ItemGroup>
96 <ItemGroup>
97 <Compile Include="AssemblyInfo.cs">
98 <SubType>Code</SubType>
99 </Compile>
100 <Compile Include="DbGridConfig.cs">
101 <SubType>Code</SubType>
102 </Compile>
103 </ItemGroup>
104 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
105 <PropertyGroup>
106 <PreBuildEvent>
107 </PreBuildEvent>
108 <PostBuildEvent>
109 </PostBuildEvent>
110 </PropertyGroup>
111</Project>
diff --git a/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
new file mode 100644
index 0000000..73e09ce
--- /dev/null
+++ b/OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build
@@ -0,0 +1,46 @@
1<?xml version="1.0" ?>
2<project name="OpenGrid.Config.GridConfigDb4o" 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="library" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenGrid.Config.GridConfigDb4o" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="AssemblyInfo.cs" />
15 <include name="DbGridConfig.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="System.dll" />
23 <include name="System.Data.dll.dll" />
24 <include name="System.Xml.dll" />
25 <include name="../../bin/libsecondlife.dll" />
26 <include name="../../bin/Db4objects.Db4o.dll" />
27 <include name="../../bin/OpenSim.Framework.dll" />
28 <include name="../../bin/OpenSim.Framework.Console.dll" />
29 </references>
30 </csc>
31 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
32 <mkdir dir="${project::get-base-directory()}/../../bin/"/>
33 <copy todir="${project::get-base-directory()}/../../bin/">
34 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
35 <include name="*.dll"/>
36 <include name="*.exe"/>
37 </fileset>
38 </copy>
39 </target>
40 <target name="clean">
41 <delete dir="${bin.dir}" failonerror="false" />
42 <delete dir="${obj.dir}" failonerror="false" />
43 </target>
44 <target name="doc" description="Creates documentation.">
45 </target>
46</project>
diff --git a/OpenGridServices.GridServer/Main.cs b/OpenGridServices.GridServer/Main.cs
index ce24d72..5b7f921 100644
--- a/OpenGridServices.GridServer/Main.cs
+++ b/OpenGridServices.GridServer/Main.cs
@@ -32,10 +32,12 @@ using System.IO;
32using System.Text; 32using System.Text;
33using System.Timers; 33using System.Timers;
34using System.Net; 34using System.Net;
35using System.Reflection;
35using libsecondlife; 36using libsecondlife;
36using OpenSim.Framework; 37using OpenSim.Framework;
37using OpenSim.Framework.Sims; 38using OpenSim.Framework.Sims;
38using OpenSim.Framework.Console; 39using OpenSim.Framework.Console;
40using OpenSim.Framework.Interfaces;
39 41
40namespace OpenGridServices.GridServer 42namespace OpenGridServices.GridServer
41{ 43{
@@ -43,6 +45,8 @@ namespace OpenGridServices.GridServer
43 /// </summary> 45 /// </summary>
44 public class OpenGrid_Main : conscmd_callback 46 public class OpenGrid_Main : conscmd_callback
45 { 47 {
48 private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll";
49 private GridConfig Cfg;
46 public static OpenGrid_Main thegrid; 50 public static OpenGrid_Main thegrid;
47 public string GridOwner; 51 public string GridOwner;
48 public string DefaultStartupMsg; 52 public string DefaultStartupMsg;
@@ -91,22 +95,10 @@ namespace OpenGridServices.GridServer
91 95
92 public void Startup() 96 public void Startup()
93 { 97 {
94 m_console.WriteLine("Main.cs:Startup() - Please press enter to retain default settings"); 98 m_console.WriteLine("Main.cs:Startup() - Loading configuration");
99 Cfg = this.LoadConfigDll(this.ConfigDll);
100 Cfg.InitConfig();
95 101
96 this.GridOwner = m_console.CmdPrompt("Grid owner [OGS development team]: ", "OGS development team");
97 this.DefaultStartupMsg = m_console.CmdPrompt("Default startup message for clients [Welcome to OGS!]: ", "Welcome to OGS!");
98
99 this.DefaultAssetServer = m_console.CmdPrompt("Default asset server [no default]: ");
100 this.AssetSendKey = m_console.CmdPrompt("Key to send to asset server: ");
101 this.AssetRecvKey = m_console.CmdPrompt("Key to expect from asset server: ");
102
103 this.DefaultUserServer = m_console.CmdPrompt("Default user server [no default]: ");
104 this.UserSendKey = m_console.CmdPrompt("Key to send to user server: ");
105 this.UserRecvKey = m_console.CmdPrompt("Key to expect from user server: ");
106
107 this.SimSendKey = m_console.CmdPrompt("Key to send to sims: ");
108 this.SimRecvKey = m_console.CmdPrompt("Key to expect from sims: ");
109
110 m_console.WriteLine("Main.cs:Startup() - Loading sim profiles from database"); 102 m_console.WriteLine("Main.cs:Startup() - Loading sim profiles from database");
111 this._regionmanager = new SimProfileManager(); 103 this._regionmanager = new SimProfileManager();
112 _regionmanager.LoadProfiles(); 104 _regionmanager.LoadProfiles();
@@ -121,6 +113,34 @@ namespace OpenGridServices.GridServer
121 SimCheckTimer.Enabled=true; 113 SimCheckTimer.Enabled=true;
122 } 114 }
123 115
116 private GridConfig LoadConfigDll(string dllName)
117 {
118 Assembly pluginAssembly = Assembly.LoadFrom(dllName);
119 GridConfig config = null;
120
121 foreach (Type pluginType in pluginAssembly.GetTypes())
122 {
123 if (pluginType.IsPublic)
124 {
125 if (!pluginType.IsAbstract)
126 {
127 Type typeInterface = pluginType.GetInterface("IGridConfig", true);
128
129 if (typeInterface != null)
130 {
131 IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
132 config = plug.GetConfigObject();
133 break;
134 }
135
136 typeInterface = null;
137 }
138 }
139 }
140 pluginAssembly = null;
141 return config;
142 }
143
124 public void CheckSims(object sender, ElapsedEventArgs e) { 144 public void CheckSims(object sender, ElapsedEventArgs e) {
125 foreach(SimProfileBase sim in _regionmanager.SimProfiles.Values) { 145 foreach(SimProfileBase sim in _regionmanager.SimProfiles.Values) {
126 string SimResponse=""; 146 string SimResponse="";
diff --git a/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj b/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj
index 12b4933..6d1614b 100644
--- a/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj
+++ b/OpenGridServices.GridServer/OpenGridServices.GridServer.csproj
@@ -70,6 +70,10 @@
70 <HintPath>System.Xml.dll</HintPath> 70 <HintPath>System.Xml.dll</HintPath>
71 <Private>False</Private> 71 <Private>False</Private>
72 </Reference> 72 </Reference>
73 <Reference Include="OpenSim.Framework.Interfaces" >
74 <HintPath>OpenSim.Framework.Interfaces.dll</HintPath>
75 <Private>False</Private>
76 </Reference>
73 <Reference Include="libsecondlife.dll" > 77 <Reference Include="libsecondlife.dll" >
74 <HintPath>..\bin\libsecondlife.dll</HintPath> 78 <HintPath>..\bin\libsecondlife.dll</HintPath>
75 <Private>False</Private> 79 <Private>False</Private>
diff --git a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
index 111e2f7..814ceea 100644
--- a/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
+++ b/OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build
@@ -25,6 +25,7 @@
25 <include name="System.Data.dll" /> 25 <include name="System.Data.dll" />
26 <include name="System.Xml.dll" /> 26 <include name="System.Xml.dll" />
27 <include name="../bin/OpenSim.Framework.dll" /> 27 <include name="../bin/OpenSim.Framework.dll" />
28 <include name="OpenSim.Framework.Interfaces.dll" />
28 <include name="../bin/OpenSim.Framework.Console.dll" /> 29 <include name="../bin/OpenSim.Framework.Console.dll" />
29 <include name="../bin/libsecondlife.dll" /> 30 <include name="../bin/libsecondlife.dll" />
30 <include name="../bin/Db4objects.Db4o.dll" /> 31 <include name="../bin/Db4objects.Db4o.dll" />
diff --git a/OpenSim.Framework/OpenSim.Framework.csproj b/OpenSim.Framework/OpenSim.Framework.csproj
index 2e2d16c..55974fa 100644
--- a/OpenSim.Framework/OpenSim.Framework.csproj
+++ b/OpenSim.Framework/OpenSim.Framework.csproj
@@ -95,6 +95,9 @@
95 <Compile Include="IConfig.cs"> 95 <Compile Include="IConfig.cs">
96 <SubType>Code</SubType> 96 <SubType>Code</SubType>
97 </Compile> 97 </Compile>
98 <Compile Include="IGridConfig.cs">
99 <SubType>Code</SubType>
100 </Compile>
98 <Compile Include="IGridServer.cs"> 101 <Compile Include="IGridServer.cs">
99 <SubType>Code</SubType> 102 <SubType>Code</SubType>
100 </Compile> 103 </Compile>
diff --git a/OpenSim.Framework/OpenSim.Framework.dll.build b/OpenSim.Framework/OpenSim.Framework.dll.build
index a5ec58c..8647ef9 100644
--- a/OpenSim.Framework/OpenSim.Framework.dll.build
+++ b/OpenSim.Framework/OpenSim.Framework.dll.build
@@ -18,6 +18,7 @@
18 <include name="HeightMapGenHills.cs" /> 18 <include name="HeightMapGenHills.cs" />
19 <include name="IAssetServer.cs" /> 19 <include name="IAssetServer.cs" />
20 <include name="IConfig.cs" /> 20 <include name="IConfig.cs" />
21 <include name="IGridConfig.cs" />
21 <include name="IGridServer.cs" /> 22 <include name="IGridServer.cs" />
22 <include name="ILocalStorage.cs" /> 23 <include name="ILocalStorage.cs" />
23 <include name="IUserServer.cs" /> 24 <include name="IUserServer.cs" />
diff --git a/OpenSim.build b/OpenSim.build
index 6195d2d..f875569 100644
--- a/OpenSim.build
+++ b/OpenSim.build
@@ -58,6 +58,7 @@
58 <nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="clean" /> 58 <nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="clean" />
59 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="clean" /> 59 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="clean" />
60 <nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="clean" /> 60 <nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="clean" />
61 <nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="clean" />
61 <nant buildfile="OpenSim/OpenSim.exe.build" target="clean" /> 62 <nant buildfile="OpenSim/OpenSim.exe.build" target="clean" />
62 <nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="clean" /> 63 <nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="clean" />
63 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="clean" /> 64 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="clean" />
@@ -72,6 +73,7 @@
72 <nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="build" /> 73 <nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="build" />
73 <nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="build" /> 74 <nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="build" />
74 <nant buildfile="OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build" target="build" /> 75 <nant buildfile="OpenSim.Config/SimConfigDb4o/OpenSim.Config.SimConfigDb4o.dll.build" target="build" />
76 <nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="build" />
75 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="build" /> 77 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="build" />
76 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="build" /> 78 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="build" />
77 <nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="build" /> 79 <nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="build" />
@@ -102,6 +104,7 @@
102 <nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="doc" /> 104 <nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="doc" />
103 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="doc" /> 105 <nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="doc" />
104 <nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="doc" /> 106 <nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="doc" />
107 <nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="doc" />
105 <nant buildfile="OpenSim/OpenSim.exe.build" target="doc" /> 108 <nant buildfile="OpenSim/OpenSim.exe.build" target="doc" />
106 <nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="doc" /> 109 <nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="doc" />
107 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="doc" /> 110 <nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="doc" />
diff --git a/OpenSim.sln b/OpenSim.sln
index 184ca2e..8e11d6d 100644
--- a/OpenSim.sln
+++ b/OpenSim.sln
@@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.GridInterfaces.Loca
24EndProject 24EndProject
25Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj", "{B771F391-0000-0000-0000-000000000000}" 25Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Physics.PhysXPlugin", "OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.csproj", "{B771F391-0000-0000-0000-000000000000}"
26EndProject 26EndProject
27Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenGrid.Config.GridConfigDb4o", "OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.csproj", "{0E19DF8F-0000-0000-0000-000000000000}"
28EndProject
27Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim/OpenSim.csproj", "{17ED9A0D-0000-0000-0000-000000000000}" 29Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim", "OpenSim/OpenSim.csproj", "{17ED9A0D-0000-0000-0000-000000000000}"
28EndProject 30EndProject
29Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageDb4o", "OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj", "{4D4E187D-0000-0000-0000-000000000000}" 31Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageDb4o", "OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj", "{4D4E187D-0000-0000-0000-000000000000}"
@@ -51,10 +53,12 @@ Global
51 ({890187AE-0000-0000-0000-000000000000}).3 = ({7404933D-0000-0000-0000-000000000000}) 53 ({890187AE-0000-0000-0000-000000000000}).3 = ({7404933D-0000-0000-0000-000000000000})
52 ({890187AE-0000-0000-0000-000000000000}).4 = ({16759386-0000-0000-0000-000000000000}) 54 ({890187AE-0000-0000-0000-000000000000}).4 = ({16759386-0000-0000-0000-000000000000})
53 ({53A65EE9-0000-0000-0000-000000000000}).3 = ({7404933D-0000-0000-0000-000000000000}) 55 ({53A65EE9-0000-0000-0000-000000000000}).3 = ({7404933D-0000-0000-0000-000000000000})
54 ({53A65EE9-0000-0000-0000-000000000000}).4 = ({16759386-0000-0000-0000-000000000000}) 56 ({53A65EE9-0000-0000-0000-000000000000}).5 = ({16759386-0000-0000-0000-000000000000})
55 ({A86B5F7E-0000-0000-0000-000000000000}).4 = ({7404933D-0000-0000-0000-000000000000}) 57 ({A86B5F7E-0000-0000-0000-000000000000}).4 = ({7404933D-0000-0000-0000-000000000000})
56 ({A86B5F7E-0000-0000-0000-000000000000}).5 = ({16759386-0000-0000-0000-000000000000}) 58 ({A86B5F7E-0000-0000-0000-000000000000}).5 = ({16759386-0000-0000-0000-000000000000})
57 ({B771F391-0000-0000-0000-000000000000}).3 = ({DA1FDCE5-0000-0000-0000-000000000000}) 59 ({B771F391-0000-0000-0000-000000000000}).3 = ({DA1FDCE5-0000-0000-0000-000000000000})
60 ({0E19DF8F-0000-0000-0000-000000000000}).5 = ({7404933D-0000-0000-0000-000000000000})
61 ({0E19DF8F-0000-0000-0000-000000000000}).6 = ({16759386-0000-0000-0000-000000000000})
58 ({17ED9A0D-0000-0000-0000-000000000000}).5 = ({7404933D-0000-0000-0000-000000000000}) 62 ({17ED9A0D-0000-0000-0000-000000000000}).5 = ({7404933D-0000-0000-0000-000000000000})
59 ({17ED9A0D-0000-0000-0000-000000000000}).6 = ({16759386-0000-0000-0000-000000000000}) 63 ({17ED9A0D-0000-0000-0000-000000000000}).6 = ({16759386-0000-0000-0000-000000000000})
60 ({17ED9A0D-0000-0000-0000-000000000000}).7 = ({DA1FDCE5-0000-0000-0000-000000000000}) 64 ({17ED9A0D-0000-0000-0000-000000000000}).7 = ({DA1FDCE5-0000-0000-0000-000000000000})
@@ -114,6 +118,10 @@ Global
114 {B771F391-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU 118 {B771F391-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
115 {B771F391-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 119 {B771F391-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
116 {B771F391-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU 120 {B771F391-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
121 {0E19DF8F-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
122 {0E19DF8F-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
123 {0E19DF8F-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
124 {0E19DF8F-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
117 {17ED9A0D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU 125 {17ED9A0D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
118 {17ED9A0D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU 126 {17ED9A0D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
119 {17ED9A0D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 127 {17ED9A0D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
diff --git a/prebuild.xml b/prebuild.xml
index 4557159..d1ae31e 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -138,6 +138,7 @@
138 <Reference name="System.Data" localCopy="false"/> 138 <Reference name="System.Data" localCopy="false"/>
139 <Reference name="System.Xml" localCopy="false"/> 139 <Reference name="System.Xml" localCopy="false"/>
140 <Reference name="OpenSim.Framework"/> 140 <Reference name="OpenSim.Framework"/>
141 <Reference name="OpenSim.Framework.Interfaces"/>
141 <Reference name="OpenSim.Framework.Console"/> 142 <Reference name="OpenSim.Framework.Console"/>
142 <Reference name="libsecondlife.dll"/> 143 <Reference name="libsecondlife.dll"/>
143 <Reference name="Db4objects.Db4o.dll"/> 144 <Reference name="Db4objects.Db4o.dll"/>
@@ -222,6 +223,32 @@
222 </Files> 223 </Files>
223 </Project> 224 </Project>
224 225
226 <Project name="OpenGrid.Config.GridConfigDb4o" path="OpenGrid.Config/GridConfigDb4o" type="Library">
227 <Configuration name="Debug">
228 <Options>
229 <OutputPath>../../bin/</OutputPath>
230 </Options>
231 </Configuration>
232 <Configuration name="Release">
233 <Options>
234 <OutputPath>../../bin/</OutputPath>
235 </Options>
236 </Configuration>
237
238 <ReferencePath>../../bin/</ReferencePath>
239 <Reference name="System" localCopy="false"/>
240 <Reference name="System.Data.dll"/>
241 <Reference name="System.Xml"/>
242 <Reference name="libsecondlife.dll"/>
243 <Reference name="Db4objects.Db4o.dll"/>
244 <Reference name="OpenSim.Framework"/>
245 <Reference name="OpenSim.Framework.Console"/>
246 <Files>
247 <Match pattern="*.cs" recurse="true"/>
248 </Files>
249 </Project>
250
251
225 <!-- Grid Server Plug-ins --> 252 <!-- Grid Server Plug-ins -->
226 <Project name="OpenSim.GridInterfaces.Local" path="OpenSim.GridInterfaces/Local" type="Library"> 253 <Project name="OpenSim.GridInterfaces.Local" path="OpenSim.GridInterfaces/Local" type="Library">
227 <Configuration name="Debug"> 254 <Configuration name="Debug">