mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Should allow multiple worlds (and UDP servers) to be ran in one instance, just missing backend comms and working Avatar/primitives classes.
This commit is contained in:
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Inventory
|
||||
{
|
||||
if (!this.InventoryFolders.ContainsKey(folderID))
|
||||
{
|
||||
Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
|
||||
System.Console.WriteLine("creating new folder called " + folderName + " in agents inventory");
|
||||
InventoryFolder Folder = new InventoryFolder();
|
||||
Folder.FolderID = folderID;
|
||||
Folder.OwnerID = this.AgentID;
|
||||
@@ -120,7 +120,7 @@ namespace OpenSim.Framework.Inventory
|
||||
{
|
||||
InventoryItem Item = this.InventoryItems[itemID];
|
||||
Item.AssetID = asset.FullID;
|
||||
Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
|
||||
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated() + " so it now is set to asset " + asset.FullID.ToStringHyphenated());
|
||||
//TODO need to update the rest of the info
|
||||
}
|
||||
return true;
|
||||
@@ -128,13 +128,13 @@ namespace OpenSim.Framework.Inventory
|
||||
|
||||
public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
|
||||
{
|
||||
Console.WriteLine("updating inventory item details");
|
||||
System.Console.WriteLine("updating inventory item details");
|
||||
if (this.InventoryItems.ContainsKey(itemID))
|
||||
{
|
||||
Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
|
||||
System.Console.WriteLine("changing name to "+ Util.FieldToString(packet.Name));
|
||||
InventoryItem Item = this.InventoryItems[itemID];
|
||||
Item.Name = Util.FieldToString(packet.Name);
|
||||
Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
|
||||
System.Console.WriteLine("updated inventory item " + itemID.ToStringHyphenated());
|
||||
//TODO need to update the rest of the info
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,149 +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;
|
||||
|
||||
namespace OpenSim.Framework.Terrain
|
||||
{
|
||||
public class HeightmapGenHills
|
||||
{
|
||||
private Random Rand = new Random();
|
||||
private int NumHills;
|
||||
private float HillMin;
|
||||
private float HillMax;
|
||||
private bool Island;
|
||||
private float[] heightmap;
|
||||
|
||||
public float[] GenerateHeightmap(int numHills, float hillMin, float hillMax, bool island)
|
||||
{
|
||||
NumHills = numHills;
|
||||
HillMin = hillMin;
|
||||
HillMax = hillMax;
|
||||
Island = island;
|
||||
|
||||
heightmap = new float[256 * 256];
|
||||
|
||||
for (int i = 0; i < numHills; i++)
|
||||
{
|
||||
AddHill();
|
||||
}
|
||||
|
||||
Normalize();
|
||||
|
||||
return heightmap;
|
||||
}
|
||||
|
||||
private void AddHill()
|
||||
{
|
||||
float x, y;
|
||||
float radius = RandomRange(HillMin, HillMax);
|
||||
|
||||
if (Island)
|
||||
{
|
||||
// Which direction from the center of the map the hill is placed
|
||||
float theta = RandomRange(0, 6.28f);
|
||||
|
||||
// How far from the center of the map to place the hill. The radius
|
||||
// is subtracted from the range to prevent any part of the hill from
|
||||
// reaching the edge of the map
|
||||
float distance = RandomRange(radius / 2.0f, 128.0f - radius);
|
||||
|
||||
x = 128.0f + (float)Math.Cos(theta) * distance;
|
||||
y = 128.0f + (float)Math.Sin(theta) * distance;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = RandomRange(-radius, 256.0f + radius);
|
||||
y = RandomRange(-radius, 256.0f + radius);
|
||||
}
|
||||
|
||||
float radiusSq = radius * radius;
|
||||
float distSq;
|
||||
float height;
|
||||
|
||||
int xMin = (int)(x - radius) - 1;
|
||||
int xMax = (int)(x + radius) + 1;
|
||||
if (xMin < 0) xMin = 0;
|
||||
if (xMax > 255) xMax = 255;
|
||||
|
||||
int yMin = (int)(y - radius) - 1;
|
||||
int yMax = (int)(y + radius) + 1;
|
||||
if (yMin < 0) yMin = 0;
|
||||
if (yMax > 255) yMax = 255;
|
||||
|
||||
// Loop through each affected cell and determine the height at that point
|
||||
for (int v = yMin; v <= yMax; ++v)
|
||||
{
|
||||
float fv = (float)v;
|
||||
|
||||
for (int h = xMin; h <= xMax; ++h)
|
||||
{
|
||||
float fh = (float)h;
|
||||
|
||||
// Determine how far from the center of this hill this point is
|
||||
distSq = (x - fh) * (x - fh) + (y - fv) * (y - fv);
|
||||
height = radiusSq - distSq;
|
||||
|
||||
// Don't add negative hill values
|
||||
if (height > 0.0f) heightmap[h + v * 256] += height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Normalize()
|
||||
{
|
||||
float min = heightmap[0];
|
||||
float max = heightmap[0];
|
||||
|
||||
for (int x = 0; x < 256; x++)
|
||||
{
|
||||
for (int y = 0; y < 256; y++)
|
||||
{
|
||||
if (heightmap[x + y * 256] < min) min = heightmap[x + y * 256];
|
||||
if (heightmap[x + y * 256] > max) max = heightmap[x + y * 256];
|
||||
}
|
||||
}
|
||||
|
||||
// Avoid a rare divide by zero
|
||||
if (min != max)
|
||||
{
|
||||
for (int x = 0; x < 256; x++)
|
||||
{
|
||||
for (int y = 0; y < 256; y++)
|
||||
{
|
||||
heightmap[x + y * 256] = ((heightmap[x + y * 256] - min) / (max - min)) * (HillMax - HillMin);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float RandomRange(float min, float max)
|
||||
{
|
||||
return (float)Rand.NextDouble() * (max - min) + min;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,6 @@ namespace OpenSim.Framework.Interfaces
|
||||
event StartAnim OnStartAnim;
|
||||
event LinkObjects OnLinkObjects;
|
||||
event GenericCall4 OnDeRezObject;
|
||||
event ModifyTerrain OnModifyTerrain;
|
||||
event GenericCall OnRegionHandShakeReply;
|
||||
event GenericCall OnRequestWearables;
|
||||
event GenericCall2 OnCompleteMovementToRegion;
|
||||
@@ -57,6 +56,13 @@ namespace OpenSim.Framework.Interfaces
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
LLUUID AgentId
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
void OutPacket(Packet newPack);
|
||||
void SendAppearance(AvatarWearable[] wearables);
|
||||
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
||||
}
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
Copyright (c) OpenSim project, http://osgrid.org/
|
||||
|
||||
* Copyright (c) <year>, <copyright holder>
|
||||
* 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.Generic;
|
||||
using System.IO;
|
||||
using libsecondlife;
|
||||
//using OpenSim.world;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// This class handles connection to the underlying database used for configuration of the region.
|
||||
/// Region content is also stored by this class. The main entry point is InitConfig() which attempts to locate
|
||||
/// opensim.yap in the current working directory. If opensim.yap can not be found, default settings are loaded from
|
||||
/// what is hardcoded here and then saved into opensim.yap for future startups.
|
||||
/// </summary>
|
||||
|
||||
|
||||
public abstract class SimConfig
|
||||
{
|
||||
public string RegionName;
|
||||
|
||||
public uint RegionLocX;
|
||||
public uint RegionLocY;
|
||||
public ulong RegionHandle;
|
||||
|
||||
public int IPListenPort;
|
||||
public string IPListenAddr;
|
||||
|
||||
public string AssetURL;
|
||||
public string AssetSendKey;
|
||||
|
||||
public string GridURL;
|
||||
public string GridSendKey;
|
||||
public string GridRecvKey;
|
||||
public string UserURL;
|
||||
public string UserSendKey;
|
||||
public string UserRecvKey;
|
||||
|
||||
public abstract void InitConfig(bool sandboxMode);
|
||||
public abstract void LoadFromGrid();
|
||||
|
||||
}
|
||||
|
||||
public interface ISimConfig
|
||||
{
|
||||
SimConfig GetConfigObject();
|
||||
}
|
||||
}
|
||||
15
Common/OpenSim.Framework/Interfaces/IWorld.cs
Normal file
15
Common/OpenSim.Framework/Interfaces/IWorld.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using OpenSim.Framework.Types;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IWorld
|
||||
{
|
||||
bool AddNewAvatar(IClientAPI remoteClient, bool childAgent);
|
||||
bool RemoveAvatar(LLUUID agentID);
|
||||
RegionInfo GetRegionInfo();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IGridServerHost
|
||||
{
|
||||
void ConnectSim(string name);
|
||||
string RequestSimURL(uint regionHandle);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IProxyServerClient
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IProxyServerHost
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IRegionGridClient
|
||||
{
|
||||
bool ExpectUser(string toRegionID, string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public interface IRegionSimHost
|
||||
{
|
||||
bool ExpectUser(string name);
|
||||
bool AgentCrossing(string name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenSim.Framework.Interfaces
|
||||
{
|
||||
public abstract class RegionGridClientBase :IRegionGridClient
|
||||
{
|
||||
public abstract bool ExpectUser(string toRegionID, string name);
|
||||
}
|
||||
}
|
||||
@@ -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>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.Framework</AssemblyName>
|
||||
@@ -15,9 +16,11 @@
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.Framework</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,32 +61,38 @@
|
||||
<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.Data" />
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>System.Xml.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>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||
<Name>OpenSim.Framework.Console</Name>
|
||||
</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>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -90,21 +102,15 @@
|
||||
<Compile Include="BlockingQueue.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HeightMapGenHills.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="LoginService.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Remoting.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimProfile.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimProfileBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimProfile.cs" />
|
||||
<Compile Include="SimProfileBase.cs" />
|
||||
<Compile Include="Types\NetworkServersInfo.cs" />
|
||||
<Compile Include="UserProfile.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -123,39 +129,57 @@
|
||||
<Compile Include="Interfaces\IClientAPI.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IGenericConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IGridConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IGridServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\ILocalStorage.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IScriptAPI.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IScriptEngine.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IUserConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IUserServer.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\IWorld.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\LocalGridBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\RemoteGridBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Config\IGenericConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Config\IGridConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Config\IUserConfig.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\IGridServerHost.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\IProxyServerClient.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\IProxyServerHost.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\IRegionGridClient.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\IRegionSimHost.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Remoting\RegionGridClientBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Scripting\IScriptAPI.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Interfaces\Scripting\IScriptEngine.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -183,6 +207,9 @@
|
||||
<Compile Include="Types\PrimData.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Types\RegionInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<PropertyGroup>
|
||||
@@ -191,4 +218,4 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
@@ -37,7 +37,7 @@ namespace OpenSim.Framework.Sims
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
System.Console.WriteLine(e.ToString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace OpenSim.Framework.Sims
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Console.WriteLine(e.ToString());
|
||||
System.Console.WriteLine(e.ToString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Console;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Types
|
||||
{
|
||||
|
||||
91
Common/OpenSim.Framework/Types/NetworkServersInfo.cs
Normal file
91
Common/OpenSim.Framework/Types/NetworkServersInfo.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
|
||||
namespace OpenSim.Framework.Types
|
||||
{
|
||||
public class NetworkServersInfo
|
||||
{
|
||||
public string AssetURL = "http://127.0.0.1:8003/";
|
||||
public string AssetSendKey = "";
|
||||
|
||||
public string GridURL = "";
|
||||
public string GridSendKey = "";
|
||||
public string GridRecvKey = "";
|
||||
public string UserURL = "";
|
||||
public string UserSendKey = "";
|
||||
public string UserRecvKey = "";
|
||||
public bool isSandbox;
|
||||
|
||||
public void InitConfig(bool sandboxMode, IGenericConfig configData)
|
||||
{
|
||||
this.isSandbox = sandboxMode;
|
||||
|
||||
try
|
||||
{
|
||||
if (!isSandbox)
|
||||
{
|
||||
string attri = "";
|
||||
//Grid Server URL
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid server URL", "http://127.0.0.1:8001/");
|
||||
configData.SetAttribute("GridServerURL", this.GridURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.GridURL = attri;
|
||||
}
|
||||
|
||||
//Grid Send Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridSendKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridSendKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to send to grid server", "null");
|
||||
configData.SetAttribute("GridSendKey", this.GridSendKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.GridSendKey = attri;
|
||||
}
|
||||
|
||||
//Grid Receive Key
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("GridRecvKey");
|
||||
if (attri == "")
|
||||
{
|
||||
this.GridRecvKey = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Key to expect from grid server", "null");
|
||||
configData.SetAttribute("GridRecvKey", this.GridRecvKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.GridRecvKey = attri;
|
||||
}
|
||||
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("AssetServerURL");
|
||||
if (attri == "")
|
||||
{
|
||||
this.AssetURL = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Asset server URL", "http://127.0.0.1:8003/");
|
||||
configData.SetAttribute("AssetServerURL", this.GridURL);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.AssetURL = attri;
|
||||
}
|
||||
|
||||
}
|
||||
configData.Commit();
|
||||
}
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
198
Common/OpenSim.Framework/Types/RegionInfo.cs
Normal file
198
Common/OpenSim.Framework/Types/RegionInfo.cs
Normal file
@@ -0,0 +1,198 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenSim.Framework.Interfaces;
|
||||
using OpenSim.Framework.Utilities;
|
||||
using OpenSim.Framework.Console;
|
||||
using libsecondlife;
|
||||
|
||||
namespace OpenSim.Framework.Types
|
||||
{
|
||||
public class RegionInfo
|
||||
{
|
||||
public LLUUID SimUUID;
|
||||
public string RegionName;
|
||||
public uint RegionLocX;
|
||||
public uint RegionLocY;
|
||||
public ulong RegionHandle;
|
||||
public ushort RegionWaterHeight = 20;
|
||||
public bool RegionTerraform = true;
|
||||
|
||||
public int IPListenPort;
|
||||
public string IPListenAddr;
|
||||
|
||||
private bool isSandbox;
|
||||
public string DataStore;
|
||||
|
||||
// Region Information
|
||||
// Low resolution 'base' textures. No longer used.
|
||||
public LLUUID TerrainBase0 = new LLUUID("b8d3965a-ad78-bf43-699b-bff8eca6c975"); // Default
|
||||
public LLUUID TerrainBase1 = new LLUUID("abb783e6-3e93-26c0-248a-247666855da3"); // Default
|
||||
public LLUUID TerrainBase2 = new LLUUID("179cdabd-398a-9b6b-1391-4dc333ba321f"); // Default
|
||||
public LLUUID TerrainBase3 = new LLUUID("beb169c7-11ea-fff2-efe5-0f24dc881df2"); // Default
|
||||
// Higher resolution terrain textures
|
||||
public LLUUID TerrainDetail0 = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||
public LLUUID TerrainDetail1 = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||
public LLUUID TerrainDetail2 = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||
public LLUUID TerrainDetail3 = new LLUUID("00000000-0000-0000-0000-000000000000");
|
||||
// First quad - each point is bilinearly interpolated at each meter of terrain
|
||||
public float TerrainStartHeight00 = 10.0f; // NW Corner ( I think )
|
||||
public float TerrainStartHeight01 = 10.0f; // NE Corner ( I think )
|
||||
public float TerrainStartHeight10 = 10.0f; // SW Corner ( I think )
|
||||
public float TerrainStartHeight11 = 10.0f; // SE Corner ( I think )
|
||||
// Second quad - also bilinearly interpolated.
|
||||
// Terrain texturing is done that:
|
||||
// 0..3 (0 = base0, 3 = base3) = (terrain[x,y] - start[x,y]) / range[x,y]
|
||||
public float TerrainHeightRange00 = 60.0f;
|
||||
public float TerrainHeightRange01 = 60.0f;
|
||||
public float TerrainHeightRange10 = 60.0f;
|
||||
public float TerrainHeightRange11 = 60.0f;
|
||||
|
||||
// Terrain Default (Must be in F32 Format!)
|
||||
public string TerrainFile = "default.r32";
|
||||
public double TerrainMultiplier = 60.0;
|
||||
|
||||
public RegionInfo()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void InitConfig(bool sandboxMode, IGenericConfig configData)
|
||||
{
|
||||
this.isSandbox = sandboxMode;
|
||||
try
|
||||
{
|
||||
// Sim UUID
|
||||
string attri = "";
|
||||
attri = configData.GetAttribute("SimUUID");
|
||||
if (attri == "")
|
||||
{
|
||||
this.SimUUID = LLUUID.Random();
|
||||
configData.SetAttribute("SimUUID", this.SimUUID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
this.SimUUID = new LLUUID(attri);
|
||||
}
|
||||
|
||||
// Sim name
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("SimName");
|
||||
if (attri == "")
|
||||
{
|
||||
this.RegionName = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Name", "OpenSim test");
|
||||
configData.SetAttribute("SimName", this.RegionName);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RegionName = attri;
|
||||
}
|
||||
// Sim/Grid location X
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("SimLocationX");
|
||||
if (attri == "")
|
||||
{
|
||||
string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location X", "997");
|
||||
configData.SetAttribute("SimLocationX", location);
|
||||
this.RegionLocX = (uint)Convert.ToUInt32(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RegionLocX = (uint)Convert.ToUInt32(attri);
|
||||
}
|
||||
// Sim/Grid location Y
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("SimLocationY");
|
||||
if (attri == "")
|
||||
{
|
||||
string location = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Grid Location Y", "996");
|
||||
configData.SetAttribute("SimLocationY", location);
|
||||
this.RegionLocY = (uint)Convert.ToUInt32(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.RegionLocY = (uint)Convert.ToUInt32(attri);
|
||||
}
|
||||
|
||||
// Local storage datastore
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("Datastore");
|
||||
if (attri == "")
|
||||
{
|
||||
string datastore = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("Filename for local storage", "localworld.yap");
|
||||
configData.SetAttribute("Datastore", datastore);
|
||||
this.DataStore = datastore;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.DataStore = attri;
|
||||
}
|
||||
|
||||
//Sim Listen Port
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("SimListenPort");
|
||||
if (attri == "")
|
||||
{
|
||||
string port = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("UDP port for client connections", "9000");
|
||||
configData.SetAttribute("SimListenPort", port);
|
||||
this.IPListenPort = Convert.ToInt32(port);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IPListenPort = Convert.ToInt32(attri);
|
||||
}
|
||||
|
||||
//Sim Listen Address
|
||||
attri = "";
|
||||
attri = configData.GetAttribute("SimListenAddress");
|
||||
if (attri == "")
|
||||
{
|
||||
this.IPListenAddr = OpenSim.Framework.Console.MainConsole.Instance.CmdPrompt("IP Address to listen on for client connections", "127.0.0.1");
|
||||
configData.SetAttribute("SimListenAddress", this.IPListenAddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Probably belongs elsewhere, but oh well.
|
||||
if (attri.Trim().StartsWith("SYSTEMIP"))
|
||||
{
|
||||
string localhostname = System.Net.Dns.GetHostName();
|
||||
System.Net.IPAddress[] ips = System.Net.Dns.GetHostAddresses(localhostname);
|
||||
try
|
||||
{
|
||||
this.IPListenAddr = ips[0].ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.ToString();
|
||||
this.IPListenAddr = "127.0.0.1"; // Use the default if we fail
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IPListenAddr = attri;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
|
||||
|
||||
configData.Commit();
|
||||
}
|
||||
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,"Sim settings loaded:");
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "UUID: " + this.SimUUID.ToStringHyphenated());
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Name: " + this.RegionName);
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Location: [" + this.RegionLocX.ToString() + "," + this.RegionLocY + "]");
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Region Handle: " + this.RegionHandle.ToString());
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Listening on IP: " + this.IPListenAddr + ":" + this.IPListenPort);
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Sandbox Mode? " + isSandbox.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,12 +139,12 @@ namespace OpenSim.Framework.User
|
||||
ClassifiedCategories.Add(ClassifiedCategoriesHash);
|
||||
|
||||
ArrayList AgentInventory = new ArrayList();
|
||||
Console.WriteLine("adding inventory to response");
|
||||
System.Console.WriteLine("adding inventory to response");
|
||||
Hashtable TempHash;
|
||||
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
|
||||
{
|
||||
TempHash = new Hashtable();
|
||||
Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
|
||||
System.Console.WriteLine("adding folder " + InvFolder.FolderName + ", ID: " + InvFolder.FolderID.ToStringHyphenated() + " with parent: " + InvFolder.ParentID.ToStringHyphenated());
|
||||
TempHash["name"] = InvFolder.FolderName;
|
||||
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
||||
TempHash["version"] = (Int32)InvFolder.Version;
|
||||
@@ -206,7 +206,7 @@ namespace OpenSim.Framework.User
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
Console.WriteLine(E.ToString());
|
||||
System.Console.WriteLine(E.ToString());
|
||||
}
|
||||
//}
|
||||
}
|
||||
@@ -251,7 +251,7 @@ namespace OpenSim.Framework.User
|
||||
response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
|
||||
|
||||
//default is ogs user server, so let the sim know about the user via a XmlRpcRequest
|
||||
Console.WriteLine(SimInfo.caps_url);
|
||||
System.Console.WriteLine(SimInfo.caps_url);
|
||||
Hashtable SimParams = new Hashtable();
|
||||
SimParams["session_id"] = theUser.CurrentSessionID.ToString();
|
||||
SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenSim.Framework.User
|
||||
{
|
||||
UserProfiles.Add(userprof.UUID, userprof);
|
||||
}
|
||||
Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database");
|
||||
System.Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database");
|
||||
db.Close();
|
||||
}
|
||||
|
||||
@@ -73,18 +73,18 @@ namespace OpenSim.Framework.User
|
||||
{
|
||||
if (TheUser.MD5passwd == passwd)
|
||||
{
|
||||
Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
|
||||
System.Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd);
|
||||
System.Console.WriteLine("UserProfile - not authorised, password not match " + TheUser.MD5passwd + " and " + passwd);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
|
||||
System.Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenSim.Framework.User
|
||||
|
||||
public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd)
|
||||
{
|
||||
Console.WriteLine("creating new profile for : " + firstname + " , " + lastname);
|
||||
System.Console.WriteLine("creating new profile for : " + firstname + " , " + lastname);
|
||||
UserProfile newprofile = new UserProfile();
|
||||
newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
|
||||
newprofile.firstname = firstname;
|
||||
|
||||
Reference in New Issue
Block a user