Deleted OpenGridServices folder as the easiest way to reimport the latest version from trunk

Sugilite
MW 2007-06-08 16:49:24 +00:00
parent 6acfd0ddea
commit a8cabbd600
100 changed files with 43 additions and 8833 deletions

View File

@ -1,31 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("GridConfig")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GridConfig")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

View File

@ -1,112 +0,0 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
using System.Collections.Generic;
using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces;
using Db4objects.Db4o;
namespace OpenGrid.Config.GridConfigDb4o
{
public class Db40ConfigPlugin: IGridConfig
{
public GridConfig GetConfigObject()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loading Db40Config dll");
return ( new DbGridConfig());
}
}
public class DbGridConfig : GridConfig
{
private IObjectContainer db;
public void LoadDefaults() {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
this.GridOwner = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid owner", "OGS development team");
this.DefaultAssetServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default asset server","http://127.0.0.1:8003/");
this.AssetSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to asset server","null");
this.AssetRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from asset server","null");
this.DefaultUserServer = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default user server","http://127.0.0.1:8002/");
this.UserSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to user server","null");
this.UserRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from user server","null");
this.SimSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to sims","null");
this.SimRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from sims","null");
}
public override void InitConfig() {
try {
db = Db4oFactory.OpenFile("opengrid.yap");
IObjectSet result = db.Get(typeof(DbGridConfig));
if(result.Count==1) {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Found a GridConfig object in the local database, loading");
foreach (DbGridConfig cfg in result) {
this.GridOwner=cfg.GridOwner;
this.DefaultAssetServer=cfg.DefaultAssetServer;
this.AssetSendKey=cfg.AssetSendKey;
this.AssetRecvKey=cfg.AssetRecvKey;
this.DefaultUserServer=cfg.DefaultUserServer;
this.UserSendKey=cfg.UserSendKey;
this.UserRecvKey=cfg.UserRecvKey;
this.SimSendKey=cfg.SimSendKey;
this.SimRecvKey=cfg.SimRecvKey;
}
} else {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
LoadDefaults();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Writing out default settings to local database");
db.Set(this);
db.Close();
}
} catch(Exception e) {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
}
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid settings loaded:");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid owner: " + this.GridOwner);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default asset server: " + this.DefaultAssetServer);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to asset server: " + this.AssetSendKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from asset server: " + this.AssetRecvKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default user server: " + this.DefaultUserServer);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to user server: " + this.UserSendKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from user server: " + this.UserRecvKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to sims: " + this.SimSendKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from sims: " + this.SimRecvKey);
}
public void Shutdown() {
db.Close();
}
}
}

View File

@ -1,107 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{B0027747-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Config.GridConfigDb4o</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Config.GridConfigDb4o</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.dll" >
<HintPath>..\..\..\bin\System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.Console" >
<HintPath>OpenSim.Framework.Console.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DbGridConfig.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Config.GridConfigDb4o" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Config.GridConfigDb4o" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="AssemblyInfo.cs" />
<include name="DbGridConfig.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll.dll" />
<include name="System.Xml.dll" />
<include name="../../../bin/libsecondlife.dll" />
<include name="../../../bin/Db4objects.Db4o.dll" />
<include name="../../../bin/OpenSim.Framework.dll" />
<include name="../../../bin/OpenSim.Framework.Console.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../../bin/"/>
<copy todir="${project::get-base-directory()}/../../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,83 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
using libsecondlife;
namespace OpenGrid.Framework.Data.DB4o
{
class DB4oGridData : IGridData
{
DB4oGridManager manager;
public void Initialise() {
manager = new DB4oGridManager("gridserver.yap");
}
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
public SimProfileData GetProfileByHandle(ulong handle) {
lock (manager.simProfiles)
{
foreach (LLUUID UUID in manager.simProfiles.Keys)
{
if (manager.simProfiles[UUID].regionHandle == handle)
{
return manager.simProfiles[UUID];
}
}
}
throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")");
}
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
{
lock (manager.simProfiles)
{
if (manager.simProfiles.ContainsKey(uuid))
return manager.simProfiles[uuid];
}
throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + ")");
}
public DataResponse AddProfile(SimProfileData profile)
{
lock (manager.simProfiles)
{
if (manager.AddRow(profile))
{
return DataResponse.RESPONSE_OK;
}
else
{
return DataResponse.RESPONSE_ERROR;
}
}
}
public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) {
if (manager.simProfiles[uuid].regionRecvKey == key)
return true;
return false;
}
public void Close()
{
manager = null;
}
public string getName()
{
return "DB4o Grid Provider";
}
public string getVersion()
{
return "0.1";
}
}
}

View File

@ -1,111 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using Db4objects.Db4o;
using OpenGrid.Framework.Data;
using libsecondlife;
namespace OpenGrid.Framework.Data.DB4o
{
class DB4oGridManager
{
public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
string dbfl;
public DB4oGridManager(string db4odb)
{
dbfl = db4odb;
IObjectContainer database;
database = Db4oFactory.OpenFile(dbfl);
IObjectSet result = database.Get(typeof(SimProfileData));
foreach(SimProfileData row in result) {
simProfiles.Add(row.UUID, row);
}
database.Close();
}
/// <summary>
/// Adds a new profile to the database (Warning: Probably slow.)
/// </summary>
/// <param name="row">The profile to add</param>
/// <returns>Successful?</returns>
public bool AddRow(SimProfileData row)
{
if (simProfiles.ContainsKey(row.UUID))
{
simProfiles[row.UUID] = row;
}
else
{
simProfiles.Add(row.UUID, row);
}
try
{
IObjectContainer database;
database = Db4oFactory.OpenFile(dbfl);
database.Set(row);
database.Close();
return true;
}
catch (Exception e)
{
return false;
}
}
}
class DB4oUserManager
{
public Dictionary<LLUUID, UserProfileData> userProfiles = new Dictionary<LLUUID, UserProfileData>();
string dbfl;
public DB4oUserManager(string db4odb)
{
dbfl = db4odb;
IObjectContainer database;
database = Db4oFactory.OpenFile(dbfl);
IObjectSet result = database.Get(typeof(UserProfileData));
foreach (UserProfileData row in result)
{
userProfiles.Add(row.UUID, row);
}
database.Close();
}
/// <summary>
/// Adds a new profile to the database (Warning: Probably slow.)
/// </summary>
/// <param name="row">The profile to add</param>
/// <returns>Successful?</returns>
public bool AddRow(UserProfileData row)
{
Console.WriteLine("adding profile to database" + row.username);
if (userProfiles.ContainsKey(row.UUID))
{
userProfiles[row.UUID] = row;
}
else
{
userProfiles.Add(row.UUID, row);
}
try
{
IObjectContainer database;
database = Db4oFactory.OpenFile(dbfl);
database.Set(row);
database.Close();
return true;
}
catch (Exception e)
{
return false;
}
}
}
}

View File

@ -1,100 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
using libsecondlife;
namespace OpenGrid.Framework.Data.DB4o
{
public class DB4oUserData : IUserData
{
DB4oUserManager manager;
public void Initialise()
{
manager = new DB4oUserManager("userprofiles.yap");
}
public UserProfileData getUserByUUID(LLUUID uuid)
{
if(manager.userProfiles.ContainsKey(uuid))
return manager.userProfiles[uuid];
return null;
}
public UserProfileData getUserByName(string name)
{
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserProfileData getUserByName(string fname, string lname)
{
foreach (UserProfileData profile in manager.userProfiles.Values)
{
if (profile.username == fname && profile.surname == lname)
return profile;
}
return null;
}
public UserAgentData getAgentByUUID(LLUUID uuid)
{
try
{
return getUserByUUID(uuid).currentAgent;
}
catch (Exception e)
{
return null;
}
}
public UserAgentData getAgentByName(string name)
{
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserAgentData getAgentByName(string fname, string lname)
{
try
{
return getUserByName(fname,lname).currentAgent;
}
catch (Exception e)
{
return null;
}
}
public void addNewUserProfile(UserProfileData user)
{
manager.AddRow(user);
}
public void addNewUserAgent(UserAgentData agent)
{
// Do nothing. yet.
}
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
{
return true;
}
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
{
return true;
}
public string getName()
{
return "DB4o Userdata";
}
public string getVersion()
{
return "0.1";
}
}
}

View File

@ -1,111 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="DB4oGridData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DB4oManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DB4oUserData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Data.DB4o" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Data.DB4o" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="DB4oGridData.cs" />
<include name="DB4oManager.cs" />
<include name="DB4oUserData.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="System.Data.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/Db4objects.Db4o.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Data.DB4o")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Data.DB4o")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("57991e15-79da-41b7-aa06-2e6b49165a63")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,136 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.MSSQL
{
public class SqlGridData : IGridData
{
private MSSqlManager database;
/// <summary>
/// Initialises the Grid Interface
/// </summary>
public void Initialise()
{
database = new MSSqlManager("localhost", "db", "user", "password", "false");
}
/// <summary>
/// Shuts down the grid interface
/// </summary>
public void Close()
{
database.Close();
}
public string getName()
{
return "Sql OpenGridData";
}
public string getVersion()
{
return "0.1";
}
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
/// <summary>
/// Returns a sim profile from it's location
/// </summary>
/// <param name="handle">Region location handle</param>
/// <returns>Sim profile</returns>
public SimProfileData GetProfileByHandle(ulong handle)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["handle"] = handle.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
result.Dispose();
return row;
}
/// <summary>
/// Returns a sim profile from it's UUID
/// </summary>
/// <param name="uuid">The region UUID</param>
/// <returns>The sim profile</returns>
public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
result.Dispose();
return row;
}
public DataResponse AddProfile(SimProfileData profile)
{
if (database.insertRow(profile))
{
return DataResponse.RESPONSE_OK;
}
else
{
return DataResponse.RESPONSE_ERROR;
}
}
/// <summary>
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
/// </summary>
/// <param name="uuid">The UUID of the challenger</param>
/// <param name="handle">The attempted regionHandle of the challenger</param>
/// <param name="authkey">The secret</param>
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
{
bool throwHissyFit = false; // Should be true by 1.0
if (throwHissyFit)
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
SimProfileData data = GetProfileByLLUUID(uuid);
return (handle == data.regionHandle && authkey == data.regionSecret);
}
/// <summary>
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
/// </summary>
/// <remarks>This requires a security audit.</remarks>
/// <param name="uuid"></param>
/// <param name="handle"></param>
/// <param name="authhash"></param>
/// <param name="challenge"></param>
/// <returns></returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
{
System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);
return false;
}
}
}

View File

@ -1,171 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.MSSQL
{
class MSSqlManager
{
IDbConnection dbcon;
/// <summary>
/// Initialises and creates a new Sql connection and maintains it.
/// </summary>
/// <param name="hostname">The Sql server being connected to</param>
/// <param name="database">The name of the Sql database being used</param>
/// <param name="username">The username logging into the database</param>
/// <param name="password">The password for the user logging in</param>
/// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
public MSSqlManager(string hostname, string database, string username, string password, string cpooling)
{
try
{
string connectionString = "Server=" + hostname + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
dbcon = new SqlConnection(connectionString);
dbcon.Open();
}
catch (Exception e)
{
throw new Exception("Error initialising Sql Database: " + e.ToString());
}
}
/// <summary>
/// Shuts down the database connection
/// </summary>
public void Close()
{
dbcon.Close();
dbcon = null;
}
/// <summary>
/// Runs a query with protection against SQL Injection by using parameterised input.
/// </summary>
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
/// <returns>A Sql DB Command</returns>
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
{
SqlCommand dbcommand = (SqlCommand)dbcon.CreateCommand();
dbcommand.CommandText = sql;
foreach (KeyValuePair<string, string> param in parameters)
{
dbcommand.Parameters.AddWithValue(param.Key, param.Value);
}
return (IDbCommand)dbcommand;
}
public SimProfileData getRow(IDataReader reader)
{
SimProfileData retval = new SimProfileData();
if (reader.Read())
{
// Region Main
retval.regionHandle = (ulong)reader["regionHandle"];
retval.regionName = (string)reader["regionName"];
retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
// Secrets
retval.regionRecvKey = (string)reader["regionRecvKey"];
retval.regionSecret = (string)reader["regionSecret"];
retval.regionSendKey = (string)reader["regionSendKey"];
// Region Server
retval.regionDataURI = (string)reader["regionDataURI"];
retval.regionOnline = false; // Needs to be pinged before this can be set.
retval.serverIP = (string)reader["serverIP"];
retval.serverPort = (uint)reader["serverPort"];
retval.serverURI = (string)reader["serverURI"];
// Location
retval.regionLocX = (uint)((int)reader["locX"]);
retval.regionLocY = (uint)((int)reader["locY"]);
retval.regionLocZ = (uint)((int)reader["locZ"]);
// Neighbours - 0 = No Override
retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
// Assets
retval.regionAssetURI = (string)reader["regionAssetURI"];
retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
// Userserver
retval.regionUserURI = (string)reader["regionUserURI"];
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
}
else
{
throw new Exception("No rows to return");
}
return retval;
}
public bool insertRow(SimProfileData profile)
{
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["regionHandle"] = profile.regionHandle.ToString();
parameters["regionName"] = profile.regionName;
parameters["uuid"] = profile.UUID.ToString();
parameters["regionRecvKey"] = profile.regionRecvKey;
parameters["regionSendKey"] = profile.regionSendKey;
parameters["regionDataURI"] = profile.regionDataURI;
parameters["serverIP"] = profile.serverIP;
parameters["serverPort"] = profile.serverPort.ToString();
parameters["serverURI"] = profile.serverURI;
parameters["locX"] = profile.regionLocX.ToString();
parameters["locY"] = profile.regionLocY.ToString();
parameters["locZ"] = profile.regionLocZ.ToString();
parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
parameters["regionAssetURI"] = profile.regionAssetURI;
parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
parameters["regionUserURI"] = profile.regionUserURI;
parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
parameters["regionUserSendKey"] = profile.regionUserSendKey;
bool returnval = false;
try
{
IDbCommand result = Query(sql, parameters);
if (result.ExecuteNonQuery() == 1)
returnval = true;
result.Dispose();
}
catch (Exception e)
{
return false;
}
return returnval;
}
}
}

View File

@ -1,104 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0A563AC1-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data.MSSQL</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data.MSSQL</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MSSQLGridData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MSSQLManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,45 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Data.MSSQL" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Data.MSSQL" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="MSSQLGridData.cs" />
<include name="MSSQLManager.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="System.Data.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/libsecondlife.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Data.MSSQL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Data.MSSQL")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0e1c1ca4-2cf2-4315-b0e7-432c02feea8a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,201 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.MySQL
{
public class MySQLGridData : IGridData
{
private MySQLManager database;
/// <summary>
/// Initialises the Grid Interface
/// </summary>
public void Initialise()
{
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
}
/// <summary>
/// Shuts down the grid interface
/// </summary>
public void Close()
{
database.Close();
}
public string getName()
{
return "MySql OpenGridData";
}
public string getVersion()
{
return "0.1";
}
public SimProfileData[] GetProfilesInRange(uint xmin, uint ymin, uint xmax, uint ymax)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?xmin"] = xmin.ToString();
param["?ymin"] = ymin.ToString();
param["?xmax"] = xmax.ToString();
param["?ymax"] = ymax.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE locX >= ?xmin AND locX <= ?xmax AND locY >= ?ymin AND locY <= ?ymax", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row;
List<SimProfileData> rows = new List<SimProfileData>();
while ((row = database.getSimRow(reader)) != null)
{
rows.Add(row);
}
reader.Close();
result.Dispose();
return rows.ToArray();
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
/// <summary>
/// Returns a sim profile from it's location
/// </summary>
/// <param name="handle">Region location handle</param>
/// <returns>Sim profile</returns>
public SimProfileData GetProfileByHandle(ulong handle)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?handle"] = handle.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE regionHandle = ?handle", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getSimRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
/// <summary>
/// Returns a sim profile from it's UUID
/// </summary>
/// <param name="uuid">The region UUID</param>
/// <returns>The sim profile</returns>
public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getSimRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
public DataResponse AddProfile(SimProfileData profile)
{
lock (database)
{
if (database.insertRow(profile))
{
return DataResponse.RESPONSE_OK;
}
else
{
return DataResponse.RESPONSE_ERROR;
}
}
}
/// <summary>
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
/// </summary>
/// <param name="uuid">The UUID of the challenger</param>
/// <param name="handle">The attempted regionHandle of the challenger</param>
/// <param name="authkey">The secret</param>
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
{
bool throwHissyFit = false; // Should be true by 1.0
if (throwHissyFit)
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
SimProfileData data = GetProfileByLLUUID(uuid);
return (handle == data.regionHandle && authkey == data.regionSecret);
}
/// <summary>
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
/// </summary>
/// <remarks>This requires a security audit.</remarks>
/// <param name="uuid"></param>
/// <param name="handle"></param>
/// <param name="authhash"></param>
/// <param name="challenge"></param>
/// <returns></returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
{
System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);
return false;
}
}
}

View File

