Should allow multiple worlds (and UDP servers) to be ran in one instance, just missing backend comms and working Avatar/primitives classes.
parent
06387d0344
commit
c746a2f9f4
|
@ -79,7 +79,7 @@ namespace OpenSim.Framework.Inventory
|
||||||
{
|
{
|
||||||
if (!this.InventoryFolders.ContainsKey(folderID))
|
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();
|
InventoryFolder Folder = new InventoryFolder();
|
||||||
Folder.FolderID = folderID;
|
Folder.FolderID = folderID;
|
||||||
Folder.OwnerID = this.AgentID;
|
Folder.OwnerID = this.AgentID;
|
||||||
|
@ -120,7 +120,7 @@ namespace OpenSim.Framework.Inventory
|
||||||
{
|
{
|
||||||
InventoryItem Item = this.InventoryItems[itemID];
|
InventoryItem Item = this.InventoryItems[itemID];
|
||||||
Item.AssetID = asset.FullID;
|
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
|
//TODO need to update the rest of the info
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -128,13 +128,13 @@ namespace OpenSim.Framework.Inventory
|
||||||
|
|
||||||
public bool UpdateItemDetails(LLUUID itemID, UpdateInventoryItemPacket.InventoryDataBlock packet)
|
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))
|
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];
|
InventoryItem Item = this.InventoryItems[itemID];
|
||||||
Item.Name = Util.FieldToString(packet.Name);
|
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
|
//TODO need to update the rest of the info
|
||||||
}
|
}
|
||||||
return true;
|
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 StartAnim OnStartAnim;
|
||||||
event LinkObjects OnLinkObjects;
|
event LinkObjects OnLinkObjects;
|
||||||
event GenericCall4 OnDeRezObject;
|
event GenericCall4 OnDeRezObject;
|
||||||
event ModifyTerrain OnModifyTerrain;
|
|
||||||
event GenericCall OnRegionHandShakeReply;
|
event GenericCall OnRegionHandShakeReply;
|
||||||
event GenericCall OnRequestWearables;
|
event GenericCall OnRequestWearables;
|
||||||
event GenericCall2 OnCompleteMovementToRegion;
|
event GenericCall2 OnCompleteMovementToRegion;
|
||||||
|
@ -57,6 +56,13 @@ namespace OpenSim.Framework.Interfaces
|
||||||
get;
|
get;
|
||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLUUID AgentId
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OutPacket(Packet newPack);
|
||||||
void SendAppearance(AvatarWearable[] wearables);
|
void SendAppearance(AvatarWearable[] wearables);
|
||||||
void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID);
|
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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>
|
<PropertyGroup>
|
||||||
<ProjectType>Local</ProjectType>
|
<ProjectType>Local</ProjectType>
|
||||||
<ProductVersion>8.0.50727</ProductVersion>
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
@ -6,7 +6,8 @@
|
||||||
<ProjectGuid>{8ACA2445-0000-0000-0000-000000000000}</ProjectGuid>
|
<ProjectGuid>{8ACA2445-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.Framework</AssemblyName>
|
<AssemblyName>OpenSim.Framework</AssemblyName>
|
||||||
|
@ -15,9 +16,11 @@
|
||||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||||
<DelaySign>false</DelaySign>
|
<DelaySign>false</DelaySign>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder></AppDesignerFolder>
|
<AppDesignerFolder>
|
||||||
|
</AppDesignerFolder>
|
||||||
<RootNamespace>OpenSim.Framework</RootNamespace>
|
<RootNamespace>OpenSim.Framework</RootNamespace>
|
||||||
<StartupObject></StartupObject>
|
<StartupObject>
|
||||||
|
</StartupObject>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -28,7 +31,8 @@
|
||||||
<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>
|
||||||
|
@ -37,7 +41,8 @@
|
||||||
<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>
|
||||||
|
@ -46,7 +51,8 @@
|
||||||
<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>
|
||||||
|
@ -55,32 +61,38 @@
|
||||||
<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">
|
||||||
<HintPath>System.dll</HintPath>
|
<HintPath>System.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xml" >
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml">
|
||||||
<HintPath>System.Xml.dll</HintPath>
|
<HintPath>System.Xml.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="libsecondlife.dll" >
|
<Reference Include="libsecondlife.dll">
|
||||||
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Db4objects.Db4o.dll" >
|
<Reference Include="Db4objects.Db4o.dll">
|
||||||
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<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">
|
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
|
||||||
<Name>XMLRPC</Name>
|
<Name>XMLRPC</Name>
|
||||||
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -90,21 +102,15 @@
|
||||||
<Compile Include="BlockingQueue.cs">
|
<Compile Include="BlockingQueue.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="HeightMapGenHills.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="LoginService.cs">
|
<Compile Include="LoginService.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Remoting.cs">
|
<Compile Include="Remoting.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="SimProfile.cs">
|
<Compile Include="SimProfile.cs" />
|
||||||
<SubType>Code</SubType>
|
<Compile Include="SimProfileBase.cs" />
|
||||||
</Compile>
|
<Compile Include="Types\NetworkServersInfo.cs" />
|
||||||
<Compile Include="SimProfileBase.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="UserProfile.cs">
|
<Compile Include="UserProfile.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -123,39 +129,57 @@
|
||||||
<Compile Include="Interfaces\IClientAPI.cs">
|
<Compile Include="Interfaces\IClientAPI.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</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">
|
<Compile Include="Interfaces\IGridServer.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Interfaces\ILocalStorage.cs">
|
<Compile Include="Interfaces\ILocalStorage.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</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">
|
<Compile Include="Interfaces\IUserServer.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Interfaces\IWorld.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Interfaces\LocalGridBase.cs">
|
<Compile Include="Interfaces\LocalGridBase.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Interfaces\RemoteGridBase.cs">
|
<Compile Include="Interfaces\RemoteGridBase.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</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">
|
<Compile Include="Properties\AssemblyInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -183,6 +207,9 @@
|
||||||
<Compile Include="Types\PrimData.cs">
|
<Compile Include="Types\PrimData.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Types\RegionInfo.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace OpenSim.Framework.Sims
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(e.ToString());
|
System.Console.WriteLine(e.ToString());
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ namespace OpenSim.Framework.Sims
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Console.WriteLine(e.ToString());
|
System.Console.WriteLine(e.ToString());
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
using OpenSim.Framework.Utilities;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Framework.Types
|
namespace OpenSim.Framework.Types
|
||||||
{
|
{
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
ClassifiedCategories.Add(ClassifiedCategoriesHash);
|
||||||
|
|
||||||
ArrayList AgentInventory = new ArrayList();
|
ArrayList AgentInventory = new ArrayList();
|
||||||
Console.WriteLine("adding inventory to response");
|
System.Console.WriteLine("adding inventory to response");
|
||||||
Hashtable TempHash;
|
Hashtable TempHash;
|
||||||
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
|
foreach (InventoryFolder InvFolder in TheUser.Inventory.InventoryFolders.Values)
|
||||||
{
|
{
|
||||||
TempHash = new Hashtable();
|
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["name"] = InvFolder.FolderName;
|
||||||
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
TempHash["parent_id"] = InvFolder.ParentID.ToStringHyphenated();
|
||||||
TempHash["version"] = (Int32)InvFolder.Version;
|
TempHash["version"] = (Int32)InvFolder.Version;
|
||||||
|
@ -206,7 +206,7 @@ namespace OpenSim.Framework.User
|
||||||
}
|
}
|
||||||
catch (Exception E)
|
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;
|
response["region_x"] = (Int32)SimInfo.RegionLocX * 256;
|
||||||
|
|
||||||
//default is ogs user server, so let the sim know about the user via a XmlRpcRequest
|
//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();
|
Hashtable SimParams = new Hashtable();
|
||||||
SimParams["session_id"] = theUser.CurrentSessionID.ToString();
|
SimParams["session_id"] = theUser.CurrentSessionID.ToString();
|
||||||
SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString();
|
SimParams["secure_session_id"] = theUser.CurrentSecureSessionID.ToString();
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace OpenSim.Framework.User
|
||||||
{
|
{
|
||||||
UserProfiles.Add(userprof.UUID, userprof);
|
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();
|
db.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,18 +73,18 @@ namespace OpenSim.Framework.User
|
||||||
{
|
{
|
||||||
if (TheUser.MD5passwd == passwd)
|
if (TheUser.MD5passwd == passwd)
|
||||||
{
|
{
|
||||||
Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
|
System.Console.WriteLine("UserProfile - authorised " + firstname + " " + lastname);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
|
System.Console.WriteLine("UserProfile - not authorised , unkown: " + firstname + " , " + lastname);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace OpenSim.Framework.User
|
||||||
|
|
||||||
public virtual UserProfile CreateNewProfile(string firstname, string lastname, string MD5passwd)
|
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();
|
UserProfile newprofile = new UserProfile();
|
||||||
newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
|
newprofile.homeregionhandle = Helpers.UIntsToLong((997 * 256), (996 * 256));
|
||||||
newprofile.firstname = firstname;
|
newprofile.firstname = firstname;
|
||||||
|
|
Binary file not shown.
218
OpenSim.sln
218
OpenSim.sln
|
@ -1,5 +1,5 @@
|
||||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||||
# Visual Studio 2005
|
# Visual C# Express 2005
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim\OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim\OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim\OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}"
|
||||||
|
@ -39,135 +39,89 @@ EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLRPC", "Common\XmlRpcCS\XMLRPC.csproj", "{8E81D43C-0000-0000-0000-000000000000}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectDependencies) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
({EE9E5D96-0000-0000-0000-000000000000}).6 = ({8ACA2445-0000-0000-0000-000000000000})
|
{2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({EE9E5D96-0000-0000-0000-000000000000}).7 = ({A7CD0630-0000-0000-0000-000000000000})
|
{2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({63A05FE9-0000-0000-0000-000000000000}).2 = ({8BE16150-0000-0000-0000-000000000000})
|
{2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).5 = ({2270B8FE-0000-0000-0000-000000000000})
|
{2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).6 = ({8ACA2445-0000-0000-0000-000000000000})
|
{EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).7 = ({A7CD0630-0000-0000-0000-000000000000})
|
{EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).8 = ({E88EF749-0000-0000-0000-000000000000})
|
{EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).9 = ({8BE16150-0000-0000-0000-000000000000})
|
{EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).10 = ({8BB20F0A-0000-0000-0000-000000000000})
|
{63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({642A14A8-0000-0000-0000-000000000000}).11 = ({8E81D43C-0000-0000-0000-000000000000})
|
{63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).5 = ({2270B8FE-0000-0000-0000-000000000000})
|
{63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).6 = ({8ACA2445-0000-0000-0000-000000000000})
|
{63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).7 = ({A7CD0630-0000-0000-0000-000000000000})
|
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).8 = ({8BE16150-0000-0000-0000-000000000000})
|
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).9 = ({8BB20F0A-0000-0000-0000-000000000000})
|
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).10 = ({632E1BFD-0000-0000-0000-000000000000})
|
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).11 = ({E88EF749-0000-0000-0000-000000000000})
|
{642A14A8-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({438A9556-0000-0000-0000-000000000000}).12 = ({8E81D43C-0000-0000-0000-000000000000})
|
{642A14A8-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).5 = ({2270B8FE-0000-0000-0000-000000000000})
|
{642A14A8-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).6 = ({8ACA2445-0000-0000-0000-000000000000})
|
{642A14A8-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).7 = ({A7CD0630-0000-0000-0000-000000000000})
|
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).8 = ({E88EF749-0000-0000-0000-000000000000})
|
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).9 = ({8BE16150-0000-0000-0000-000000000000})
|
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).10 = ({8BB20F0A-0000-0000-0000-000000000000})
|
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({632E1BFD-0000-0000-0000-000000000000}).11 = ({8E81D43C-0000-0000-0000-000000000000})
|
{632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({E88EF749-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
{632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({8BE16150-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
{632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({8BE16150-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
{632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({4F874463-0000-0000-0000-000000000000}).2 = ({8BE16150-0000-0000-0000-000000000000})
|
{E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({988F0AC4-0000-0000-0000-000000000000}).3 = ({8BE16150-0000-0000-0000-000000000000})
|
{E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({B55C0B5D-0000-0000-0000-000000000000}).3 = ({8ACA2445-0000-0000-0000-000000000000})
|
{E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({B55C0B5D-0000-0000-0000-000000000000}).4 = ({A7CD0630-0000-0000-0000-000000000000})
|
{E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({B55C0B5D-0000-0000-0000-000000000000}).5 = ({8E81D43C-0000-0000-0000-000000000000})
|
{8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({8ACA2445-0000-0000-0000-000000000000}).4 = ({8E81D43C-0000-0000-0000-000000000000})
|
{8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({8BB20F0A-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
{8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({8BB20F0A-0000-0000-0000-000000000000}).3 = ({A7CD0630-0000-0000-0000-000000000000})
|
{8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({8BB20F0A-0000-0000-0000-000000000000}).5 = ({8E81D43C-0000-0000-0000-000000000000})
|
{4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({E1B79ECF-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
|
{4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({E1B79ECF-0000-0000-0000-000000000000}).5 = ({A7CD0630-0000-0000-0000-000000000000})
|
{4F874463-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({6B20B603-0000-0000-0000-000000000000}).5 = ({8ACA2445-0000-0000-0000-000000000000})
|
{4F874463-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
({6B20B603-0000-0000-0000-000000000000}).6 = ({A7CD0630-0000-0000-0000-000000000000})
|
{988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
({97A82740-0000-0000-0000-000000000000}).2 = ({8ACA2445-0000-0000-0000-000000000000})
|
{988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
({546099CD-0000-0000-0000-000000000000}).4 = ({8ACA2445-0000-0000-0000-000000000000})
|
{988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
({546099CD-0000-0000-0000-000000000000}).5 = ({A7CD0630-0000-0000-0000-000000000000})
|
{988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
{B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
{B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{2270B8FE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{2270B8FE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{EE9E5D96-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{EE9E5D96-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{63A05FE9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{63A05FE9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A7CD0630-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A7CD0630-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{642A14A8-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{642A14A8-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{642A14A8-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{642A14A8-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{97A82740-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{438A9556-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{97A82740-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{438A9556-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{546099CD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{632E1BFD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{546099CD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{632E1BFD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{E88EF749-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
EndGlobalSection
|
||||||
{E88EF749-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
{8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
HideSolutionNode = FALSE
|
||||||
{8BE16150-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
EndGlobalSection
|
||||||
{8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8BE16150-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{4F874463-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{4F874463-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{4F874463-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{988F0AC4-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{988F0AC4-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{B55C0B5D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{B55C0B5D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8ACA2445-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8ACA2445-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8BB20F0A-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8BB20F0A-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E1B79ECF-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E1B79ECF-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6B20B603-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6B20B603-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{97A82740-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{97A82740-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{97A82740-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{546099CD-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{546099CD-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{546099CD-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8E81D43C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8E81D43C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
BIN
OpenSim.suo
BIN
OpenSim.suo
Binary file not shown.
|
@ -28,6 +28,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Reflection;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim;
|
using OpenSim;
|
||||||
|
@ -71,6 +72,20 @@ namespace OpenSim.Assets
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssetCache(string assetServerDLLName, string assetServerURL, string assetServerKey)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Creating Asset cache");
|
||||||
|
_assetServer = this.LoadAssetDll(assetServerDLLName);
|
||||||
|
_assetServer.SetServerInfo(assetServerURL, assetServerKey);
|
||||||
|
_assetServer.SetReceiver(this);
|
||||||
|
Assets = new Dictionary<libsecondlife.LLUUID, AssetInfo>();
|
||||||
|
Textures = new Dictionary<libsecondlife.LLUUID, TextureImage>();
|
||||||
|
this._assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
|
||||||
|
this._assetCacheThread.IsBackground = true;
|
||||||
|
this._assetCacheThread.Start();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -513,6 +528,34 @@ namespace OpenSim.Assets
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
private IAssetServer LoadAssetDll(string dllName)
|
||||||
|
{
|
||||||
|
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
||||||
|
IAssetServer server = null;
|
||||||
|
|
||||||
|
foreach (Type pluginType in pluginAssembly.GetTypes())
|
||||||
|
{
|
||||||
|
if (pluginType.IsPublic)
|
||||||
|
{
|
||||||
|
if (!pluginType.IsAbstract)
|
||||||
|
{
|
||||||
|
Type typeInterface = pluginType.GetInterface("IAssetPlugin", true);
|
||||||
|
|
||||||
|
if (typeInterface != null)
|
||||||
|
{
|
||||||
|
IAssetPlugin plug = (IAssetPlugin)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||||
|
server = plug.GetAssetServer();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
typeInterface = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pluginAssembly = null;
|
||||||
|
return server;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AssetRequest
|
public class AssetRequest
|
||||||
|
|
|
@ -2,13 +2,11 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.UserServer;
|
using OpenSim.UserServer;
|
||||||
using OpenSim.Servers;
|
using OpenSim.Servers;
|
||||||
using OpenSim.Assets;
|
using OpenSim.Assets;
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.RegionServer.world.scripting;
|
|
||||||
using Avatar=libsecondlife.Avatar;
|
using Avatar=libsecondlife.Avatar;
|
||||||
|
|
||||||
namespace OpenSim.CAPS
|
namespace OpenSim.CAPS
|
||||||
|
|
|
@ -0,0 +1,96 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
using OpenSim.Framework.Inventory;
|
||||||
|
using libsecondlife;
|
||||||
|
using libsecondlife.Packets;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
partial class ClientView
|
||||||
|
{
|
||||||
|
public event ChatFromViewer OnChatFromViewer;
|
||||||
|
public event RezObject OnRezObject;
|
||||||
|
public event GenericCall4 OnDeRezObject;
|
||||||
|
public event ModifyTerrain OnModifyTerrain;
|
||||||
|
public event GenericCall OnRegionHandShakeReply;
|
||||||
|
public event GenericCall OnRequestWearables;
|
||||||
|
public event SetAppearance OnSetAppearance;
|
||||||
|
public event GenericCall2 OnCompleteMovementToRegion;
|
||||||
|
public event GenericCall3 OnAgentUpdate;
|
||||||
|
public event StartAnim OnStartAnim;
|
||||||
|
public event GenericCall OnRequestAvatarsData;
|
||||||
|
public event LinkObjects OnLinkObjects;
|
||||||
|
public event GenericCall4 OnAddPrim;
|
||||||
|
public event UpdateShape OnUpdatePrimShape;
|
||||||
|
public event ObjectSelect OnObjectSelect;
|
||||||
|
public event UpdatePrimFlags OnUpdatePrimFlags;
|
||||||
|
public event UpdatePrimTexture OnUpdatePrimTexture;
|
||||||
|
public event UpdatePrimVector OnUpdatePrimPosition;
|
||||||
|
public event UpdatePrimRotation OnUpdatePrimRotation;
|
||||||
|
public event UpdatePrimVector OnUpdatePrimScale;
|
||||||
|
public event StatusChange OnChildAgentStatus;
|
||||||
|
public event GenericCall2 OnStopMovement;
|
||||||
|
|
||||||
|
public LLVector3 StartPos
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return startpos;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
startpos = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public LLUUID AgentId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.AgentID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region World/Avatar to Client
|
||||||
|
public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
||||||
|
{
|
||||||
|
System.Text.Encoding enc = System.Text.Encoding.ASCII;
|
||||||
|
libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
|
||||||
|
reply.ChatData.Audible = 1;
|
||||||
|
reply.ChatData.Message = message;
|
||||||
|
reply.ChatData.ChatType = type;
|
||||||
|
reply.ChatData.SourceType = 1;
|
||||||
|
reply.ChatData.Position = fromPos;
|
||||||
|
reply.ChatData.FromName = enc.GetBytes(fromName + "\0");
|
||||||
|
reply.ChatData.OwnerID = fromAgentID;
|
||||||
|
reply.ChatData.SourceID = fromAgentID;
|
||||||
|
|
||||||
|
this.OutPacket(reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendAppearance(AvatarWearable[] wearables)
|
||||||
|
{
|
||||||
|
AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
|
||||||
|
aw.AgentData.AgentID = this.AgentID;
|
||||||
|
aw.AgentData.SerialNum = 0;
|
||||||
|
aw.AgentData.SessionID = this.SessionID;
|
||||||
|
|
||||||
|
aw.WearableData = new AgentWearablesUpdatePacket.WearableDataBlock[13];
|
||||||
|
AgentWearablesUpdatePacket.WearableDataBlock awb;
|
||||||
|
for (int i = 0; i < wearables.Length; i++)
|
||||||
|
{
|
||||||
|
awb = new AgentWearablesUpdatePacket.WearableDataBlock();
|
||||||
|
awb.WearableType = (byte)i;
|
||||||
|
awb.AssetID = wearables[i].AssetID;
|
||||||
|
awb.ItemID = wearables[i].ItemID;
|
||||||
|
aw.WearableData[i] = awb;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.OutPacket(aw);
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,7 +13,6 @@ using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Assets;
|
using OpenSim.Assets;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
|
|
|
@ -13,7 +13,6 @@ using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Assets;
|
using OpenSim.Assets;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
|
@ -42,26 +41,21 @@ namespace OpenSim
|
||||||
KillObjectPacket kill = new KillObjectPacket();
|
KillObjectPacket kill = new KillObjectPacket();
|
||||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||||
kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
// kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (ClientView client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
client.OutPacket(kill);
|
client.OutPacket(kill);
|
||||||
}
|
}
|
||||||
if (this.m_userServer != null)
|
|
||||||
{
|
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
||||||
this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
|
m_gridServer.LogoutSession(this.SessionID, this.AgentID, this.CircuitCode);
|
||||||
/*lock (m_world.Entities)
|
/*lock (m_world.Entities)
|
||||||
{
|
{
|
||||||
m_world.Entities.Remove(this.AgentID);
|
m_world.Entities.Remove(this.AgentID);
|
||||||
}*/
|
}*/
|
||||||
m_world.RemoveViewerAgent(this);
|
// m_world.RemoveViewerAgent(this);
|
||||||
//need to do other cleaning up here too
|
//need to do other cleaning up here too
|
||||||
m_clientThreads.Remove(this.CircuitCode);
|
m_clientThreads.Remove(this.CircuitCode);
|
||||||
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
||||||
|
|
|
@ -13,15 +13,12 @@ using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Assets;
|
using OpenSim.Assets;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
public partial class ClientView
|
public partial class ClientView
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
protected override void ProcessInPacket(Packet Pack)
|
protected override void ProcessInPacket(Packet Pack)
|
||||||
{
|
{
|
||||||
ack_pack(Pack);
|
ack_pack(Pack);
|
||||||
|
@ -65,10 +62,10 @@ namespace OpenSim
|
||||||
//empty message so don't bother with it
|
//empty message so don't bother with it
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
string fromName = ClientAvatar.firstname + " " + ClientAvatar.lastname;
|
string fromName = ""; //ClientAvatar.firstname + " " + ClientAvatar.lastname;
|
||||||
byte[] message = inchatpack.ChatData.Message;
|
byte[] message = inchatpack.ChatData.Message;
|
||||||
byte type = inchatpack.ChatData.Type;
|
byte type = inchatpack.ChatData.Type;
|
||||||
LLVector3 fromPos = ClientAvatar.Pos;
|
LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos;
|
||||||
LLUUID fromAgentID = AgentID;
|
LLUUID fromAgentID = AgentID;
|
||||||
this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
|
this.OnChatFromViewer(message, type, fromPos, fromName, fromAgentID);
|
||||||
break;
|
break;
|
||||||
|
@ -151,7 +148,7 @@ namespace OpenSim
|
||||||
OnLinkObjects(parentprimid, childrenprims);
|
OnLinkObjects(parentprimid, childrenprims);
|
||||||
break;
|
break;
|
||||||
case PacketType.ObjectAdd:
|
case PacketType.ObjectAdd:
|
||||||
m_world.AddNewPrim((ObjectAddPacket)Pack, this);
|
// m_world.AddNewPrim((ObjectAddPacket)Pack, this);
|
||||||
OnAddPrim(Pack, this);
|
OnAddPrim(Pack, this);
|
||||||
break;
|
break;
|
||||||
case PacketType.ObjectShape:
|
case PacketType.ObjectShape:
|
||||||
|
@ -270,7 +267,7 @@ namespace OpenSim
|
||||||
RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
|
RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack;
|
||||||
ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket();
|
ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket();
|
||||||
bool foundent = false;
|
bool foundent = false;
|
||||||
foreach (Entity ent in m_world.Entities.Values)
|
/* foreach (Entity ent in m_world.Entities.Values)
|
||||||
{
|
{
|
||||||
if (ent.localid == requesttask.InventoryData.LocalID)
|
if (ent.localid == requesttask.InventoryData.LocalID)
|
||||||
{
|
{
|
||||||
|
@ -283,13 +280,13 @@ namespace OpenSim
|
||||||
if (foundent)
|
if (foundent)
|
||||||
{
|
{
|
||||||
this.OutPacket(replytask);
|
this.OutPacket(replytask);
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
case PacketType.UpdateTaskInventory:
|
case PacketType.UpdateTaskInventory:
|
||||||
// Console.WriteLine(Pack.ToString());
|
// Console.WriteLine(Pack.ToString());
|
||||||
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
|
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
|
||||||
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
|
||||||
if (myinventory != null)
|
/*if (myinventory != null)
|
||||||
{
|
{
|
||||||
if (updatetask.UpdateData.Key == 0)
|
if (updatetask.UpdateData.Key == 0)
|
||||||
{
|
{
|
||||||
|
@ -315,7 +312,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
case PacketType.MapLayerRequest:
|
case PacketType.MapLayerRequest:
|
||||||
this.RequestMapLayer();
|
this.RequestMapLayer();
|
||||||
|
|
|
@ -35,11 +35,11 @@ using System.Net.Sockets;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Assets;
|
using OpenSim.Assets;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
|
@ -58,8 +58,7 @@ namespace OpenSim
|
||||||
public LLUUID AgentID;
|
public LLUUID AgentID;
|
||||||
public LLUUID SessionID;
|
public LLUUID SessionID;
|
||||||
public LLUUID SecureSessionID = LLUUID.Zero;
|
public LLUUID SecureSessionID = LLUUID.Zero;
|
||||||
public bool m_child;
|
public bool m_child = false;
|
||||||
public world.Avatar ClientAvatar;
|
|
||||||
private UseCircuitCodePacket cirpack;
|
private UseCircuitCodePacket cirpack;
|
||||||
public Thread ClientThread;
|
public Thread ClientThread;
|
||||||
public LLVector3 startpos;
|
public LLVector3 startpos;
|
||||||
|
@ -67,64 +66,32 @@ namespace OpenSim
|
||||||
private AgentAssetUpload UploadAssets;
|
private AgentAssetUpload UploadAssets;
|
||||||
private LLUUID newAssetFolder = LLUUID.Zero;
|
private LLUUID newAssetFolder = LLUUID.Zero;
|
||||||
private bool debug = false;
|
private bool debug = false;
|
||||||
private World m_world;
|
private IWorld m_world;
|
||||||
private Dictionary<uint, ClientView> m_clientThreads;
|
private Dictionary<uint, ClientView> m_clientThreads;
|
||||||
private AssetCache m_assetCache;
|
private AssetCache m_assetCache;
|
||||||
private IGridServer m_gridServer;
|
private IGridServer m_gridServer;
|
||||||
private IUserServer m_userServer = null;
|
|
||||||
private InventoryCache m_inventoryCache;
|
private InventoryCache m_inventoryCache;
|
||||||
public bool m_sandboxMode;
|
|
||||||
private int cachedtextureserial = 0;
|
private int cachedtextureserial = 0;
|
||||||
private RegionInfo m_regionData;
|
private RegionInfo m_regionData;
|
||||||
protected AuthenticateSessionsBase m_authenticateSessionsHandler;
|
protected AuthenticateSessionsBase m_authenticateSessionsHandler;
|
||||||
|
|
||||||
public IUserServer UserServer
|
|
||||||
{
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.m_userServer = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public LLVector3 StartPos
|
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions)
|
||||||
{
|
{
|
||||||
get
|
|
||||||
{
|
|
||||||
return startpos;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
startpos = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, World world, Dictionary<uint, ClientView> clientThreads, AssetCache assetCache, IGridServer gridServer, OpenSimNetworkHandler application, InventoryCache inventoryCache, bool sandboxMode, bool child, RegionInfo regionDat, AuthenticateSessionsBase authenSessions)
|
|
||||||
{
|
|
||||||
m_world = world;
|
|
||||||
m_clientThreads = clientThreads;
|
m_clientThreads = clientThreads;
|
||||||
m_assetCache = assetCache;
|
m_assetCache = assetCache;
|
||||||
m_gridServer = gridServer;
|
|
||||||
m_networkServer = application;
|
m_networkServer = packServer;
|
||||||
m_inventoryCache = inventoryCache;
|
m_inventoryCache = inventoryCache;
|
||||||
m_sandboxMode = sandboxMode;
|
|
||||||
m_child = child;
|
|
||||||
m_regionData = regionDat;
|
|
||||||
m_authenticateSessionsHandler = authenSessions;
|
m_authenticateSessionsHandler = authenSessions;
|
||||||
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
|
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
|
||||||
cirpack = initialcirpack;
|
cirpack = initialcirpack;
|
||||||
userEP = remoteEP;
|
userEP = remoteEP;
|
||||||
|
|
||||||
if (m_gridServer.GetName() == "Remote")
|
this.m_child = m_authenticateSessionsHandler.GetAgentChildStatus(initialcirpack.CircuitCode.Code);
|
||||||
{
|
this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
|
||||||
this.m_child = m_authenticateSessionsHandler.GetAgentChildStatus(initialcirpack.CircuitCode.Code);
|
|
||||||
this.startpos = m_authenticateSessionsHandler.GetPosition(initialcirpack.CircuitCode.Code);
|
|
||||||
//Console.WriteLine("start pos is " + this.startpos.X + " , " + this.startpos.Y + " , " + this.startpos.Z);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f);
|
|
||||||
}
|
|
||||||
|
|
||||||
PacketQueue = new BlockingQueue<QueItem>();
|
PacketQueue = new BlockingQueue<QueItem>();
|
||||||
|
|
||||||
|
@ -146,11 +113,10 @@ namespace OpenSim
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
|
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "SimClient.cs:UpgradeClient() - upgrading child to full agent");
|
||||||
this.m_child = false;
|
this.m_child = false;
|
||||||
//this.m_world.RemoveViewerAgent(this);
|
//this.m_world.RemoveViewerAgent(this);
|
||||||
if (!this.m_sandboxMode)
|
|
||||||
{
|
this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
|
||||||
this.startpos = m_authenticateSessionsHandler.GetPosition(CircuitCode);
|
m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
|
||||||
m_authenticateSessionsHandler.UpdateAgentChildStatus(CircuitCode, false);
|
|
||||||
}
|
|
||||||
OnChildAgentStatus(this.m_child);
|
OnChildAgentStatus(this.m_child);
|
||||||
//this.InitNewClient();
|
//this.InitNewClient();
|
||||||
}
|
}
|
||||||
|
@ -169,21 +135,16 @@ namespace OpenSim
|
||||||
KillObjectPacket kill = new KillObjectPacket();
|
KillObjectPacket kill = new KillObjectPacket();
|
||||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
||||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
||||||
kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
//kill.ObjectData[0].ID = this.ClientAvatar.localid;
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (ClientView client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
client.OutPacket(kill);
|
client.OutPacket(kill);
|
||||||
}
|
}
|
||||||
if (this.m_userServer != null)
|
|
||||||
{
|
|
||||||
this.m_inventoryCache.ClientLeaving(this.AgentID, this.m_userServer);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_world.RemoveViewerAgent(this);
|
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
|
||||||
|
|
||||||
|
|
||||||
|
// m_world.RemoveViewerAgent(this);
|
||||||
|
|
||||||
m_clientThreads.Remove(this.CircuitCode);
|
m_clientThreads.Remove(this.CircuitCode);
|
||||||
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
m_networkServer.RemoveClientCircuit(this.CircuitCode);
|
||||||
|
@ -270,13 +231,13 @@ namespace OpenSim
|
||||||
protected virtual void InitNewClient()
|
protected virtual void InitNewClient()
|
||||||
{
|
{
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
|
||||||
this.ClientAvatar = m_world.AddViewerAgent(this);
|
// this.ClientAvatar = m_world.AddViewerAgent(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void AuthUser()
|
protected virtual void AuthUser()
|
||||||
{
|
{
|
||||||
// AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
// AuthenticateResponse sessionInfo = m_gridServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
||||||
AuthenticateResponse sessionInfo = this.m_networkServer.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
AuthenticateResponse sessionInfo = this.m_authenticateSessionsHandler.AuthenticateSession(cirpack.CircuitCode.SessionID, cirpack.CircuitCode.ID, cirpack.CircuitCode.Code);
|
||||||
if (!sessionInfo.Authorised)
|
if (!sessionInfo.Authorised)
|
||||||
{
|
{
|
||||||
//session/circuit not authorised
|
//session/circuit not authorised
|
||||||
|
@ -291,19 +252,13 @@ namespace OpenSim
|
||||||
this.SessionID = cirpack.CircuitCode.SessionID;
|
this.SessionID = cirpack.CircuitCode.SessionID;
|
||||||
this.CircuitCode = cirpack.CircuitCode.Code;
|
this.CircuitCode = cirpack.CircuitCode.Code;
|
||||||
InitNewClient();
|
InitNewClient();
|
||||||
this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
|
//this.ClientAvatar.firstname = sessionInfo.LoginInfo.First;
|
||||||
this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
|
// this.ClientAvatar.lastname = sessionInfo.LoginInfo.Last;
|
||||||
if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
|
if (sessionInfo.LoginInfo.SecureSession != LLUUID.Zero)
|
||||||
{
|
{
|
||||||
this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
|
this.SecureSessionID = sessionInfo.LoginInfo.SecureSession;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create Inventory, currently only works for sandbox mode
|
|
||||||
if (m_sandboxMode)
|
|
||||||
{
|
|
||||||
this.SetupInventory(sessionInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
ClientLoop();
|
ClientLoop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ namespace OpenSim
|
||||||
public uint CircuitCode;
|
public uint CircuitCode;
|
||||||
public EndPoint userEP;
|
public EndPoint userEP;
|
||||||
|
|
||||||
protected OpenSimNetworkHandler m_networkServer;
|
protected PacketServer m_networkServer;
|
||||||
|
|
||||||
public ClientViewBase()
|
public ClientViewBase()
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
public class CommsManager
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Reflection;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.UserServer;
|
|
||||||
|
|
||||||
namespace OpenSim
|
|
||||||
{
|
|
||||||
public class Grid
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,91 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,7 +6,8 @@
|
||||||
<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>
|
||||||
|
@ -15,9 +16,11 @@
|
||||||
<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>
|
||||||
|
@ -28,7 +31,8 @@
|
||||||
<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>
|
||||||
|
@ -37,7 +41,8 @@
|
||||||
<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>
|
||||||
|
@ -46,7 +51,8 @@
|
||||||
<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>
|
||||||
|
@ -55,26 +61,28 @@
|
||||||
<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">
|
||||||
<HintPath>System.dll</HintPath>
|
<HintPath>System.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xml" >
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml">
|
||||||
<HintPath>System.Xml.dll</HintPath>
|
<HintPath>System.Xml.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="libsecondlife.dll" >
|
<Reference Include="libsecondlife.dll">
|
||||||
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Axiom.MathLib.dll" >
|
<Reference Include="Axiom.MathLib.dll">
|
||||||
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Db4objects.Db4o.dll" >
|
<Reference Include="Db4objects.Db4o.dll">
|
||||||
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -84,43 +92,43 @@
|
||||||
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
||||||
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
||||||
<Name>OpenSim.Framework</Name>
|
<Name>OpenSim.Framework</Name>
|
||||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||||
<Name>OpenSim.Framework.Console</Name>
|
<Name>OpenSim.Framework.Console</Name>
|
||||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
||||||
<Name>OpenSim.GenericConfig.Xml</Name>
|
<Name>OpenSim.GenericConfig.Xml</Name>
|
||||||
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
||||||
<Name>OpenSim.Physics.Manager</Name>
|
<Name>OpenSim.Physics.Manager</Name>
|
||||||
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
||||||
<Name>OpenSim.Servers</Name>
|
<Name>OpenSim.Servers</Name>
|
||||||
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
||||||
<Name>XMLRPC</Name>
|
<Name>XMLRPC</Name>
|
||||||
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -157,30 +165,17 @@
|
||||||
<Compile Include="CommsManager.cs">
|
<Compile Include="CommsManager.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Grid.cs">
|
<Compile Include="OpenSimNetworkHandler.cs" />
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="OpenSimMain.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="OpenSimNetworkHandler.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="PacketServer.cs">
|
<Compile Include="PacketServer.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="RegionInfo.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="RegionInfoBase.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="RegionServerBase.cs">
|
<Compile Include="RegionServerBase.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UDPServer.cs">
|
<Compile Include="UDPServer.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="UserConfigUtility.cs" />
|
||||||
<Compile Include="VersionInfo.cs">
|
<Compile Include="VersionInfo.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
@ -193,66 +188,6 @@
|
||||||
<Compile Include="CAPS\AdminWebFront.cs">
|
<Compile Include="CAPS\AdminWebFront.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="types\Mesh.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="types\Triangle.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Avatar.Client.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Avatar.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Avatar.Update.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\AvatarAnimations.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Entity.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Primitive.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\Primitive2.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\SceneObject.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\World.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\World.PacketHandlers.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\World.Scripting.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\WorldBase.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\IScriptContext.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\IScriptEntity.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\IScriptHandler.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\Script.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\ScriptFactory.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="world\scripting\Scripts\FollowRandomAvatar.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -1,531 +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.Text;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using libsecondlife;
|
|
||||||
using libsecondlife.Packets;
|
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Terrain;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.UserServer;
|
|
||||||
using OpenSim.Assets;
|
|
||||||
using OpenSim.CAPS;
|
|
||||||
using OpenSim.Framework.Console;
|
|
||||||
using OpenSim.Physics.Manager;
|
|
||||||
using Nwc.XmlRpc;
|
|
||||||
using OpenSim.Servers;
|
|
||||||
using OpenSim.GenericConfig;
|
|
||||||
|
|
||||||
namespace OpenSim
|
|
||||||
{
|
|
||||||
//moved to the opensim main application project (do we want it there or here?)
|
|
||||||
/*
|
|
||||||
public class OpenSimMain : OpenSimApplicationBase , conscmd_callback
|
|
||||||
{
|
|
||||||
|
|
||||||
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool silent, string configFile)
|
|
||||||
{
|
|
||||||
this.configFileSetup = useConfigFile;
|
|
||||||
m_sandbox = sandBoxMode;
|
|
||||||
m_loginserver = startLoginServer;
|
|
||||||
m_physicsEngine = physicsEngine;
|
|
||||||
m_config = configFile;
|
|
||||||
|
|
||||||
m_console = new ConsoleBase("region-console-" + Guid.NewGuid().ToString() + ".log", "Region", this, silent);
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance = m_console;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs initialisation of the world, such as loading configuration from disk.
|
|
||||||
/// </summary>
|
|
||||||
public override void StartUp()
|
|
||||||
{
|
|
||||||
this.regionData = new RegionInfo();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.localConfig = new XmlConfig(m_config);
|
|
||||||
this.localConfig.LoadData();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.Message);
|
|
||||||
}
|
|
||||||
if (this.configFileSetup)
|
|
||||||
{
|
|
||||||
this.SetupFromConfigFile(this.localConfig);
|
|
||||||
}
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
|
|
||||||
this.regionData.InitConfig(this.m_sandbox, this.localConfig);
|
|
||||||
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
|
|
||||||
|
|
||||||
GridServers = new Grid();
|
|
||||||
if (m_sandbox)
|
|
||||||
{
|
|
||||||
this.SetupLocalGridServers();
|
|
||||||
//Authenticate Session Handler
|
|
||||||
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
|
|
||||||
this.AuthenticateSessionsHandler = authen;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.SetupRemoteGridServers();
|
|
||||||
//Authenticate Session Handler
|
|
||||||
AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
|
|
||||||
this.AuthenticateSessionsHandler = authen;
|
|
||||||
}
|
|
||||||
|
|
||||||
startuptime = DateTime.Now;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
AssetCache = new AssetCache(GridServers.AssetServer);
|
|
||||||
InventoryCache = new InventoryCache();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler);
|
|
||||||
|
|
||||||
//should be passing a IGenericConfig object to these so they can read the config data they want from it
|
|
||||||
GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
|
|
||||||
IGridServer gridServer = GridServers.GridServer;
|
|
||||||
gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey);
|
|
||||||
|
|
||||||
if (!m_sandbox)
|
|
||||||
{
|
|
||||||
this.ConnectToRemoteGridServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.SetupLocalWorld();
|
|
||||||
|
|
||||||
if (m_sandbox)
|
|
||||||
{
|
|
||||||
AssetCache.LoadDefaultTextureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server");
|
|
||||||
|
|
||||||
this.SetupHttpListener();
|
|
||||||
|
|
||||||
LoginServer loginServer = null;
|
|
||||||
LoginServer adminLoginServer = null;
|
|
||||||
|
|
||||||
bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
|
|
||||||
if (sandBoxWithLoginServer)
|
|
||||||
{
|
|
||||||
loginServer = new LoginServer( regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
|
|
||||||
loginServer.Startup();
|
|
||||||
loginServer.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession);
|
|
||||||
|
|
||||||
if (user_accounts)
|
|
||||||
{
|
|
||||||
//sandbox mode with loginserver using accounts
|
|
||||||
this.GridServers.UserServer = loginServer;
|
|
||||||
adminLoginServer = loginServer;
|
|
||||||
|
|
||||||
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//sandbox mode with loginserver not using accounts
|
|
||||||
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
|
|
||||||
adminWebFront.LoadMethods(httpServer);
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting HTTP server");
|
|
||||||
httpServer.Start();
|
|
||||||
|
|
||||||
//MainServerListener();
|
|
||||||
this.m_udpServer.ServerListener();
|
|
||||||
|
|
||||||
m_heartbeatTimer.Enabled = true;
|
|
||||||
m_heartbeatTimer.Interval = 100;
|
|
||||||
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
|
|
||||||
}
|
|
||||||
|
|
||||||
# region Setup methods
|
|
||||||
protected virtual void SetupLocalGridServers()
|
|
||||||
{
|
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GridServers.Initialise();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void SetupRemoteGridServers()
|
|
||||||
{
|
|
||||||
if (this.gridLocalAsset)
|
|
||||||
{
|
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll";
|
|
||||||
}
|
|
||||||
GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode");
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
GridServers.Initialise();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void SetupLocalWorld()
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
|
|
||||||
m_console.componentname = "Region " + regionData.RegionName;
|
|
||||||
|
|
||||||
m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
|
|
||||||
LocalWorld.InventoryCache = InventoryCache;
|
|
||||||
LocalWorld.AssetCache = AssetCache;
|
|
||||||
|
|
||||||
this.m_udpServer.LocalWorld = LocalWorld;
|
|
||||||
this.m_udpServer.PacketServer.RegisterClientPacketHandlers();
|
|
||||||
|
|
||||||
this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
|
|
||||||
this.physManager.LoadPlugins();
|
|
||||||
|
|
||||||
LocalWorld.m_datastore = this.regionData.DataStore;
|
|
||||||
|
|
||||||
LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
|
|
||||||
LocalWorld.LoadWorldMap();
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system");
|
|
||||||
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
|
|
||||||
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
|
|
||||||
LocalWorld.LoadPrimsFromStorage();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void SetupHttpListener()
|
|
||||||
{
|
|
||||||
httpServer = new BaseHttpServer(regionData.IPListenPort);
|
|
||||||
|
|
||||||
if (this.GridServers.GridServer.GetName() == "Remote")
|
|
||||||
{
|
|
||||||
|
|
||||||
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
|
|
||||||
httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser );
|
|
||||||
|
|
||||||
httpServer.AddXmlRPCHandler("agent_crossing",
|
|
||||||
delegate(XmlRpcRequest request)
|
|
||||||
{
|
|
||||||
Hashtable requestData = (Hashtable)request.Params[0];
|
|
||||||
AgentCircuitData agent_data = new AgentCircuitData();
|
|
||||||
agent_data.firstname = (string)requestData["firstname"];
|
|
||||||
agent_data.lastname = (string)requestData["lastname"];
|
|
||||||
agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
|
|
||||||
agent_data.startpos = new LLVector3(Single.Parse((string)requestData["pos_x"]), Single.Parse((string)requestData["pos_y"]), Single.Parse((string)requestData["pos_z"]));
|
|
||||||
|
|
||||||
if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode))
|
|
||||||
{
|
|
||||||
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].firstname = agent_data.firstname;
|
|
||||||
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].lastname = agent_data.lastname;
|
|
||||||
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode].startpos = agent_data.startpos;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new XmlRpcResponse();
|
|
||||||
});
|
|
||||||
|
|
||||||
httpServer.AddRestHandler("GET", "/simstatus/",
|
|
||||||
delegate(string request, string path, string param)
|
|
||||||
{
|
|
||||||
return "OK";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void ConnectToRemoteGridServer()
|
|
||||||
{
|
|
||||||
if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down.");
|
|
||||||
Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]);
|
|
||||||
|
|
||||||
// If we are being told to load a file, load it.
|
|
||||||
string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"];
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(dataUri))
|
|
||||||
{
|
|
||||||
this.LocalWorld.m_datastore = dataUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "")
|
|
||||||
{
|
|
||||||
// The grid server has told us who we are
|
|
||||||
// We must obey the grid server.
|
|
||||||
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(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private void SetupFromConfigFile(IGenericConfig configData)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// SandBoxMode
|
|
||||||
string attri = "";
|
|
||||||
attri = configData.GetAttribute("SandBox");
|
|
||||||
if ((attri == "") || ((attri != "false") && (attri != "true")))
|
|
||||||
{
|
|
||||||
this.m_sandbox = false;
|
|
||||||
configData.SetAttribute("SandBox", "false");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.m_sandbox = Convert.ToBoolean(attri);
|
|
||||||
}
|
|
||||||
|
|
||||||
// LoginServer
|
|
||||||
attri = "";
|
|
||||||
attri = configData.GetAttribute("LoginServer");
|
|
||||||
if ((attri == "") || ((attri != "false") && (attri != "true")))
|
|
||||||
{
|
|
||||||
this.m_loginserver = false;
|
|
||||||
configData.SetAttribute("LoginServer", "false");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.m_loginserver = Convert.ToBoolean(attri);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sandbox User accounts
|
|
||||||
attri = "";
|
|
||||||
attri = configData.GetAttribute("UserAccount");
|
|
||||||
if ((attri == "") || ((attri != "false") && (attri != "true")))
|
|
||||||
{
|
|
||||||
this.user_accounts = false;
|
|
||||||
configData.SetAttribute("UserAccounts", "false");
|
|
||||||
}
|
|
||||||
else if (attri == "true")
|
|
||||||
{
|
|
||||||
this.user_accounts = Convert.ToBoolean(attri);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Grid mode hack to use local asset server
|
|
||||||
attri = "";
|
|
||||||
attri = configData.GetAttribute("LocalAssets");
|
|
||||||
if ((attri == "") || ((attri != "false") && (attri != "true")))
|
|
||||||
{
|
|
||||||
this.gridLocalAsset = false;
|
|
||||||
configData.SetAttribute("LocalAssets", "false");
|
|
||||||
}
|
|
||||||
else if (attri == "true")
|
|
||||||
{
|
|
||||||
this.gridLocalAsset = Convert.ToBoolean(attri);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
attri = "";
|
|
||||||
attri = configData.GetAttribute("PhysicsEngine");
|
|
||||||
switch (attri)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs any last-minute sanity checking and shuts down the region server
|
|
||||||
/// </summary>
|
|
||||||
public virtual void Shutdown()
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing all threads");
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing listener thread");
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients");
|
|
||||||
// IMPLEMENT THIS
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating");
|
|
||||||
LocalWorld.Close();
|
|
||||||
GridServers.Close();
|
|
||||||
m_console.Close();
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs per-frame updates regularly
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
void Heartbeat(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
LocalWorld.Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Console Commands
|
|
||||||
/// <summary>
|
|
||||||
/// Runs commands issued by the server console from the operator
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="command">The first argument of the parameter (the command)</param>
|
|
||||||
/// <param name="cmdparams">Additional arguments passed to the command</param>
|
|
||||||
public void RunCmd(string command, string[] cmdparams)
|
|
||||||
{
|
|
||||||
switch (command)
|
|
||||||
{
|
|
||||||
case "help":
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "show users - show info about connected users");
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "shutdown - disconnect all clients and shutdown");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "show":
|
|
||||||
Show(cmdparams[0]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "terrain":
|
|
||||||
string result = "";
|
|
||||||
if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "shutdown":
|
|
||||||
Shutdown();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "Unknown command");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Outputs to the console information about the region
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="ShowWhat">What information to display (valid arguments are "uptime", "users")</param>
|
|
||||||
public void Show(string ShowWhat)
|
|
||||||
{
|
|
||||||
switch (ShowWhat)
|
|
||||||
{
|
|
||||||
case "uptime":
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "OpenSim has been running since " + startuptime.ToString());
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, "That is " + (DateTime.Now - startuptime).ToString());
|
|
||||||
break;
|
|
||||||
case "users":
|
|
||||||
OpenSim.world.Avatar TempAv;
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
|
|
||||||
foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
|
|
||||||
{
|
|
||||||
if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
|
||||||
{
|
|
||||||
TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
}
|
|
|
@ -4,15 +4,16 @@ using System.Text;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
|
|
||||||
public interface OpenSimNetworkHandler
|
public interface OpenSimNetworkHandler
|
||||||
{
|
{
|
||||||
void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
|
void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode);// EndPoint packetSender);
|
||||||
void RemoveClientCircuit(uint circuitcode);
|
void RemoveClientCircuit(uint circuitcode);
|
||||||
void RegisterPacketServer(PacketServer server);
|
void RegisterPacketServer(PacketServer server);
|
||||||
AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,20 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using OpenSim.world;
|
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using OpenSim.Assets;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
public class PacketServer
|
public class PacketServer
|
||||||
{
|
{
|
||||||
private OpenSimNetworkHandler _networkHandler;
|
private OpenSimNetworkHandler _networkHandler;
|
||||||
private World _localWorld;
|
private IWorld _localWorld;
|
||||||
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
|
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
|
||||||
|
public Dictionary<uint, IClientAPI> ClientAPIs = new Dictionary<uint, IClientAPI>();
|
||||||
|
|
||||||
public PacketServer(OpenSimNetworkHandler networkHandler)
|
public PacketServer(OpenSimNetworkHandler networkHandler)
|
||||||
{
|
{
|
||||||
|
@ -18,7 +22,7 @@ namespace OpenSim
|
||||||
_networkHandler.RegisterPacketServer(this);
|
_networkHandler.RegisterPacketServer(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public World LocalWorld
|
public IWorld LocalWorld
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
@ -59,27 +63,23 @@ namespace OpenSim
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Client Packet Handlers
|
public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AuthenticateSessionsBase authenticateSessionsClass)
|
||||||
|
|
||||||
public bool RequestUUIDName(ClientView simClient, Packet packet)
|
|
||||||
{
|
{
|
||||||
System.Text.Encoding enc = System.Text.Encoding.ASCII;
|
ClientView newuser = new ClientView(epSender, useCircuit, this.ClientThreads, assetCache, this, inventoryCache, authenticateSessionsClass);
|
||||||
Console.WriteLine(packet.ToString());
|
this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
|
||||||
UUIDNameRequestPacket nameRequest = (UUIDNameRequestPacket)packet;
|
this.ClientAPIs.Add(useCircuit.CircuitCode.Code, (IClientAPI)newuser);
|
||||||
UUIDNameReplyPacket nameReply = new UUIDNameReplyPacket();
|
|
||||||
nameReply.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[nameRequest.UUIDNameBlock.Length];
|
|
||||||
|
|
||||||
for (int i = 0; i < nameRequest.UUIDNameBlock.Length; i++)
|
|
||||||
{
|
|
||||||
nameReply.UUIDNameBlock[i] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
|
|
||||||
nameReply.UUIDNameBlock[i].ID = nameRequest.UUIDNameBlock[i].ID;
|
|
||||||
nameReply.UUIDNameBlock[i].FirstName = enc.GetBytes("Who\0"); //for now send any name
|
|
||||||
nameReply.UUIDNameBlock[i].LastName = enc.GetBytes("Knows\0"); //in future need to look it up
|
|
||||||
}
|
|
||||||
simClient.OutPacket(nameReply);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
public virtual void SendPacketTo(byte[] buffer, int size, SocketFlags flags, uint circuitcode)
|
||||||
|
{
|
||||||
|
this._networkHandler.SendPacketTo(buffer, size, flags, circuitcode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void RemoveClientCircuit(uint circuitcode)
|
||||||
|
{
|
||||||
|
this._networkHandler.RemoveClientCircuit(circuitcode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,22 +7,13 @@ using System.IO;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using OpenSim.Framework.Types;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
public class RegionInfo : RegionInfoBase
|
public class RegionInfo : RegionInfoBase
|
||||||
{
|
{
|
||||||
//following should be removed and the GenericConfig object passed around,
|
|
||||||
//so each class (AssetServer, GridServer etc) can access what config data they want
|
|
||||||
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 = "";
|
|
||||||
private bool isSandbox;
|
private bool isSandbox;
|
||||||
|
|
||||||
public string DataStore;
|
public string DataStore;
|
||||||
|
@ -129,62 +120,7 @@ namespace OpenSim
|
||||||
this.IPListenAddr = attri;
|
this.IPListenAddr = attri;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isSandbox)
|
|
||||||
{
|
|
||||||
//shouldn't be reading this data in here, it should be up to the classes implementing the server interfaces to read what they need from the config object
|
|
||||||
|
|
||||||
//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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
|
this.RegionHandle = Util.UIntsToLong((RegionLocX * 256), (RegionLocY * 256));
|
||||||
|
|
||||||
configData.Commit();
|
configData.Commit();
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.Net;
|
|
||||||
using System.Web;
|
|
||||||
using System.IO;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Utilities;
|
|
||||||
using libsecondlife;
|
|
||||||
|
|
||||||
namespace OpenSim
|
|
||||||
{
|
|
||||||
public class RegionInfoBase
|
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|
||||||
public RegionInfoBase()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -10,7 +10,6 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Terrain;
|
using OpenSim.Terrain;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
|
@ -29,14 +28,12 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
protected IGenericConfig localConfig;
|
protected IGenericConfig localConfig;
|
||||||
protected PhysicsManager physManager;
|
protected PhysicsManager physManager;
|
||||||
protected Grid GridServers;
|
|
||||||
protected AssetCache AssetCache;
|
protected AssetCache AssetCache;
|
||||||
protected InventoryCache InventoryCache;
|
protected InventoryCache InventoryCache;
|
||||||
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
|
protected Dictionary<EndPoint, uint> clientCircuits = new Dictionary<EndPoint, uint>();
|
||||||
protected DateTime startuptime;
|
protected DateTime startuptime;
|
||||||
protected RegionInfo regionData;
|
protected NetworkServersInfo serversData;
|
||||||
|
|
||||||
protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
|
|
||||||
public string m_physicsEngine;
|
public string m_physicsEngine;
|
||||||
public bool m_sandbox = false;
|
public bool m_sandbox = false;
|
||||||
public bool m_loginserver;
|
public bool m_loginserver;
|
||||||
|
@ -45,7 +42,9 @@ namespace OpenSim
|
||||||
protected bool configFileSetup = false;
|
protected bool configFileSetup = false;
|
||||||
public string m_config;
|
public string m_config;
|
||||||
|
|
||||||
protected UDPServer m_udpServer;
|
protected List<UDPServer> m_udpServer = new List<UDPServer>();
|
||||||
|
protected List<RegionInfo> regionData = new List<RegionInfo>();
|
||||||
|
protected List<IWorld> m_localWorld = new List<IWorld>();
|
||||||
protected BaseHttpServer httpServer;
|
protected BaseHttpServer httpServer;
|
||||||
protected AuthenticateSessionsBase AuthenticateSessionsHandler;
|
protected AuthenticateSessionsBase AuthenticateSessionsHandler;
|
||||||
|
|
||||||
|
@ -65,11 +64,11 @@ namespace OpenSim
|
||||||
m_config = configFile;
|
m_config = configFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected World m_localWorld;
|
/*protected World m_localWorld;
|
||||||
public World LocalWorld
|
public World LocalWorld
|
||||||
{
|
{
|
||||||
get { return m_localWorld; }
|
get { return m_localWorld; }
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs initialisation of the world, such as loading configuration from disk.
|
/// Performs initialisation of the world, such as loading configuration from disk.
|
||||||
|
|
|
@ -10,7 +10,6 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim.world;
|
|
||||||
using OpenSim.Terrain;
|
using OpenSim.Terrain;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
|
@ -24,7 +23,6 @@ using OpenSim.GenericConfig;
|
||||||
|
|
||||||
namespace OpenSim
|
namespace OpenSim
|
||||||
{
|
{
|
||||||
public delegate AuthenticateResponse AuthenticateSessionHandler(LLUUID sessionID, LLUUID agentID, uint circuitCode);
|
|
||||||
|
|
||||||
public class UDPServer : OpenSimNetworkHandler
|
public class UDPServer : OpenSimNetworkHandler
|
||||||
{
|
{
|
||||||
|
@ -39,18 +37,12 @@ namespace OpenSim
|
||||||
protected PacketServer _packetServer;
|
protected PacketServer _packetServer;
|
||||||
|
|
||||||
protected int listenPort;
|
protected int listenPort;
|
||||||
protected Grid m_gridServers;
|
protected IWorld m_localWorld;
|
||||||
protected World m_localWorld;
|
|
||||||
protected AssetCache m_assetCache;
|
protected AssetCache m_assetCache;
|
||||||
protected InventoryCache m_inventoryCache;
|
protected InventoryCache m_inventoryCache;
|
||||||
protected RegionInfo m_regionData;
|
|
||||||
protected bool m_sandbox = false;
|
|
||||||
protected bool user_accounts = false;
|
|
||||||
protected ConsoleBase m_console;
|
protected ConsoleBase m_console;
|
||||||
protected AuthenticateSessionsBase m_authenticateSessionsClass;
|
protected AuthenticateSessionsBase m_authenticateSessionsClass;
|
||||||
|
|
||||||
public AuthenticateSessionHandler AuthenticateHandler;
|
|
||||||
|
|
||||||
public PacketServer PacketServer
|
public PacketServer PacketServer
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -63,7 +55,7 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public World LocalWorld
|
public IWorld LocalWorld
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
@ -76,21 +68,15 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console, AuthenticateSessionsBase authenticateClass)
|
public UDPServer(int port, AssetCache assetCache, InventoryCache inventoryCache, ConsoleBase console, AuthenticateSessionsBase authenticateClass)
|
||||||
{
|
{
|
||||||
listenPort = port;
|
listenPort = port;
|
||||||
this.m_gridServers = gridServers;
|
|
||||||
this.m_assetCache = assetCache;
|
this.m_assetCache = assetCache;
|
||||||
this.m_inventoryCache = inventoryCache;
|
this.m_inventoryCache = inventoryCache;
|
||||||
this.m_regionData = _regionData;
|
|
||||||
this.m_sandbox = sandbox;
|
|
||||||
this.user_accounts = accounts;
|
|
||||||
this.m_console = console;
|
this.m_console = console;
|
||||||
this.m_authenticateSessionsClass = authenticateClass;
|
this.m_authenticateSessionsClass = authenticateClass;
|
||||||
this.CreatePacketServer();
|
this.CreatePacketServer();
|
||||||
|
|
||||||
//set up delegate for authenticate sessions
|
|
||||||
this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void CreatePacketServer()
|
protected virtual void CreatePacketServer()
|
||||||
|
@ -131,15 +117,8 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
|
UseCircuitCodePacket useCircuit = (UseCircuitCodePacket)packet;
|
||||||
this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
|
this.clientCircuits.Add(epSender, useCircuit.CircuitCode.Code);
|
||||||
bool isChildAgent = false;
|
|
||||||
|
|
||||||
ClientView newuser = new ClientView(epSender, useCircuit, m_localWorld, _packetServer.ClientThreads, m_assetCache, m_gridServers.GridServer, this, m_inventoryCache, m_sandbox, isChildAgent, this.m_regionData, m_authenticateSessionsClass);
|
this.PacketServer.AddNewClient(epSender, useCircuit, m_assetCache, m_inventoryCache, m_authenticateSessionsClass);
|
||||||
if ((this.m_gridServers.UserServer != null) && (user_accounts))
|
|
||||||
{
|
|
||||||
newuser.UserServer = this.m_gridServers.UserServer;
|
|
||||||
}
|
|
||||||
//OpenSimRoot.Instance.ClientThreads.Add(epSender, newuser);
|
|
||||||
this._packetServer.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ServerListener()
|
public void ServerListener()
|
||||||
|
@ -197,9 +176,6 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitCode)
|
|
||||||
{
|
|
||||||
return this.AuthenticateHandler(sessionID, agentID, circuitCode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace OpenSim
|
||||||
|
{
|
||||||
|
public class UserConfigUtility
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -32,6 +32,6 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class VersionInfo
|
public class VersionInfo
|
||||||
{
|
{
|
||||||
public static string Version = "0.2, SVN build - please use releng if you desire any form of support";
|
public static string Version = "0.2, SVN build ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ using System.Data;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
using BerkeleyDb;
|
using BerkeleyDb;
|
||||||
using Kds.Serialization;
|
using Kds.Serialization;
|
||||||
using Kds.Serialization.Buffer;
|
using Kds.Serialization.Buffer;
|
||||||
|
|
|
@ -31,7 +31,7 @@ using Db4objects.Db4o.Query;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
|
|
||||||
namespace OpenSim.Storage.LocalStorageDb4o
|
namespace OpenSim.Storage.LocalStorageDb4o
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ using System.Data.SQLite;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
|
|
||||||
namespace OpenSim.Storage.LocalStorageSQLite
|
namespace OpenSim.Storage.LocalStorageSQLite
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Text;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim.Physics.Manager;
|
using OpenSim.Physics.Manager;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.world
|
namespace OpenSim.world
|
||||||
{
|
{
|
||||||
|
@ -22,7 +23,7 @@ namespace OpenSim.world
|
||||||
|
|
||||||
public ObjectUpdatePacket CreateUpdatePacket()
|
public ObjectUpdatePacket CreateUpdatePacket()
|
||||||
{
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendInitialPosition()
|
public void SendInitialPosition()
|
||||||
|
@ -35,7 +36,7 @@ namespace OpenSim.world
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendOurAppearance(ClientView OurClient)
|
public void SendOurAppearance(IClientAPI OurClient)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +58,7 @@ namespace OpenSim.world
|
||||||
|
|
||||||
public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
|
public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateTerseBlock()
|
||||||
{
|
{
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sends animation update
|
// Sends animation update
|
||||||
|
|
|
@ -17,7 +17,7 @@ namespace OpenSim.world
|
||||||
public static AvatarAnimations Animations;
|
public static AvatarAnimations Animations;
|
||||||
public string firstname;
|
public string firstname;
|
||||||
public string lastname;
|
public string lastname;
|
||||||
public ClientView ControllingClient;
|
public IClientAPI ControllingClient;
|
||||||
public LLUUID current_anim;
|
public LLUUID current_anim;
|
||||||
public int anim_seq;
|
public int anim_seq;
|
||||||
private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
|
private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate;
|
||||||
|
@ -37,7 +37,7 @@ namespace OpenSim.world
|
||||||
private bool m_regionTerraform;
|
private bool m_regionTerraform;
|
||||||
private bool childAvatar = false;
|
private bool childAvatar = false;
|
||||||
|
|
||||||
public Avatar(ClientView TheClient, World world, string regionName, Dictionary<uint, ClientView> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
|
public Avatar(IClientAPI TheClient, World world, string regionName, Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater)
|
||||||
{
|
{
|
||||||
m_world = world;
|
m_world = world;
|
||||||
// m_clientThreads = clientThreads;
|
// m_clientThreads = clientThreads;
|
||||||
|
@ -49,7 +49,7 @@ namespace OpenSim.world
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)");
|
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs - Loading details from grid (DUMMY)");
|
||||||
ControllingClient = TheClient;
|
ControllingClient = TheClient;
|
||||||
localid = 8880000 + (this.m_world._localNumber++);
|
localid = 8880000 + (this.m_world._localNumber++);
|
||||||
Pos = ControllingClient.startpos;
|
Pos = ControllingClient.StartPos;
|
||||||
visualParams = new byte[218];
|
visualParams = new byte[218];
|
||||||
for (int i = 0; i < 218; i++)
|
for (int i = 0; i < 218; i++)
|
||||||
{
|
{
|
||||||
|
@ -66,14 +66,14 @@ namespace OpenSim.world
|
||||||
this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
|
this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
|
||||||
|
|
||||||
//register for events
|
//register for events
|
||||||
ControllingClient.OnRequestWearables += new ClientView.GenericCall(this.SendOurAppearance);
|
ControllingClient.OnRequestWearables += new GenericCall(this.SendOurAppearance);
|
||||||
ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
|
ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
|
||||||
ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.CompleteMovement);
|
ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.CompleteMovement);
|
||||||
ControllingClient.OnCompleteMovementToRegion += new ClientView.GenericCall2(this.SendInitialPosition);
|
ControllingClient.OnCompleteMovementToRegion += new GenericCall2(this.SendInitialPosition);
|
||||||
ControllingClient.OnAgentUpdate += new ClientView.GenericCall3(this.HandleAgentUpdate);
|
ControllingClient.OnAgentUpdate += new GenericCall3(this.HandleAgentUpdate);
|
||||||
ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
|
ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
|
||||||
ControllingClient.OnChildAgentStatus += new ClientView.StatusChange(this.ChildStatusChange);
|
ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
||||||
ControllingClient.OnStopMovement += new ClientView.GenericCall2(this.StopMovement);
|
ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PhysicsActor PhysActor
|
public PhysicsActor PhysActor
|
||||||
|
|
|
@ -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,7 +6,8 @@
|
||||||
<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>
|
||||||
|
@ -15,9 +16,11 @@
|
||||||
<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>
|
||||||
|
@ -28,7 +31,8 @@
|
||||||
<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>
|
||||||
|
@ -37,7 +41,8 @@
|
||||||
<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>
|
||||||
|
@ -46,7 +51,8 @@
|
||||||
<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>
|
||||||
|
@ -55,26 +61,27 @@
|
||||||
<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">
|
||||||
<HintPath>System.dll</HintPath>
|
<HintPath>System.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xml" >
|
<Reference Include="System.Xml">
|
||||||
<HintPath>System.Xml.dll</HintPath>
|
<HintPath>System.Xml.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="libsecondlife.dll" >
|
<Reference Include="libsecondlife.dll">
|
||||||
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Axiom.MathLib.dll" >
|
<Reference Include="Axiom.MathLib.dll">
|
||||||
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Db4objects.Db4o.dll" >
|
<Reference Include="Db4objects.Db4o.dll">
|
||||||
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -84,43 +91,43 @@
|
||||||
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
||||||
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
||||||
<Name>OpenSim.Framework</Name>
|
<Name>OpenSim.Framework</Name>
|
||||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||||
<Name>OpenSim.Framework.Console</Name>
|
<Name>OpenSim.Framework.Console</Name>
|
||||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
||||||
<Name>OpenSim.GenericConfig.Xml</Name>
|
<Name>OpenSim.GenericConfig.Xml</Name>
|
||||||
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
||||||
<Name>OpenSim.Physics.Manager</Name>
|
<Name>OpenSim.Physics.Manager</Name>
|
||||||
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
||||||
<Name>OpenSim.Servers</Name>
|
<Name>OpenSim.Servers</Name>
|
||||||
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
||||||
<Name>XMLRPC</Name>
|
<Name>XMLRPC</Name>
|
||||||
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -142,9 +149,6 @@
|
||||||
<Compile Include="Primitive.cs">
|
<Compile Include="Primitive.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Primitive2.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="SceneObject.cs">
|
<Compile Include="SceneObject.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -7,11 +7,485 @@ using libsecondlife.Packets;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Physics.Manager;
|
using OpenSim.Physics.Manager;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
|
using OpenSim.Framework.Inventory;
|
||||||
|
|
||||||
namespace OpenSim.world
|
namespace OpenSim.world
|
||||||
{
|
{
|
||||||
public class Primitive : Entity
|
public class Primitive : Entity
|
||||||
{
|
{
|
||||||
|
protected PrimData primData;
|
||||||
|
//private ObjectUpdatePacket OurPacket;
|
||||||
|
private LLVector3 positionLastFrame = new LLVector3(0, 0, 0);
|
||||||
|
private Dictionary<uint, IClientAPI> m_clientThreads;
|
||||||
|
private ulong m_regionHandle;
|
||||||
|
private const uint FULL_MASK_PERMISSIONS = 2147483647;
|
||||||
|
private bool physicsEnabled = false;
|
||||||
|
|
||||||
|
private Dictionary<LLUUID, InventoryItem> inventoryItems;
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
public LLVector3 Scale
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this.primData.Scale = value;
|
||||||
|
//this.dirtyFlag = true;
|
||||||
|
}
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.primData.Scale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public PhysicsActor PhysActor
|
||||||
|
{
|
||||||
|
set
|
||||||
|
{
|
||||||
|
this._physActor = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public override LLVector3 Pos
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return base.Pos;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base.Pos = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public Primitive(Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, World world)
|
||||||
|
{
|
||||||
|
m_clientThreads = clientThreads;
|
||||||
|
m_regionHandle = regionHandle;
|
||||||
|
m_world = world;
|
||||||
|
inventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Primitive(Dictionary<uint, IClientAPI> clientThreads, ulong regionHandle, World world, LLUUID owner)
|
||||||
|
{
|
||||||
|
m_clientThreads = clientThreads;
|
||||||
|
m_regionHandle = regionHandle;
|
||||||
|
m_world = world;
|
||||||
|
inventoryItems = new Dictionary<LLUUID, InventoryItem>();
|
||||||
|
this.primData = new PrimData();
|
||||||
|
this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
|
this.primData.OwnerID = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] GetByteArray()
|
||||||
|
{
|
||||||
|
byte[] result = null;
|
||||||
|
List<byte[]> dataArrays = new List<byte[]>();
|
||||||
|
dataArrays.Add(primData.ToBytes());
|
||||||
|
foreach (Entity child in children)
|
||||||
|
{
|
||||||
|
if (child is OpenSim.world.Primitive)
|
||||||
|
{
|
||||||
|
dataArrays.Add(((OpenSim.world.Primitive)child).GetByteArray());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
byte[] primstart = Helpers.StringToField("<Prim>");
|
||||||
|
byte[] primend = Helpers.StringToField("</Prim>");
|
||||||
|
int totalLength = primstart.Length + primend.Length;
|
||||||
|
for (int i = 0; i < dataArrays.Count; i++)
|
||||||
|
{
|
||||||
|
totalLength += dataArrays[i].Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = new byte[totalLength];
|
||||||
|
int arraypos = 0;
|
||||||
|
Array.Copy(primstart, 0, result, 0, primstart.Length);
|
||||||
|
arraypos += primstart.Length;
|
||||||
|
for (int i = 0; i < dataArrays.Count; i++)
|
||||||
|
{
|
||||||
|
Array.Copy(dataArrays[i], 0, result, arraypos, dataArrays[i].Length);
|
||||||
|
arraypos += dataArrays[i].Length;
|
||||||
|
}
|
||||||
|
Array.Copy(primend, 0, result, arraypos, primend.Length);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Overridden Methods
|
||||||
|
|
||||||
|
public override void update()
|
||||||
|
{
|
||||||
|
LLVector3 pos2 = new LLVector3(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void BackUp()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Packet handlers
|
||||||
|
|
||||||
|
public void UpdatePosition(LLVector3 pos)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
|
||||||
|
{
|
||||||
|
this.primData.PathBegin = addPacket.PathBegin;
|
||||||
|
this.primData.PathEnd = addPacket.PathEnd;
|
||||||
|
this.primData.PathScaleX = addPacket.PathScaleX;
|
||||||
|
this.primData.PathScaleY = addPacket.PathScaleY;
|
||||||
|
this.primData.PathShearX = addPacket.PathShearX;
|
||||||
|
this.primData.PathShearY = addPacket.PathShearY;
|
||||||
|
this.primData.PathSkew = addPacket.PathSkew;
|
||||||
|
this.primData.ProfileBegin = addPacket.ProfileBegin;
|
||||||
|
this.primData.ProfileEnd = addPacket.ProfileEnd;
|
||||||
|
this.primData.PathCurve = addPacket.PathCurve;
|
||||||
|
this.primData.ProfileCurve = addPacket.ProfileCurve;
|
||||||
|
this.primData.ProfileHollow = addPacket.ProfileHollow;
|
||||||
|
this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
|
||||||
|
this.primData.PathRevolutions = addPacket.PathRevolutions;
|
||||||
|
this.primData.PathTaperX = addPacket.PathTaperX;
|
||||||
|
this.primData.PathTaperY = addPacket.PathTaperY;
|
||||||
|
this.primData.PathTwist = addPacket.PathTwist;
|
||||||
|
this.primData.PathTwistBegin = addPacket.PathTwistBegin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateTexture(byte[] tex)
|
||||||
|
{
|
||||||
|
this.primData.Texture = tex;
|
||||||
|
//this.dirtyFlag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateObjectFlags(ObjectFlagUpdatePacket pack)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AssignToParent(Primitive prim)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void GetProperites(IClientAPI client)
|
||||||
|
{
|
||||||
|
ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
|
||||||
|
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
|
||||||
|
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
|
||||||
|
proper.ObjectData[0].ItemID = LLUUID.Zero;
|
||||||
|
proper.ObjectData[0].CreationDate = (ulong)this.primData.CreationDate;
|
||||||
|
proper.ObjectData[0].CreatorID = this.primData.OwnerID;
|
||||||
|
proper.ObjectData[0].FolderID = LLUUID.Zero;
|
||||||
|
proper.ObjectData[0].FromTaskID = LLUUID.Zero;
|
||||||
|
proper.ObjectData[0].GroupID = LLUUID.Zero;
|
||||||
|
proper.ObjectData[0].InventorySerial = 0;
|
||||||
|
proper.ObjectData[0].LastOwnerID = LLUUID.Zero;
|
||||||
|
proper.ObjectData[0].ObjectID = this.uuid;
|
||||||
|
proper.ObjectData[0].OwnerID = primData.OwnerID;
|
||||||
|
proper.ObjectData[0].TouchName = new byte[0];
|
||||||
|
proper.ObjectData[0].TextureID = new byte[0];
|
||||||
|
proper.ObjectData[0].SitName = new byte[0];
|
||||||
|
proper.ObjectData[0].Name = new byte[0];
|
||||||
|
proper.ObjectData[0].Description = new byte[0];
|
||||||
|
proper.ObjectData[0].OwnerMask = this.primData.OwnerMask;
|
||||||
|
proper.ObjectData[0].NextOwnerMask = this.primData.NextOwnerMask;
|
||||||
|
proper.ObjectData[0].GroupMask = this.primData.GroupMask;
|
||||||
|
proper.ObjectData[0].EveryoneMask = this.primData.EveryoneMask;
|
||||||
|
proper.ObjectData[0].BaseMask = this.primData.BaseMask;
|
||||||
|
|
||||||
|
client.OutPacket(proper);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
# region Inventory Methods
|
||||||
|
|
||||||
|
public bool AddToInventory(InventoryItem item)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public InventoryItem RemoveFromInventory(LLUUID itemID)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestInventoryInfo(IClientAPI simClient, RequestTaskInventoryPacket packet)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RequestXferInventory(IClientAPI simClient, ulong xferID)
|
||||||
|
{
|
||||||
|
//will only currently work if the total size of the inventory data array is under about 1000 bytes
|
||||||
|
SendXferPacketPacket send = new SendXferPacketPacket();
|
||||||
|
|
||||||
|
send.XferID.ID = xferID;
|
||||||
|
send.XferID.Packet = 1 + 2147483648;
|
||||||
|
send.DataPacket.Data = this.ConvertInventoryToBytes();
|
||||||
|
|
||||||
|
simClient.OutPacket(send);
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] ConvertInventoryToBytes()
|
||||||
|
{
|
||||||
|
System.Text.Encoding enc = System.Text.Encoding.ASCII;
|
||||||
|
byte[] result = new byte[0];
|
||||||
|
List<byte[]> inventoryData = new List<byte[]>();
|
||||||
|
int totallength = 0;
|
||||||
|
foreach (InventoryItem invItem in inventoryItems.Values)
|
||||||
|
{
|
||||||
|
byte[] data = enc.GetBytes(invItem.ExportString());
|
||||||
|
inventoryData.Add(data);
|
||||||
|
totallength += data.Length;
|
||||||
|
}
|
||||||
|
//TODO: copy arrays into the single result array
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateInventoryFromBytes(byte[] data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Update viewers Methods
|
||||||
|
|
||||||
|
//should change these mehtods, so that outgoing packets are sent through the avatar class
|
||||||
|
public void SendFullUpdateToClient(IClientAPI remoteClient)
|
||||||
|
{
|
||||||
|
LLVector3 lPos;
|
||||||
|
if (this._physActor != null && this.physicsEnabled)
|
||||||
|
{
|
||||||
|
PhysicsVector pPos = this._physActor.Position;
|
||||||
|
lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lPos = this.Pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
|
||||||
|
outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
|
||||||
|
outPacket.ObjectData[0] = this.CreateUpdateBlock();
|
||||||
|
byte[] pb = lPos.GetBytes();
|
||||||
|
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
|
||||||
|
|
||||||
|
remoteClient.OutPacket(outPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendFullUpdateToAllClients()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendTerseUpdateToClient(IClientAPI RemoteClient)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendTerseUpdateToALLClients()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Create Methods
|
||||||
|
|
||||||
|
public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID ownerID, uint localID)
|
||||||
|
{
|
||||||
|
PrimData PData = new PrimData();
|
||||||
|
this.primData = PData;
|
||||||
|
this.primData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
|
|
||||||
|
PData.OwnerID = ownerID;
|
||||||
|
PData.PCode = addPacket.ObjectData.PCode;
|
||||||
|
PData.PathBegin = addPacket.ObjectData.PathBegin;
|
||||||
|
PData.PathEnd = addPacket.ObjectData.PathEnd;
|
||||||
|
PData.PathScaleX = addPacket.ObjectData.PathScaleX;
|
||||||
|
PData.PathScaleY = addPacket.ObjectData.PathScaleY;
|
||||||
|
PData.PathShearX = addPacket.ObjectData.PathShearX;
|
||||||
|
PData.PathShearY = addPacket.ObjectData.PathShearY;
|
||||||
|
PData.PathSkew = addPacket.ObjectData.PathSkew;
|
||||||
|
PData.ProfileBegin = addPacket.ObjectData.ProfileBegin;
|
||||||
|
PData.ProfileEnd = addPacket.ObjectData.ProfileEnd;
|
||||||
|
PData.Scale = addPacket.ObjectData.Scale;
|
||||||
|
PData.PathCurve = addPacket.ObjectData.PathCurve;
|
||||||
|
PData.ProfileCurve = addPacket.ObjectData.ProfileCurve;
|
||||||
|
PData.ParentID = 0;
|
||||||
|
PData.ProfileHollow = addPacket.ObjectData.ProfileHollow;
|
||||||
|
PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
|
||||||
|
PData.PathRevolutions = addPacket.ObjectData.PathRevolutions;
|
||||||
|
PData.PathTaperX = addPacket.ObjectData.PathTaperX;
|
||||||
|
PData.PathTaperY = addPacket.ObjectData.PathTaperY;
|
||||||
|
PData.PathTwist = addPacket.ObjectData.PathTwist;
|
||||||
|
PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
|
||||||
|
LLVector3 pos1 = addPacket.ObjectData.RayEnd;
|
||||||
|
this.primData.FullID = this.uuid = LLUUID.Random();
|
||||||
|
this.localid = (uint)(localID);
|
||||||
|
this.primData.Position = this.Pos = pos1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateFromBytes(byte[] data)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateFromPrimData(PrimData primData)
|
||||||
|
{
|
||||||
|
this.CreateFromPrimData(primData, primData.Position, primData.LocalID, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CreateFromPrimData(PrimData primData, LLVector3 posi, uint localID, bool newprim)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Packet Update Methods
|
||||||
|
protected void SetDefaultPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
|
||||||
|
{
|
||||||
|
objdata.PSBlock = new byte[0];
|
||||||
|
objdata.ExtraParams = new byte[1];
|
||||||
|
objdata.MediaURL = new byte[0];
|
||||||
|
objdata.NameValue = new byte[0];
|
||||||
|
objdata.Text = new byte[0];
|
||||||
|
objdata.TextColor = new byte[4];
|
||||||
|
objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0);
|
||||||
|
objdata.JointPivot = new LLVector3(0, 0, 0);
|
||||||
|
objdata.Material = 3;
|
||||||
|
objdata.TextureAnim = new byte[0];
|
||||||
|
objdata.Sound = LLUUID.Zero;
|
||||||
|
LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
|
||||||
|
this.primData.Texture = objdata.TextureEntry = ntex.ToBytes();
|
||||||
|
objdata.State = 0;
|
||||||
|
objdata.Data = new byte[0];
|
||||||
|
|
||||||
|
objdata.ObjectData = new byte[60];
|
||||||
|
objdata.ObjectData[46] = 128;
|
||||||
|
objdata.ObjectData[47] = 63;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void SetPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData)
|
||||||
|
{
|
||||||
|
objectData.OwnerID = this.primData.OwnerID;
|
||||||
|
objectData.PCode = this.primData.PCode;
|
||||||
|
objectData.PathBegin = this.primData.PathBegin;
|
||||||
|
objectData.PathEnd = this.primData.PathEnd;
|
||||||
|
objectData.PathScaleX = this.primData.PathScaleX;
|
||||||
|
objectData.PathScaleY = this.primData.PathScaleY;
|
||||||
|
objectData.PathShearX = this.primData.PathShearX;
|
||||||
|
objectData.PathShearY = this.primData.PathShearY;
|
||||||
|
objectData.PathSkew = this.primData.PathSkew;
|
||||||
|
objectData.ProfileBegin = this.primData.ProfileBegin;
|
||||||
|
objectData.ProfileEnd = this.primData.ProfileEnd;
|
||||||
|
objectData.Scale = this.primData.Scale;
|
||||||
|
objectData.PathCurve = this.primData.PathCurve;
|
||||||
|
objectData.ProfileCurve = this.primData.ProfileCurve;
|
||||||
|
objectData.ParentID = this.primData.ParentID;
|
||||||
|
objectData.ProfileHollow = this.primData.ProfileHollow;
|
||||||
|
objectData.PathRadiusOffset = this.primData.PathRadiusOffset;
|
||||||
|
objectData.PathRevolutions = this.primData.PathRevolutions;
|
||||||
|
objectData.PathTaperX = this.primData.PathTaperX;
|
||||||
|
objectData.PathTaperY = this.primData.PathTaperY;
|
||||||
|
objectData.PathTwist = this.primData.PathTwist;
|
||||||
|
objectData.PathTwistBegin = this.primData.PathTwistBegin;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
protected ObjectUpdatePacket.ObjectDataBlock CreateUpdateBlock()
|
||||||
|
{
|
||||||
|
ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
|
||||||
|
this.SetDefaultPacketValues(objupdate);
|
||||||
|
objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
|
||||||
|
this.SetPacketShapeData(objupdate);
|
||||||
|
byte[] pb = this.Pos.GetBytes();
|
||||||
|
Array.Copy(pb, 0, objupdate.ObjectData, 0, pb.Length);
|
||||||
|
return objupdate;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock()
|
||||||
|
{
|
||||||
|
uint ID = this.localid;
|
||||||
|
byte[] bytes = new byte[60];
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock();
|
||||||
|
dat.TextureEntry = new byte[0];
|
||||||
|
bytes[i++] = (byte)(ID % 256);
|
||||||
|
bytes[i++] = (byte)((ID >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)((ID >> 16) % 256);
|
||||||
|
bytes[i++] = (byte)((ID >> 24) % 256);
|
||||||
|
bytes[i++] = 0;
|
||||||
|
bytes[i++] = 0;
|
||||||
|
|
||||||
|
LLVector3 lPos;
|
||||||
|
Axiom.MathLib.Quaternion lRot;
|
||||||
|
if (this._physActor != null && this.physicsEnabled)
|
||||||
|
{
|
||||||
|
PhysicsVector pPos = this._physActor.Position;
|
||||||
|
lPos = new LLVector3(pPos.X, pPos.Y, pPos.Z);
|
||||||
|
lRot = this._physActor.Orientation;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lPos = this.Pos;
|
||||||
|
lRot = this.rotation;
|
||||||
|
}
|
||||||
|
byte[] pb = lPos.GetBytes();
|
||||||
|
Array.Copy(pb, 0, bytes, i, pb.Length);
|
||||||
|
i += 12;
|
||||||
|
ushort ac = 32767;
|
||||||
|
|
||||||
|
//vel
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
|
||||||
|
//accel
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
|
||||||
|
ushort rw, rx, ry, rz;
|
||||||
|
rw = (ushort)(32768 * (lRot.w + 1));
|
||||||
|
rx = (ushort)(32768 * (lRot.x + 1));
|
||||||
|
ry = (ushort)(32768 * (lRot.y + 1));
|
||||||
|
rz = (ushort)(32768 * (lRot.z + 1));
|
||||||
|
|
||||||
|
//rot
|
||||||
|
bytes[i++] = (byte)(rx % 256);
|
||||||
|
bytes[i++] = (byte)((rx >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ry % 256);
|
||||||
|
bytes[i++] = (byte)((ry >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(rz % 256);
|
||||||
|
bytes[i++] = (byte)((rz >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(rw % 256);
|
||||||
|
bytes[i++] = (byte)((rw >> 8) % 256);
|
||||||
|
|
||||||
|
//rotation vel
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
bytes[i++] = (byte)(ac % 256);
|
||||||
|
bytes[i++] = (byte)((ac >> 8) % 256);
|
||||||
|
|
||||||
|
dat.Data = bytes;
|
||||||
|
return dat;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ namespace OpenSim.world
|
||||||
public class SceneObject : Entity
|
public class SceneObject : Entity
|
||||||
{
|
{
|
||||||
private LLUUID rootUUID;
|
private LLUUID rootUUID;
|
||||||
private Dictionary<LLUUID, Primitive2> ChildPrimitives = new Dictionary<LLUUID, Primitive2>();
|
private Dictionary<LLUUID, Primitive> ChildPrimitives = new Dictionary<LLUUID, Primitive>();
|
||||||
private Dictionary<uint, ClientView> m_clientThreads;
|
private Dictionary<uint, IClientAPI> m_clientThreads;
|
||||||
private World m_world;
|
private World m_world;
|
||||||
|
|
||||||
public SceneObject()
|
public SceneObject()
|
||||||
|
@ -42,7 +42,7 @@ namespace OpenSim.world
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetProperites(ClientView client)
|
public void GetProperites(IClientAPI client)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
|
ObjectPropertiesPacket proper = new ObjectPropertiesPacket();
|
||||||
|
|
|
@ -6,10 +6,8 @@ using libsecondlife.Packets;
|
||||||
using OpenSim.Physics.Manager;
|
using OpenSim.Physics.Manager;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Assets;
|
|
||||||
|
|
||||||
namespace OpenSim.world
|
namespace OpenSim.world
|
||||||
{
|
{
|
||||||
|
@ -35,10 +33,10 @@ namespace OpenSim.world
|
||||||
|
|
||||||
public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
||||||
{
|
{
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (IClientAPI client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
// int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
|
// int dis = Util.fast_distance2d((int)(client.ClientAvatar.Pos.X - simClient.ClientAvatar.Pos.X), (int)(client.ClientAvatar.Pos.Y - simClient.ClientAvatar.Pos.Y));
|
||||||
int dis = (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos);
|
int dis = 0; // (int)client.ClientAvatar.Pos.GetDistanceTo(fromPos);
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -72,190 +70,57 @@ namespace OpenSim.world
|
||||||
|
|
||||||
public void RezObject(AssetBase primAsset, LLVector3 pos)
|
public void RezObject(AssetBase primAsset, LLVector3 pos)
|
||||||
{
|
{
|
||||||
PrimData primd = new PrimData(primAsset.Data);
|
|
||||||
Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
|
|
||||||
nPrim.CreateFromStorage(primd, pos, this._primCount, true);
|
|
||||||
this.Entities.Add(nPrim.uuid, nPrim);
|
|
||||||
this._primCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeRezObject(Packet packet, ClientView simClient)
|
|
||||||
{
|
|
||||||
DeRezObjectPacket DeRezPacket = (DeRezObjectPacket)packet;
|
|
||||||
|
|
||||||
//Needs to delete object from physics at a later date
|
|
||||||
if (DeRezPacket.AgentBlock.DestinationID == LLUUID.Zero)
|
|
||||||
{
|
|
||||||
//currently following code not used (or don't know of any case of destination being zero
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
|
|
||||||
{
|
|
||||||
Entity selectedEnt = null;
|
|
||||||
//OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
|
|
||||||
foreach (Entity ent in this.Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == Data.ObjectLocalID)
|
|
||||||
{
|
|
||||||
AssetBase primAsset = new AssetBase();
|
|
||||||
primAsset.FullID = LLUUID.Random();//DeRezPacket.AgentBlock.TransactionID.Combine(LLUUID.Zero); //should be combining with securesessionid
|
|
||||||
primAsset.InvType = 6;
|
|
||||||
primAsset.Type = 6;
|
|
||||||
primAsset.Name = "Prim";
|
|
||||||
primAsset.Description = "";
|
|
||||||
primAsset.Data = ((Primitive)ent).GetByteArray();
|
|
||||||
this._assetCache.AddAsset(primAsset);
|
|
||||||
this._inventoryCache.AddNewInventoryItem(simClient, DeRezPacket.AgentBlock.DestinationID, primAsset);
|
|
||||||
selectedEnt = ent;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (selectedEnt != null)
|
|
||||||
{
|
|
||||||
this.localStorage.RemovePrim(selectedEnt.uuid);
|
|
||||||
KillObjectPacket kill = new KillObjectPacket();
|
|
||||||
kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
|
|
||||||
kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
|
|
||||||
kill.ObjectData[0].ID = selectedEnt.localid;
|
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
|
||||||
{
|
|
||||||
client.OutPacket(kill);
|
|
||||||
}
|
|
||||||
lock (Entities)
|
|
||||||
{
|
|
||||||
Entities.Remove(selectedEnt.uuid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAvatarsToClient(ClientView remoteClient)
|
public void DeRezObject(Packet packet, IClientAPI simClient)
|
||||||
{
|
{
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
|
||||||
{
|
}
|
||||||
if (client.AgentID != remoteClient.AgentID)
|
|
||||||
{
|
public void SendAvatarsToClient(IClientAPI remoteClient)
|
||||||
// ObjectUpdatePacket objupdate = client.ClientAvatar.CreateUpdatePacket();
|
{
|
||||||
// RemoteClient.OutPacket(objupdate);
|
|
||||||
client.ClientAvatar.SendUpdateToOtherClient(remoteClient.ClientAvatar);
|
|
||||||
client.ClientAvatar.SendAppearanceToOtherAgent(remoteClient.ClientAvatar);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LinkObjects(uint parentPrim, List<uint> childPrims)
|
public void LinkObjects(uint parentPrim, List<uint> childPrims)
|
||||||
{
|
{
|
||||||
Primitive parentprim = null;
|
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == parentPrim)
|
|
||||||
{
|
|
||||||
parentprim = (OpenSim.world.Primitive)ent;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < childPrims.Count; i++)
|
|
||||||
{
|
|
||||||
uint childId = childPrims[i];
|
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == childId)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).MakeParent(parentprim);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
|
public void UpdatePrimShape(uint primLocalID, ObjectShapePacket.ObjectDataBlock shapeBlock)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == primLocalID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).UpdateShape(shapeBlock);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SelectPrim(uint primLocalID, ClientView remoteClient)
|
public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == primLocalID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).GetProperites(remoteClient);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimFlags(uint localID, Packet packet, ClientView remoteClient)
|
public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == localID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).UpdateObjectFlags((ObjectFlagUpdatePacket) packet);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimTexture(uint localID, byte[] texture, ClientView remoteClient)
|
public void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == localID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).UpdateTexture(texture);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimPosition(uint localID, LLVector3 pos, ClientView remoteClient)
|
public void UpdatePrimPosition(uint localID, LLVector3 pos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == localID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).UpdatePosition(pos);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimRotation(uint localID, LLQuaternion rot, ClientView remoteClient)
|
public void UpdatePrimRotation(uint localID, LLQuaternion rot, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == localID)
|
|
||||||
{
|
|
||||||
ent.rotation = new Axiom.MathLib.Quaternion(rot.W, rot.X, rot.Y, rot.Z);
|
|
||||||
((OpenSim.world.Primitive)ent).UpdateFlag = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePrimScale(uint localID, LLVector3 scale, ClientView remoteClient)
|
public void UpdatePrimScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
foreach (Entity ent in Entities.Values)
|
|
||||||
{
|
|
||||||
if (ent.localid == localID)
|
|
||||||
{
|
|
||||||
((OpenSim.world.Primitive)ent).Scale = scale;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace OpenSim.world
|
||||||
pos.Y = y;
|
pos.Y = y;
|
||||||
Primitive prim = entity as Primitive;
|
Primitive prim = entity as Primitive;
|
||||||
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
||||||
prim.UpdatePosition(pos);
|
//prim.UpdatePosition(pos);
|
||||||
// Console.WriteLine("script- setting entity " + localID + " positon");
|
// Console.WriteLine("script- setting entity " + localID + " positon");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,13 +6,11 @@ using System.Text;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Timers;
|
||||||
using OpenSim.Physics.Manager;
|
using OpenSim.Physics.Manager;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Assets;
|
|
||||||
//using OpenSim.world.scripting;
|
|
||||||
using OpenSim.RegionServer.world.scripting;
|
using OpenSim.RegionServer.world.scripting;
|
||||||
using OpenSim.Terrain;
|
using OpenSim.Terrain;
|
||||||
|
|
||||||
|
@ -20,6 +18,7 @@ namespace OpenSim.world
|
||||||
{
|
{
|
||||||
public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
|
public partial class World : WorldBase, ILocalStorageReceiver, IScriptAPI
|
||||||
{
|
{
|
||||||
|
protected System.Timers.Timer m_heartbeatTimer = new System.Timers.Timer();
|
||||||
public object LockPhysicsEngine = new object();
|
public object LockPhysicsEngine = new object();
|
||||||
public Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
|
public Dictionary<libsecondlife.LLUUID, Avatar> Avatars;
|
||||||
public Dictionary<libsecondlife.LLUUID, Primitive> Prims;
|
public Dictionary<libsecondlife.LLUUID, Primitive> Prims;
|
||||||
|
@ -57,15 +56,16 @@ namespace OpenSim.world
|
||||||
/// <param name="clientThreads">Dictionary to contain client threads</param>
|
/// <param name="clientThreads">Dictionary to contain client threads</param>
|
||||||
/// <param name="regionHandle">Region Handle for this region</param>
|
/// <param name="regionHandle">Region Handle for this region</param>
|
||||||
/// <param name="regionName">Region Name for this region</param>
|
/// <param name="regionName">Region Name for this region</param>
|
||||||
public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo, ulong regionHandle, string regionName)
|
public World(Dictionary<uint, IClientAPI> clientThreads, RegionInfo regInfo)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
updateLock = new Mutex(false);
|
updateLock = new Mutex(false);
|
||||||
m_clientThreads = clientThreads;
|
m_clientThreads = clientThreads;
|
||||||
m_regionHandle = regionHandle;
|
|
||||||
m_regionName = regionName;
|
|
||||||
m_regInfo = regInfo;
|
m_regInfo = regInfo;
|
||||||
|
m_regionHandle = m_regInfo.RegionHandle;
|
||||||
|
m_regionName = m_regInfo.RegionName;
|
||||||
|
this.m_datastore = m_regInfo.DataStore;
|
||||||
|
|
||||||
m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
|
m_scriptHandlers = new Dictionary<LLUUID, ScriptHandler>();
|
||||||
m_scripts = new Dictionary<string, ScriptFactory>();
|
m_scripts = new Dictionary<string, ScriptFactory>();
|
||||||
|
@ -85,6 +85,8 @@ namespace OpenSim.world
|
||||||
Avatar.LoadAnims();
|
Avatar.LoadAnims();
|
||||||
this.SetDefaultScripts();
|
this.SetDefaultScripts();
|
||||||
this.LoadScriptEngines();
|
this.LoadScriptEngines();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -93,6 +95,13 @@ namespace OpenSim.world
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public void StartTimer()
|
||||||
|
{
|
||||||
|
m_heartbeatTimer.Enabled = true;
|
||||||
|
m_heartbeatTimer.Interval = 100;
|
||||||
|
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
|
||||||
|
}
|
||||||
|
|
||||||
#region Script Methods
|
#region Script Methods
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads a new script into the specified entity
|
/// Loads a new script into the specified entity
|
||||||
|
@ -167,6 +176,18 @@ namespace OpenSim.world
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Update Methods
|
#region Update Methods
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Performs per-frame updates regularly
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
void Heartbeat(object sender, System.EventArgs e)
|
||||||
|
{
|
||||||
|
this.Update();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Performs per-frame updates on the world, this should be the central world loop
|
/// Performs per-frame updates on the world, this should be the central world loop
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -327,7 +348,7 @@ namespace OpenSim.world
|
||||||
}
|
}
|
||||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||||
|
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (IClientAPI client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
this.SendLayerData(client);
|
this.SendLayerData(client);
|
||||||
}
|
}
|
||||||
|
@ -358,7 +379,7 @@ namespace OpenSim.world
|
||||||
}
|
}
|
||||||
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
this.localStorage.SaveMap(this.Terrain.getHeights1D());
|
||||||
|
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (IClientAPI client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
this.SendLayerData(client);
|
this.SendLayerData(client);
|
||||||
}
|
}
|
||||||
|
@ -388,7 +409,7 @@ namespace OpenSim.world
|
||||||
{
|
{
|
||||||
/* Dont save here, rely on tainting system instead */
|
/* Dont save here, rely on tainting system instead */
|
||||||
|
|
||||||
foreach (ClientView client in m_clientThreads.Values)
|
foreach (IClientAPI client in m_clientThreads.Values)
|
||||||
{
|
{
|
||||||
this.SendLayerData(pointx, pointy, client);
|
this.SendLayerData(pointx, pointy, client);
|
||||||
}
|
}
|
||||||
|
@ -436,23 +457,9 @@ namespace OpenSim.world
|
||||||
/// Sends prims to a client
|
/// Sends prims to a client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="RemoteClient">Client to send to</param>
|
/// <param name="RemoteClient">Client to send to</param>
|
||||||
public void GetInitialPrims(ClientView RemoteClient)
|
public void GetInitialPrims(IClientAPI RemoteClient)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (libsecondlife.LLUUID UUID in Entities.Keys)
|
|
||||||
{
|
|
||||||
if (Entities[UUID] is Primitive)
|
|
||||||
{
|
|
||||||
Primitive primitive = Entities[UUID] as Primitive;
|
|
||||||
primitive.UpdateClient(RemoteClient);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: GetInitialPrims() - Failed with exception " + e.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -477,67 +484,32 @@ namespace OpenSim.world
|
||||||
/// <param name="prim">The object to load</param>
|
/// <param name="prim">The object to load</param>
|
||||||
public void PrimFromStorage(PrimData prim)
|
public void PrimFromStorage(PrimData prim)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
if (prim.LocalID >= this._primCount)
|
|
||||||
{
|
|
||||||
_primCount = prim.LocalID + 1;
|
|
||||||
}
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: PrimFromStorage() - Reloading prim (localId " + prim.LocalID + " ) from storage");
|
|
||||||
Primitive nPrim = new Primitive(m_clientThreads, m_regionHandle, this);
|
|
||||||
nPrim.CreateFromStorage(prim);
|
|
||||||
this.Entities.Add(nPrim.uuid, nPrim);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: PrimFromStorage() - Failed with exception " + e.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNewPrim(Packet addPacket, ClientView agentClient)
|
public void AddNewPrim(Packet addPacket, IClientAPI agentClient)
|
||||||
{
|
{
|
||||||
AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentID);
|
AddNewPrim((ObjectAddPacket)addPacket, agentClient.AgentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
|
public void AddNewPrim(ObjectAddPacket addPacket, LLUUID ownerID)
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "World.cs: AddNewPrim() - Creating new prim");
|
|
||||||
Primitive prim = new Primitive(m_clientThreads, m_regionHandle, this);
|
|
||||||
prim.CreateFromPacket(addPacket, ownerID, this._primCount);
|
|
||||||
PhysicsVector pVec = new PhysicsVector(prim.Pos.X, prim.Pos.Y, prim.Pos.Z);
|
|
||||||
PhysicsVector pSize = new PhysicsVector(0.255f, 0.255f, 0.255f);
|
|
||||||
if (OpenSim.world.Avatar.PhysicsEngineFlying)
|
|
||||||
{
|
|
||||||
lock (this.LockPhysicsEngine)
|
|
||||||
{
|
|
||||||
prim.PhysActor = this.phyScene.AddPrim(pVec, pSize);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.Entities.Add(prim.uuid, prim);
|
|
||||||
this._primCount++;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "World.cs: AddNewPrim() - Failed with exception " + e.ToString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add/Remove Avatar Methods
|
#region Add/Remove Avatar Methods
|
||||||
|
|
||||||
public override Avatar AddViewerAgent(ClientView agentClient)
|
public override bool AddNewAvatar(IClientAPI agentClient, bool child)
|
||||||
{
|
{
|
||||||
Avatar newAvatar = null;
|
|
||||||
return newAvatar;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void RemoveViewerAgent(ClientView agentClient)
|
public override bool RemoveAvatar(LLUUID agentID)
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -9,28 +9,27 @@ using System.Threading;
|
||||||
using OpenSim.Physics.Manager;
|
using OpenSim.Physics.Manager;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Terrain;
|
|
||||||
using OpenSim.Framework.Inventory;
|
using OpenSim.Framework.Inventory;
|
||||||
using OpenSim.Assets;
|
|
||||||
using OpenSim.RegionServer.world.scripting;
|
using OpenSim.RegionServer.world.scripting;
|
||||||
using OpenSim.Terrain;
|
using OpenSim.Terrain;
|
||||||
|
|
||||||
namespace OpenSim.world
|
namespace OpenSim.world
|
||||||
{
|
{
|
||||||
public class WorldBase
|
public class WorldBase : IWorld
|
||||||
{
|
{
|
||||||
public Dictionary<libsecondlife.LLUUID, Entity> Entities;
|
public Dictionary<libsecondlife.LLUUID, Entity> Entities;
|
||||||
protected Dictionary<uint, IClientAPI> m_clientThreads;
|
protected Dictionary<uint, IClientAPI> m_clientThreads;
|
||||||
protected ulong m_regionHandle;
|
protected ulong m_regionHandle;
|
||||||
protected string m_regionName;
|
protected string m_regionName;
|
||||||
protected InventoryCache _inventoryCache;
|
// protected InventoryCache _inventoryCache;
|
||||||
protected AssetCache _assetCache;
|
// protected AssetCache _assetCache;
|
||||||
protected RegionInfo m_regInfo;
|
protected RegionInfo m_regInfo;
|
||||||
|
|
||||||
public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
|
public TerrainEngine Terrain; //TODO: Replace TerrainManager with this.
|
||||||
protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
|
protected libsecondlife.TerrainManager TerrainManager; // To be referenced via TerrainEngine
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
/*
|
||||||
public InventoryCache InventoryCache
|
public InventoryCache InventoryCache
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
|
@ -46,6 +45,7 @@ namespace OpenSim.world
|
||||||
this._assetCache = value;
|
this._assetCache = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
@ -56,14 +56,7 @@ namespace OpenSim.world
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Setup Methods
|
#region Setup Methods
|
||||||
/// <summary>
|
|
||||||
/// Register Packet handler Methods with the packet server (which will register them with the SimClient)
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="packetServer"></param>
|
|
||||||
public virtual void RegisterPacketHandlers(PacketServer packetServer)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Update Methods
|
#region Update Methods
|
||||||
|
@ -90,7 +83,7 @@ namespace OpenSim.world
|
||||||
/// Send the region heightmap to the client
|
/// Send the region heightmap to the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="RemoteClient">Client to send to</param>
|
/// <param name="RemoteClient">Client to send to</param>
|
||||||
public virtual void SendLayerData(ClientView RemoteClient)
|
public virtual void SendLayerData(IClientAPI RemoteClient)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -122,7 +115,7 @@ namespace OpenSim.world
|
||||||
/// <param name="px">Patch coordinate (x) 0..16</param>
|
/// <param name="px">Patch coordinate (x) 0..16</param>
|
||||||
/// <param name="py">Patch coordinate (y) 0..16</param>
|
/// <param name="py">Patch coordinate (y) 0..16</param>
|
||||||
/// <param name="RemoteClient">The client to send to</param>
|
/// <param name="RemoteClient">The client to send to</param>
|
||||||
public void SendLayerData(int px, int py, ClientView RemoteClient)
|
public void SendLayerData(int px, int py, IClientAPI RemoteClient)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -144,25 +137,23 @@ namespace OpenSim.world
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add/Remove Agent/Avatar
|
#region Add/Remove Agent/Avatar
|
||||||
/// <summary>
|
public virtual bool AddNewAvatar(IClientAPI remoteClient, bool child)
|
||||||
/// Add a new Agent's avatar
|
{
|
||||||
/// </summary>
|
return false;
|
||||||
/// <param name="agentClient"></param>
|
}
|
||||||
public virtual Avatar AddViewerAgent(ClientView agentClient)
|
|
||||||
|
public virtual bool RemoveAvatar(LLUUID agentID)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
public virtual RegionInfo GetRegionInfo()
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Remove a Agent's avatar
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="agentClient"></param>
|
|
||||||
public virtual void RemoveViewerAgent(ClientView agentClient)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Shutdown
|
#region Shutdown
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tidy before shutdown
|
/// Tidy before shutdown
|
||||||
|
|
|
@ -87,7 +87,7 @@ namespace OpenSim.RegionServer.world.scripting
|
||||||
{
|
{
|
||||||
Primitive prim = m_entity as Primitive;
|
Primitive prim = m_entity as Primitive;
|
||||||
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
// Of course, we really should have asked the physEngine if this is possible, and if not, returned false.
|
||||||
prim.UpdatePosition( value );
|
// prim.UpdatePosition( value );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,7 +6,8 @@
|
||||||
<ProjectGuid>{438A9556-0000-0000-0000-000000000000}</ProjectGuid>
|
<ProjectGuid>{438A9556-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</AssemblyName>
|
<AssemblyName>OpenSim</AssemblyName>
|
||||||
|
@ -15,9 +16,11 @@
|
||||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||||
<DelaySign>false</DelaySign>
|
<DelaySign>false</DelaySign>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<AppDesignerFolder></AppDesignerFolder>
|
<AppDesignerFolder>
|
||||||
|
</AppDesignerFolder>
|
||||||
<RootNamespace>OpenSim</RootNamespace>
|
<RootNamespace>OpenSim</RootNamespace>
|
||||||
<StartupObject></StartupObject>
|
<StartupObject>
|
||||||
|
</StartupObject>
|
||||||
<FileUpgradeFlags>
|
<FileUpgradeFlags>
|
||||||
</FileUpgradeFlags>
|
</FileUpgradeFlags>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -28,7 +31,8 @@
|
||||||
<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>
|
||||||
|
@ -37,7 +41,8 @@
|
||||||
<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>
|
||||||
|
@ -46,7 +51,8 @@
|
||||||
<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>
|
||||||
|
@ -55,26 +61,27 @@
|
||||||
<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">
|
||||||
<HintPath>System.dll</HintPath>
|
<HintPath>System.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xml" >
|
<Reference Include="System.Xml">
|
||||||
<HintPath>System.Xml.dll</HintPath>
|
<HintPath>System.Xml.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="libsecondlife.dll" >
|
<Reference Include="libsecondlife.dll">
|
||||||
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
<HintPath>..\..\bin\libsecondlife.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Axiom.MathLib.dll" >
|
<Reference Include="Axiom.MathLib.dll">
|
||||||
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
<HintPath>..\..\bin\Axiom.MathLib.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Db4objects.Db4o.dll" >
|
<Reference Include="Db4objects.Db4o.dll">
|
||||||
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
<HintPath>..\..\bin\Db4objects.Db4o.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
@ -84,49 +91,53 @@
|
||||||
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
||||||
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj">
|
||||||
<Name>OpenSim.Framework</Name>
|
<Name>OpenSim.Framework</Name>
|
||||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||||
<Name>OpenSim.Framework.Console</Name>
|
<Name>OpenSim.Framework.Console</Name>
|
||||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
||||||
<Name>OpenSim.Physics.Manager</Name>
|
<Name>OpenSim.Physics.Manager</Name>
|
||||||
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.Servers\OpenSim.Servers.csproj">
|
||||||
<Name>OpenSim.Servers</Name>
|
<Name>OpenSim.Servers</Name>
|
||||||
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\OpenSim.RegionServer\OpenSim.RegionServer.csproj">
|
<ProjectReference Include="..\OpenSim.RegionServer\OpenSim.RegionServer.csproj">
|
||||||
<Name>OpenSim.RegionServer</Name>
|
<Name>OpenSim.RegionServer</Name>
|
||||||
<Project>{632E1BFD-0000-0000-0000-000000000000}</Project>
|
<Project>{632E1BFD-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
<ProjectReference Include="..\..\Common\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
||||||
<Name>OpenSim.GenericConfig.Xml</Name>
|
<Name>OpenSim.GenericConfig.Xml</Name>
|
||||||
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
<ProjectReference Include="..\..\Common\XmlRpcCS\XMLRPC.csproj">
|
||||||
<Name>XMLRPC</Name>
|
<Name>XMLRPC</Name>
|
||||||
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
||||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\OpenSim.World\OpenSim.World.csproj">
|
||||||
|
<Project>{642A14A8-0000-0000-0000-000000000000}</Project>
|
||||||
|
<Name>OpenSim.World</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -75,7 +75,7 @@ namespace OpenSim
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void StartUp()
|
public override void StartUp()
|
||||||
{
|
{
|
||||||
this.regionData = new RegionInfo();
|
this.serversData = new NetworkServersInfo();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.localConfig = new XmlConfig(m_config);
|
this.localConfig = new XmlConfig(m_config);
|
||||||
|
@ -90,10 +90,9 @@ namespace OpenSim
|
||||||
this.SetupFromConfigFile(this.localConfig);
|
this.SetupFromConfigFile(this.localConfig);
|
||||||
}
|
}
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Loading configuration");
|
||||||
this.regionData.InitConfig(this.m_sandbox, this.localConfig);
|
this.serversData.InitConfig(this.m_sandbox, this.localConfig);
|
||||||
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
|
this.localConfig.Close();//for now we can close it as no other classes read from it , but this should change
|
||||||
|
|
||||||
GridServers = new Grid();
|
|
||||||
if (m_sandbox)
|
if (m_sandbox)
|
||||||
{
|
{
|
||||||
this.SetupLocalGridServers();
|
this.SetupLocalGridServers();
|
||||||
|
@ -113,36 +112,11 @@ namespace OpenSim
|
||||||
|
|
||||||
startuptime = DateTime.Now;
|
startuptime = DateTime.Now;
|
||||||
|
|
||||||
try
|
this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
|
||||||
{
|
this.physManager.LoadPlugins();
|
||||||
AssetCache = new AssetCache(GridServers.AssetServer);
|
|
||||||
InventoryCache = new InventoryCache();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler);
|
|
||||||
|
|
||||||
//should be passing a IGenericConfig object to these so they can read the config data they want from it
|
|
||||||
GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
|
|
||||||
IGridServer gridServer = GridServers.GridServer;
|
|
||||||
gridServer.SetServerInfo(regionData.GridURL, regionData.GridSendKey, regionData.GridRecvKey);
|
|
||||||
|
|
||||||
if (!m_sandbox)
|
|
||||||
{
|
|
||||||
this.ConnectToRemoteGridServer();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.SetupLocalWorld();
|
this.SetupLocalWorld();
|
||||||
|
|
||||||
if (m_sandbox)
|
|
||||||
{
|
|
||||||
AssetCache.LoadDefaultTextureSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Initialising HTTP server");
|
||||||
|
|
||||||
this.SetupHttpListener();
|
this.SetupHttpListener();
|
||||||
|
@ -151,30 +125,18 @@ namespace OpenSim
|
||||||
LoginServer loginServer = null;
|
LoginServer loginServer = null;
|
||||||
LoginServer adminLoginServer = null;
|
LoginServer adminLoginServer = null;
|
||||||
|
|
||||||
bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
|
if (m_sandbox)
|
||||||
if (sandBoxWithLoginServer)
|
|
||||||
{
|
{
|
||||||
loginServer = new LoginServer(regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
|
loginServer = new LoginServer(regionData[0].IPListenAddr, regionData[0].IPListenPort, regionData[0].RegionLocX, regionData[0].RegionLocY, this.user_accounts);
|
||||||
loginServer.Startup();
|
loginServer.Startup();
|
||||||
loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession);
|
loginServer.SetSessionHandler(((AuthenticateSessionsLocal)this.AuthenticateSessionsHandler).AddNewSession);
|
||||||
|
|
||||||
if (user_accounts)
|
//sandbox mode with loginserver not using accounts
|
||||||
{
|
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
|
||||||
//sandbox mode with loginserver using accounts
|
|
||||||
this.GridServers.UserServer = loginServer;
|
|
||||||
adminLoginServer = loginServer;
|
|
||||||
|
|
||||||
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.LocalUserManager.XmlRpcLoginMethod);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//sandbox mode with loginserver not using accounts
|
|
||||||
httpServer.AddXmlRPCHandler("login_to_simulator", loginServer.XmlRpcLoginMethod);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Web front end setup
|
//Web front end setup
|
||||||
AdminWebFront adminWebFront = new AdminWebFront("Admin", LocalWorld, InventoryCache, adminLoginServer);
|
AdminWebFront adminWebFront = new AdminWebFront("Admin");
|
||||||
adminWebFront.LoadMethods(httpServer);
|
adminWebFront.LoadMethods(httpServer);
|
||||||
|
|
||||||
//Start http server
|
//Start http server
|
||||||
|
@ -182,89 +144,93 @@ namespace OpenSim
|
||||||
httpServer.Start();
|
httpServer.Start();
|
||||||
|
|
||||||
// Start UDP server
|
// Start UDP server
|
||||||
this.m_udpServer.ServerListener();
|
for (int i = 0; i < m_udpServer.Count; i++)
|
||||||
|
{
|
||||||
|
this.m_udpServer[i].ServerListener();
|
||||||
|
}
|
||||||
|
|
||||||
m_heartbeatTimer.Enabled = true;
|
|
||||||
m_heartbeatTimer.Interval = 100;
|
|
||||||
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(this.Heartbeat);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# region Setup methods
|
# region Setup methods
|
||||||
protected override void SetupLocalGridServers()
|
protected override void SetupLocalGridServers()
|
||||||
{
|
{
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
GridServers.GridDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Sandbox mode");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GridServers.Initialise();
|
AssetCache = new AssetCache("OpenSim.GridInterfaces.Local.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
|
||||||
|
InventoryCache = new InventoryCache();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup local cache");
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetupRemoteGridServers()
|
protected override void SetupRemoteGridServers()
|
||||||
{
|
{
|
||||||
if (this.gridLocalAsset)
|
|
||||||
{
|
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Local.dll";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GridServers.AssetDll = "OpenSim.GridInterfaces.Remote.dll";
|
|
||||||
}
|
|
||||||
GridServers.GridDll = "OpenSim.GridInterfaces.Remote.dll";
|
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Starting in Grid mode");
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
GridServers.Initialise();
|
AssetCache = new AssetCache("OpenSim.GridInterfaces.Remote.dll", this.serversData.AssetURL, this.serversData.AssetSendKey);
|
||||||
|
InventoryCache = new InventoryCache();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup the grid interface");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, e.Message + "\nSorry, could not setup remote cache");
|
||||||
Environment.Exit(1);
|
Environment.Exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetupLocalWorld()
|
protected override void SetupLocalWorld()
|
||||||
{
|
{
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
|
IGenericConfig regionConfig;
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
|
World LocalWorld;
|
||||||
m_console.componentname = "Region " + regionData.RegionName;
|
UDPServer udpServer;
|
||||||
|
RegionInfo regionDat = new RegionInfo();
|
||||||
|
|
||||||
m_localWorld = new World(this.m_udpServer.PacketServer.ClientThreads, regionData, regionData.RegionHandle, regionData.RegionName);
|
string path = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "Regions");
|
||||||
LocalWorld.InventoryCache = InventoryCache;
|
string[] pluginFiles = Directory.GetFiles(path, "*.xml");
|
||||||
LocalWorld.AssetCache = AssetCache;
|
|
||||||
|
|
||||||
this.m_udpServer.LocalWorld = LocalWorld;
|
for (int i = 0; i < pluginFiles.Length; i++)
|
||||||
this.m_udpServer.PacketServer.RegisterClientPacketHandlers();
|
{
|
||||||
|
regionConfig = new XmlConfig(pluginFiles[i]);
|
||||||
|
regionConfig.LoadData();
|
||||||
|
regionDat.InitConfig(this.m_sandbox, regionConfig);
|
||||||
|
regionConfig.Close();
|
||||||
|
|
||||||
this.physManager = new OpenSim.Physics.Manager.PhysicsManager();
|
udpServer = new UDPServer(regionDat.IPListenPort, this.AssetCache, this.InventoryCache, this.m_console, this.AuthenticateSessionsHandler);
|
||||||
this.physManager.LoadPlugins();
|
|
||||||
|
|
||||||
LocalWorld.m_datastore = this.regionData.DataStore;
|
m_udpServer.Add(udpServer);
|
||||||
|
this.regionData.Add(regionDat);
|
||||||
|
|
||||||
LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
|
/*
|
||||||
LocalWorld.LoadWorldMap();
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.NORMAL, "Main.cs:Startup() - We are " + regionData.RegionName + " at " + regionData.RegionLocX.ToString() + "," + regionData.RegionLocY.ToString());
|
||||||
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Initialising world");
|
||||||
|
m_console.componentname = "Region " + regionData.RegionName;
|
||||||
|
*/
|
||||||
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system");
|
LocalWorld = new World(udpServer.PacketServer.ClientAPIs, regionDat);
|
||||||
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
|
this.m_localWorld.Add(LocalWorld);
|
||||||
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
|
//LocalWorld.InventoryCache = InventoryCache;
|
||||||
LocalWorld.LoadPrimsFromStorage();
|
//LocalWorld.AssetCache = AssetCache;
|
||||||
|
|
||||||
|
udpServer.LocalWorld = LocalWorld;
|
||||||
|
|
||||||
|
LocalWorld.LoadStorageDLL("OpenSim.Storage.LocalStorageDb4o.dll"); //all these dll names shouldn't be hard coded.
|
||||||
|
LocalWorld.LoadWorldMap();
|
||||||
|
|
||||||
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Starting up messaging system");
|
||||||
|
LocalWorld.PhysScene = this.physManager.GetPhysicsScene(this.m_physicsEngine);
|
||||||
|
LocalWorld.PhysScene.SetTerrain(LocalWorld.Terrain.getHeights1D());
|
||||||
|
LocalWorld.LoadPrimsFromStorage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetupHttpListener()
|
protected override void SetupHttpListener()
|
||||||
{
|
{
|
||||||
httpServer = new BaseHttpServer(regionData.IPListenPort);
|
httpServer = new BaseHttpServer(regionData[0].IPListenPort);
|
||||||
|
|
||||||
if (this.GridServers.GridServer.GetName() == "Remote")
|
if (!this.m_sandbox)
|
||||||
{
|
{
|
||||||
|
|
||||||
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
|
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
|
||||||
|
@ -297,42 +263,7 @@ namespace OpenSim
|
||||||
|
|
||||||
protected override void ConnectToRemoteGridServer()
|
protected override void ConnectToRemoteGridServer()
|
||||||
{
|
{
|
||||||
if (GridServers.GridServer.RequestConnection(regionData.SimUUID, regionData.IPListenAddr, (uint)regionData.IPListenPort))
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Startup() - Success: Got a grid connection OK!");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.CRITICAL, "Main.cs:Startup() - FAILED: Unable to get connection to grid. Shutting down.");
|
|
||||||
Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
GridServers.AssetServer.SetServerInfo((string)((RemoteGridBase)GridServers.GridServer).GridData["asset_url"], (string)((RemoteGridBase)GridServers.GridServer).GridData["asset_sendkey"]);
|
|
||||||
|
|
||||||
// If we are being told to load a file, load it.
|
|
||||||
string dataUri = (string)((RemoteGridBase)GridServers.GridServer).GridData["data_uri"];
|
|
||||||
|
|
||||||
if (!String.IsNullOrEmpty(dataUri))
|
|
||||||
{
|
|
||||||
this.LocalWorld.m_datastore = dataUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (((RemoteGridBase)(GridServers.GridServer)).GridData["regionname"].ToString() != "")
|
|
||||||
{
|
|
||||||
// The grid server has told us who we are
|
|
||||||
// We must obey the grid server.
|
|
||||||
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(OpenSim.Framework.Console.LogPriority.CRITICAL, e.Message + "\nBAD ERROR! THIS SHOULD NOT HAPPEN! Bad GridData from the grid interface!!!! ZOMG!!!");
|
|
||||||
Environment.Exit(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -447,22 +378,14 @@ namespace OpenSim
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Killing clients");
|
||||||
// IMPLEMENT THIS
|
// IMPLEMENT THIS
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating");
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Main.cs:Shutdown() - Closing console and terminating");
|
||||||
LocalWorld.Close();
|
for (int i = 0; i < m_localWorld.Count; i++)
|
||||||
GridServers.Close();
|
{
|
||||||
|
((World)m_localWorld[i]).Close();
|
||||||
|
}
|
||||||
m_console.Close();
|
m_console.Close();
|
||||||
Environment.Exit(0);
|
Environment.Exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Performs per-frame updates regularly
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
void Heartbeat(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
LocalWorld.Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Console Commands
|
#region Console Commands
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs commands issued by the server console from the operator
|
/// Runs commands issued by the server console from the operator
|
||||||
|
@ -484,10 +407,10 @@ namespace OpenSim
|
||||||
|
|
||||||
case "terrain":
|
case "terrain":
|
||||||
string result = "";
|
string result = "";
|
||||||
if (!LocalWorld.Terrain.RunTerrainCmd(cmdparams, ref result))
|
/* if (!((World)m_localWorld).Terrain.RunTerrainCmd(cmdparams, ref result))
|
||||||
{
|
{
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, result);
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "shutdown":
|
case "shutdown":
|
||||||
|
@ -515,14 +438,14 @@ namespace OpenSim
|
||||||
case "users":
|
case "users":
|
||||||
OpenSim.world.Avatar TempAv;
|
OpenSim.world.Avatar TempAv;
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP"));
|
||||||
foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
|
/* foreach (libsecondlife.LLUUID UUID in LocalWorld.Entities.Keys)
|
||||||
{
|
{
|
||||||
if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
if (LocalWorld.Entities[UUID].ToString() == "OpenSim.world.Avatar")
|
||||||
{
|
{
|
||||||
TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
|
TempAv = (OpenSim.world.Avatar)LocalWorld.Entities[UUID];
|
||||||
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
|
m_console.WriteLine(OpenSim.Framework.Console.LogPriority.HIGH, String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue