Compare commits

...

13 Commits

Author SHA1 Message Date
MW 3d0fff1c09 2007-05-07 16:23:33 +00:00
Adam Frisby 40eb8bc8b6 * DB4o usermanager replacement coded for read-only attributes.
* IUserData interface needs expansion to cover all user/user-server related interactions.
2007-05-07 04:26:22 +00:00
Adam Frisby 4a155b08d7 * Adding support for proper databased based user server. Not hooked up yet.
* Code cleaning.
2007-05-07 03:57:39 +00:00
gareth b6487e4aaa Flush() the log 2007-05-07 00:11:44 +00:00
Adam Frisby 315e4dede6 Fixed GridServer to use default Recv Key if a sim profile is not present. 2007-05-07 00:05:56 +00:00
Adam Frisby fdd0191f59 Shortened exception message that occurs when looking for a missing sim. 2007-05-06 23:55:17 +00:00
Adam Frisby 982421e285 Fixing a duplicate addition exception that can occur if you launch a sim twice on the same grid. 2007-05-06 23:54:36 +00:00
Adam Frisby 1b7f74bc7e Defaults to DB4o grid provider, loads storage engines correctly now. Tested and stable. 2007-05-06 23:41:50 +00:00
gareth 284a3b49a9 Added some more try/catch blocks and sanity checking 2007-05-06 20:49:27 +00:00
gareth 5eec666476 oops 2007-05-06 18:35:22 +00:00
gareth ad7f130165 Updating releng scripts 2007-05-06 18:34:00 +00:00
gareth c77c688a50 Added missing build files
Added sanity checking for config options in OpenSimMain.cs
2007-05-06 18:05:51 +00:00
gareth 33b7869b85 Added -prestable branch ready for the audit to end all audits 2007-05-06 17:20:21 +00:00
15 changed files with 424 additions and 169 deletions

View File

@ -9,20 +9,20 @@ namespace OpenGrid.Framework.Data.DB4o
{
class DB4oGridData : IGridData
{
DB4oManager manager;
DB4oGridManager manager;
public void Initialise() {
manager = new DB4oManager("gridserver.yap");
manager = new DB4oGridManager("gridserver.yap");
}
public SimProfileData GetProfileByHandle(ulong handle) {
lock (manager.profiles)
lock (manager.simProfiles)
{
foreach (LLUUID UUID in manager.profiles.Keys)
foreach (LLUUID UUID in manager.simProfiles.Keys)
{
if (manager.profiles[UUID].regionHandle == handle)
if (manager.simProfiles[UUID].regionHandle == handle)
{
return manager.profiles[UUID];
return manager.simProfiles[UUID];
}
}
}
@ -31,17 +31,17 @@ namespace OpenGrid.Framework.Data.DB4o
public SimProfileData GetProfileByLLUUID(LLUUID uuid)
{
lock (manager.profiles)
lock (manager.simProfiles)
{
if (manager.profiles.ContainsKey(uuid))
return manager.profiles[uuid];
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.profiles)
lock (manager.simProfiles)
{
if (manager.AddRow(profile))
{
@ -55,7 +55,7 @@ namespace OpenGrid.Framework.Data.DB4o
}
public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) {
if (manager.profiles[uuid].regionRecvKey == key)
if (manager.simProfiles[uuid].regionRecvKey == key)
return true;
return false;
}

View File

@ -7,19 +7,19 @@ using libsecondlife;
namespace OpenGrid.Framework.Data.DB4o
{
class DB4oManager
class DB4oGridManager
{
public Dictionary<LLUUID, SimProfileData> profiles = new Dictionary<LLUUID, SimProfileData>();
public Dictionary<LLUUID, SimProfileData> simProfiles = new Dictionary<LLUUID, SimProfileData>();
string dbfl;
public DB4oManager(string db4odb)
public DB4oGridManager(string db4odb)
{
dbfl = db4odb;
IObjectContainer database;
database = Db4oFactory.OpenFile(dbfl);
IObjectSet result = database.Get(typeof(SimProfileData));
foreach(SimProfileData row in result) {
profiles.Add(row.UUID, row);
simProfiles.Add(row.UUID, row);
}
database.Close();
}
@ -31,7 +31,65 @@ namespace OpenGrid.Framework.Data.DB4o
/// <returns>Successful?</returns>
public bool AddRow(SimProfileData row)
{
profiles.Add(row.UUID, 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)
{
if (userProfiles.ContainsKey(row.UUID))
{
userProfiles[row.UUID] = row;
}
else
{
userProfiles.Add(row.UUID, row);
}
try
{

View File

@ -0,0 +1,75 @@
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 = 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 bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
{
return true;
}
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
{
return true;
}
}
}

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>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{39BD9497-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data.DB4o</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data.DB4o</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@ -55,26 +61,27 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<Reference Include="System.Data">
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<Reference Include="libsecondlife.dll">
<HintPath>..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Db4objects.Db4o.dll" >
<Reference Include="Db4objects.Db4o.dll">
<HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
<Private>False</Private>
</Reference>
@ -84,7 +91,7 @@
<Name>OpenGrid.Framework.Data</Name>
<Project>{62CDF671-0000-0000-0000-000000000000}</Project>
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
<Private>False</Private>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
@ -94,6 +101,7 @@
<Compile Include="DB4oManager.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="DB4oUserData.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
@ -105,4 +113,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

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>
<ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{62CDF671-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>OpenGrid.Framework.Data</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder>
<AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenGrid.Framework.Data</RootNamespace>
<StartupObject></StartupObject>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
</PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize>
@ -55,22 +61,23 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<NoWarn></NoWarn>
<NoWarn>
</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" >
<Reference Include="System">
<HintPath>System.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml" >
<Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System.Data" >
<Reference Include="System.Data">
<HintPath>System.Data.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="libsecondlife.dll" >
<Reference Include="libsecondlife.dll">
<HintPath>..\bin\libsecondlife.dll</HintPath>
<Private>False</Private>
</Reference>
@ -84,6 +91,7 @@
<Compile Include="SimProfileData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UserData.cs" />
<Compile Include="UserProfileData.cs">
<SubType>Code</SubType>
</Compile>
@ -98,4 +106,4 @@
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
namespace OpenGrid.Framework.Data
{
public interface IUserData
{
// Retrieval
// User Profiles
UserProfileData getUserByUUID(LLUUID user);
UserProfileData getUserByName(string name);
UserProfileData getUserByName(string fname, string lname);
// User Agents
UserAgentData getAgentByUUID(LLUUID user);
UserAgentData getAgentByName(string name);
UserAgentData getAgentByName(string fname, string lname);
// Transactional
bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount);
bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory);
}
}

View File

@ -7,27 +7,42 @@ namespace OpenGrid.Framework.Data
{
public class UserProfileData
{
string username; // The configurable part of the users username
string surname; // The users surname (can be used to indicate user class - eg 'Test User' or 'Test Admin')
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')
ulong homeRegion; // RegionHandle of home
LLVector3 homeLocation; // Home Location inside the sim
public string passwordHash; // Hash of the users password
int created; // UNIX Epoch Timestamp (User Creation)
int lastLogin; // UNIX Epoch Timestamp (Last Login Time)
public ulong homeRegion; // RegionHandle of home
public LLVector3 homeLocation; // Home Location inside the sim
string userInventoryURI; // URI to inventory server for this user
string userAssetURI; // URI to asset server for this user
public int created; // UNIX Epoch Timestamp (User Creation)
public int lastLogin; // UNIX Epoch Timestamp (Last Login Time)
uint profileCanDoMask; // Profile window "I can do" mask
uint profileWantDoMask; // Profile window "I want to" mask
public string userInventoryURI; // URI to inventory server for this user
public string userAssetURI; // URI to asset server for this user
string profileAboutText; // My about window text
string profileFirstText; // First Life Text
public uint profileCanDoMask; // Profile window "I can do" mask
public uint profileWantDoMask; // Profile window "I want to" mask
LLUUID profileImage; // My avatars profile image
LLUUID profileFirstImage; // First-life image
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 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
public LLUUID secureSessionID; // The secure session ID for the agent
public LLUUID regionID; // The region ID the agent occupies
public uint loginTime; // EPOCH based Timestamp
public uint logoutTime; // Timestamp or 0 if N/A
}
}

View File

@ -16,6 +16,7 @@ namespace OpenGridServices.GridServer
class GridManager
{
Dictionary<string, IGridData> _plugins = new Dictionary<string, IGridData>();
public string defaultRecvKey;
/// <summary>
/// Adds a new grid server plugin - grid servers will be requested in the order they were loaded.
@ -23,27 +24,26 @@ namespace OpenGridServices.GridServer
/// <param name="FileName">The filename to the grid server plugin DLL</param>
public void AddPlugin(string FileName)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Attempting to load " + FileName);
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Found " + pluginAssembly.GetTypes().Length + " interfaces.");
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (pluginType.IsPublic)
{
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);
}
typeInterface = null;
}
}
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("Storage: Added IGridData Interface");
}
typeInterface = null;
}
}
pluginAssembly = null;
@ -63,7 +63,7 @@ namespace OpenGridServices.GridServer
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin UUID " + kvp.Key + " is made of fail: " + e.ToString());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + uuid.ToStringHyphenated() + " via " + kvp.Key);
}
}
return null;
@ -84,7 +84,7 @@ namespace OpenGridServices.GridServer
}
catch (Exception e)
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("getRegionPlugin Handle " + kvp.Key + " is made of fail: " + e.ToString());
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key);
}
}
return null;
@ -269,6 +269,7 @@ namespace OpenGridServices.GridServer
TheSim = new SimProfileData();
LLUUID UUID = new LLUUID(param);
TheSim.UUID = UUID;
TheSim.regionRecvKey = defaultRecvKey;
}
XmlDocument doc = new XmlDocument();
@ -320,11 +321,13 @@ namespace OpenGridServices.GridServer
try
{
OpenSim.Framework.Console.MainConsole.Instance.WriteLine("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("New sim added to grid (" + TheSim.regionName + ")");
}
catch (Exception e)
{

View File

@ -47,6 +47,7 @@ namespace OpenGridServices.GridServer
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;
@ -94,9 +95,10 @@ namespace OpenGridServices.GridServer
Cfg = this.LoadConfigDll(this.ConfigDll);
Cfg.InitConfig();
m_console.WriteLine("Main.cs:Startup() - Connecting to MySql Server");
m_console.WriteLine("Main.cs:Startup() - Connecting to Storage Server");
m_gridManager = new GridManager();
m_gridManager.AddPlugin("OpenGrid.Framework.Data.MySQL.dll"); // Made of win
m_gridManager.AddPlugin(GridDll); // Made of win
m_gridManager.defaultRecvKey = Cfg.SimRecvKey;
m_console.WriteLine("Main.cs:Startup() - Starting HTTP process");
BaseHttpServer httpServer = new BaseHttpServer(8001);

View File

@ -43,6 +43,7 @@ namespace OpenSim.Framework.Console
public void Write(string format, params object[] args)
{
Log.Write(format, args);
Log.Flush();
if(!disableOutput)
{
System.Console.Write(format, args);
@ -53,7 +54,8 @@ namespace OpenSim.Framework.Console
public void WriteLine(string format, params object[] args)
{
Log.WriteLine(format, args);
if(!disableOutput)
Log.Flush();
if(!disableOutput)
{
System.Console.WriteLine(format, args);
}

View File

@ -22,7 +22,6 @@
<include name="UserProfileManager.cs" />
<include name="UserProfileManagerBase.cs" />
<include name="Util.cs" />
<include name="VersionInfo.cs" />
<include name="Interfaces/IAssetServer.cs" />
<include name="Interfaces/IConfig.cs" />
<include name="Interfaces/IGenericConfig.cs" />

View File

@ -19,6 +19,7 @@
<include name="QueItem.cs" />
<include name="RegionInfo.cs" />
<include name="SimClient.cs" />
<include name="VersionInfo.cs" />
<include name="Assets/AssetCache.cs" />
<include name="Assets/InventoryCache.cs" />
<include name="CAPS/AdminWebFront.cs" />

View File

@ -150,12 +150,28 @@ namespace OpenSim
m_console.WriteLine("Starting in Grid mode");
}
GridServers.Initialise();
try
{
GridServers.Initialise();
}
catch (Exception e)
{
m_console.WriteLine(e.Message + "\nSorry, could not setup the grid interface");
Environment.Exit(1);
}
startuptime = DateTime.Now;
AssetCache = new AssetCache(GridServers.AssetServer);
InventoryCache = new InventoryCache();
try
{
AssetCache = new AssetCache(GridServers.AssetServer);
InventoryCache = new InventoryCache();
}
catch (Exception e)
{
m_console.WriteLine(e.Message + "\nSorry, could not setup local cache");
Environment.Exit(1);
}
PacketServer packetServer = new PacketServer(this);
@ -189,9 +205,17 @@ namespace OpenSim
{
// The grid server has told us who we are
// We must obey the grid server.
regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
try
{
regionData.RegionLocX = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locx"].ToString());
regionData.RegionLocY = Convert.ToUInt32(((RemoteGridBase)(GridServers.GridServer)).GridData["region_locy"].ToString());
regionData.RegionName = ((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString();
}
catch (Exception e)
{
m_console.WriteLine(e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
Environment.Exit(1);
}
}
}
@ -234,6 +258,7 @@ namespace OpenSim
if (gridServer.GetName() == "Remote")
{
// should startup the OGS protocol server here
// Are we actually using this?
OGSServer = new OpenGridProtocolServer(this.regionData.IPListenPort - 500); // Changed so we can have more than one OGSServer per machine.
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
@ -347,7 +372,7 @@ namespace OpenSim
// SandBoxMode
string attri = "";
attri = configData.GetAttribute("SandBox");
if (attri == "")
if ((attri == "") || ((attri != "false") && (attri != "true")))
{
this.m_sandbox = false;
configData.SetAttribute("SandBox", "false");
@ -360,7 +385,7 @@ namespace OpenSim
// LoginServer
attri = "";
attri = configData.GetAttribute("LoginServer");
if (attri == "")
if ((attri == "") || ((attri != "false") && (attri != "true")))
{
this.m_loginserver = false;
configData.SetAttribute("LoginServer", "false");
@ -373,12 +398,12 @@ namespace OpenSim
// Sandbox User accounts
attri = "";
attri = configData.GetAttribute("UserAccount");
if (attri == "")
if ((attri == "") || ((attri != "false") && (attri != "true")))
{
this.user_accounts = false;
configData.SetAttribute("UserAccounts", "false");
}
else
else if (attri == "true")
{
this.user_accounts = Convert.ToBoolean(attri);
}
@ -386,70 +411,96 @@ namespace OpenSim
// Grid mode hack to use local asset server
attri = "";
attri = configData.GetAttribute("LocalAssets");
if (attri == "")
if ((attri == "") || ((attri != "false") && (attri != "true")))
{
this.gridLocalAsset = false;
configData.SetAttribute("LocalAssets", "false");
}
else
else if (attri == "true")
{
this.gridLocalAsset = Convert.ToBoolean(attri);
}
// Grid mode hack to use local asset server
attri = "";
attri = configData.GetAttribute("PhysicsEngine");
if (attri == "")
switch (attri)
{
this.m_physicsEngine = "basicphysics";
configData.SetAttribute("PhysicsEngine", "basicphysics");
}
else
{
this.m_physicsEngine = attri;
if ((attri == "RealPhysX") || (attri == "OpenDynamicsEngine"))
{
OpenSim.world.Avatar.PhysicsEngineFlying = true;
}
else
{
default:
m_console.WriteLine("Main.cs: SetupFromConfig() - Invalid value for PhysicsEngine attribute, terminating");
Environment.Exit(1);
break;
case "":
this.m_physicsEngine = "basicphysics";
configData.SetAttribute("PhysicsEngine", "basicphysics");
OpenSim.world.Avatar.PhysicsEngineFlying = false;
}
break;
case "basicphysics":
this.m_physicsEngine = "basicphysics";
configData.SetAttribute("PhysicsEngine", "basicphysics");
OpenSim.world.Avatar.PhysicsEngineFlying = false;
break;
case "RealPhysX":
this.m_physicsEngine = "RealPhysX";
OpenSim.world.Avatar.PhysicsEngineFlying = true;
break;
case "OpenDynamicsEngine":
this.m_physicsEngine = "OpenDynamicsEngine";
OpenSim.world.Avatar.PhysicsEngineFlying = true;
break;
}
configData.Commit();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.WriteLine("\nSorry, a fatal error occurred while trying to initialise the configuration data");
Console.WriteLine("Can not continue starting up");
Environment.Exit(1);
}
}
private SimConfig LoadConfigDll(string dllName)
{
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
SimConfig config = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
try
{
if (pluginType.IsPublic)
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
SimConfig config = null;
foreach (Type pluginType in pluginAssembly.GetTypes())
{
if (!pluginType.IsAbstract)
if (pluginType.IsPublic)
{
Type typeInterface = pluginType.GetInterface("ISimConfig", true);
if (typeInterface != null)
if (!pluginType.IsAbstract)
{
ISimConfig plug = (ISimConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
config = plug.GetConfigObject();
break;
}
Type typeInterface = pluginType.GetInterface("ISimConfig", true);
typeInterface = null;
if (typeInterface != null)
{
ISimConfig plug = (ISimConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
config = plug.GetConfigObject();
break;
}
typeInterface = null;
}
}
}
pluginAssembly = null;
return config;
}
catch (Exception e)
{
m_console.WriteLine(e.Message + "\nSorry, a fatal error occurred while trying to load the config DLL");
m_console.WriteLine("Can not continue starting up");
Environment.Exit(1);
return null;
}
pluginAssembly = null;
return config;
}
private void OnReceivedData(IAsyncResult result)

View File

@ -46,31 +46,34 @@
<echo message="Deleting all builds from all configurations" />
<delete dir="${bin.dir}" failonerror="false" />
<delete dir="${obj.dir}" failonerror="false" />
<nant buildfile="OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="clean" />
<nant buildfile="OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="clean" />
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="clean" />
<nant buildfile="OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="clean" />
<nant buildfile="XmlRpcCS/XMLRPC.dll.build" target="clean" />
<nant buildfile="OpenSim.Servers/OpenSim.Servers.dll.build" target="clean" />
<nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="clean" />
<nant buildfile="OpenSim.RegionServer/OpenSim.RegionServer.dll.build" target="clean" />
<nant buildfile="OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="clean" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="clean" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="clean" />
<nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="clean" />
<nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="clean" />
<nant buildfile="OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="clean" />
<nant buildfile="OpenSim/OpenSim.exe.build" target="clean" />
<nant buildfile="OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="clean" />
<nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="clean" />
<nant buildfile="OpenSim.Servers/OpenSim.Servers.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="clean" />
<nant buildfile="OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="clean" />
<nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="clean" />
<nant buildfile="OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="clean" />
<nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="clean" />
<nant buildfile="OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build" target="clean" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="clean" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="clean" />
<nant buildfile="OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="clean" />
<nant buildfile="OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="clean" />
<nant buildfile="OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="clean" />
<nant buildfile="OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="clean" />
<nant buildfile="OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="clean" />
<nant buildfile="OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="clean" />
<nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="clean" />
<nant buildfile="OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="clean" />
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="clean" />
<nant buildfile="XmlRpcCS/XMLRPC.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="clean" />
<nant buildfile="OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="clean" />
</target>
<target name="build" depends="init" description="">
@ -85,6 +88,9 @@
<nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="build" />
<nant buildfile="OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="build" />
<nant buildfile="OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="build" />
<nant buildfile="OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="build" />
<nant buildfile="OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="build" />
<nant buildfile="OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="build" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="build" />
<nant buildfile="OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="build" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="build" />
@ -109,31 +115,34 @@
<target name="doc" depends="build-release">
<echo message="Generating all documentation from all builds" />
<nant buildfile="OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="doc" />
<nant buildfile="OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="doc" />
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="doc" />
<nant buildfile="OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="doc" />
<nant buildfile="XmlRpcCS/XMLRPC.dll.build" target="doc" />
<nant buildfile="OpenSim.Servers/OpenSim.Servers.dll.build" target="doc" />
<nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="doc" />
<nant buildfile="OpenSim.RegionServer/OpenSim.RegionServer.dll.build" target="doc" />
<nant buildfile="OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="doc" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="doc" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="doc" />
<nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="doc" />
<nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="doc" />
<nant buildfile="OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="doc" />
<nant buildfile="OpenSim/OpenSim.exe.build" target="doc" />
<nant buildfile="OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="doc" />
<nant buildfile="OpenGrid.Config/GridConfigDb4o/OpenGrid.Config.GridConfigDb4o.dll.build" target="doc" />
<nant buildfile="OpenSim.Servers/OpenSim.Servers.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data.SQLite/OpenGrid.Framework.Data.SQLite.dll.build" target="doc" />
<nant buildfile="OpenGridServices.AssetServer/OpenGridServices.AssetServer.exe.build" target="doc" />
<nant buildfile="OpenSim.GridInterfaces/Remote/OpenSim.GridInterfaces.Remote.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="doc" />
<nant buildfile="OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="doc" />
<nant buildfile="OpenSim.GridInterfaces/Local/OpenSim.GridInterfaces.Local.dll.build" target="doc" />
<nant buildfile="OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build" target="doc" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="doc" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data.MySQL/OpenGrid.Framework.Data.MySQL.dll.build" target="doc" />
<nant buildfile="OpenUser.Config/UserConfigDb4o/OpenUser.Config.UserConfigDb4o.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data/OpenGrid.Framework.Data.dll.build" target="doc" />
<nant buildfile="OpenSim.Terrain.BasicTerrain/OpenSim.Terrain.BasicTerrain.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data.MSSQL/OpenGrid.Framework.Data.MSSQL.dll.build" target="doc" />
<nant buildfile="OpenSim.Scripting/EmbeddedJVM/OpenSim.Scripting.EmbeddedJVM.dll.build" target="doc" />
<nant buildfile="OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build" target="doc" />
<nant buildfile="OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="doc" />
<nant buildfile="OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build" target="doc" />
<nant buildfile="OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/Manager/OpenSim.Physics.Manager.dll.build" target="doc" />
<nant buildfile="OpenGrid.Framework.Data.DB4o/OpenGrid.Framework.Data.DB4o.dll.build" target="doc" />
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/PhysXPlugin/OpenSim.Physics.PhysXPlugin.dll.build" target="doc" />
<nant buildfile="XmlRpcCS/XMLRPC.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/BasicPhysicsPlugin/OpenSim.Physics.BasicPhysicsPlugin.dll.build" target="doc" />
<nant buildfile="OpenSim.Physics/OdePlugin/OpenSim.Physics.OdePlugin.dll.build" target="doc" />
</target>
</project>

View File

@ -5,8 +5,8 @@
export OPENSIMMAJOR=0
export OPENSIMMINOR=1
export BUILD=`date +%s`
export BRANCH=DEVEL
export SVNURL=svn://openmetaverse.org/opensim/trunk
export BRANCH=PRESTABLE
export SVNURL=svn://openmetaverse.org/opensim/branches/0.1-prestable