@ -1,270 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
// MySQL Native
using MySql;
using MySql.Data;
using MySql.Data.Types;
using MySql.Data.MySqlClient;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.MySQL
{
class MySQLManager
{
IDbConnection dbcon;
/// <summary>
/// Initialises and creates a new MySQL connection and maintains it.
/// </summary>
/// <param name="hostname">The MySQL server being connected to</param>
/// <param name="database">The name of the MySQL database being used</param>
/// <param name="username">The username logging into the database</param>
/// <param name="password">The password for the user logging in</param>
/// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port)
{
try
{
string connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + username + ";Password=" + password + ";Pooling=" + cpooling + ";";
dbcon = new MySqlConnection(connectionString);
dbcon.Open();
}
catch (Exception e)
{
throw new Exception("Error initialising MySql Database: " + e.ToString());
}
}
/// <summary>
/// Shuts down the database connection
/// </summary>
public void Close()
{
dbcon.Close();
dbcon = null;
}
/// <summary>
/// Runs a query with protection against SQL Injection by using parameterised input.
/// </summary>
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
/// <returns>A MySQL DB Command</returns>
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
{
try
{
MySqlCommand dbcommand = (MySqlCommand)dbcon.CreateCommand();
dbcommand.CommandText = sql;
foreach (KeyValuePair<string, string> param in parameters)
{
dbcommand.Parameters.Add(param.Key, param.Value);
}
return (IDbCommand)dbcommand;
}
catch (Exception e)
{
Console.WriteLine("Failed during Query generation: " + e.ToString());
return null;
}
}
public SimProfileData getSimRow(IDataReader reader)
{
SimProfileData retval = new SimProfileData();
if (reader.Read())
{
// Region Main
retval.regionHandle = Convert.ToUInt64(reader["regionHandle"].ToString());
retval.regionName = (string)reader["regionName"];
retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
// Secrets
retval.regionRecvKey = (string)reader["regionRecvKey"];
retval.regionSecret = (string)reader["regionSecret"];
retval.regionSendKey = (string)reader["regionSendKey"];
// Region Server
retval.regionDataURI = (string)reader["regionDataURI"];
retval.regionOnline = false; // Needs to be pinged before this can be set.
retval.serverIP = (string)reader["serverIP"];
retval.serverPort = (uint)reader["serverPort"];
retval.serverURI = (string)reader["serverURI"];
// Location
retval.regionLocX = Convert.ToUInt32(reader["locX"].ToString());
retval.regionLocY = Convert.ToUInt32(reader["locY"].ToString());
retval.regionLocZ = Convert.ToUInt32(reader["locZ"].ToString());
// Neighbours - 0 = No Override
retval.regionEastOverrideHandle = Convert.ToUInt64(reader["eastOverrideHandle"].ToString());
retval.regionWestOverrideHandle = Convert.ToUInt64(reader["westOverrideHandle"].ToString());
retval.regionSouthOverrideHandle = Convert.ToUInt64(reader["southOverrideHandle"].ToString());
retval.regionNorthOverrideHandle = Convert.ToUInt64(reader["northOverrideHandle"].ToString());
// Assets
retval.regionAssetURI = (string)reader["regionAssetURI"];
retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
// Userserver
retval.regionUserURI = (string)reader["regionUserURI"];
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
// World Map Addition
retval.regionMapTextureID = new libsecondlife.LLUUID((string)reader["regionMapTexture"]);
}
else
{
return null;
}
return retval;
}
public UserAgentData getAgentRow(IDataReader reader)
{
UserAgentData retval = new UserAgentData();
if (reader.Read())
{
// Agent IDs
retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
retval.sessionID = new libsecondlife.LLUUID((string)reader["sessionID"]);
retval.secureSessionID = new libsecondlife.LLUUID((string)reader["secureSessionID"]);
// Agent Who?
retval.agentIP = (string)reader["agentIP"];
retval.agentPort = Convert.ToUInt32(reader["agentPort"].ToString());
retval.agentOnline = Convert.ToBoolean(reader["agentOnline"].ToString());
// Login/Logout times (UNIX Epoch)
retval.loginTime = Convert.ToInt32(reader["loginTime"].ToString());
retval.logoutTime = Convert.ToInt32(reader["logoutTime"].ToString());
// Current position
retval.currentRegion = (string)reader["currentRegion"];
retval.currentHandle = Convert.ToUInt64(reader["currentHandle"].ToString());
libsecondlife.LLVector3.TryParse((string)reader["currentPos"], out retval.currentPos);
}
else
{
return null;
}
return retval;
}
public UserProfileData getUserRow(IDataReader reader)
{
UserProfileData retval = new UserProfileData();
if (reader.Read())
{
retval.UUID = new libsecondlife.LLUUID((string)reader["UUID"]);
retval.username = (string)reader["username"];
retval.surname = (string)reader["lastname"];
retval.passwordHash = (string)reader["passwordHash"];
retval.passwordSalt = (string)reader["passwordSalt"];
retval.homeRegion = Convert.ToUInt64(reader["homeRegion"].ToString());
retval.homeLocation = new libsecondlife.LLVector3(
Convert.ToSingle(reader["homeLocationX"].ToString()),
Convert.ToSingle(reader["homeLocationY"].ToString()),
Convert.ToSingle(reader["homeLocationZ"].ToString()));
retval.homeLookAt = new libsecondlife.LLVector3(
Convert.ToSingle(reader["homeLookAtX"].ToString()),
Convert.ToSingle(reader["homeLookAtY"].ToString()),
Convert.ToSingle(reader["homeLookAtZ"].ToString()));
retval.created = Convert.ToInt32(reader["created"].ToString());
retval.lastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
retval.userInventoryURI = (string)reader["userInventoryURI"];
retval.userAssetURI = (string)reader["userAssetURI"];
retval.profileCanDoMask = Convert.ToUInt32(reader["profileCanDoMask"].ToString());
retval.profileWantDoMask = Convert.ToUInt32(reader["profileWantDoMask"].ToString());
retval.profileAboutText = (string)reader["profileAboutText"];
retval.profileFirstText = (string)reader["profileFirstText"];
retval.profileImage = new libsecondlife.LLUUID((string)reader["profileImage"]);
retval.profileFirstImage = new libsecondlife.LLUUID((string)reader["profileFirstImage"]);
}
else
{
return null;
}
return retval;
}
public bool insertRow(SimProfileData profile)
{
string sql = "REPLACE INTO regions (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture) VALUES ";
sql += "(?regionHandle, ?regionName, ?uuid, ?regionRecvKey, ?regionSecret, ?regionSendKey, ?regionDataURI, ";
sql += "?serverIP, ?serverPort, ?serverURI, ?locX, ?locY, ?locZ, ?eastOverrideHandle, ?westOverrideHandle, ?southOverrideHandle, ?northOverrideHandle, ?regionAssetURI, ?regionAssetRecvKey, ";
sql += "?regionAssetSendKey, ?regionUserURI, ?regionUserRecvKey, ?regionUserSendKey, ?regionMapTexture);";
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["?regionHandle"] = profile.regionHandle.ToString();
parameters["?regionName"] = profile.regionName.ToString();
parameters["?uuid"] = profile.UUID.ToStringHyphenated();
parameters["?regionRecvKey"] = profile.regionRecvKey.ToString();
parameters["?regionSecret"] = profile.regionSecret.ToString();
parameters["?regionSendKey"] = profile.regionSendKey.ToString();
parameters["?regionDataURI"] = profile.regionDataURI.ToString();
parameters["?serverIP"] = profile.serverIP.ToString();
parameters["?serverPort"] = profile.serverPort.ToString();
parameters["?serverURI"] = profile.serverURI.ToString();
parameters["?locX"] = profile.regionLocX.ToString();
parameters["?locY"] = profile.regionLocY.ToString();
parameters["?locZ"] = profile.regionLocZ.ToString();
parameters["?eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
parameters["?westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
parameters["?northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
parameters["?southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
parameters["?regionAssetURI"] = profile.regionAssetURI.ToString();
parameters["?regionAssetRecvKey"] = profile.regionAssetRecvKey.ToString();
parameters["?regionAssetSendKey"] = profile.regionAssetSendKey.ToString();
parameters["?regionUserURI"] = profile.regionUserURI.ToString();
parameters["?regionUserRecvKey"] = profile.regionUserRecvKey.ToString();
parameters["?regionUserSendKey"] = profile.regionUserSendKey.ToString();
parameters["?regionMapTexture"] = profile.regionMapTextureID.ToStringHyphenated();
bool returnval = false;
try
{
IDbCommand result = Query(sql, parameters);
//Console.WriteLine(result.CommandText);
if (result.ExecuteNonQuery() == 1)
returnval = true;
result.Dispose();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return false;
}
return returnval;
}
}
}

View File

@ -1,153 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
using libsecondlife;
namespace OpenGrid.Framework.Data.MySQL
{
class MySQLUserData : IUserData
{
public MySQLManager database;
public void Initialise()
{
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
}
public UserProfileData getUserByName(string name)
{
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserProfileData getUserByName(string user, string last)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?first"] = user;
param["?second"] = last;
System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE username = ?first AND lastname = ?second", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserProfileData row = database.getUserRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
public UserProfileData getUserByUUID(LLUUID uuid)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM users WHERE UUID = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserProfileData row = database.getUserRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
public UserAgentData getAgentByName(string name)
{
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserAgentData getAgentByName(string user, string last)
{
UserProfileData profile = getUserByName(user, last);
return getAgentByUUID(profile.UUID);
}
public UserAgentData getAgentByUUID(LLUUID uuid)
{
try
{
lock (database)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["?uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM agents WHERE UUID = ?uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
UserAgentData row = database.getAgentRow(reader);
reader.Close();
result.Dispose();
return row;
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
return null;
}
}
public void addNewUserProfile(UserProfileData user)
{
}
public void addNewUserAgent(UserAgentData agent)
{
// Do nothing.
}
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
{
return false;
}
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
{
return false;
}
public string getName()
{
return "MySQL Userdata Interface";
}
public string getVersion()
{
return "0.1";
}
}
}

View File

@ -1,111 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0F3C3AC1-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data.MySQL</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data.MySQL</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="MySql.Data.dll" >
<HintPath>..\..\bin\MySql.Data.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="MySQLGridData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MySQLManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MySQLUserData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Data.MySQL" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Data.MySQL" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="MySQLGridData.cs" />
<include name="MySQLManager.cs" />
<include name="MySQLUserData.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="System.Data.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/MySql.Data.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Data.MySQL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Data.MySQL")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e49826b2-dcef-41be-a5bd-596733fa3304")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,108 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1E3F341A-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data.SQLite</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data.SQLite</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.SQLite.dll" >
<HintPath>..\..\bin\System.Data.SQLite.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="SQLiteGridData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SQLiteManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Data.SQLite" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Data.SQLite" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="SQLiteGridData.cs" />
<include name="SQLiteManager.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="System.Data.dll" />
<include name="../../bin/System.Data.SQLite.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/libsecondlife.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Data.SQLite")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Data.SQLite")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6113d5ce-4547-49f4-9236-0dcc503457b1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,136 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.SQLite
{
public class SQLiteGridData : IGridData
{
private SQLiteManager database;
/// <summary>
/// Initialises the Grid Interface
/// </summary>
public void Initialise()
{
database = new SQLiteManager("localhost", "db", "user", "password", "false");
}
/// <summary>
/// Shuts down the grid interface
/// </summary>
public void Close()
{
database.Close();
}
public string getName()
{
return "SQLite OpenGridData";
}
public string getVersion()
{
return "0.1";
}
public SimProfileData[] GetProfilesInRange(uint a, uint b, uint c, uint d)
{
return null;
}
/// <summary>
/// Returns a sim profile from it's location
/// </summary>
/// <param name="handle">Region location handle</param>
/// <returns>Sim profile</returns>
public SimProfileData GetProfileByHandle(ulong handle)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["handle"] = handle.ToString();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE handle = @handle", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
result.Dispose();
return row;
}
/// <summary>
/// Returns a sim profile from it's UUID
/// </summary>
/// <param name="uuid">The region UUID</param>
/// <returns>The sim profile</returns>
public SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID uuid)
{
Dictionary<string, string> param = new Dictionary<string, string>();
param["uuid"] = uuid.ToStringHyphenated();
System.Data.IDbCommand result = database.Query("SELECT * FROM regions WHERE uuid = @uuid", param);
System.Data.IDataReader reader = result.ExecuteReader();
SimProfileData row = database.getRow(reader);
reader.Close();
result.Dispose();
return row;
}
public DataResponse AddProfile(SimProfileData profile)
{
if (database.insertRow(profile))
{
return DataResponse.RESPONSE_OK;
}
else
{
return DataResponse.RESPONSE_ERROR;
}
}
/// <summary>
/// DEPRECIATED. Attempts to authenticate a region by comparing a shared secret.
/// </summary>
/// <param name="uuid">The UUID of the challenger</param>
/// <param name="handle">The attempted regionHandle of the challenger</param>
/// <param name="authkey">The secret</param>
/// <returns>Whether the secret and regionhandle match the database entry for UUID</returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authkey)
{
bool throwHissyFit = false; // Should be true by 1.0
if (throwHissyFit)
throw new Exception("CRYPTOWEAK AUTHENTICATE: Refusing to authenticate due to replay potential.");
SimProfileData data = GetProfileByLLUUID(uuid);
return (handle == data.regionHandle && authkey == data.regionSecret);
}
/// <summary>
/// NOT YET FUNCTIONAL. Provides a cryptographic authentication of a region
/// </summary>
/// <remarks>This requires a security audit.</remarks>
/// <param name="uuid"></param>
/// <param name="handle"></param>
/// <param name="authhash"></param>
/// <param name="challenge"></param>
/// <returns></returns>
public bool AuthenticateSim(libsecondlife.LLUUID uuid, ulong handle, string authhash, string challenge)
{
System.Security.Cryptography.SHA512Managed HashProvider = new System.Security.Cryptography.SHA512Managed();
System.Text.ASCIIEncoding TextProvider = new ASCIIEncoding();
byte[] stream = TextProvider.GetBytes(uuid.ToStringHyphenated() + ":" + handle.ToString() + ":" + challenge);
byte[] hash = HashProvider.ComputeHash(stream);
return false;
}
}
}

View File

@ -1,172 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SQLite;
using OpenGrid.Framework.Data;
namespace OpenGrid.Framework.Data.SQLite
{
class SQLiteManager
{
IDbConnection dbcon;
/// <summary>
/// Initialises and creates a new SQLite connection and maintains it.
/// </summary>
/// <param name="hostname">The SQLite server being connected to</param>
/// <param name="database">The name of the SQLite database being used</param>
/// <param name="username">The username logging into the database</param>
/// <param name="password">The password for the user logging in</param>
/// <param name="cpooling">Whether to use connection pooling or not, can be one of the following: 'yes', 'true', 'no' or 'false', if unsure use 'false'.</param>
public SQLiteManager(string hostname, string database, string username, string password, string cpooling)
{
try
{
string connectionString = "URI=file:GridServerSqlite.db;";
dbcon = new SQLiteConnection(connectionString);
dbcon.Open();
}
catch (Exception e)
{
throw new Exception("Error initialising SQLite Database: " + e.ToString());
}
}
/// <summary>
/// Shuts down the database connection
/// </summary>
public void Close()
{
dbcon.Close();
dbcon = null;
}
/// <summary>
/// Runs a query with protection against SQL Injection by using parameterised input.
/// </summary>
/// <param name="sql">The SQL string - replace any variables such as WHERE x = "y" with WHERE x = @y</param>
/// <param name="parameters">The parameters - index so that @y is indexed as 'y'</param>
/// <returns>A SQLite DB Command</returns>
public IDbCommand Query(string sql, Dictionary<string, string> parameters)
{
SQLiteCommand dbcommand = (SQLiteCommand)dbcon.CreateCommand();
dbcommand.CommandText = sql;
foreach (KeyValuePair<string, string> param in parameters)
{
SQLiteParameter paramx = new SQLiteParameter(param.Key,param.Value);
dbcommand.Parameters.Add(paramx);
}
return (IDbCommand)dbcommand;
}
public SimProfileData getRow(IDataReader reader)
{
SimProfileData retval = new SimProfileData();
if (reader.Read())
{
// Region Main
retval.regionHandle = (ulong)reader["regionHandle"];
retval.regionName = (string)reader["regionName"];
retval.UUID = new libsecondlife.LLUUID((string)reader["uuid"]);
// Secrets
retval.regionRecvKey = (string)reader["regionRecvKey"];
retval.regionSecret = (string)reader["regionSecret"];
retval.regionSendKey = (string)reader["regionSendKey"];
// Region Server
retval.regionDataURI = (string)reader["regionDataURI"];
retval.regionOnline = false; // Needs to be pinged before this can be set.
retval.serverIP = (string)reader["serverIP"];
retval.serverPort = (uint)reader["serverPort"];
retval.serverURI = (string)reader["serverURI"];
// Location
retval.regionLocX = (uint)((int)reader["locX"]);
retval.regionLocY = (uint)((int)reader["locY"]);
retval.regionLocZ = (uint)((int)reader["locZ"]);
// Neighbours - 0 = No Override
retval.regionEastOverrideHandle = (ulong)reader["eastOverrideHandle"];
retval.regionWestOverrideHandle = (ulong)reader["westOverrideHandle"];
retval.regionSouthOverrideHandle = (ulong)reader["southOverrideHandle"];
retval.regionNorthOverrideHandle = (ulong)reader["northOverrideHandle"];
// Assets
retval.regionAssetURI = (string)reader["regionAssetURI"];
retval.regionAssetRecvKey = (string)reader["regionAssetRecvKey"];
retval.regionAssetSendKey = (string)reader["regionAssetSendKey"];
// Userserver
retval.regionUserURI = (string)reader["regionUserURI"];
retval.regionUserRecvKey = (string)reader["regionUserRecvKey"];
retval.regionUserSendKey = (string)reader["regionUserSendKey"];
}
else
{
throw new Exception("No rows to return");
}
return retval;
}
public bool insertRow(SimProfileData profile)
{
string sql = "REPLACE INTO regions VALUES (regionHandle, regionName, uuid, regionRecvKey, regionSecret, regionSendKey, regionDataURI, ";
sql += "serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, ";
sql += "regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey) VALUES ";
sql += "(@regionHandle, @regionName, @uuid, @regionRecvKey, @regionSecret, @regionSendKey, @regionDataURI, ";
sql += "@serverIP, @serverPort, @serverURI, @locX, @locY, @locZ, @eastOverrideHandle, @westOverrideHandle, @southOverrideHandle, @northOverrideHandle, @regionAssetURI, @regionAssetRecvKey, ";
sql += "@regionAssetSendKey, @regionUserURI, @regionUserRecvKey, @regionUserSendKey);";
Dictionary<string, string> parameters = new Dictionary<string, string>();
parameters["regionHandle"] = profile.regionHandle.ToString();
parameters["regionName"] = profile.regionName;
parameters["uuid"] = profile.UUID.ToString();
parameters["regionRecvKey"] = profile.regionRecvKey;
parameters["regionSendKey"] = profile.regionSendKey;
parameters["regionDataURI"] = profile.regionDataURI;
parameters["serverIP"] = profile.serverIP;
parameters["serverPort"] = profile.serverPort.ToString();
parameters["serverURI"] = profile.serverURI;
parameters["locX"] = profile.regionLocX.ToString();
parameters["locY"] = profile.regionLocY.ToString();
parameters["locZ"] = profile.regionLocZ.ToString();
parameters["eastOverrideHandle"] = profile.regionEastOverrideHandle.ToString();
parameters["westOverrideHandle"] = profile.regionWestOverrideHandle.ToString();
parameters["northOverrideHandle"] = profile.regionNorthOverrideHandle.ToString();
parameters["southOverrideHandle"] = profile.regionSouthOverrideHandle.ToString();
parameters["regionAssetURI"] = profile.regionAssetURI;
parameters["regionAssetRecvKey"] = profile.regionAssetRecvKey;
parameters["regionAssetSendKey"] = profile.regionAssetSendKey;
parameters["regionUserURI"] = profile.regionUserURI;
parameters["regionUserRecvKey"] = profile.regionUserRecvKey;
parameters["regionUserSendKey"] = profile.regionUserSendKey;
bool returnval = false;
try
{
IDbCommand result = Query(sql, parameters);
if (result.ExecuteNonQuery() == 1)
returnval = true;
result.Dispose();
}
catch (Exception e)
{
return false;
}
return returnval;
}
}
}

View File

@ -1,83 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenGrid.Framework.Data
{
public enum DataResponse
{
RESPONSE_OK,
RESPONSE_AUTHREQUIRED,
RESPONSE_INVALIDCREDENTIALS,
RESPONSE_ERROR
}
/// <summary>
/// A standard grid interface
/// </summary>
public interface IGridData
{
/// <summary>
/// Returns a sim profile from a regionHandle
/// </summary>
/// <param name="regionHandle">A 64bit Region Handle</param>
/// <returns>A simprofile</returns>
SimProfileData GetProfileByHandle(ulong regionHandle);
/// <summary>
/// Returns a sim profile from a UUID
/// </summary>
/// <param name="UUID">A 128bit UUID</param>
/// <returns>A sim profile</returns>
SimProfileData GetProfileByLLUUID(libsecondlife.LLUUID UUID);
/// <summary>
/// Returns all profiles within the specified range
/// </summary>
/// <param name="Xmin">Minimum sim coordinate (X)</param>
/// <param name="Ymin">Minimum sim coordinate (Y)</param>
/// <param name="Xmax">Maximum sim coordinate (X)</param>
/// <param name="Ymin">Maximum sim coordinate (Y)</param>
/// <returns>An array containing all the sim profiles in the specified range</returns>
SimProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
/// <summary>
/// Authenticates a sim by use of it's recv key.
/// WARNING: Insecure
/// </summary>
/// <param name="UUID">The UUID sent by the sim</param>
/// <param name="regionHandle">The regionhandle sent by the sim</param>
/// <param name="simrecvkey">The recieving key sent by the sim</param>
/// <returns>Whether the sim has been authenticated</returns>
bool AuthenticateSim(libsecondlife.LLUUID UUID, ulong regionHandle, string simrecvkey);
/// <summary>
/// Initialises the interface
/// </summary>
void Initialise();
/// <summary>
/// Closes the interface
/// </summary>
void Close();
/// <summary>
/// The plugin being loaded
/// </summary>
/// <returns>A string containing the plugin name</returns>
string getName();
/// <summary>
/// The plugins version
/// </summary>
/// <returns>A string containing the plugin version</returns>
string getVersion();
/// <summary>
/// Adds a new profile to the database
/// </summary>
/// <param name="profile">The profile to add</param>
/// <returns>RESPONSE_OK if successful, error if not.</returns>
DataResponse AddProfile(SimProfileData profile);
}
}

View File

@ -1,73 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Text.RegularExpressions;
/*
Taken from public code listing at by Alex Pinsker
http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html
*/
namespace OpenGrid.Framework.Data
{
/// <summary>
/// Parse settings from ini-like files
/// </summary>
public class IniFile
{
static IniFile()
{
_iniKeyValuePatternRegex = new Regex(
@"((\s)*(?<Key>([^\=^\s^\n]+))[\s^\n]*
# key part (surrounding whitespace stripped)
\=
(\s)*(?<Value>([^\n^\s]+(\n){0,1})))
# value part (surrounding whitespace stripped)
",
RegexOptions.IgnorePatternWhitespace |
RegexOptions.Compiled |
RegexOptions.CultureInvariant);
}
static private Regex _iniKeyValuePatternRegex;
public IniFile(string iniFileName)
{
_iniFileName = iniFileName;
}
public string ParseFileReadValue(string key)
{
using (StreamReader reader =
new StreamReader(_iniFileName))
{
do
{
string line = reader.ReadLine();
Match match =
_iniKeyValuePatternRegex.Match(line);
if (match.Success)
{
string currentKey =
match.Groups["Key"].Value as string;
if (currentKey != null &&
currentKey.Trim().CompareTo(key) == 0)
{
string value =
match.Groups["Value"].Value as string;
return value;
}
}
}
while (reader.Peek() != -1);
}
return null;
}
public string IniFileName
{
get { return _iniFileName; }
} private string _iniFileName;
}
}

View File

@ -1,107 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="GridData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="IniConfig.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SimProfileData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserProfileData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Data" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Data" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="GridData.cs" />
<include name="IniConfig.cs" />
<include name="SimProfileData.cs" />
<include name="UserData.cs" />
<include name="UserProfileData.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="System.Data.dll" />
<include name="../../bin/libsecondlife.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OpenGrid.Framework.Data")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OpenGrid.Framework.Data")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3a711c34-b0c0-4264-b0fe-f366eabf9d7b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,84 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace OpenGrid.Framework.Data
{
public class SimProfileData
{
/// <summary>
/// The name of the region
/// </summary>
public string regionName = "";
/// <summary>
/// A 64-bit number combining map position into a (mostly) unique ID
/// </summary>
public ulong regionHandle;
/// <summary>
/// OGS/OpenSim Specific ID for a region
/// </summary>
public libsecondlife.LLUUID UUID;
/// <summary>
/// Coordinates of the region
/// </summary>
public uint regionLocX;
public uint regionLocY;
public uint regionLocZ; // Reserved (round-robin, layers, etc)
/// <summary>
/// Authentication secrets
/// </summary>
/// <remarks>Not very secure, needs improvement.</remarks>
public string regionSendKey = "";
public string regionRecvKey = "";
public string regionSecret = "";
/// <summary>
/// Whether the region is online
/// </summary>
public bool regionOnline;
/// <summary>
/// Information about the server that the region is currently hosted on
/// </summary>
public string serverIP = "";
public uint serverPort;
public string serverURI = "";
/// <summary>
/// Set of optional overrides. Can be used to create non-eulicidean spaces.
/// </summary>
public ulong regionNorthOverrideHandle;
public ulong regionSouthOverrideHandle;
public ulong regionEastOverrideHandle;
public ulong regionWestOverrideHandle;
/// <summary>
/// Optional: URI Location of the region database
/// </summary>
/// <remarks>Used for floating sim pools where the region data is not nessecarily coupled to a specific server</remarks>
public string regionDataURI = "";
/// <summary>
/// Region Asset Details
/// </summary>
public string regionAssetURI = "";
public string regionAssetSendKey = "";
public string regionAssetRecvKey = "";
/// <summary>
/// Region Userserver Details
/// </summary>
public string regionUserURI = "";
public string regionUserSendKey = "";
public string regionUserRecvKey = "";
/// <summary>
/// Region Map Texture Asset
/// </summary>
public libsecondlife.LLUUID regionMapTextureID = new libsecondlife.LLUUID("00000000-0000-0000-9999-000000000006");
}
}

View File

@ -1,101 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenGrid.Framework.Data
{
public interface IUserData
{
/// <summary>
/// Returns a user profile from a database via their UUID
/// </summary>
/// <param name="user">The accounts UUID</param>
/// <returns>The user data profile</returns>
UserProfileData getUserByUUID(LLUUID user);
/// <summary>
/// Returns a users profile by searching their username
/// </summary>
/// <param name="name">The users username</param>
/// <returns>The user data profile</returns>
UserProfileData getUserByName(string name);
/// <summary>
/// Returns a users profile by searching their username parts
/// </summary>
/// <param name="fname">Account firstname</param>
/// <param name="lname">Account lastname</param>
/// <returns>The user data profile</returns>
UserProfileData getUserByName(string fname, string lname);
/// <summary>
/// Returns the current agent for a user searching by it's UUID
/// </summary>
/// <param name="user">The users UUID</param>
/// <returns>The current agent session</returns>
UserAgentData getAgentByUUID(LLUUID user);
/// <summary>
/// Returns the current session agent for a user searching by username
/// </summary>
/// <param name="name">The users account name</param>
/// <returns>The current agent session</returns>
UserAgentData getAgentByName(string name);
/// <summary>
/// Returns the current session agent for a user searching by username parts
/// </summary>
/// <param name="fname">The users first account name</param>
/// <param name="lname">The users account surname</param>
/// <returns>The current agent session</returns>
UserAgentData getAgentByName(string fname, string lname);
/// <summary>
/// Adds a new User profile to the database
/// </summary>
/// <param name="user">UserProfile to add</param>
void addNewUserProfile(UserProfileData user);
/// <summary>
/// Adds a new agent to the database
/// </summary>
/// <param name="agent">The agent to add</param>
void addNewUserAgent(UserAgentData agent);
/// <summary>
/// Attempts to move currency units between accounts (NOT RELIABLE / TRUSTWORTHY. DONT TRY RUN YOUR OWN CURRENCY EXCHANGE WITH REAL VALUES)
/// </summary>
/// <param name="from">The account to transfer from</param>
/// <param name="to">The account to transfer to</param>
/// <param name="amount">The amount to transfer</param>
/// <returns>Successful?</returns>
bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
/// <summary>
/// Attempts to move inventory between accounts, if inventory is copyable it will be copied into the target account.
/// </summary>
/// <param name="from">User to transfer from</param>
/// <param name="to">User to transfer to</param>
/// <param name="inventory">Specified inventory item</param>
/// <returns>Successful?</returns>
bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
/// <summary>
/// Returns the plugin version
/// </summary>
/// <returns>Plugin version in MAJOR.MINOR.REVISION.BUILD format</returns>
string getVersion();
/// <summary>
/// Returns the plugin name
/// </summary>
/// <returns>Plugin name, eg MySQL User Provider</returns>
string getName();
/// <summary>
/// Initialises the plugin (artificial constructor)
/// </summary>
void Initialise();
}
}

View File

@ -1,54 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenGrid.Framework.Data
{
public class UserProfileData
{
public LLUUID UUID;
public string username; // The configurable part of the users username
public string surname; // The users surname (can be used to indicate user class - eg 'Test User' or 'Test Admin')
public string passwordHash; // Hash of the users password
public string passwordSalt; // Salt for the users password
public ulong homeRegion; // RegionHandle of home
public LLVector3 homeLocation; // Home Location inside the sim
public LLVector3 homeLookAt; // Coordinates where the user is looking
public int created; // UNIX Epoch Timestamp (User Creation)
public int lastLogin; // UNIX Epoch Timestamp (Last Login Time)
public string userInventoryURI; // URI to inventory server for this user
public string userAssetURI; // URI to asset server for this user
public uint profileCanDoMask; // Profile window "I can do" mask
public uint profileWantDoMask; // Profile window "I want to" mask
public string profileAboutText; // My about window text
public string profileFirstText; // First Life Text
public LLUUID profileImage; // My avatars profile image
public LLUUID profileFirstImage; // First-life image
public UserAgentData currentAgent; // The users last agent
}
public class UserAgentData
{
public LLUUID UUID; // Account ID
public string agentIP; // The IP of the agent
public uint agentPort; // The port of the agent
public bool agentOnline; // The online status of the agent
public LLUUID sessionID; // The session ID for the agent (used by client)
public LLUUID secureSessionID; // The secure session ID for the agent (used by client)
public LLUUID regionID; // The region ID the agent occupies
public int loginTime; // EPOCH based Timestamp
public int logoutTime; // Timestamp or 0 if N/A
public LLUUID currentRegion; // UUID of the users current region
public ulong currentHandle; // RegionHandle of the users current region
public LLVector3 currentPos; // Current position in the region
}
}

View File

@ -1,76 +0,0 @@
using Nwc.XmlRpc;
using OpenSim.Framework;
using OpenSim.Servers;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
namespace OpenGrid.Framework.Manager
{
public delegate void GridManagerCallback(string param);
public class GridManagementAgent
{
private GridManagerCallback thecallback;
private string sendkey;
private string recvkey;
private string component_type;
private static ArrayList Sessions;
public GridManagementAgent(BaseHttpServer app_httpd, string component_type, string sendkey, string recvkey, GridManagerCallback thecallback)
{
this.sendkey = sendkey;
this.recvkey = recvkey;
this.component_type = component_type;
this.thecallback = thecallback;
Sessions = new ArrayList();
app_httpd.AddXmlRPCHandler("manager_login", XmlRpcLoginMethod);
switch (component_type)
{
case "gridserver":
GridServerManager.sendkey = this.sendkey;
GridServerManager.recvkey = this.recvkey;
GridServerManager.thecallback = thecallback;
app_httpd.AddXmlRPCHandler("shutdown", GridServerManager.XmlRpcShutdownMethod);
break;
}
}
public static bool SessionExists(LLUUID sessionID)
{
return Sessions.Contains(sessionID);
}
public static XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0];
Hashtable responseData = new Hashtable();
// TODO: Switch this over to using OpenGrid.Framework.Data
if (requestData["username"].Equals("admin") && requestData["password"].Equals("supersecret"))
{
response.IsFault = false;
LLUUID new_session = LLUUID.Random();
Sessions.Add(new_session);
responseData["session_id"] = new_session.ToString();
responseData["msg"] = "Login OK";
}
else
{
response.IsFault = true;
responseData["error"] = "Invalid username or password";
}
response.Value = responseData;
return response;
}
}
}

View File

@ -1,50 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Nwc.XmlRpc;
using System.Threading;
using libsecondlife;
namespace OpenGrid.Framework.Manager {
public class GridServerManager
{
public static GridManagerCallback thecallback;
public static string sendkey;
public static string recvkey;
public static XmlRpcResponse XmlRpcShutdownMethod(XmlRpcRequest request)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0];
Hashtable responseData = new Hashtable();
if(requestData.ContainsKey("session_id")) {
if(GridManagementAgent.SessionExists(new LLUUID((string)requestData["session_id"]))) {
responseData["msg"]="Shutdown command accepted";
(new Thread(new ThreadStart(ZOMGServerIsNowTerminallyIll))).Start();
} else {
response.IsFault=true;
responseData["error"]="bad session ID";
}
} else {
response.IsFault=true;
responseData["error"]="no session ID";
}
response.Value = responseData;
return response;
}
// Brought to by late-night coding
public static void ZOMGServerIsNowTerminallyIll()
{
Console.WriteLine("ZOMG! THIS SERVER IS TERMINALLY ILL - WE GOT A SHUTDOWN REQUEST FROM A GRID MANAGER!!!!");
Console.WriteLine("We have 3 seconds to live...");
Thread.Sleep(3000);
thecallback("shutdown");
}
}
}

View File

@ -1,99 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7924FD35-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Manager</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Manager</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Servers" >
<HintPath>OpenSim.Servers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC" >
<HintPath>XMLRPC.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="GridManagementAgent.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="GridServerManager.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,44 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGrid.Framework.Manager" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenGrid.Framework.Manager" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="GridManagementAgent.cs" />
<include name="GridServerManager.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="../../bin/OpenSim.Framework.dll" />
<include name="../../bin/OpenSim.Servers.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,92 +0,0 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
//using OpenSim.CAPS;
using Nwc.XmlRpc;
using System.Collections;
using OpenSim.Framework.Console;
using OpenSim.Servers;
namespace OpenGridServices.AssetServer
{
public class AssetHttpServer :BaseHttpServer
{
public AssetHttpServer(int port)
: base(port)
{
}
public override void HandleRequest(Object stateinfo)
{
try
{
HttpListenerContext context = (HttpListenerContext)stateinfo;
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
response.KeepAlive = false;
response.SendChunked = false;
System.IO.Stream body = request.InputStream;
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
System.IO.StreamReader reader = new System.IO.StreamReader(body, encoding);
string requestBody = reader.ReadToEnd();
body.Close();
reader.Close();
//Console.WriteLine(request.HttpMethod + " " + request.RawUrl + " Http/" + request.ProtocolVersion.ToString() + " content type: " + request.ContentType);
//Console.WriteLine(requestBody);
string responseString = "";
switch (request.ContentType)
{
case "text/xml":
// must be XML-RPC, so pass to the XML-RPC parser
responseString = ParseXMLRPC(requestBody);
responseString = Regex.Replace(responseString, "utf-16", "utf-8");
response.AddHeader("Content-type", "text/xml");
break;
case "application/xml":
// probably LLSD we hope, otherwise it should be ignored by the parser
responseString = ParseLLSDXML(requestBody);
response.AddHeader("Content-type", "application/xml");
break;
case "application/x-www-form-urlencoded":
// a form data POST so send to the REST parser
responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
response.AddHeader("Content-type", "text/plain");
break;
case null:
// must be REST or invalid crap, so pass to the REST parser
responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod);
response.AddHeader("Content-type", "text/plain");
break;
}
Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
byte[] buffer = Windows1252Encoding.GetBytes(responseString);
System.IO.Stream output = response.OutputStream;
response.SendChunked = false;
response.ContentLength64 = buffer.Length;
output.Write(buffer, 0, buffer.Length);
output.Close();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
}
}

View File

@ -1,337 +0,0 @@
/*
Copyright (c) OpenSim project, http://osgrid.org/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Text;
using System.Timers;
using System.Net;
using System.Reflection;
using System.Threading;
using libsecondlife;
using OpenSim.Framework;
using OpenSim.Framework.Sims;
using OpenSim.Framework.Console;
using OpenSim.Framework.Types;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Utilities;
using OpenSim.Servers;
using Db4objects.Db4o;
using Db4objects.Db4o.Query;
namespace OpenGridServices.AssetServer
{
/// <summary>
/// </summary>
public class OpenAsset_Main : BaseServer, conscmd_callback
{
private IObjectContainer db;
public static OpenAsset_Main assetserver;
private ConsoleBase m_console;
[STAThread]
public static void Main(string[] args)
{
Console.WriteLine("Starting...\n");
assetserver = new OpenAsset_Main();
assetserver.Startup();
assetserver.Work();
}
private void Work()
{
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "\nEnter help for a list of commands\n");
while (true)
{
m_console.MainConsolePrompt();
}
}
private OpenAsset_Main()
{
m_console = new ConsoleBase("opengrid-AssetServer-console.log", "OpenGrid", this, false);
MainConsole.Instance = m_console;
}
public void Startup()
{
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Setting up asset DB");
setupDB();
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP process");
AssetHttpServer httpServer = new AssetHttpServer(8003);
httpServer.AddRestHandler("GET", "/assets/", this.assetGetMethod);
httpServer.AddRestHandler("POST", "/assets/", this.assetPostMethod);
httpServer.Start();
}
public string assetPostMethod(string requestBody, string path, string param)
{
AssetBase asset = new AssetBase();
asset.Name = "";
asset.FullID = new LLUUID(param);
Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
byte[] buffer = Windows1252Encoding.GetBytes(requestBody);
asset.Data = buffer;
AssetStorage store = new AssetStorage();
store.Data = asset.Data;
store.Name = asset.Name;
store.UUID = asset.FullID;
db.Set(store);
db.Commit();
return "";
}
public string assetGetMethod(string request, string path, string param)
{
Console.WriteLine("got a request " +param);
byte[] assetdata = getAssetData(new LLUUID(param), false);
if (assetdata != null)
{
Encoding Windows1252Encoding = Encoding.GetEncoding(1252);
string ret = Windows1252Encoding.GetString(assetdata);
//string ret = System.Text.Encoding.Unicode.GetString(assetdata);
return ret;
}
else
{
return "";
}
}
public byte[] getAssetData(LLUUID assetID, bool isTexture)
{
bool found = false;
AssetStorage foundAsset = null;
IObjectSet result = db.Get(new AssetStorage(assetID));
if (result.Count > 0)
{
foundAsset = (AssetStorage)result.Next();
found = true;
}
if (found)
{
return foundAsset.Data;
}
else
{
return null;
}
}
public void setupDB()
{
bool yapfile = System.IO.File.Exists("assets.yap");
try
{
db = Db4oFactory.OpenFile("assets.yap");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:setupDB() - creation");
}
catch (Exception e)
{
db.Close();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Main.cs:setupDB() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, e.ToString());
}
if (!yapfile)
{
this.LoadDB();
}
}
public void LoadDB()
{
try
{
Console.WriteLine("setting up Asset database");
AssetBase Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001");
Image.Name = "Bricks";
this.LoadAsset(Image, true, "bricks.jp2");
AssetStorage store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000002");
Image.Name = "Plywood";
this.LoadAsset(Image, true, "plywood.jp2");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000003");
Image.Name = "Rocks";
this.LoadAsset(Image, true, "rocks.jp2");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000004");
Image.Name = "Granite";
this.LoadAsset(Image, true, "granite.jp2");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000005");
Image.Name = "Hardwood";
this.LoadAsset(Image, true, "hardwood.jp2");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("00000000-0000-0000-5005-000000000005");
Image.Name = "Prim Base Texture";
this.LoadAsset(Image, true, "plywood.jp2");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
Image = new AssetBase();
Image.FullID = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
Image.Name = "Shape";
this.LoadAsset(Image, false, "base_shape.dat");
store = new AssetStorage();
store.Data = Image.Data;
store.Name = Image.Name;
store.UUID = Image.FullID;
db.Set(store);
db.Commit();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
private void LoadAsset(AssetBase info, bool image, string filename)
{
string dataPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "assets"); //+ folder;
string fileName = Path.Combine(dataPath, filename);
FileInfo fInfo = new FileInfo(fileName);
long numBytes = fInfo.Length;
FileStream fStream = new FileStream(fileName, FileMode.Open, FileAccess.Read);
byte[] idata = new byte[numBytes];
BinaryReader br = new BinaryReader(fStream);
idata = br.ReadBytes((int)numBytes);
br.Close();
fStream.Close();
info.Data = idata;
//info.loaded=true;
}
/*private GridConfig LoadConfigDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
GridConfig config = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IGridConfig", true);
if (typeInterface != null)
{
IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
config = plug.GetConfigObject();
break;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
return config;
}*/
public void RunCmd(string cmd, string[] cmdparams)
{
switch (cmd)
{
case "help":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - shutdown this asset server (USE CAUTION!)");
break;
case "shutdown":
m_console.Close();
Environment.Exit(0);
break;
}
}
public void Show(string ShowWhat)
{
}
}
}

View File

@ -1,118 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0021261B-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.AssetServer</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGridServices.AssetServer</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.Console" >
<HintPath>OpenSim.Framework.Console.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Servers" >
<HintPath>OpenSim.Servers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC" >
<HintPath>XMLRPC.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="AssetHttpServer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Main.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,50 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGridServices.AssetServer" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
<resources prefix="OpenGridServices.AssetServer" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="AssetHttpServer.cs" />
<include name="Main.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Xml.dll" />
<include name="../../bin/OpenSim.Framework.dll" />
<include name="../../bin/OpenSim.Framework.Console.dll" />
<include name="../../bin/OpenSim.GridInterfaces.Local.dll" />
<include name="../../bin/OpenSim.Servers.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/Db4objects.Db4o.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,126 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{21BFC8E2-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.GridServer</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGridServices.GridServer</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
<Name>OpenSim.Framework</Name>
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
<Name>OpenSim.Framework.Console</Name>
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
<Name>OpenSim.Servers</Name>
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Name>XMLRPC</Name>
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="SimProfiles.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGridServices.GridServer" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
<resources prefix="OpenGridServices.GridServer" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="Main.cs" />
<include name="SimProfiles.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Xml.dll" />
<include name="../bin/OpenSim.Framework.dll" />
<include name="../bin/OpenSim.Framework.Console.dll" />
<include name="../bin/OpenSim.Servers.dll" />
<include name="../bin/libsecondlife.dll" />
<include name="../bin/Db4objects.Db4o.dll" />
<include name="../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />
<mkdir dir="${project::get-base-directory()}/../bin/"/>
<copy todir="${project::get-base-directory()}/../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OGS-AssetServer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OGS-AssetServer")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,474 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using OpenGrid.Framework.Data;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Console;
using OpenSim.Framework.Sims;
using libsecondlife;
using Nwc.XmlRpc;
using System.Xml;
namespace OpenGridServices.GridServer
{
class GridManager
{
Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
public OpenSim.Framework.Interfaces.GridConfig config;
/// <summary>
/// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
/// </summary>
/// <param name="FileName">The filename to the grid server plugin DLL</param>
public void AddPlugin(string FileName)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IGridData", true);
if (typeInterface != null)
{
IGridData plug = (IGridData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise();
this._plugins.Add(plug.getName(), plug);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Storage: Added IGridData Interface");
}
typeInterface = null;
}
}
pluginAssembly = null;
}
/// <summary>
/// Returns a region by argument
/// </summary>
/// <param name="uuid">A UUID key of the region to return</param>
/// <returns>A SimProfileData for the region</returns>
public SimProfileData getRegion(libsecondlife.LLUUID uuid)
{
foreach(KeyValuePair<string,IGridData> kvp in _plugins) {
try
{
return kvp.Value.GetProfileByLLUUID(uuid);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL,"Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key);
}
}
return null;
}
/// <summary>
/// Returns a region by argument
/// </summary>
/// <param name="uuid">A regionHandle of the region to return</param>
/// <returns>A SimProfileData for the region</returns>
public SimProfileData getRegion(ulong handle)
{
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{
try
{
return kvp.Value.GetProfileByHandle(handle);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL,"Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key);
}
}
return null;
}
public Dictionary<ulong, SimProfileData> getRegions(uint xmin, uint ymin, uint xmax, uint ymax)
{
Dictionary<ulong, SimProfileData> regions = new Dictionary<ulong, SimProfileData>();
SimProfileData[] neighbours;
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{
try
{
neighbours = kvp.Value.GetProfilesInRange(xmin, ymin, xmax, ymax);
foreach (SimProfileData neighbour in neighbours)
{
regions[neighbour.regionHandle] = neighbour;
}
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Storage: Unable to query regionblock via " + kvp.Key);
}
}
return regions;
}
/// <summary>
/// Returns a XML String containing a list of the neighbouring regions
/// </summary>
/// <param name="reqhandle">The regionhandle for the center sim</param>
/// <returns>An XML string containing neighbour entities</returns>
public string GetXMLNeighbours(ulong reqhandle)
{
string response = "";
SimProfileData central_region = getRegion(reqhandle);
SimProfileData neighbour;
for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
{
if (getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256)) != null)
{
neighbour = getRegion(Util.UIntsToLong((uint)((central_region.regionLocX + x) * 256), (uint)(central_region.regionLocY + y) * 256));
response += "<neighbour>";
response += "<sim_ip>" + neighbour.serverIP + "</sim_ip>";
response += "<sim_port>" + neighbour.serverPort.ToString() + "</sim_port>";
response += "<locx>" + neighbour.regionLocX.ToString() + "</locx>";
response += "<locy>" + neighbour.regionLocY.ToString() + "</locy>";
response += "<regionhandle>" + neighbour.regionHandle.ToString() + "</regionhandle>";
response += "</neighbour>";
}
}
return response;
}
/// <summary>
/// Performed when a region connects to the grid server initially.
/// </summary>
/// <param name="request">The XMLRPC Request</param>
/// <returns>Startup parameters</returns>
public XmlRpcResponse XmlRpcLoginToSimulatorMethod(XmlRpcRequest request)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
response.Value = responseData;
SimProfileData TheSim = null;
Hashtable requestData = (Hashtable)request.Params[0];
if (requestData.ContainsKey("UUID"))
{
TheSim = getRegion(new LLUUID((string)requestData["UUID"]));
}
else if (requestData.ContainsKey("region_handle"))
{
TheSim = getRegion((ulong)Convert.ToUInt64(requestData["region_handle"]));
}
if (TheSim == null)
{
responseData["error"] = "sim not found";
}
else
{
ArrayList SimNeighboursData = new ArrayList();
SimProfileData neighbour;
Hashtable NeighbourBlock;
bool fastMode = false; // Only compatible with MySQL right now
if (fastMode)
{
Dictionary<ulong, SimProfileData> neighbours = getRegions(TheSim.regionLocX - 1, TheSim.regionLocY - 1, TheSim.regionLocX + 1, TheSim.regionLocY + 1);
foreach (KeyValuePair<ulong, SimProfileData> aSim in neighbours)
{
NeighbourBlock = new Hashtable();
NeighbourBlock["sim_ip"] = aSim.Value.serverIP.ToString();
NeighbourBlock["sim_port"] = aSim.Value.serverPort.ToString();
NeighbourBlock["region_locx"] = aSim.Value.regionLocX.ToString();
NeighbourBlock["region_locy"] = aSim.Value.regionLocY.ToString();
NeighbourBlock["UUID"] = aSim.Value.UUID.ToString();
if (aSim.Value.UUID != TheSim.UUID)
SimNeighboursData.Add(NeighbourBlock);
}
}
else
{
for (int x = -1; x < 2; x++) for (int y = -1; y < 2; y++)
{
if (getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256)) != null)
{
neighbour = getRegion(Helpers.UIntsToLong((uint)((TheSim.regionLocX + x) * 256), (uint)(TheSim.regionLocY + y) * 256));
NeighbourBlock = new Hashtable();
NeighbourBlock["sim_ip"] = neighbour.serverIP;
NeighbourBlock["sim_port"] = neighbour.serverPort.ToString();
NeighbourBlock["region_locx"] = neighbour.regionLocX.ToString();
NeighbourBlock["region_locy"] = neighbour.regionLocY.ToString();
NeighbourBlock["UUID"] = neighbour.UUID.ToString();
if (neighbour.UUID != TheSim.UUID) SimNeighboursData.Add(NeighbourBlock);
}
}
}
responseData["UUID"] = TheSim.UUID.ToString();
responseData["region_locx"] = TheSim.regionLocX.ToString();
responseData["region_locy"] = TheSim.regionLocY.ToString();
responseData["regionname"] = TheSim.regionName;
responseData["estate_id"] = "1";
responseData["neighbours"] = SimNeighboursData;
responseData["sim_ip"] = TheSim.serverIP;
responseData["sim_port"] = TheSim.serverPort.ToString();
responseData["asset_url"] = TheSim.regionAssetURI;
responseData["asset_sendkey"] = TheSim.regionAssetSendKey;
responseData["asset_recvkey"] = TheSim.regionAssetRecvKey;
responseData["user_url"] = TheSim.regionUserURI;
responseData["user_sendkey"] = TheSim.regionUserSendKey;
responseData["user_recvkey"] = TheSim.regionUserRecvKey;
responseData["authkey"] = TheSim.regionSecret;
// New! If set, use as URL to local sim storage (ie http://remotehost/region.yap)
responseData["data_uri"] = TheSim.regionDataURI;
}
return response;
}
public XmlRpcResponse XmlRpcMapBlockMethod(XmlRpcRequest request)
{
int xmin=980, ymin=980, xmax=1020, ymax=1020;
Hashtable requestData = (Hashtable)request.Params[0];
if (requestData.ContainsKey("xmin"))
{
xmin = (Int32)requestData["xmin"];
}
if (requestData.ContainsKey("ymin"))
{
ymin = (Int32)requestData["ymin"];
}
if (requestData.ContainsKey("xmax"))
{
xmax = (Int32)requestData["xmax"];
}
if (requestData.ContainsKey("ymax"))
{
ymax = (Int32)requestData["ymax"];
}
XmlRpcResponse response = new XmlRpcResponse();
Hashtable responseData = new Hashtable();
response.Value = responseData;
IList simProfileList = new ArrayList();
SimProfileData simProfile;
for (int x = xmin; x < xmax; x++)
{
for (int y = ymin; y < ymax; y++)
{
simProfile = getRegion(Helpers.UIntsToLong((uint)(x * 256), (uint)(y * 256)));
if (simProfile != null)
{
Hashtable simProfileBlock = new Hashtable();
simProfileBlock["x"] = x;
simProfileBlock["y"] = y;
simProfileBlock["name"] = simProfile.regionName;
simProfileBlock["access"] = 0;
simProfileBlock["region-flags"] = 0;
simProfileBlock["water-height"] = 20;
simProfileBlock["agents"] = 1;
simProfileBlock["map-image-id"] = simProfile.regionMapTextureID.ToString();
simProfileList.Add(simProfileBlock);
}
}
}
responseData["sim-profiles"] = simProfileList;
return response;
}
/// <summary>
/// Performs a REST Get Operation
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string RestGetRegionMethod(string request, string path, string param)
{
return RestGetSimMethod("", "/sims/", param);
}
/// <summary>
/// Performs a REST Set Operation
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string RestSetRegionMethod(string request, string path, string param)
{
return RestSetSimMethod("", "/sims/", param);
}
/// <summary>
/// Returns information about a sim via a REST Request
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns>Information about the sim in XML</returns>
public string RestGetSimMethod(string request, string path, string param)
{
string respstring = String.Empty;
SimProfileData TheSim;
LLUUID UUID = new LLUUID(param);
TheSim = getRegion(UUID);
if (!(TheSim == null))
{
respstring = "<Root>";
respstring += "<authkey>" + TheSim.regionSendKey + "</authkey>";
respstring += "<sim>";
respstring += "<uuid>" + TheSim.UUID.ToString() + "</uuid>";
respstring += "<regionname>" + TheSim.regionName + "</regionname>";
respstring += "<sim_ip>" + TheSim.serverIP + "</sim_ip>";
respstring += "<sim_port>" + TheSim.serverPort.ToString() + "</sim_port>";
respstring += "<region_locx>" + TheSim.regionLocX.ToString() + "</region_locx>";
respstring += "<region_locy>" + TheSim.regionLocY.ToString() + "</region_locy>";
respstring += "<estate_id>1</estate_id>";
respstring += "</sim>";
respstring += "</Root>";
}
return respstring;
}
/// <summary>
/// Creates or updates a sim via a REST Method Request
/// BROKEN with SQL Update
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns>"OK" or an error</returns>
public string RestSetSimMethod(string request, string path, string param)
{
Console.WriteLine("SimProfiles.cs:RestSetSimMethod() - processing request......");
SimProfileData TheSim;
TheSim = getRegion(new LLUUID(param));
if ((TheSim) == null)
{
TheSim = new SimProfileData();
LLUUID UUID = new LLUUID(param);
TheSim.UUID = UUID;
TheSim.regionRecvKey = config.SimRecvKey;
}
XmlDocument doc = new XmlDocument();
doc.LoadXml(request);
XmlNode rootnode = doc.FirstChild;
XmlNode authkeynode = rootnode.ChildNodes[0];
if (authkeynode.Name != "authkey")
{
return "ERROR! bad XML - expected authkey tag";
}
XmlNode simnode = rootnode.ChildNodes[1];
if (simnode.Name != "sim")
{
return "ERROR! bad XML - expected sim tag";
}
if (authkeynode.InnerText != TheSim.regionRecvKey)
{
return "ERROR! invalid key";
}
//TheSim.regionSendKey = Cfg;
TheSim.regionRecvKey = config.SimRecvKey;
TheSim.regionSendKey = config.SimSendKey;
TheSim.regionSecret = config.SimRecvKey;
TheSim.regionDataURI = "";
TheSim.regionAssetURI = config.DefaultAssetServer;
TheSim.regionAssetRecvKey = config.AssetRecvKey;
TheSim.regionAssetSendKey = config.AssetSendKey;
TheSim.regionUserURI = config.DefaultUserServer;
TheSim.regionUserSendKey = config.UserSendKey;
TheSim.regionUserRecvKey = config.UserRecvKey;
for (int i = 0; i < simnode.ChildNodes.Count; i++)
{
switch (simnode.ChildNodes[i].Name)
{
case "regionname":
TheSim.regionName = simnode.ChildNodes[i].InnerText;
break;
case "sim_ip":
TheSim.serverIP = simnode.ChildNodes[i].InnerText;
break;
case "sim_port":
TheSim.serverPort = Convert.ToUInt32(simnode.ChildNodes[i].InnerText);
break;
case "region_locx":
TheSim.regionLocX = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText);
TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
break;
case "region_locy":
TheSim.regionLocY = Convert.ToUInt32((string)simnode.ChildNodes[i].InnerText);
TheSim.regionHandle = Helpers.UIntsToLong((TheSim.regionLocX * 256), (TheSim.regionLocY * 256));
break;
}
}
TheSim.serverURI = "http://" + TheSim.serverIP + ":" + TheSim.serverPort + "/";
bool requirePublic = false;
if (requirePublic && (TheSim.serverIP.StartsWith("172.16") || TheSim.serverIP.StartsWith("192.168") || TheSim.serverIP.StartsWith("10.") || TheSim.serverIP.StartsWith("0.") || TheSim.serverIP.StartsWith("255.")))
{
return "ERROR! Servers must register with public addresses.";
}
try
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Attempting to add a new region to the grid - " + _plugins.Count + " storage provider(s) registered.");
foreach (KeyValuePair<string, IGridData> kvp in _plugins)
{
try
{
kvp.Value.AddProfile(TheSim);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"New sim added to grid (" + TheSim.regionName + ")");
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"getRegionPlugin Handle " + kvp.Key + " unable to add new sim: " + e.ToString());
}
}
return "OK";
}
catch (Exception e)
{
return "ERROR! Could not save to database! (" + e.ToString() + ")";
}
}
}
}

View File

@ -1,272 +0,0 @@
/*
Copyright (c) OpenSim project, http://osgrid.org/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.IO;
using System.Text;
using System.Timers;
using System.Net;
using System.Threading;
using System.Reflection;
using libsecondlife;
using OpenGrid.Framework.Manager;
using OpenSim.Framework;
using OpenSim.Framework.Sims;
using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces;
using OpenSim.Servers;
using OpenSim.GenericConfig;
namespace OpenGridServices.GridServer
{
/// <summary>
/// </summary>
public class OpenGrid_Main : BaseServer, conscmd_callback
{
private string ConfigDll = "OpenGrid.Config.GridConfigDb4o.dll";
private string GridDll = "OpenGrid.Framework.Data.DB4o.dll";
public GridConfig Cfg;
public static OpenGrid_Main thegrid;
protected IGenericConfig localXMLConfig;
public static bool setuponly;
//public LLUUID highestUUID;
// private SimProfileManager m_simProfileManager;
private GridManager m_gridManager;
private ConsoleBase m_console;
[STAThread]
public static void Main(string[] args)
{
if (args.Length > 0)
{
if (args[0] == "-setuponly") setuponly = true;
}
Console.WriteLine("Starting...\n");
thegrid = new OpenGrid_Main();
thegrid.Startup();
thegrid.Work();
}
private void Work()
{
while (true)
{
Thread.Sleep(5000);
// should flush the DB etc here
}
}
private OpenGrid_Main()
{
m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this, false);
MainConsole.Instance = m_console;
}
public void managercallback(string cmd)
{
switch (cmd)
{
case "shutdown":
RunCmd("shutdown", new string[0]);
break;
}
}
public void Startup()
{
this.localXMLConfig = new XmlConfig("GridServerConfig.xml");
this.localXMLConfig.LoadData();
this.ConfigDB(this.localXMLConfig);
this.localXMLConfig.Close();
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
Cfg = this.LoadConfigDll(this.ConfigDll);
Cfg.InitConfig();
if (setuponly) Environment.Exit(0);
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Connecting to Storage Server");
m_gridManager = new GridManager();
m_gridManager.AddPlugin(GridDll); // Made of win
m_gridManager.config = Cfg;
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(8001);
GridManagementAgent GridManagerAgent = new GridManagementAgent(httpServer, "gridserver", Cfg.SimSendKey, Cfg.SimRecvKey, managercallback);
httpServer.AddXmlRPCHandler("simulator_login", m_gridManager.XmlRpcLoginToSimulatorMethod);
httpServer.AddXmlRPCHandler("map_block", m_gridManager.XmlRpcMapBlockMethod);
httpServer.AddRestHandler("GET", "/sims/", m_gridManager.RestGetSimMethod);
httpServer.AddRestHandler("POST", "/sims/", m_gridManager.RestSetSimMethod);
httpServer.AddRestHandler("GET", "/regions/", m_gridManager.RestGetRegionMethod);
httpServer.AddRestHandler("POST", "/regions/", m_gridManager.RestSetRegionMethod);
// lbsa71 : This code snippet taken from old http server.
// I have no idea what this was supposed to do - looks like an infinite recursion to me.
// case "regions":
//// DIRTY HACK ALERT
//Console.WriteLine("/regions/ accessed");
//TheSim = OpenGrid_Main.thegrid._regionmanager.GetProfileByHandle((ulong)Convert.ToUInt64(rest_params[1]));
//respstring = ParseREST("/regions/" + rest_params[1], requestBody, HTTPmethod);
//break;
// lbsa71 : I guess these were never used?
//Listener.Prefixes.Add("http://+:8001/gods/");
//Listener.Prefixes.Add("http://+:8001/highestuuid/");
//Listener.Prefixes.Add("http://+:8001/uuidblocks/");
httpServer.Start();
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting sim status checker");
System.Timers.Timer simCheckTimer = new System.Timers.Timer(300000); // 5 minutes
simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims);
simCheckTimer.Enabled = true;
}
private GridConfig LoadConfigDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
GridConfig config = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IGridConfig", true);
if (typeInterface != null)
{
IGridConfig plug = (IGridConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
config = plug.GetConfigObject();
break;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
return config;
}
public void CheckSims(object sender, ElapsedEventArgs e)
{
/*
foreach (SimProfileBase sim in m_simProfileManager.SimProfiles.Values)
{
string SimResponse = "";
try
{
WebRequest CheckSim = WebRequest.Create("http://" + sim.sim_ip + ":" + sim.sim_port.ToString() + "/checkstatus/");
CheckSim.Method = "GET";
CheckSim.ContentType = "text/plaintext";
CheckSim.ContentLength = 0;
StreamWriter stOut = new StreamWriter(CheckSim.GetRequestStream(), System.Text.Encoding.ASCII);
stOut.Write("");
stOut.Close();
StreamReader stIn = new StreamReader(CheckSim.GetResponse().GetResponseStream());
SimResponse = stIn.ReadToEnd();
stIn.Close();
}
catch
{
}
if (SimResponse == "OK")
{
m_simProfileManager.SimProfiles[sim.UUID].online = true;
}
else
{
m_simProfileManager.SimProfiles[sim.UUID].online = false;
}
}
*/
}
public void RunCmd(string cmd, string[] cmdparams)
{
switch (cmd)
{
case "help":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - shutdown the grid (USE CAUTION!)");
break;
case "shutdown":
m_console.Close();
Environment.Exit(0);
break;
}
}
public void Show(string ShowWhat)
{
}
private void ConfigDB(IGenericConfig configData)
{
try
{
string attri = "";
attri = configData.GetAttribute("DataBaseProvider");
if (attri == "")
{
GridDll = "OpenGrid.Framework.Data.DB4o.dll";
configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll");
}
else
{
GridDll = attri;
}
configData.Commit();
}
catch (Exception e)
{
}
}
}
}

View File

@ -1,134 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{21BFC8E2-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.GridServer</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGridServices.GridServer</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.Console" >
<HintPath>OpenSim.Framework.Console.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Servers" >
<HintPath>OpenSim.Servers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.GenericConfig.Xml" >
<HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC" >
<HintPath>XMLRPC.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
<ProjectReference Include="..\OpenGrid.Framework.Manager\OpenGrid.Framework.Manager.csproj">
<Name>OpenGrid.Framework.Manager</Name>
<Project>{7924FD35-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="GridManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Main.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGridServices.GridServer" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
<resources prefix="OpenGridServices.GridServer" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="GridManager.cs" />
<include name="Main.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Xml.dll" />
<include name="../../bin/OpenSim.Framework.dll" />
<include name="../../bin/OpenSim.Framework.Console.dll" />
<include name="../../bin/OpenSim.Servers.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/OpenGrid.Framework.Manager.dll" />
<include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/Db4objects.Db4o.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OGS-GridServer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OGS-GridServer")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("b541b244-3d1d-4625-9003-bc2a3a6a39a4")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,16 +0,0 @@
<Combine name="OpenGridServices.Manager" fileversion="2.0" outputpath="../../mono-1.2.3.1/lib/monodevelop/bin" MakePkgConfig="False" MakeLibPC="True">
<Configurations active="Debug">
<Configuration name="Debug" ctype="CombineConfiguration">
<Entry build="True" name="OpenGridServices.Manager" configuration="Debug" />
</Configuration>
<Configuration name="Release" ctype="CombineConfiguration">
<Entry build="True" name="OpenGridServices.Manager" configuration="Release" />
</Configuration>
</Configurations>
<StartMode startupentry="OpenGridServices.Manager" single="True">
<Execute type="None" entry="OpenGridServices.Manager" />
</StartMode>
<Entries>
<Entry filename="./OpenGridServices.Manager/OpenGridServices.Manager.mdp" />
</Entries>
</Combine>

View File

@ -1,39 +0,0 @@
<?xml version="1.0"?>
<UserCombinePreferences filename="/home/gareth/OpenGridServices.Manager/OpenGridServices.Manager.mds">
<Files>
<File filename="Welcome" />
<File filename="./OpenGridServices.Manager/MainWindow.cs" />
<File filename="./OpenGridServices.Manager/ConnectToGridServerDialog.cs" />
<File filename="./OpenGridServices.Manager/Main.cs" />
</Files>
<Views>
<ViewMemento Id="MonoDevelop.Ide.Gui.Pads.ProjectPad">
<TreeView>
<Node expanded="True">
<Node name="OpenGridServices.Manager" expanded="True">
<Node name="References" expanded="True" />
<Node name="Resources" expanded="True" />
<Node name="UserInterface" expanded="True" />
<Node name="ConnectToGridServerDialog.cs" expanded="False" selected="True" />
</Node>
</Node>
</TreeView>
</ViewMemento>
<ViewMemento Id="MonoDevelop.Ide.Gui.Pads.ClassPad">
<TreeView>
<Node expanded="True" />
</TreeView>
</ViewMemento>
<ViewMemento Id="MonoDevelop.NUnit.TestPad">
<TreeView>
<Node expanded="False" />
</TreeView>
</ViewMemento>
</Views>
<Properties>
<Properties>
<Property key="ActiveConfiguration" value="Debug" />
<Property key="ActiveWindow" value="/home/gareth/OpenGridServices.Manager/OpenGridServices.Manager/ConnectToGridServerDialog.cs" />
</Properties>
</Properties>
</UserCombinePreferences>

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfUserTask xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />

View File

@ -1,32 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]
// The following attributes specify the key for the sign of your assembly. See the
// .NET Framework documentation for more information about signing.
// This is not required, if you don't want signing let these attributes like they're.
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]

View File

@ -1,33 +0,0 @@
using System;
using System.Threading;
using System.Collections.Generic;
using System.Text;
namespace OpenGridServices.Manager
{
public class BlockingQueue<T>
{
private Queue<T> _queue = new Queue<T>();
private object _queueSync = new object();
public void Enqueue(T value)
{
lock (_queueSync)
{
_queue.Enqueue(value);
Monitor.Pulse(_queueSync);
}
}
public T Dequeue()
{
lock (_queueSync)
{
if (_queue.Count < 1)
Monitor.Wait(_queueSync);
return _queue.Dequeue();
}
}
}
}

View File

@ -1,16 +0,0 @@
using System;
namespace OpenGridServices.Manager
{
public partial class Connect to grid server : Gtk.Dialog
{
public Connect to grid server()
{
this.Build();
}
}
}

View File

@ -1,29 +0,0 @@
using Gtk;
using System;
namespace OpenGridServices.Manager {
public partial class ConnectToGridServerDialog : Gtk.Dialog
{
public ConnectToGridServerDialog()
{
this.Build();
}
protected virtual void OnResponse(object o, Gtk.ResponseArgs args)
{
switch(args.ResponseId) {
case Gtk.ResponseType.Ok:
MainClass.PendingOperations.Enqueue("connect_to_gridserver " + this.entry1.Text + " " + this.entry2.Text + " " + this.entry3.Text);
break;
case Gtk.ResponseType.Cancel:
break;
}
this.Hide();
}
}
}

View File

@ -1,106 +0,0 @@
using Nwc.XmlRpc;
using System;
using System.Net;
using System.IO;
using System.Xml;
using System.Collections;
using System.Collections.Generic;
using libsecondlife;
namespace OpenGridServices.Manager
{
public class GridServerConnectionManager
{
private string ServerURL;
public LLUUID SessionID;
public bool connected=false;
public RegionBlock[][] WorldMap;
public bool Connect(string GridServerURL, string username, string password)
{
try {
this.ServerURL=GridServerURL;
Hashtable LoginParamsHT = new Hashtable();
LoginParamsHT["username"]=username;
LoginParamsHT["password"]=password;
ArrayList LoginParams = new ArrayList();
LoginParams.Add(LoginParamsHT);
XmlRpcRequest GridLoginReq = new XmlRpcRequest("manager_login",LoginParams);
XmlRpcResponse GridResp = GridLoginReq.Send(ServerURL,3000);
if(GridResp.IsFault) {
connected=false;
return false;
} else {
Hashtable gridrespData = (Hashtable)GridResp.Value;
this.SessionID = new LLUUID((string)gridrespData["session_id"]);
connected=true;
return true;
}
} catch(Exception e) {
Console.WriteLine(e.ToString());
connected=false;
return false;
}
}
public void DownloadMap()
{
System.Net.WebClient mapdownloader = new WebClient();
Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist");
RegionBlock TempRegionData;
XmlDocument doc = new XmlDocument();
doc.Load(regionliststream);
regionliststream.Close();
XmlNode rootnode = doc.FirstChild;
if (rootnode.Name != "regions")
{
// TODO - ERROR!
}
for(int i=0; i<=rootnode.ChildNodes.Count; i++)
{
if(rootnode.ChildNodes.Item(i).Name != "region") {
// TODO - ERROR!
} else {
TempRegionData = new RegionBlock();
}
}
}
public bool RestartServer()
{
return true;
}
public bool ShutdownServer()
{
try {
Hashtable ShutdownParamsHT = new Hashtable();
ArrayList ShutdownParams = new ArrayList();
ShutdownParamsHT["session_id"]=this.SessionID.ToString();
ShutdownParams.Add(ShutdownParamsHT);
XmlRpcRequest GridShutdownReq = new XmlRpcRequest("shutdown",ShutdownParams);
XmlRpcResponse GridResp = GridShutdownReq.Send(this.ServerURL,3000);
if(GridResp.IsFault) {
return false;
} else {
connected=false;
return true;
}
} catch(Exception e) {
Console.WriteLine(e.ToString());
return false;
}
}
public void DisconnectServer()
{
this.connected=false;
}
}
}

View File

@ -1,96 +0,0 @@
// project created on 5/14/2007 at 2:04 PM
using System;
using System.Threading;
using Gtk;
namespace OpenGridServices.Manager
{
class MainClass
{
public static bool QuitReq=false;
public static BlockingQueue<string> PendingOperations = new BlockingQueue<string>();
private static Thread OperationsRunner;
private static GridServerConnectionManager gridserverConn;
private static MainWindow win;
public static void DoMainLoop()
{
while(!QuitReq)
{
Application.RunIteration();
}
}
public static void RunOperations()
{
string operation;
string cmd;
char[] sep = new char[1];
sep[0]=' ';
while(!QuitReq)
{
operation=PendingOperations.Dequeue();
Console.WriteLine(operation);
cmd = operation.Split(sep)[0];
switch(cmd) {
case "connect_to_gridserver":
win.SetStatus("Connecting to grid server...");
if(gridserverConn.Connect(operation.Split(sep)[1],operation.Split(sep)[2],operation.Split(sep)[3])) {
win.SetStatus("Connected OK with session ID:" + gridserverConn.SessionID);
win.SetGridServerConnected(true);
Thread.Sleep(3000);
win.SetStatus("Downloading region maps...");
gridserverConn.DownloadMap();
} else {
win.SetStatus("Could not connect");
}
break;
case "restart_gridserver":
win.SetStatus("Restarting grid server...");
if(gridserverConn.RestartServer()) {
win.SetStatus("Restarted server OK");
Thread.Sleep(3000);
win.SetStatus("");
} else {
win.SetStatus("Error restarting grid server!!!");
}
break;
case "shutdown_gridserver":
win.SetStatus("Shutting down grid server...");
if(gridserverConn.ShutdownServer()) {
win.SetStatus("Grid server shutdown");
win.SetGridServerConnected(false);
Thread.Sleep(3000);
win.SetStatus("");
} else {
win.SetStatus("Could not shutdown grid server!!!");
}
break;
case "disconnect_gridserver":
gridserverConn.DisconnectServer();
win.SetGridServerConnected(false);
break;
}
}
}
public static void Main (string[] args)
{
gridserverConn = new GridServerConnectionManager();
Application.Init ();
win = new MainWindow ();
win.Show ();
OperationsRunner = new Thread(new ThreadStart(RunOperations));
OperationsRunner.IsBackground=true;
OperationsRunner.Start();
DoMainLoop();
}
}
}

View File

@ -1,76 +0,0 @@
using System;
using Gtk;
namespace OpenGridServices.Manager {
public partial class MainWindow: Gtk.Window
{
public MainWindow (): base (Gtk.WindowType.Toplevel)
{
Build ();
}
public void SetStatus(string statustext)
{
this.statusbar1.Pop(0);
this.statusbar1.Push(0,statustext);
}
public void DrawGrid(RegionBlock[][] regions)
{
for(int x=0; x<=regions.GetUpperBound(0); x++) {
for(int y=0; y<=regions.GetUpperBound(1); y++) {
Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256);
this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256);
}
}
}
public void SetGridServerConnected(bool connected)
{
if(connected) {
this.ConnectToGridserver.Visible=false;
this.DisconnectFromGridServer.Visible=true;
} else {
this.ConnectToGridserver.Visible=true;
this.DisconnectFromGridServer.Visible=false;
}
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit ();
MainClass.QuitReq=true;
a.RetVal = true;
}
protected virtual void QuitMenu(object sender, System.EventArgs e)
{
MainClass.QuitReq=true;
Application.Quit();
}
protected virtual void ConnectToGridServerMenu(object sender, System.EventArgs e)
{
ConnectToGridServerDialog griddialog = new ConnectToGridServerDialog ();
griddialog.Show();
}
protected virtual void RestartGridserverMenu(object sender, System.EventArgs e)
{
MainClass.PendingOperations.Enqueue("restart_gridserver");
}
protected virtual void ShutdownGridserverMenu(object sender, System.EventArgs e)
{
MainClass.PendingOperations.Enqueue("shutdown_gridserver");
}
protected virtual void DisconnectGridServerMenu(object sender, System.EventArgs e)
{
MainClass.PendingOperations.Enqueue("disconnect_gridserver");
}
}
}

View File

@ -1,43 +0,0 @@
<Project name="OpenGridServices.Manager" fileversion="2.0" language="C#" clr-version="Net_2_0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
<Output directory="./bin/Debug" assembly="OpenGridServices.Manager" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="./bin/Release" assembly="OpenGridServices.Manager" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
<CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
<File name="./gtk-gui/gui.stetic" subtype="Code" buildaction="EmbedAsResource" />
<File name="./gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
<File name="./MainWindow.cs" subtype="Code" buildaction="Compile" />
<File name="./Main.cs" subtype="Code" buildaction="Compile" />
<File name="./AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
<File name="./ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
<File name="./Util.cs" subtype="Code" buildaction="Compile" />
<File name="./gtk-gui/OpenGridServices.Manager.MainWindow.cs" subtype="Code" buildaction="Compile" />
<File name="./BlockingQueue.cs" subtype="Code" buildaction="Compile" />
<File name="./gtk-gui/OpenGridServices.Manager.ConnectToGridServerDialog.cs" subtype="Code" buildaction="Compile" />
<File name="./GridServerConnectionManager.cs" subtype="Code" buildaction="Compile" />
<File name="./RegionBlock.cs" subtype="Code" buildaction="Compile" />
</Contents>
<References>
<ProjectReference type="Gac" localcopy="True" refto="gtk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="glib-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="glade-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Gac" localcopy="True" refto="pango-sharp, Version=2.4.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
<ProjectReference type="Assembly" localcopy="True" refto="../../bin/libsecondlife.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
<ProjectReference type="Assembly" localcopy="True" refto="../../bin/XMLRPC.dll" />
<ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</References>
<GtkDesignInfo partialTypes="True" />
</Project>

View File

@ -1,37 +0,0 @@
using System;
using System.Xml;
using libsecondlife;
using OpenSim.Framework.Utilities;
namespace OpenGridServices.Manager
{
public class RegionBlock
{
public uint regloc_x;
public uint regloc_y;
public string httpd_url;
public string region_name;
public ulong regionhandle {
get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); }
}
public Gdk.Pixbuf MiniMap;
public RegionBlock()
{
}
public void LoadFromXmlNode(XmlNode sourcenode)
{
this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value);
this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value);
this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value;
this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value;
}
}
}

View File

@ -1,133 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using libsecondlife.Packets;
namespace OpenSim.Framework.Utilities
{
public class Util
{
private static Random randomClass = new Random();
private static uint nextXferID = 5000;
private static object XferLock = new object();
public static ulong UIntsToLong(uint X, uint Y)
{
return Helpers.UIntsToLong(X, Y);
}
public static Random RandomClass
{
get
{
return randomClass;
}
}
public static uint GetNextXferID()
{
uint id = 0;
lock(XferLock)
{
id = nextXferID;
nextXferID++;
}
return id;
}
//public static int fast_distance2d(int x, int y)
//{
// x = System.Math.Abs(x);
// y = System.Math.Abs(y);
// int min = System.Math.Min(x, y);
// return (x + y - (min >> 1) - (min >> 2) + (min >> 4));
//}
public static string FieldToString(byte[] bytes)
{
return FieldToString(bytes, String.Empty);
}
/// <summary>
/// Convert a variable length field (byte array) to a string, with a
/// field name prepended to each line of the output
/// </summary>
/// <remarks>If the byte array has unprintable characters in it, a
/// hex dump will be put in the string instead</remarks>
/// <param name="bytes">The byte array to convert to a string</param>
/// <param name="fieldName">A field name to prepend to each line of output</param>
/// <returns>An ASCII string or a string containing a hex dump, minus
/// the null terminator</returns>
public static string FieldToString(byte[] bytes, string fieldName)
{
// Check for a common case
if (bytes.Length == 0) return String.Empty;
StringBuilder output = new StringBuilder();
bool printable = true;
for (int i = 0; i < bytes.Length; ++i)
{
// Check if there are any unprintable characters in the array
if ((bytes[i] < 0x20 || bytes[i] > 0x7E) && bytes[i] != 0x09
&& bytes[i] != 0x0D && bytes[i] != 0x0A && bytes[i] != 0x00)
{
printable = false;
break;
}
}
if (printable)
{
if (fieldName.Length > 0)
{
output.Append(fieldName);
output.Append(": ");
}
if (bytes[bytes.Length - 1] == 0x00)
output.Append(UTF8Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1));
else
output.Append(UTF8Encoding.UTF8.GetString(bytes));
}
else
{
for (int i = 0; i < bytes.Length; i += 16)
{
if (i != 0)
output.Append(Environment.NewLine);
if (fieldName.Length > 0)
{
output.Append(fieldName);
output.Append(": ");
}
for (int j = 0; j < 16; j++)
{
if ((i + j) < bytes.Length)
output.Append(String.Format("{0:X2} ", bytes[i + j]));
else
output.Append(" ");
}
for (int j = 0; j < 16 && (i + j) < bytes.Length; j++)
{
if (bytes[i + j] >= 0x20 && bytes[i + j] < 0x7E)
output.Append((char)bytes[i + j]);
else
output.Append(".");
}
}
}
return output.ToString();
}
public Util()
{
}
}
}

View File

@ -1,226 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace OpenGridServices.Manager {
public partial class ConnectToGridServerDialog {
private Gtk.VBox vbox2;
private Gtk.VBox vbox3;
private Gtk.HBox hbox1;
private Gtk.Label label1;
private Gtk.Entry entry1;
private Gtk.HBox hbox2;
private Gtk.Label label2;
private Gtk.Entry entry2;
private Gtk.HBox hbox3;
private Gtk.Label label3;
private Gtk.Entry entry3;
private Gtk.Button button2;
private Gtk.Button button8;
protected virtual void Build() {
Stetic.Gui.Initialize();
// Widget OpenGridServices.Manager.ConnectToGridServerDialog
this.Events = ((Gdk.EventMask)(256));
this.Name = "OpenGridServices.Manager.ConnectToGridServerDialog";
this.Title = Mono.Unix.Catalog.GetString("Connect to Grid server");
this.WindowPosition = ((Gtk.WindowPosition)(4));
this.HasSeparator = false;
// Internal child OpenGridServices.Manager.ConnectToGridServerDialog.VBox
Gtk.VBox w1 = this.VBox;
w1.Events = ((Gdk.EventMask)(256));
w1.Name = "dialog_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog_VBox.Gtk.Box+BoxChild
this.vbox2 = new Gtk.VBox();
this.vbox2.Name = "vbox2";
// Container child vbox2.Gtk.Box+BoxChild
this.vbox3 = new Gtk.VBox();
this.vbox3.Name = "vbox3";
// Container child vbox3.Gtk.Box+BoxChild
this.hbox1 = new Gtk.HBox();
this.hbox1.Name = "hbox1";
// Container child hbox1.Gtk.Box+BoxChild
this.label1 = new Gtk.Label();
this.label1.Name = "label1";
this.label1.Xalign = 1F;
this.label1.LabelProp = Mono.Unix.Catalog.GetString("Grid server URL: ");
this.label1.Justify = ((Gtk.Justification)(1));
this.hbox1.Add(this.label1);
Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1]));
w2.Position = 0;
// Container child hbox1.Gtk.Box+BoxChild
this.entry1 = new Gtk.Entry();
this.entry1.CanFocus = true;
this.entry1.Name = "entry1";
this.entry1.Text = Mono.Unix.Catalog.GetString("http://gridserver:8001");
this.entry1.IsEditable = true;
this.entry1.MaxLength = 255;
this.entry1.InvisibleChar = '•';
this.hbox1.Add(this.entry1);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.entry1]));
w3.Position = 1;
this.vbox3.Add(this.hbox1);
Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox1]));
w4.Position = 0;
w4.Expand = false;
w4.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.hbox2 = new Gtk.HBox();
this.hbox2.Name = "hbox2";
// Container child hbox2.Gtk.Box+BoxChild
this.label2 = new Gtk.Label();
this.label2.Name = "label2";
this.label2.Xalign = 1F;
this.label2.LabelProp = Mono.Unix.Catalog.GetString("Username:");
this.label2.Justify = ((Gtk.Justification)(1));
this.hbox2.Add(this.label2);
Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox2[this.label2]));
w5.Position = 0;
// Container child hbox2.Gtk.Box+BoxChild
this.entry2 = new Gtk.Entry();
this.entry2.CanFocus = true;
this.entry2.Name = "entry2";
this.entry2.IsEditable = true;
this.entry2.InvisibleChar = '•';
this.hbox2.Add(this.entry2);
Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.hbox2[this.entry2]));
w6.Position = 1;
this.vbox3.Add(this.hbox2);
Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox2]));
w7.Position = 1;
w7.Expand = false;
w7.Fill = false;
// Container child vbox3.Gtk.Box+BoxChild
this.hbox3 = new Gtk.HBox();
this.hbox3.Name = "hbox3";
// Container child hbox3.Gtk.Box+BoxChild
this.label3 = new Gtk.Label();
this.label3.Name = "label3";
this.label3.Xalign = 1F;
this.label3.LabelProp = Mono.Unix.Catalog.GetString("Password:");
this.label3.Justify = ((Gtk.Justification)(1));
this.hbox3.Add(this.label3);
Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox3[this.label3]));
w8.Position = 0;
// Container child hbox3.Gtk.Box+BoxChild
this.entry3 = new Gtk.Entry();
this.entry3.CanFocus = true;
this.entry3.Name = "entry3";
this.entry3.IsEditable = true;
this.entry3.InvisibleChar = '•';
this.hbox3.Add(this.entry3);
Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.hbox3[this.entry3]));
w9.Position = 1;
this.vbox3.Add(this.hbox3);
Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox3[this.hbox3]));
w10.Position = 2;
w10.Expand = false;
w10.Fill = false;
this.vbox2.Add(this.vbox3);
Gtk.Box.BoxChild w11 = ((Gtk.Box.BoxChild)(this.vbox2[this.vbox3]));
w11.Position = 2;
w11.Expand = false;
w11.Fill = false;
w1.Add(this.vbox2);
Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.vbox2]));
w12.Position = 0;
// Internal child OpenGridServices.Manager.ConnectToGridServerDialog.ActionArea
Gtk.HButtonBox w13 = this.ActionArea;
w13.Events = ((Gdk.EventMask)(256));
w13.Name = "OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea";
w13.Spacing = 6;
w13.BorderWidth = ((uint)(5));
w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
// Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.button2 = new Gtk.Button();
this.button2.CanDefault = true;
this.button2.CanFocus = true;
this.button2.Name = "button2";
this.button2.UseUnderline = true;
// Container child button2.Gtk.Container+ContainerChild
Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
w14.Name = "GtkAlignment";
// Container child GtkAlignment.Gtk.Container+ContainerChild
Gtk.HBox w15 = new Gtk.HBox();
w15.Name = "GtkHBox";
w15.Spacing = 2;
// Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Image w16 = new Gtk.Image();
w16.Name = "image1";
w16.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-apply", 16, 0);
w15.Add(w16);
// Container child GtkHBox.Gtk.Container+ContainerChild
Gtk.Label w18 = new Gtk.Label();
w18.Name = "GtkLabel";
w18.LabelProp = Mono.Unix.Catalog.GetString("Connect");
w18.UseUnderline = true;
w15.Add(w18);
w14.Add(w15);
this.button2.Add(w14);
this.AddActionWidget(this.button2, -5);
Gtk.ButtonBox.ButtonBoxChild w22 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button2]));
w22.Expand = false;
w22.Fill = false;
// Container child OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.button8 = new Gtk.Button();
this.button8.CanDefault = true;
this.button8.CanFocus = true;
this.button8.Name = "button8";
this.button8.UseUnderline = true;
// Container child button8.Gtk.Container+ContainerChild
Gtk.Alignment w23 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
w23.Name = "GtkAlignment1";
// Container child GtkAlignment1.Gtk.Container+ContainerChild
Gtk.HBox w24 = new Gtk.HBox();
w24.Name = "GtkHBox1";
w24.Spacing = 2;
// Container child GtkHBox1.Gtk.Container+ContainerChild
Gtk.Image w25 = new Gtk.Image();
w25.Name = "image2";
w25.Pixbuf = Gtk.IconTheme.Default.LoadIcon("gtk-cancel", 16, 0);
w24.Add(w25);
// Container child GtkHBox1.Gtk.Container+ContainerChild
Gtk.Label w27 = new Gtk.Label();
w27.Name = "GtkLabel1";
w27.LabelProp = Mono.Unix.Catalog.GetString("Cancel");
w27.UseUnderline = true;
w24.Add(w27);
w23.Add(w24);
this.button8.Add(w23);
this.AddActionWidget(this.button8, -6);
Gtk.ButtonBox.ButtonBoxChild w31 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.button8]));
w31.Position = 1;
w31.Expand = false;
w31.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 476;
this.DefaultHeight = 137;
this.Show();
this.Response += new Gtk.ResponseHandler(this.OnResponse);
}
}
}

View File

@ -1,256 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace OpenGridServices.Manager {
public partial class MainWindow {
private Gtk.Action Grid;
private Gtk.Action User;
private Gtk.Action Asset;
private Gtk.Action Region;
private Gtk.Action Services;
private Gtk.Action ConnectToGridserver;
private Gtk.Action RestartWholeGrid;
private Gtk.Action ShutdownWholeGrid;
private Gtk.Action ExitGridManager;
private Gtk.Action ConnectToUserserver;
private Gtk.Action AccountManagment;
private Gtk.Action GlobalNotice;
private Gtk.Action DisableAllLogins;
private Gtk.Action DisableNonGodUsersOnly;
private Gtk.Action ShutdownUserServer;
private Gtk.Action ShutdownGridserverOnly;
private Gtk.Action RestartGridserverOnly;
private Gtk.Action DefaultLocalGridUserserver;
private Gtk.Action CustomUserserver;
private Gtk.Action RemoteGridDefaultUserserver;
private Gtk.Action DisconnectFromGridServer;
private Gtk.Action UploadAsset;
private Gtk.Action AssetManagement;
private Gtk.Action ConnectToAssetServer;
private Gtk.Action ConnectToDefaultAssetServerForGrid;
private Gtk.Action DefaultForLocalGrid;
private Gtk.Action DefaultForRemoteGrid;
private Gtk.Action CustomAssetServer;
private Gtk.VBox vbox1;
private Gtk.MenuBar menubar2;
private Gtk.HBox hbox1;
private Gtk.ScrolledWindow scrolledwindow1;
private Gtk.DrawingArea drawingarea1;
private Gtk.TreeView treeview1;
private Gtk.Statusbar statusbar1;
protected virtual void Build() {
Stetic.Gui.Initialize();
// Widget OpenGridServices.Manager.MainWindow
Gtk.UIManager w1 = new Gtk.UIManager();
Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default");
this.Grid = new Gtk.Action("Grid", Mono.Unix.Catalog.GetString("Grid"), null, null);
this.Grid.HideIfEmpty = false;
this.Grid.ShortLabel = Mono.Unix.Catalog.GetString("Grid");
w2.Add(this.Grid, "<Alt><Mod2>g");
this.User = new Gtk.Action("User", Mono.Unix.Catalog.GetString("User"), null, null);
this.User.HideIfEmpty = false;
this.User.ShortLabel = Mono.Unix.Catalog.GetString("User");
w2.Add(this.User, null);
this.Asset = new Gtk.Action("Asset", Mono.Unix.Catalog.GetString("Asset"), null, null);
this.Asset.HideIfEmpty = false;
this.Asset.ShortLabel = Mono.Unix.Catalog.GetString("Asset");
w2.Add(this.Asset, null);
this.Region = new Gtk.Action("Region", Mono.Unix.Catalog.GetString("Region"), null, null);
this.Region.ShortLabel = Mono.Unix.Catalog.GetString("Region");
w2.Add(this.Region, null);
this.Services = new Gtk.Action("Services", Mono.Unix.Catalog.GetString("Services"), null, null);
this.Services.ShortLabel = Mono.Unix.Catalog.GetString("Services");
w2.Add(this.Services, null);
this.ConnectToGridserver = new Gtk.Action("ConnectToGridserver", Mono.Unix.Catalog.GetString("Connect to gridserver..."), null, "gtk-connect");
this.ConnectToGridserver.HideIfEmpty = false;
this.ConnectToGridserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to gridserver");
w2.Add(this.ConnectToGridserver, null);
this.RestartWholeGrid = new Gtk.Action("RestartWholeGrid", Mono.Unix.Catalog.GetString("Restart whole grid"), null, "gtk-refresh");
this.RestartWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Restart whole grid");
w2.Add(this.RestartWholeGrid, null);
this.ShutdownWholeGrid = new Gtk.Action("ShutdownWholeGrid", Mono.Unix.Catalog.GetString("Shutdown whole grid"), null, "gtk-stop");
this.ShutdownWholeGrid.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown whole grid");
w2.Add(this.ShutdownWholeGrid, null);
this.ExitGridManager = new Gtk.Action("ExitGridManager", Mono.Unix.Catalog.GetString("Exit grid manager"), null, "gtk-close");
this.ExitGridManager.ShortLabel = Mono.Unix.Catalog.GetString("Exit grid manager");
w2.Add(this.ExitGridManager, null);
this.ConnectToUserserver = new Gtk.Action("ConnectToUserserver", Mono.Unix.Catalog.GetString("Connect to userserver"), null, "gtk-connect");
this.ConnectToUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Connect to userserver");
w2.Add(this.ConnectToUserserver, null);
this.AccountManagment = new Gtk.Action("AccountManagment", Mono.Unix.Catalog.GetString("Account managment"), null, "gtk-properties");
this.AccountManagment.ShortLabel = Mono.Unix.Catalog.GetString("Account managment");
w2.Add(this.AccountManagment, null);
this.GlobalNotice = new Gtk.Action("GlobalNotice", Mono.Unix.Catalog.GetString("Global notice"), null, "gtk-network");
this.GlobalNotice.ShortLabel = Mono.Unix.Catalog.GetString("Global notice");
w2.Add(this.GlobalNotice, null);
this.DisableAllLogins = new Gtk.Action("DisableAllLogins", Mono.Unix.Catalog.GetString("Disable all logins"), null, "gtk-no");
this.DisableAllLogins.ShortLabel = Mono.Unix.Catalog.GetString("Disable all logins");
w2.Add(this.DisableAllLogins, null);
this.DisableNonGodUsersOnly = new Gtk.Action("DisableNonGodUsersOnly", Mono.Unix.Catalog.GetString("Disable non-god users only"), null, "gtk-no");
this.DisableNonGodUsersOnly.ShortLabel = Mono.Unix.Catalog.GetString("Disable non-god users only");
w2.Add(this.DisableNonGodUsersOnly, null);
this.ShutdownUserServer = new Gtk.Action("ShutdownUserServer", Mono.Unix.Catalog.GetString("Shutdown user server"), null, "gtk-stop");
this.ShutdownUserServer.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown user server");
w2.Add(this.ShutdownUserServer, null);
this.ShutdownGridserverOnly = new Gtk.Action("ShutdownGridserverOnly", Mono.Unix.Catalog.GetString("Shutdown gridserver only"), null, "gtk-stop");
this.ShutdownGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Shutdown gridserver only");
w2.Add(this.ShutdownGridserverOnly, null);
this.RestartGridserverOnly = new Gtk.Action("RestartGridserverOnly", Mono.Unix.Catalog.GetString("Restart gridserver only"), null, "gtk-refresh");
this.RestartGridserverOnly.ShortLabel = Mono.Unix.Catalog.GetString("Restart gridserver only");
w2.Add(this.RestartGridserverOnly, null);
this.DefaultLocalGridUserserver = new Gtk.Action("DefaultLocalGridUserserver", Mono.Unix.Catalog.GetString("Default local grid userserver"), null, null);
this.DefaultLocalGridUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Default local grid userserver");
w2.Add(this.DefaultLocalGridUserserver, null);
this.CustomUserserver = new Gtk.Action("CustomUserserver", Mono.Unix.Catalog.GetString("Custom userserver..."), null, null);
this.CustomUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Custom userserver");
w2.Add(this.CustomUserserver, null);
this.RemoteGridDefaultUserserver = new Gtk.Action("RemoteGridDefaultUserserver", Mono.Unix.Catalog.GetString("Remote grid default userserver..."), null, null);
this.RemoteGridDefaultUserserver.ShortLabel = Mono.Unix.Catalog.GetString("Remote grid default userserver");
w2.Add(this.RemoteGridDefaultUserserver, null);
this.DisconnectFromGridServer = new Gtk.Action("DisconnectFromGridServer", Mono.Unix.Catalog.GetString("Disconnect from grid server"), null, "gtk-disconnect");
this.DisconnectFromGridServer.ShortLabel = Mono.Unix.Catalog.GetString("Disconnect from grid server");
this.DisconnectFromGridServer.Visible = false;
w2.Add(this.DisconnectFromGridServer, null);
this.UploadAsset = new Gtk.Action("UploadAsset", Mono.Unix.Catalog.GetString("Upload asset"), null, null);
this.UploadAsset.ShortLabel = Mono.Unix.Catalog.GetString("Upload asset");
w2.Add(this.UploadAsset, null);
this.AssetManagement = new Gtk.Action("AssetManagement", Mono.Unix.Catalog.GetString("Asset management"), null, null);
this.AssetManagement.ShortLabel = Mono.Unix.Catalog.GetString("Asset management");
w2.Add(this.AssetManagement, null);
this.ConnectToAssetServer = new Gtk.Action("ConnectToAssetServer", Mono.Unix.Catalog.GetString("Connect to asset server"), null, null);
this.ConnectToAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Connect to asset server");
w2.Add(this.ConnectToAssetServer, null);
this.ConnectToDefaultAssetServerForGrid = new Gtk.Action("ConnectToDefaultAssetServerForGrid", Mono.Unix.Catalog.GetString("Connect to default asset server for grid"), null, null);
this.ConnectToDefaultAssetServerForGrid.ShortLabel = Mono.Unix.Catalog.GetString("Connect to default asset server for grid");
w2.Add(this.ConnectToDefaultAssetServerForGrid, null);
this.DefaultForLocalGrid = new Gtk.Action("DefaultForLocalGrid", Mono.Unix.Catalog.GetString("Default for local grid"), null, null);
this.DefaultForLocalGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for local grid");
w2.Add(this.DefaultForLocalGrid, null);
this.DefaultForRemoteGrid = new Gtk.Action("DefaultForRemoteGrid", Mono.Unix.Catalog.GetString("Default for remote grid..."), null, null);
this.DefaultForRemoteGrid.ShortLabel = Mono.Unix.Catalog.GetString("Default for remote grid...");
w2.Add(this.DefaultForRemoteGrid, null);
this.CustomAssetServer = new Gtk.Action("CustomAssetServer", Mono.Unix.Catalog.GetString("Custom asset server..."), null, null);
this.CustomAssetServer.ShortLabel = Mono.Unix.Catalog.GetString("Custom asset server...");
w2.Add(this.CustomAssetServer, null);
w1.InsertActionGroup(w2, 0);
this.AddAccelGroup(w1.AccelGroup);
this.WidthRequest = 800;
this.HeightRequest = 600;
this.Name = "OpenGridServices.Manager.MainWindow";
this.Title = Mono.Unix.Catalog.GetString("Open Grid Services Manager");
this.Icon = Gtk.IconTheme.Default.LoadIcon("gtk-network", 48, 0);
// Container child OpenGridServices.Manager.MainWindow.Gtk.Container+ContainerChild
this.vbox1 = new Gtk.VBox();
this.vbox1.Name = "vbox1";
// Container child vbox1.Gtk.Box+BoxChild
w1.AddUiFromString("<ui><menubar name='menubar2'><menu action='Grid'><menuitem action='ConnectToGridserver'/><menuitem action='DisconnectFromGridServer'/><separator/><menuitem action='RestartWholeGrid'/><menuitem action='RestartGridserverOnly'/><separator/><menuitem action='ShutdownWholeGrid'/><menuitem action='ShutdownGridserverOnly'/><separator/><menuitem action='ExitGridManager'/></menu><menu action='User'><menu action='ConnectToUserserver'><menuitem action='DefaultLocalGridUserserver'/><menuitem action='CustomUserserver'/><menuitem action='RemoteGridDefaultUserserver'/></menu><separator/><menuitem action='AccountManagment'/><menuitem action='GlobalNotice'/><separator/><menuitem action='DisableAllLogins'/><menuitem action='DisableNonGodUsersOnly'/><separator/><menuitem action='ShutdownUserServer'/></menu><menu action='Asset'><menuitem action='UploadAsset'/><menuitem action='AssetManagement'/><menu action='ConnectToAssetServer'><menuitem action='DefaultForLocalGrid'/><menuitem action='DefaultForRemoteGrid'/><menuitem action='CustomAssetServer'/></menu></menu><menu action='Region'/><menu action='Services'/></menubar></ui>");
this.menubar2 = ((Gtk.MenuBar)(w1.GetWidget("/menubar2")));
this.menubar2.HeightRequest = 25;
this.menubar2.Name = "menubar2";
this.vbox1.Add(this.menubar2);
Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar2]));
w3.Position = 0;
w3.Expand = false;
w3.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.hbox1 = new Gtk.HBox();
this.hbox1.Name = "hbox1";
// Container child hbox1.Gtk.Box+BoxChild
this.scrolledwindow1 = new Gtk.ScrolledWindow();
this.scrolledwindow1.CanFocus = true;
this.scrolledwindow1.Name = "scrolledwindow1";
this.scrolledwindow1.VscrollbarPolicy = ((Gtk.PolicyType)(1));
this.scrolledwindow1.HscrollbarPolicy = ((Gtk.PolicyType)(1));
// Container child scrolledwindow1.Gtk.Container+ContainerChild
Gtk.Viewport w4 = new Gtk.Viewport();
w4.Name = "GtkViewport";
w4.ShadowType = ((Gtk.ShadowType)(0));
// Container child GtkViewport.Gtk.Container+ContainerChild
this.drawingarea1 = new Gtk.DrawingArea();
this.drawingarea1.Name = "drawingarea1";
w4.Add(this.drawingarea1);
this.scrolledwindow1.Add(w4);
this.hbox1.Add(this.scrolledwindow1);
Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow1]));
w7.Position = 1;
// Container child hbox1.Gtk.Box+BoxChild
this.treeview1 = new Gtk.TreeView();
this.treeview1.CanFocus = true;
this.treeview1.Name = "treeview1";
this.hbox1.Add(this.treeview1);
Gtk.Box.BoxChild w8 = ((Gtk.Box.BoxChild)(this.hbox1[this.treeview1]));
w8.Position = 2;
this.vbox1.Add(this.hbox1);
Gtk.Box.BoxChild w9 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
w9.Position = 1;
// Container child vbox1.Gtk.Box+BoxChild
this.statusbar1 = new Gtk.Statusbar();
this.statusbar1.Name = "statusbar1";
this.statusbar1.Spacing = 5;
this.vbox1.Add(this.statusbar1);
Gtk.Box.BoxChild w10 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
w10.PackType = ((Gtk.PackType)(1));
w10.Position = 2;
w10.Expand = false;
w10.Fill = false;
this.Add(this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll();
}
this.DefaultWidth = 800;
this.DefaultHeight = 800;
this.Show();
this.DeleteEvent += new Gtk.DeleteEventHandler(this.OnDeleteEvent);
this.ConnectToGridserver.Activated += new System.EventHandler(this.ConnectToGridServerMenu);
this.ExitGridManager.Activated += new System.EventHandler(this.QuitMenu);
this.ShutdownGridserverOnly.Activated += new System.EventHandler(this.ShutdownGridserverMenu);
this.RestartGridserverOnly.Activated += new System.EventHandler(this.RestartGridserverMenu);
this.DisconnectFromGridServer.Activated += new System.EventHandler(this.DisconnectGridServerMenu);
}
}
}

View File

@ -1,35 +0,0 @@
// ------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Mono Runtime Version: 2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
// ------------------------------------------------------------------------------
namespace Stetic {
internal class Gui {
private static bool initialized;
internal static void Initialize() {
if ((Stetic.Gui.initialized == false)) {
Stetic.Gui.initialized = true;
}
}
}
internal class ActionGroups {
public static Gtk.ActionGroup GetActionGroup(System.Type type) {
return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
public static Gtk.ActionGroup GetActionGroup(string name) {
return null;
}
}
}

View File

@ -1,502 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<stetic-interface>
<widget class="Gtk.Window" id="OpenGridServices.Manager.MainWindow" design-size="800 800">
<action-group name="Default">
<action id="Grid">
<property name="Type">Action</property>
<property name="Accelerator">&lt;Alt&gt;&lt;Mod2&gt;g</property>
<property name="HideIfEmpty">False</property>
<property name="Label" translatable="yes">Grid</property>
<property name="ShortLabel" translatable="yes">Grid</property>
</action>
<action id="User">
<property name="Type">Action</property>
<property name="HideIfEmpty">False</property>
<property name="Label" translatable="yes">User</property>
<property name="ShortLabel" translatable="yes">User</property>
</action>
<action id="Asset">
<property name="Type">Action</property>
<property name="HideIfEmpty">False</property>
<property name="Label" translatable="yes">Asset</property>
<property name="ShortLabel" translatable="yes">Asset</property>
</action>
<action id="Region">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Region</property>
<property name="ShortLabel" translatable="yes">Region</property>
</action>
<action id="Services">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Services</property>
<property name="ShortLabel" translatable="yes">Services</property>
</action>
<action id="ConnectToGridserver">
<property name="Type">Action</property>
<property name="HideIfEmpty">False</property>
<property name="Label" translatable="yes">Connect to gridserver...</property>
<property name="ShortLabel" translatable="yes">Connect to gridserver</property>
<property name="StockId">gtk-connect</property>
<signal name="Activated" handler="ConnectToGridServerMenu" />
</action>
<action id="RestartWholeGrid">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Restart whole grid</property>
<property name="ShortLabel" translatable="yes">Restart whole grid</property>
<property name="StockId">gtk-refresh</property>
</action>
<action id="ShutdownWholeGrid">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Shutdown whole grid</property>
<property name="ShortLabel" translatable="yes">Shutdown whole grid</property>
<property name="StockId">gtk-stop</property>
</action>
<action id="ExitGridManager">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Exit grid manager</property>
<property name="ShortLabel" translatable="yes">Exit grid manager</property>
<property name="StockId">gtk-close</property>
<signal name="Activated" handler="QuitMenu" after="yes" />
</action>
<action id="ConnectToUserserver">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Connect to userserver</property>
<property name="ShortLabel" translatable="yes">Connect to userserver</property>
<property name="StockId">gtk-connect</property>
</action>
<action id="AccountManagment">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Account managment</property>
<property name="ShortLabel" translatable="yes">Account managment</property>
<property name="StockId">gtk-properties</property>
</action>
<action id="GlobalNotice">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Global notice</property>
<property name="ShortLabel" translatable="yes">Global notice</property>
<property name="StockId">gtk-network</property>
</action>
<action id="DisableAllLogins">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Disable all logins</property>
<property name="ShortLabel" translatable="yes">Disable all logins</property>
<property name="StockId">gtk-no</property>
</action>
<action id="DisableNonGodUsersOnly">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Disable non-god users only</property>
<property name="ShortLabel" translatable="yes">Disable non-god users only</property>
<property name="StockId">gtk-no</property>
</action>
<action id="ShutdownUserServer">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Shutdown user server</property>
<property name="ShortLabel" translatable="yes">Shutdown user server</property>
<property name="StockId">gtk-stop</property>
</action>
<action id="ShutdownGridserverOnly">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Shutdown gridserver only</property>
<property name="ShortLabel" translatable="yes">Shutdown gridserver only</property>
<property name="StockId">gtk-stop</property>
<signal name="Activated" handler="ShutdownGridserverMenu" after="yes" />
</action>
<action id="RestartGridserverOnly">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Restart gridserver only</property>
<property name="ShortLabel" translatable="yes">Restart gridserver only</property>
<property name="StockId">gtk-refresh</property>
<signal name="Activated" handler="RestartGridserverMenu" after="yes" />
</action>
<action id="DefaultLocalGridUserserver">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Default local grid userserver</property>
<property name="ShortLabel" translatable="yes">Default local grid userserver</property>
</action>
<action id="CustomUserserver">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Custom userserver...</property>
<property name="ShortLabel" translatable="yes">Custom userserver</property>
</action>
<action id="RemoteGridDefaultUserserver">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Remote grid default userserver...</property>
<property name="ShortLabel" translatable="yes">Remote grid default userserver</property>
</action>
<action id="DisconnectFromGridServer">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Disconnect from grid server</property>
<property name="ShortLabel" translatable="yes">Disconnect from grid server</property>
<property name="StockId">gtk-disconnect</property>
<property name="Visible">False</property>
<signal name="Activated" handler="DisconnectGridServerMenu" after="yes" />
</action>
<action id="UploadAsset">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Upload asset</property>
<property name="ShortLabel" translatable="yes">Upload asset</property>
</action>
<action id="AssetManagement">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Asset management</property>
<property name="ShortLabel" translatable="yes">Asset management</property>
</action>
<action id="ConnectToAssetServer">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Connect to asset server</property>
<property name="ShortLabel" translatable="yes">Connect to asset server</property>
</action>
<action id="ConnectToDefaultAssetServerForGrid">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Connect to default asset server for grid</property>
<property name="ShortLabel" translatable="yes">Connect to default asset server for grid</property>
</action>
<action id="DefaultForLocalGrid">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Default for local grid</property>
<property name="ShortLabel" translatable="yes">Default for local grid</property>
</action>
<action id="DefaultForRemoteGrid">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Default for remote grid...</property>
<property name="ShortLabel" translatable="yes">Default for remote grid...</property>
</action>
<action id="CustomAssetServer">
<property name="Type">Action</property>
<property name="Label" translatable="yes">Custom asset server...</property>
<property name="ShortLabel" translatable="yes">Custom asset server...</property>
</action>
</action-group>
<property name="MemberName" />
<property name="WidthRequest">800</property>
<property name="HeightRequest">600</property>
<property name="Title" translatable="yes">Open Grid Services Manager</property>
<property name="Icon">stock:gtk-network Dialog</property>
<signal name="DeleteEvent" handler="OnDeleteEvent" />
<child>
<widget class="Gtk.VBox" id="vbox1">
<property name="MemberName" />
<child>
<widget class="Gtk.MenuBar" id="menubar2">
<property name="MemberName" />
<property name="HeightRequest">25</property>
<node name="menubar2" type="Menubar">
<node type="Menu" action="Grid">
<node type="Menuitem" action="ConnectToGridserver" />
<node type="Menuitem" action="DisconnectFromGridServer" />
<node type="Separator" />
<node type="Menuitem" action="RestartWholeGrid" />
<node type="Menuitem" action="RestartGridserverOnly" />
<node type="Separator" />
<node type="Menuitem" action="ShutdownWholeGrid" />
<node type="Menuitem" action="ShutdownGridserverOnly" />
<node type="Separator" />
<node type="Menuitem" action="ExitGridManager" />
</node>
<node type="Menu" action="User">
<node type="Menu" action="ConnectToUserserver">
<node type="Menuitem" action="DefaultLocalGridUserserver" />
<node type="Menuitem" action="CustomUserserver" />
<node type="Menuitem" action="RemoteGridDefaultUserserver" />
</node>
<node type="Separator" />
<node type="Menuitem" action="AccountManagment" />
<node type="Menuitem" action="GlobalNotice" />
<node type="Separator" />
<node type="Menuitem" action="DisableAllLogins" />
<node type="Menuitem" action="DisableNonGodUsersOnly" />
<node type="Separator" />
<node type="Menuitem" action="ShutdownUserServer" />
</node>
<node type="Menu" action="Asset">
<node type="Menuitem" action="UploadAsset" />
<node type="Menuitem" action="AssetManagement" />
<node type="Menu" action="ConnectToAssetServer">
<node type="Menuitem" action="DefaultForLocalGrid" />
<node type="Menuitem" action="DefaultForRemoteGrid" />
<node type="Menuitem" action="CustomAssetServer" />
</node>
</node>
<node type="Menu" action="Region" />
<node type="Menu" action="Services" />
</node>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
<child>
<placeholder />
</child>
<child>
<widget class="Gtk.ScrolledWindow" id="scrolledwindow1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="VscrollbarPolicy">Automatic</property>
<property name="HscrollbarPolicy">Automatic</property>
<child>
<widget class="Gtk.Viewport" id="GtkViewport">
<property name="MemberName" />
<property name="ShadowType">None</property>
<child>
<widget class="Gtk.DrawingArea" id="drawingarea1">
<property name="MemberName" />
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<widget class="Gtk.TreeView" id="treeview1">
<property name="MemberName" />
<property name="CanFocus">True</property>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<widget class="Gtk.Statusbar" id="statusbar1">
<property name="MemberName">statusBar1</property>
<property name="Spacing">5</property>
<child>
<placeholder />
</child>
<child>
<placeholder />
</child>
</widget>
<packing>
<property name="PackType">End</property>
<property name="Position">2</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="Gtk.Dialog" id="OpenGridServices.Manager.ConnectToGridServerDialog" design-size="476 137">
<property name="MemberName" />
<property name="Events">ButtonPressMask</property>
<property name="Title" translatable="yes">Connect to Grid server</property>
<property name="WindowPosition">CenterOnParent</property>
<property name="Buttons">2</property>
<property name="HelpButton">False</property>
<property name="HasSeparator">False</property>
<signal name="Response" handler="OnResponse" />
<child internal-child="VBox">
<widget class="Gtk.VBox" id="dialog_VBox">
<property name="MemberName" />
<property name="Events">ButtonPressMask</property>
<property name="BorderWidth">2</property>
<child>
<widget class="Gtk.VBox" id="vbox2">
<property name="MemberName" />
<child>
<placeholder />
</child>
<child>
<placeholder />
</child>
<child>
<widget class="Gtk.VBox" id="vbox3">
<property name="MemberName" />
<child>
<widget class="Gtk.HBox" id="hbox1">
<property name="MemberName" />
<child>
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="Xalign">1</property>
<property name="LabelProp" translatable="yes">Grid server URL: </property>
<property name="Justify">Right</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="entry1">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Text" translatable="yes">http://gridserver:8001</property>
<property name="IsEditable">True</property>
<property name="MaxLength">255</property>
<property name="InvisibleChar">•</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<placeholder />
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox2">
<property name="MemberName" />
<child>
<widget class="Gtk.Label" id="label2">
<property name="MemberName" />
<property name="Xalign">1</property>
<property name="LabelProp" translatable="yes">Username:</property>
<property name="Justify">Right</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="entry2">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<placeholder />
</child>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">False</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.HBox" id="hbox3">
<property name="MemberName" />
<child>
<widget class="Gtk.Label" id="label3">
<property name="MemberName" />
<property name="Xalign">1</property>
<property name="LabelProp" translatable="yes">Password:</property>
<property name="Justify">Right</property>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Entry" id="entry3">
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="IsEditable">True</property>
<property name="InvisibleChar">•</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="AutoSize">True</property>
</packing>
</child>
<child>
<placeholder />
</child>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">2</property>
<property name="AutoSize">True</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
</packing>
</child>
</widget>
</child>
<child internal-child="ActionArea">
<widget class="Gtk.HButtonBox" id="OpenGridServices.Manager.ConnectToGridServerDialog_ActionArea">
<property name="MemberName" />
<property name="Events">ButtonPressMask</property>
<property name="Spacing">6</property>
<property name="BorderWidth">5</property>
<property name="Size">2</property>
<property name="LayoutStyle">End</property>
<child>
<widget class="Gtk.Button" id="button2">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-apply Menu</property>
<property name="Label" translatable="yes">Connect</property>
<property name="UseUnderline">True</property>
<property name="IsDialogButton">True</property>
<property name="ResponseId">-5</property>
</widget>
<packing>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
<child>
<widget class="Gtk.Button" id="button8">
<property name="MemberName" />
<property name="CanDefault">True</property>
<property name="CanFocus">True</property>
<property name="Type">TextAndIcon</property>
<property name="Icon">stock:gtk-cancel Menu</property>
<property name="Label" translatable="yes">Cancel</property>
<property name="UseUnderline">True</property>
<property name="IsDialogButton">True</property>
<property name="ResponseId">-6</property>
</widget>
<packing>
<property name="Position">1</property>
<property name="Expand">False</property>
<property name="Fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</stetic-interface>

View File

@ -1,217 +0,0 @@
/*
Copyright (c) OpenSim project, http://osgrid.org/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using System.Text;
using libsecondlife;
using OpenSim.Framework.User;
using OpenSim.Framework.Sims;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Console;
using OpenSim.Servers;
using OpenSim.Framework.Utilities;
using OpenSim.GenericConfig;
namespace OpenGridServices.UserServer
{
/// <summary>
/// </summary>
public class OpenUser_Main : BaseServer, conscmd_callback
{
private string ConfigDll = "OpenUser.Config.UserConfigDb4o.dll";
private string StorageDll = "OpenGrid.Framework.Data.DB4o.dll";
private UserConfig Cfg;
protected IGenericConfig localXMLConfig;
public UserManager m_userManager; // Replaces below.
//private UserProfileManager m_userProfileManager; // Depreciated
public Dictionary<LLUUID, UserProfile> UserSessions = new Dictionary<LLUUID, UserProfile>();
ConsoleBase m_console;
[STAThread]
public static void Main(string[] args)
{
Console.WriteLine("Starting...\n");
OpenUser_Main userserver = new OpenUser_Main();
userserver.Startup();
userserver.Work();
}
private OpenUser_Main()
{
m_console = new ConsoleBase("opengrid-userserver-console.log", "OpenUser", this , false);
MainConsole.Instance = m_console;
}
private void Work()
{
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"\nEnter help for a list of commands\n");
while (true)
{
m_console.MainConsolePrompt();
}
}
public void Startup()
{
this.localXMLConfig = new XmlConfig("UserServerConfig.xml");
this.localXMLConfig.LoadData();
this.ConfigDB(this.localXMLConfig);
this.localXMLConfig.Close();
MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Loading configuration");
Cfg = this.LoadConfigDll(this.ConfigDll);
Cfg.InitConfig();
MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Establishing data connection");
m_userManager = new UserManager();
m_userManager._config = Cfg;
m_userManager.AddPlugin(StorageDll);
MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Main.cs:Startup() - Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(8002);
httpServer.AddXmlRPCHandler("login_to_simulator", m_userManager.XmlRpcLoginMethod);
httpServer.AddRestHandler("DELETE", "/usersessions/", m_userManager.RestDeleteUserSessionMethod);
httpServer.Start();
}
public void do_create(string what)
{
switch (what)
{
case "user":
string tempfirstname;
string templastname;
string tempMD5Passwd;
uint regX = 997;
uint regY = 996;
tempfirstname = m_console.CmdPrompt("First name");
templastname = m_console.CmdPrompt("Last name");
tempMD5Passwd = m_console.PasswdPrompt("Password");
regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X"));
regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y"));
tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + "");
m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY);
break;
}
}
public void RunCmd(string cmd, string[] cmdparams)
{
switch (cmd)
{
case "help":
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"create user - create a new user");
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"shutdown - shutdown the grid (USE CAUTION!)");
break;
case "create":
do_create(cmdparams[0]);
break;
case "shutdown":
m_console.Close();
Environment.Exit(0);
break;
}
}
private void ConfigDB(IGenericConfig configData)
{
try
{
string attri = "";
attri = configData.GetAttribute("DataBaseProvider");
if (attri == "")
{
StorageDll = "OpenGrid.Framework.Data.DB4o.dll";
configData.SetAttribute("DataBaseProvider", "OpenGrid.Framework.Data.DB4o.dll");
}
else
{
StorageDll = attri;
}
configData.Commit();
}
catch (Exception e)
{
}
}
private UserConfig LoadConfigDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
UserConfig config = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IUserConfig", true);
if (typeInterface != null)
{
IUserConfig plug = (IUserConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
config = plug.GetConfigObject();
break;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
return config;
}
public void Show(string ShowWhat)
{
}
}
}

View File

@ -1,63 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D45B6E48-5668-478D-B9CB-6D46E665FACF}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OGS_UserServer</RootNamespace>
<AssemblyName>OGS-UserServer</AssemblyName>
<StartupObject>OpenGridServices.OpenUser_Main</StartupObject>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\common\bin\libsecondlife.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\common\src\OGS-Console.cs">
<Link>OGS-Console.cs</Link>
</Compile>
<Compile Include="..\..\common\VersionInfo\VersionInfo.cs">
<Link>VersionInfo.cs</Link>
</Compile>
<Compile Include="ConsoleCmds.cs" />
<Compile Include="Main.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UserHttp.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\OpenSim.FrameWork\OpenSim.Framework.csproj">
<Project>{2E46A825-3168-492F-93BC-637126B5B72B}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\..\ServerConsole\ServerConsole.csproj">
<Project>{7667E6E2-F227-41A2-B1B2-315613E1BAFC}</Project>
<Name>ServerConsole</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -1,128 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{66591469-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGridServices.UserServer</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenGridServices.UserServer</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.Console" >
<HintPath>OpenSim.Framework.Console.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.GenericConfig.Xml" >
<HintPath>OpenSim.GenericConfig.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Servers" >
<HintPath>OpenSim.Servers.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="XMLRPC" >
<HintPath>XMLRPC.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenGrid.Framework.Data\OpenGrid.Framework.Data.csproj">
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,51 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenGridServices.UserServer" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
<resources prefix="OpenGridServices.UserServer" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="Main.cs" />
<include name="UserManager.cs" />
<include name="Properties/AssemblyInfo.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll" />
<include name="System.Xml.dll" />
<include name="../../bin/OpenSim.Framework.dll" />
<include name="../../bin/OpenSim.Framework.Console.dll" />
<include name="../../bin/OpenGrid.Framework.Data.dll" />
<include name="../../bin/OpenSim.GenericConfig.Xml.dll" />
<include name="../../bin/OpenSim.Servers.dll" />
<include name="../../bin/libsecondlife.dll" />
<include name="../../bin/Db4objects.Db4o.dll" />
<include name="../../bin/XMLRPC.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,33 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("OGS-UserServer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OGS-UserServer")]
[assembly: AssemblyCopyright("Copyright © 2007")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e266513a-090b-4d38-80f6-8599eef68c8c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,597 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
using libsecondlife;
using System.Reflection;
using System.Xml;
using Nwc.XmlRpc;
using OpenSim.Framework.Sims;
using OpenSim.Framework.Inventory;
using OpenSim.Framework.Utilities;
using System.Security.Cryptography;
namespace OpenGridServices.UserServer
{
public class UserManager
{
public OpenSim.Framework.Interfaces.UserConfig _config;
Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
/// <summary>
/// Adds a new user server plugin - user servers will be requested in the order they were loaded.
/// </summary>
/// <param name="FileName">The filename to the user server plugin DLL</param>
public void AddPlugin(string FileName)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (!pluginType.IsAbstract)
{
Type typeInterface = pluginType.GetInterface("IUserData", true);
if (typeInterface != null)
{
IUserData plug = (IUserData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Initialise();
this._plugins.Add(plug.getName(), plug);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Userstorage: Added IUserData Interface");
}
typeInterface = null;
}
}
pluginAssembly = null;
}
/// <summary>
///
/// </summary>
/// <param name="user"></param>
public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
{
UserProfileData user = new UserProfileData();
user.homeLocation = new LLVector3(128, 128, 100);
user.UUID = LLUUID.Random();
user.username = firstName;
user.surname = lastName;
user.passwordHash = pass;
user.passwordSalt = "";
user.created = Util.UnixTimeSinceEpoch();
user.homeLookAt = new LLVector3(100, 100, 100);
user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
plugin.Value.addNewUserProfile(user);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
}
/// <summary>
/// Loads a user profile from a database by UUID
/// </summary>
/// <param name="uuid">The target UUID</param>
/// <returns>A user profile</returns>
public UserProfileData getUserProfile(LLUUID uuid)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
UserProfileData profile = plugin.Value.getUserByUUID(uuid);
profile.currentAgent = getUserAgent(profile.UUID);
return profile;
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Loads a user profile by name
/// </summary>
/// <param name="name">The target name</param>
/// <returns>A user profile</returns>
public UserProfileData getUserProfile(string name)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
UserProfileData profile = plugin.Value.getUserByName(name);
profile.currentAgent = getUserAgent(profile.UUID);
return profile;
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Loads a user profile by name
/// </summary>
/// <param name="fname">First name</param>
/// <param name="lname">Last name</param>
/// <returns>A user profile</returns>
public UserProfileData getUserProfile(string fname, string lname)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
UserProfileData profile = plugin.Value.getUserByName(fname,lname);
try
{
profile.currentAgent = getUserAgent(profile.UUID);
}
catch (Exception e)
{
// Ignore
}
return profile;
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Loads a user agent by uuid (not called directly)
/// </summary>
/// <param name="uuid">The agents UUID</param>
/// <returns>Agent profiles</returns>
public UserAgentData getUserAgent(LLUUID uuid)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
return plugin.Value.getAgentByUUID(uuid);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Loads a user agent by name (not called directly)
/// </summary>
/// <param name="name">The agents name</param>
/// <returns>A user agent</returns>
public UserAgentData getUserAgent(string name)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
return plugin.Value.getAgentByName(name);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Loads a user agent by name (not called directly)
/// </summary>
/// <param name="fname">The agents firstname</param>
/// <param name="lname">The agents lastname</param>
/// <returns>A user agent</returns>
public UserAgentData getUserAgent(string fname, string lname)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
try
{
return plugin.Value.getAgentByName(fname,lname);
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
}
}
return null;
}
/// <summary>
/// Creates a error response caused by invalid XML
/// </summary>
/// <returns>An XMLRPC response</returns>
private static XmlRpcResponse CreateErrorConnectingToGridResponse()
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable ErrorRespData = new Hashtable();
ErrorRespData["reason"] = "key";
ErrorRespData["message"] = "Error connecting to grid. Could not percieve credentials from login XML.";
ErrorRespData["login"] = "false";
response.Value = ErrorRespData;
return response;
}
/// <summary>
/// Creates an error response caused by bad login credentials
/// </summary>
/// <returns>An XMLRPC response</returns>
private static XmlRpcResponse CreateLoginErrorResponse()
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable ErrorRespData = new Hashtable();
ErrorRespData["reason"] = "key";
ErrorRespData["message"] = "Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.";
ErrorRespData["login"] = "false";
response.Value = ErrorRespData;
return response;
}
/// <summary>
/// Creates an error response caused by being logged in already
/// </summary>
/// <returns>An XMLRPC Response</returns>
private static XmlRpcResponse CreateAlreadyLoggedInResponse()
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable PresenceErrorRespData = new Hashtable();
PresenceErrorRespData["reason"] = "presence";
PresenceErrorRespData["message"] = "You appear to be already logged in, if this is not the case please wait for your session to timeout, if this takes longer than a few minutes please contact the grid owner";
PresenceErrorRespData["login"] = "false";
response.Value = PresenceErrorRespData;
return response;
}
/// <summary>
/// Customises the login response and fills in missing values.
/// </summary>
/// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param>
public virtual void CustomiseResponse(ref Hashtable response, ref UserProfileData theUser)
{
// Load information from the gridserver
SimProfile SimInfo = new SimProfile();
SimInfo = SimInfo.LoadFromGrid(theUser.currentAgent.currentHandle, _config.GridServerURL, _config.GridSendKey, _config.GridRecvKey);
// Customise the response
// Home Location
response["home"] = "{'region_handle':[r" + (SimInfo.RegionLocX * 256).ToString() + ",r" + (SimInfo.RegionLocY * 256).ToString() + "], " +
"'position':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
"'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" + theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
// Destination
response["sim_ip"] = SimInfo.sim_ip;
response["sim_port"] = (Int32)SimInfo.sim_port;
response["region_y"] = (Int32)SimInfo.RegionLocY * 256;
response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
// Notify the target of an incoming user
Console.WriteLine("Notifying " + SimInfo.regionname + " (" + SimInfo.caps_url + ")");
// Prepare notification
Hashtable SimParams = new Hashtable();
SimParams["session_id"] = theUser.currentAgent.sessionID.ToString();
SimParams["secure_session_id"] = theUser.currentAgent.secureSessionID.ToString();
SimParams["firstname"] = theUser.username;
SimParams["lastname"] = theUser.surname;
SimParams["agent_id"] = theUser.UUID.ToString();
SimParams["circuit_code"] = (Int32)Convert.ToUInt32(response["circuit_code"]);
SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString();
SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString();
SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString();
ArrayList SendParams = new ArrayList();
SendParams.Add(SimParams);
// Update agent with target sim
theUser.currentAgent.currentRegion = SimInfo.UUID;
theUser.currentAgent.currentHandle = SimInfo.regionhandle;
// Send
XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams);
XmlRpcResponse GridResp = GridReq.Send(SimInfo.caps_url, 3000);
}
/// <summary>
/// Checks a user against it's password hash
/// </summary>
/// <param name="profile">The users profile</param>
/// <param name="password">The supplied password</param>
/// <returns>Authenticated?</returns>
public bool AuthenticateUser(ref UserProfileData profile, string password)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(
OpenSim.Framework.Console.LogPriority.LOW,
"Authenticating " + profile.username + " " + profile.surname);
password = password.Remove(0, 3); //remove $1$
string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
return profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase);
}
/// <summary>
/// Creates and initialises a new user agent - make sure to use CommitAgent when done to submit to the DB
/// </summary>
/// <param name="profile">The users profile</param>
/// <param name="request">The users loginrequest</param>
public void CreateAgent(ref UserProfileData profile, XmlRpcRequest request)
{
Hashtable requestData = (Hashtable)request.Params[0];
UserAgentData agent = new UserAgentData();
// User connection
agent.agentIP = "";
agent.agentOnline = true;
agent.agentPort = 0;
// Generate sessions
RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
byte[] randDataS = new byte[16];
byte[] randDataSS = new byte[16];
rand.GetBytes(randDataS);
rand.GetBytes(randDataSS);
agent.secureSessionID = new LLUUID(randDataSS, 0);
agent.sessionID = new LLUUID(randDataS, 0);
// Profile UUID
agent.UUID = profile.UUID;
// Current position (from Home)
agent.currentHandle = profile.homeRegion;
agent.currentPos = profile.homeLocation;
// If user specified additional start, use that
if (requestData.ContainsKey("start"))
{
string startLoc = (string)requestData["start"];
if (!(startLoc == "last" || startLoc == "home"))
{
// Ignore it! Heh.
}
}
// What time did the user login?
agent.loginTime = Util.UnixTimeSinceEpoch();
agent.logoutTime = 0;
// Current location
agent.regionID = new LLUUID(); // Fill in later
agent.currentRegion = new LLUUID(); // Fill in later
profile.currentAgent = agent;
}
/// <summary>
/// Saves a target agent to the database
/// </summary>
/// <param name="profile">The users profile</param>
/// <returns>Successful?</returns>
public bool CommitAgent(ref UserProfileData profile)
{
// Saves the agent to database
return true;
}
/// <summary>
/// Main user login function
/// </summary>
/// <param name="request">The XMLRPC request</param>
/// <returns>The response to send</returns>
public XmlRpcResponse XmlRpcLoginMethod(XmlRpcRequest request)
{
XmlRpcResponse response = new XmlRpcResponse();
Hashtable requestData = (Hashtable)request.Params[0];
bool GoodXML = (requestData.Contains("first") && requestData.Contains("last") && requestData.Contains("passwd"));
bool GoodLogin = false;
string firstname = "";
string lastname = "";
string passwd = "";
UserProfileData TheUser;
if (GoodXML)
{
firstname = (string)requestData["first"];
lastname = (string)requestData["last"];
passwd = (string)requestData["passwd"];
TheUser = getUserProfile(firstname, lastname);
if (TheUser == null)
return CreateLoginErrorResponse();
GoodLogin = AuthenticateUser(ref TheUser, passwd);
}
else
{
return CreateErrorConnectingToGridResponse();
}
if (!GoodLogin)
{
return CreateLoginErrorResponse();
}
else
{
// If we already have a session...
if (TheUser.currentAgent != null && TheUser.currentAgent.agentOnline)
{
// Reject the login
return CreateAlreadyLoggedInResponse();
}
// Otherwise...
// Create a new agent session
CreateAgent(ref TheUser, request);
try
{
Hashtable responseData = new Hashtable();
LLUUID AgentID = TheUser.UUID;
// Global Texture Section
Hashtable GlobalT = new Hashtable();
GlobalT["sun_texture_id"] = "cce0f112-878f-4586-a2e2-a8f104bba271";
GlobalT["cloud_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
GlobalT["moon_texture_id"] = "fc4b9f0b-d008-45c6-96a4-01dd947ac621";
ArrayList GlobalTextures = new ArrayList();
GlobalTextures.Add(GlobalT);
// Login Flags Section
Hashtable LoginFlagsHash = new Hashtable();
LoginFlagsHash["daylight_savings"] = "N";
LoginFlagsHash["stipend_since_login"] = "N";
LoginFlagsHash["gendered"] = "Y";
LoginFlagsHash["ever_logged_in"] = "N"; // Should allow male/female av selection
ArrayList LoginFlags = new ArrayList();
LoginFlags.Add(LoginFlagsHash);
// UI Customisation Section
Hashtable uiconfig = new Hashtable();
uiconfig["allow_first_life"] = "Y";
ArrayList ui_config = new ArrayList();
ui_config.Add(uiconfig);
// Classified Categories Section
Hashtable ClassifiedCategoriesHash = new Hashtable();
ClassifiedCategoriesHash["category_name"] = "Generic";
ClassifiedCategoriesHash["category_id"] = (Int32)1;
ArrayList ClassifiedCategories = new ArrayList();
ClassifiedCategories.Add(ClassifiedCategoriesHash);
// Inventory Library Section
ArrayList AgentInventoryArray = new ArrayList();
Hashtable TempHash;
AgentInventory Library = new AgentInventory();
Library.CreateRootFolder(AgentID, true);
foreach (InventoryFolder InvFolder in Library.InventoryFolders.Values)
{
TempHash = new Hashtable();
TempHash["name"] = InvFolder.FolderName;
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
TempHash["version"] = (Int32)InvFolder.Version;
TempHash["type_default"] = (Int32)InvFolder.DefaultType;
TempHash["folder_id"] = InvFolder.FolderID.ToStringHyphenated();
AgentInventoryArray.Add(TempHash);
}
Hashtable InventoryRootHash = new Hashtable();
InventoryRootHash["folder_id"] = Library.InventoryRoot.FolderID.ToStringHyphenated();
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
Hashtable InitialOutfitHash = new Hashtable();
InitialOutfitHash["folder_name"] = "Nightclub Female";
InitialOutfitHash["gender"] = "female";
ArrayList InitialOutfit = new ArrayList();
InitialOutfit.Add(InitialOutfitHash);
// Circuit Code
uint circode = (uint)(Util.RandomClass.Next());
// Generics
responseData["last_name"] = TheUser.surname;
responseData["ui-config"] = ui_config;
responseData["sim_ip"] = "127.0.0.1"; //SimInfo.sim_ip.ToString();
responseData["login-flags"] = LoginFlags;
responseData["global-textures"] = GlobalTextures;
responseData["classified_categories"] = ClassifiedCategories;
responseData["event_categories"] = new ArrayList();
responseData["inventory-skeleton"] = AgentInventoryArray;
responseData["inventory-skel-lib"] = new ArrayList();
responseData["inventory-root"] = InventoryRoot;
responseData["event_notifications"] = new ArrayList();
responseData["gestures"] = new ArrayList();
responseData["inventory-lib-owner"] = new ArrayList();
responseData["initial-outfit"] = InitialOutfit;
responseData["seconds_since_epoch"] = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
responseData["start_location"] = "last";
responseData["home"] = "!!null temporary value {home}!!"; // Overwritten
responseData["message"] = _config.DefaultStartupMsg;
responseData["first_name"] = TheUser.username;
responseData["circuit_code"] = (Int32)circode;
responseData["sim_port"] = 0; //(Int32)SimInfo.sim_port;
responseData["secure_session_id"] = TheUser.currentAgent.secureSessionID.ToStringHyphenated();
responseData["look_at"] = "\n[r" + TheUser.homeLookAt.X.ToString() + ",r" + TheUser.homeLookAt.Y.ToString() + ",r" + TheUser.homeLookAt.Z.ToString() + "]\n";
responseData["agent_id"] = AgentID.ToStringHyphenated();
responseData["region_y"] = (Int32)0; // Overwritten
responseData["region_x"] = (Int32)0; // Overwritten
responseData["seed_capability"] = "";
responseData["agent_access"] = "M";
responseData["session_id"] = TheUser.currentAgent.sessionID.ToStringHyphenated();
responseData["login"] = "true";
this.CustomiseResponse(ref responseData, ref TheUser);
CommitAgent(ref TheUser);
response.Value = responseData;
// TheUser.SendDataToSim(SimInfo);
return response;
}
catch (Exception E)
{
Console.WriteLine(E.ToString());
}
//}
}
return response;
}
/// <summary>
/// Deletes an active agent session
/// </summary>
/// <param name="request">The request</param>
/// <param name="path">The path (eg /bork/narf/test)</param>
/// <param name="param">Parameters sent</param>
/// <returns>Success "OK" else error</returns>
public string RestDeleteUserSessionMethod(string request, string path, string param)
{
// TODO! Important!
return "OK";
}
}
}

View File

@ -1,31 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Information about this assembly is defined by the following
// attributes.
//
// change them to the information which is associated with the assembly
// you compile.
[assembly: AssemblyTitle("UserConfig")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UserConfig")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
[assembly: AssemblyVersion("1.0.*")]

View File

@ -1,95 +0,0 @@
/*
* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the <organization> nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
using System;
using System.Collections.Generic;
using OpenSim.Framework.Console;
using OpenSim.Framework.Interfaces;
using Db4objects.Db4o;
namespace OpenUser.Config.UserConfigDb4o
{
public class Db4oConfigPlugin: IUserConfig
{
public UserConfig GetConfigObject()
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Loading Db40Config dll");
return ( new DbUserConfig());
}
}
public class DbUserConfig : UserConfig
{
private IObjectContainer db;
public void LoadDefaults() {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH,"Config.cs:LoadDefaults() - Please press enter to retain default or enter new settings");
this.DefaultStartupMsg = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Default startup message", "Welcome to OGS");
this.GridServerURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL","http://127.0.0.1:8001/");
this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server","null");
this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server","null");
}
public override void InitConfig() {
try {
db = Db4oFactory.OpenFile("openuser.yap");
IObjectSet result = db.Get(typeof(DbUserConfig));
if(result.Count==1) {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Found a UserConfig object in the local database, loading");
foreach (DbUserConfig cfg in result) {
this.GridServerURL=cfg.GridServerURL;
this.GridSendKey=cfg.GridSendKey;
this.GridRecvKey=cfg.GridRecvKey;
this.DefaultStartupMsg=cfg.DefaultStartupMsg;
}
} else {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Config.cs:InitConfig() - Could not find object in database, loading precompiled defaults");
LoadDefaults();
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Writing out default settings to local database");
db.Set(this);
db.Close();
}
} catch(Exception e) {
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Config.cs:InitConfig() - Exception occured");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,e.ToString());
}
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"User settings loaded:");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Default startup message: " + this.DefaultStartupMsg);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Grid server URL: " + this.GridServerURL);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to send to grid: " + this.GridSendKey);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Key to expect from grid: " + this.GridRecvKey);
}
public void Shutdown() {
db.Close();
}
}
}

View File

@ -1,107 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7E494328-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenUser.Config.UserConfigDb4o</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>OpenUser.Config.UserConfigDb4o</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.dll" >
<HintPath>..\..\..\bin\System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework" >
<HintPath>OpenSim.Framework.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="OpenSim.Framework.Console" >
<HintPath>OpenSim.Framework.Console.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DbUserConfig.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" ?>
<project name="OpenUser.Config.UserConfigDb4o" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
<resources prefix="OpenUser.Config.UserConfigDb4o" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="AssemblyInfo.cs" />
<include name="DbUserConfig.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.Data.dll.dll" />
<include name="System.Xml.dll" />
<include name="../../../bin/libsecondlife.dll" />
<include name="../../../bin/Db4objects.Db4o.dll" />
<include name="../../../bin/OpenSim.Framework.dll" />
<include name="../../../bin/OpenSim.Framework.Console.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../../bin/"/>
<copy todir="${project::get-base-directory()}/../../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

View File

@ -1,24 +0,0 @@
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for agents
-- ----------------------------
CREATE TABLE `agents` (
`UUID` varchar(36) NOT NULL,
`sessionID` varchar(36) NOT NULL,
`secureSessionID` varchar(36) NOT NULL,
`agentIP` varchar(16) NOT NULL,
`agentPort` int(11) NOT NULL,
`agentOnline` tinyint(4) NOT NULL,
`loginTime` int(11) NOT NULL,
`logoutTime` int(11) NOT NULL,
`currentRegion` varchar(36) NOT NULL,
`currentHandle` bigint(20) unsigned NOT NULL,
`currentPos` varchar(64) NOT NULL,
PRIMARY KEY (`UUID`),
UNIQUE KEY `session` (`sessionID`),
UNIQUE KEY `ssession` (`secureSessionID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------

View File

@ -1,29 +0,0 @@
CREATE TABLE `regions` (
`uuid` varchar(36) NOT NULL,
`regionHandle` bigint(20) unsigned NOT NULL,
`regionName` varchar(32) default NULL,
`regionRecvKey` varchar(128) default NULL,
`regionSendKey` varchar(128) default NULL,
`regionSecret` varchar(128) default NULL,
`regionDataURI` varchar(255) default NULL,
`serverIP` varchar(16) default NULL,
`serverPort` int(10) unsigned default NULL,
`serverURI` varchar(255) default NULL,
`locX` int(10) unsigned default NULL,
`locY` int(10) unsigned default NULL,
`locZ` int(10) unsigned default NULL,
`eastOverrideHandle` bigint(20) unsigned default NULL,
`westOverrideHandle` bigint(20) unsigned default NULL,
`southOverrideHandle` bigint(20) unsigned default NULL,
`northOverrideHandle` bigint(20) unsigned default NULL,
`regionAssetURI` varchar(255) default NULL,
`regionAssetRecvKey` varchar(128) default NULL,
`regionAssetSendKey` varchar(128) default NULL,
`regionUserURI` varchar(255) default NULL,
`regionUserRecvKey` varchar(128) default NULL,
`regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL,
PRIMARY KEY (`uuid`),
KEY `regionName` (`regionName`),
KEY `regionHandle` (`regionHandle`),
KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED

View File

@ -1,34 +0,0 @@
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for users
-- ----------------------------
CREATE TABLE `users` (
`UUID` varchar(36) NOT NULL default '',
`username` varchar(32) NOT NULL,
`lastname` varchar(32) NOT NULL,
`passwordHash` varchar(32) NOT NULL,
`passwordSalt` varchar(32) NOT NULL,
`homeRegion` bigint(20) unsigned default NULL,
`homeLocationX` float default NULL,
`homeLocationY` float default NULL,
`homeLocationZ` float default NULL,
`homeLookAtX` float default NULL,
`homeLookAtY` float default NULL,
`homeLookAtZ` float default NULL,
`created` int(11) NOT NULL,
`lastLogin` int(11) NOT NULL,
`userInventoryURI` varchar(255) default NULL,
`userAssetURI` varchar(255) default NULL,
`profileCanDoMask` int(10) unsigned default NULL,
`profileWantDoMask` int(10) unsigned default NULL,
`profileAboutText` text,
`profileFirstText` text,
`profileImage` varchar(36) default NULL,
`profileFirstImage` varchar(36) default NULL,
PRIMARY KEY (`UUID`),
UNIQUE KEY `usernames` (`username`,`lastname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------

View File

@ -1,160 +0,0 @@
using System;
using System.Diagnostics;
using System.Threading;
using System.ServiceProcess;
using System.Xml;
using System.IO;
public class OpenGridMasterService : System.ServiceProcess.ServiceBase {
private Thread ServiceWorkerThread;
public OpenGridMasterService()
{
CanPauseAndContinue = false;
ServiceName = "OpenGridServices-master";
}
private void InitializeComponent()
{
this.CanPauseAndContinue = false;
this.CanShutdown = true;
this.ServiceName = "OpenGridServices-master";
}
protected override void OnStart(string[] args)
{
ServiceWorkerThread = new Thread(new ThreadStart(MainServiceThread));
ServiceWorkerThread.Start();
}
protected override void OnStop()
{
ServiceWorkerThread.Abort();
}
private void MainServiceThread()
{
try {
StreamReader reader=new StreamReader("opengrid-master-cfg.xml");
string configxml = reader.ReadToEnd();
XmlDocument doc = new XmlDocument();
doc.LoadXml(configxml);
XmlNode rootnode = doc.FirstChild;
if (rootnode.Name != "regions")
{
EventLog.WriteEntry("ERROR! bad XML in opengrid-master-cfg.xml - expected regions tag");
Console.WriteLine("Sorry, could not startup the service - please check your opengrid-master-cfg.xml file: missing regions tag");
(new ServiceController("OpenGridServices-master")).Stop();
}
for(int i=0; i<=rootnode.ChildNodes.Count; i++)
{
if(rootnode.ChildNodes.Item(i).Name != "region") {
EventLog.WriteEntry("nonfatal error - unexpected tag inside regions block of opengrid-master-cfg.xml");
(new ServiceController("OpenGridServices-master")).Stop();
}
}
} catch(Exception e) {
Console.WriteLine(e.ToString());
(new ServiceController("OpenGridServices-master")).Stop();
}
}
private static string SetupGrid()
{
Console.WriteLine("Running external program (OpenGridServices.GridServer.exe) to configure the grid server");
Process p = new Process();
p.StartInfo.Arguments = "-setuponly";
p.StartInfo.FileName = "OpenGridServices.GridServer.exe";
p.Start();
return "<gridserver />"; // we let the gridserver handle it's own setup
}
private static string SetupUser()
{
return "<user></user>";
}
private static string SetupAsset()
{
return "<asset></asset>";
}
private static string SetupRegion()
{
return "<regions></regions>";
}
public static void InitSetup()
{
string choice="";
string GridInfo;
string UserInfo;
string AssetInfo;
string RegionInfo;
bool grid=false;
bool user=false;
bool asset=false;
bool region=false;
while(choice!="OK")
{
Console.Clear();
Console.WriteLine("Please select the components you would like to run on this server:\n");
Console.WriteLine("1 - [" + (grid ? "X" : " ") + "] Grid server - this service handles co-ordinates of regions/sims on the grid");
Console.WriteLine("2 - [" + (user ? "X" : " ") + "] User server - this service handles user login, profiles, inventory and IM");
Console.WriteLine("3 - [" + (asset ? "X" : " ") + "] Asset server - this service handles storage of assets such as textures, objects, sounds, scripts");
Console.WriteLine("4 - [" + (region ? "X" : " ") + "] Region server - this is the main opensim server and can run without the above services, it handles physics simulation, terrain, building and other such features");
Console.Write("Type a number to toggle a choice or type OK to accept your current choices: ");
choice = Console.ReadLine();
switch(choice)
{
case "1":
grid = (!grid);
break;
case "2":
user = (!user);
break;
case "3":
asset = (!asset);
break;
case "4":
region = (!region);
break;
}
}
if(grid) GridInfo = SetupGrid();
if(user) UserInfo = SetupUser();
if(asset) AssetInfo = SetupAsset();
if(region) RegionInfo = SetupRegion();
}
public static void Main()
{
if(!File.Exists("opengrid-master-cfg.xml"))
{
Console.WriteLine("Could not find a config file, running initial setup");
InitSetup();
}
Console.WriteLine("Starting up OGS master service");
try {
ServiceBase.Run(new OpenGridMasterService());
} catch(Exception e) {
Console.WriteLine("THIS SHOULD NEVER HAPPEN!!!!!!!!!!!!!!!!!!!!!");
Console.WriteLine(e.ToString());
}
}
}

View File

@ -1,88 +0,0 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E141F4EE-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>ServiceManager</AssemblyName>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Exe</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<RootNamespace>ServiceManager</RootNamespace>
<StartupObject></StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
<OutputPath>..\..\bin\</OutputPath>
<RegisterForComInterop>False</RegisterForComInterop>
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.ServiceProcess" >
<HintPath>System.ServiceProcess.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<Compile Include="ServiceManager.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>

View File

@ -1,12 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ReferencePath>C:\New Folder\second-life-viewer\opensim-dailys2\opensim26-05\branches\Sugilite\bin\</ReferencePath>
<LastOpenVersion>8.0.50727</LastOpenVersion>
<ProjectView>ProjectFiles</ProjectView>
<ProjectTrust>0</ProjectTrust>
</PropertyGroup>
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<PropertyGroup Condition = " '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
</Project>

View File

@ -1,41 +0,0 @@
<?xml version="1.0" ?>
<project name="ServiceManager" default="build">
<target name="build">
<echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
<mkdir dir="${project::get-base-directory()}/${build.dir}" />
<copy todir="${project::get-base-directory()}/${build.dir}">
<fileset basedir="${project::get-base-directory()}">
</fileset>
</copy>
<csc target="exe" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.exe">
<resources prefix="ServiceManager" dynamicprefix="true" >
</resources>
<sources failonempty="true">
<include name="ServiceManager.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>
<include name="${project::get-base-directory()}" />
<include name="${project::get-base-directory()}/${build.dir}" />
</lib>
<include name="System.dll" />
<include name="System.ServiceProcess.dll" />
<include name="System.Xml.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../bin/" />
<mkdir dir="${project::get-base-directory()}/../../bin/"/>
<copy todir="${project::get-base-directory()}/../../bin/">
<fileset basedir="${project::get-base-directory()}/${build.dir}/" >
<include name="*.dll"/>
<include name="*.exe"/>
</fileset>
</copy>
</target>
<target name="clean">
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
</target>
<target name="doc" description="Creates documentation.">
</target>
</project>

Binary file not shown.

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,8 +6,7 @@
<ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon> <ApplicationIcon></ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>OpenSim.RegionServer</AssemblyName> <AssemblyName>OpenSim.RegionServer</AssemblyName>
@ -16,11 +15,9 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder> <AppDesignerFolder></AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.RegionServer</RootNamespace> <RootNamespace>OpenSim.RegionServer</RootNamespace>
<StartupObject> <StartupObject></StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -31,8 +28,7 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile> <DocumentationFile></DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -41,8 +37,7 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn> <NoWarn></NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -51,8 +46,7 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile> <DocumentationFile></DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -61,8 +55,7 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn> <NoWarn></NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" > <Reference Include="System" >

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,8 +6,7 @@
<ProjectGuid>{642A14A8-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{642A14A8-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon> <ApplicationIcon></ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>OpenSim.World</AssemblyName> <AssemblyName>OpenSim.World</AssemblyName>
@ -16,11 +15,9 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder> <AppDesignerFolder></AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.World</RootNamespace> <RootNamespace>OpenSim.World</RootNamespace>
<StartupObject> <StartupObject></StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -31,8 +28,7 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile> <DocumentationFile></DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -41,8 +37,7 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn> <NoWarn></NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -51,8 +46,7 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile> <DocumentationFile></DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -61,8 +55,7 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn> <NoWarn></NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" > <Reference Include="System" >

Binary file not shown.