* Modernized ScriptManager to new interface-based module calls.
* 'remove redundant this qualifier' ftwafrisby
parent
3f6b3f6b59
commit
8f0b03597b
|
@ -39,7 +39,6 @@ using Avatar = OpenSim.Region.Environment.Scenes.ScenePresence;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings
|
/// Processes requests regarding estates. Refer to EstateSettings.cs in OpenSim.Framework. Types for all of the core settings
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -125,7 +124,8 @@ namespace OpenSim.Region.Environment
|
||||||
/// <param name="TerrainLowerLimit">Minimum amount terrain can be lowered from previous baking</param>
|
/// <param name="TerrainLowerLimit">Minimum amount terrain can be lowered from previous baking</param>
|
||||||
/// <param name="UseFixedSun">Use a fixed time of day on the sun?</param>
|
/// <param name="UseFixedSun">Use a fixed time of day on the sun?</param>
|
||||||
/// <param name="SunHour">The offset hour of the day</param>
|
/// <param name="SunHour">The offset hour of the day</param>
|
||||||
public void setRegionSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit, bool UseFixedSun, float SunHour)
|
public void setRegionSettings(float WaterHeight, float TerrainRaiseLimit, float TerrainLowerLimit,
|
||||||
|
bool UseFixedSun, float SunHour)
|
||||||
{
|
{
|
||||||
// Water Height
|
// Water Height
|
||||||
m_regInfo.estateSettings.waterHeight = WaterHeight;
|
m_regInfo.estateSettings.waterHeight = WaterHeight;
|
||||||
|
@ -144,13 +144,12 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
#region Packet Handlers
|
#region Packet Handlers
|
||||||
|
|
||||||
|
|
||||||
public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client)
|
public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
switch (Helpers.FieldToUTF8String(packet.MethodData.Method))
|
switch (Helpers.FieldToUTF8String(packet.MethodData.Method))
|
||||||
{
|
{
|
||||||
case "getinfo":
|
case "getinfo":
|
||||||
this.sendRegionInfoPacketToAll();
|
sendRegionInfoPacketToAll();
|
||||||
break;
|
break;
|
||||||
case "setregioninfo":
|
case "setregioninfo":
|
||||||
if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId))
|
if (m_scene.PermissionsMngr.CanEditEstateTerrain(remote_client.AgentId))
|
||||||
|
@ -193,29 +192,35 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[0].Parameter))
|
if (convertParamStringToBool(packet.ParamList[0].Parameter))
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.BlockTerraform;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.BlockTerraform;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[1].Parameter))
|
if (convertParamStringToBool(packet.ParamList[1].Parameter))
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.NoFly;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.NoFly;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[2].Parameter))
|
if (convertParamStringToBool(packet.ParamList[2].Parameter))
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.AllowDamage;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.AllowDamage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
|
if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.BlockLandResell;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.BlockLandResell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
|
int tempMaxAgents =
|
||||||
|
Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
|
||||||
m_regInfo.estateSettings.maxAgents = (byte) tempMaxAgents;
|
m_regInfo.estateSettings.maxAgents = (byte) tempMaxAgents;
|
||||||
|
|
||||||
float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
|
float tempObjectBonusFactor =
|
||||||
|
(float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
|
||||||
m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor;
|
m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor;
|
||||||
|
|
||||||
int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
|
int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
|
||||||
|
@ -224,16 +229,17 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[7].Parameter))
|
if (convertParamStringToBool(packet.ParamList[7].Parameter))
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.RestrictPushObject;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.RestrictPushObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (convertParamStringToBool(packet.ParamList[8].Parameter))
|
if (convertParamStringToBool(packet.ParamList[8].Parameter))
|
||||||
{
|
{
|
||||||
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags | Simulator.RegionFlags.AllowParcelChanges;
|
m_regInfo.estateSettings.regionFlags = m_regInfo.estateSettings.regionFlags |
|
||||||
|
Simulator.RegionFlags.AllowParcelChanges;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendRegionInfoPacketToAll();
|
sendRegionInfoPacketToAll();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,9 +252,11 @@ namespace OpenSim.Region.Environment
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float WaterHeight = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
|
float WaterHeight = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
|
||||||
float TerrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
|
float TerrainRaiseLimit =
|
||||||
float TerrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
|
(float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
|
||||||
bool UseFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter);
|
float TerrainLowerLimit =
|
||||||
|
(float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
|
||||||
|
bool UseFixedSun = convertParamStringToBool(packet.ParamList[4].Parameter);
|
||||||
float SunHour = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
|
float SunHour = (float) Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
|
||||||
|
|
||||||
setRegionSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour);
|
setRegionSettings(WaterHeight, TerrainRaiseLimit, TerrainLowerLimit, UseFixedSun, SunHour);
|
||||||
|
@ -265,7 +273,6 @@ namespace OpenSim.Region.Environment
|
||||||
string[] splitField = s.Split(' ');
|
string[] splitField = s.Split(' ');
|
||||||
if (splitField.Length == 3)
|
if (splitField.Length == 3)
|
||||||
{
|
{
|
||||||
|
|
||||||
Int16 corner = Convert.ToInt16(splitField[0]);
|
Int16 corner = Convert.ToInt16(splitField[0]);
|
||||||
float lowValue = (float) Convert.ToDecimal(splitField[1]);
|
float lowValue = (float) Convert.ToDecimal(splitField[1]);
|
||||||
float highValue = (float) Convert.ToDecimal(splitField[2]);
|
float highValue = (float) Convert.ToDecimal(splitField[2]);
|
||||||
|
@ -279,7 +286,6 @@ namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
|
foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
|
||||||
{
|
{
|
||||||
|
|
||||||
string s = Helpers.FieldToUTF8String(block.Parameter);
|
string s = Helpers.FieldToUTF8String(block.Parameter);
|
||||||
string[] splitField = s.Split(' ');
|
string[] splitField = s.Split(' ');
|
||||||
if (splitField.Length == 2)
|
if (splitField.Length == 2)
|
||||||
|
@ -330,7 +336,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
this.sendRegionInfoPacket(avatars[i].ControllingClient);
|
sendRegionInfoPacket(avatars[i].ControllingClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,7 +346,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
this.sendRegionHandshake(avatars[i].ControllingClient);
|
sendRegionHandshake(avatars[i].ControllingClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,6 +385,5 @@ namespace OpenSim.Region.Environment
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
|
||||||
|
@ -10,8 +7,12 @@ namespace OpenSim.Region.Environment.Interfaces
|
||||||
{
|
{
|
||||||
void RegisterRender(string handleType, IDynamicTextureRender render);
|
void RegisterRender(string handleType, IDynamicTextureRender render);
|
||||||
void ReturnData(LLUUID id, byte[] data);
|
void ReturnData(LLUUID id, byte[] data);
|
||||||
LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, int updateTimer);
|
|
||||||
LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, int updateTimer);
|
LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams,
|
||||||
|
int updateTimer);
|
||||||
|
|
||||||
|
LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams,
|
||||||
|
int updateTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface IDynamicTextureRender
|
public interface IDynamicTextureRender
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
|
|
@ -26,15 +26,10 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using libsecondlife;
|
|
||||||
|
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.Region;
|
|
||||||
using OpenSim.Region.Environment;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.LandManagement;
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using libsecondlife;
|
||||||
|
using OpenSim.Region.Environment.LandManagement;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
using System;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
{
|
{
|
||||||
public interface IRegionModule
|
public interface IRegionModule
|
||||||
{
|
{
|
||||||
void Initialise(Scenes.Scene scene);
|
void Initialise(Scene scene);
|
||||||
void PostInitialise();
|
void PostInitialise();
|
||||||
void CloseDown();
|
void CloseDown();
|
||||||
string GetName();
|
string GetName();
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
|
|
@ -1,6 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
|
@ -10,7 +7,10 @@ namespace OpenSim.Region.Environment.Interfaces
|
||||||
bool Tainted();
|
bool Tainted();
|
||||||
bool Tainted(int x, int y);
|
bool Tainted(int x, int y);
|
||||||
void ResetTaint();
|
void ResetTaint();
|
||||||
void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser);
|
|
||||||
|
void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west,
|
||||||
|
IClientAPI remoteUser);
|
||||||
|
|
||||||
void CheckHeightValues();
|
void CheckHeightValues();
|
||||||
float[] GetHeights1D();
|
float[] GetHeights1D();
|
||||||
float[,] GetHeights2D();
|
float[,] GetHeights2D();
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Interfaces
|
namespace OpenSim.Region.Environment.Interfaces
|
||||||
{
|
{
|
||||||
public interface IXfer
|
public interface IXfer
|
||||||
|
|
|
@ -8,13 +8,16 @@ using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.LandManagement
|
namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Parcel Class
|
#region Parcel Class
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Keeps track of a specific piece of land's information
|
/// Keeps track of a specific piece of land's information
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class Land
|
public class Land
|
||||||
{
|
{
|
||||||
#region Member Variables
|
#region Member Variables
|
||||||
|
|
||||||
public LandData landData = new LandData();
|
public LandData landData = new LandData();
|
||||||
public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
|
public List<SceneObjectGroup> primsOverMe = new List<SceneObjectGroup>();
|
||||||
|
|
||||||
|
@ -24,21 +27,21 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
|
public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
|
||||||
{
|
{
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
landData.ownerID = owner_id;
|
landData.ownerID = owner_id;
|
||||||
landData.isGroupOwned = is_group_owned;
|
landData.isGroupOwned = is_group_owned;
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Member Functions
|
#region Member Functions
|
||||||
|
|
||||||
#region General Functions
|
#region General Functions
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks to see if this land object contains a point
|
/// Checks to see if this land object contains a point
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -59,10 +62,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
public Land Copy()
|
public Land Copy()
|
||||||
{
|
{
|
||||||
Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene);
|
Land newLand = new Land(landData.ownerID, landData.isGroupOwned, m_scene);
|
||||||
|
|
||||||
//Place all new variables here!
|
//Place all new variables here!
|
||||||
newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
|
newLand.landBitmap = (bool[,]) (landBitmap.Clone());
|
||||||
newLand.landData = landData.Copy();
|
newLand.landData = landData.Copy();
|
||||||
|
|
||||||
return newLand;
|
return newLand;
|
||||||
|
@ -70,17 +73,17 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Packet Request Handling
|
#region Packet Request Handling
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sends land properties as requested
|
/// Sends land properties as requested
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sequence_id">ID sent by client for them to keep track of</param>
|
/// <param name="sequence_id">ID sent by client for them to keep track of</param>
|
||||||
/// <param name="snap_selection">Bool sent by client for them to use</param>
|
/// <param name="snap_selection">Bool sent by client for them to use</param>
|
||||||
/// <param name="remote_client">Object representing the client</param>
|
/// <param name="remote_client">Object representing the client</param>
|
||||||
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result, IClientAPI remote_client)
|
public void sendLandProperties(int sequence_id, bool snap_selection, int request_result,
|
||||||
|
IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
|
|
||||||
ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket();
|
ParcelPropertiesPacket updatePacket = new ParcelPropertiesPacket();
|
||||||
updatePacket.ParcelData.AABBMax = landData.AABBMax;
|
updatePacket.ParcelData.AABBMax = landData.AABBMax;
|
||||||
updatePacket.ParcelData.AABBMin = landData.AABBMin;
|
updatePacket.ParcelData.AABBMin = landData.AABBMin;
|
||||||
|
@ -101,7 +104,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.LocalID = landData.localID;
|
updatePacket.ParcelData.LocalID = landData.localID;
|
||||||
if (landData.area > 0)
|
if (landData.area > 0)
|
||||||
{
|
{
|
||||||
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
updatePacket.ParcelData.MaxPrims =
|
||||||
|
Convert.ToInt32(
|
||||||
|
Math.Round((Convert.ToDecimal(landData.area)/Convert.ToDecimal(65536))*15000*
|
||||||
|
Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -124,10 +130,14 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
updatePacket.ParcelData.PublicCount = 0; //unemplemented
|
||||||
|
|
||||||
uint regionFlags = (uint) m_scene.RegionInfo.estateSettings.regionFlags;
|
uint regionFlags = (uint) m_scene.RegionInfo.estateSettings.regionFlags;
|
||||||
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
|
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint) Simulator.RegionFlags.DenyAnonymous) >
|
||||||
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
|
0);
|
||||||
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
|
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint) Simulator.RegionFlags.DenyIdentified) >
|
||||||
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
|
0);
|
||||||
|
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint) Simulator.RegionFlags.DenyTransacted) >
|
||||||
|
0);
|
||||||
|
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint) Simulator.RegionFlags.RestrictPushObject) >
|
||||||
|
0);
|
||||||
|
|
||||||
updatePacket.ParcelData.RentPrice = 0;
|
updatePacket.ParcelData.RentPrice = 0;
|
||||||
updatePacket.ParcelData.RequestResult = request_result;
|
updatePacket.ParcelData.RequestResult = request_result;
|
||||||
|
@ -137,7 +147,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.SequenceID = sequence_id;
|
updatePacket.ParcelData.SequenceID = sequence_id;
|
||||||
if (landData.simwideArea > 0)
|
if (landData.simwideArea > 0)
|
||||||
{
|
{
|
||||||
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
updatePacket.ParcelData.SimWideMaxPrims =
|
||||||
|
Convert.ToInt32(
|
||||||
|
Math.Round((Convert.ToDecimal(landData.simwideArea)/Convert.ToDecimal(65536))*15000*
|
||||||
|
Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -147,7 +160,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
updatePacket.ParcelData.SnapSelection = snap_selection;
|
updatePacket.ParcelData.SnapSelection = snap_selection;
|
||||||
updatePacket.ParcelData.SnapshotID = landData.snapshotID;
|
updatePacket.ParcelData.SnapshotID = landData.snapshotID;
|
||||||
updatePacket.ParcelData.Status = (byte) landData.landStatus;
|
updatePacket.ParcelData.Status = (byte) landData.landStatus;
|
||||||
updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims + landData.selectedPrims;
|
updatePacket.ParcelData.TotalPrims = landData.ownerPrims + landData.groupPrims + landData.otherPrims +
|
||||||
|
landData.selectedPrims;
|
||||||
updatePacket.ParcelData.UserLocation = landData.userLocation;
|
updatePacket.ParcelData.UserLocation = landData.userLocation;
|
||||||
updatePacket.ParcelData.UserLookAt = landData.userLookAt;
|
updatePacket.ParcelData.UserLookAt = landData.userLookAt;
|
||||||
remote_client.OutPacket((Packet) updatePacket);
|
remote_client.OutPacket((Packet) updatePacket);
|
||||||
|
@ -159,7 +173,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
//Needs later group support
|
//Needs later group support
|
||||||
landData.authBuyerID = packet.ParcelData.AuthBuyerID;
|
landData.authBuyerID = packet.ParcelData.AuthBuyerID;
|
||||||
landData.category = (libsecondlife.Parcel.ParcelCategory)packet.ParcelData.Category;
|
landData.category = (Parcel.ParcelCategory) packet.ParcelData.Category;
|
||||||
landData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
|
landData.landDesc = Helpers.FieldToUTF8String(packet.ParcelData.Desc);
|
||||||
landData.groupID = packet.ParcelData.GroupID;
|
landData.groupID = packet.ParcelData.GroupID;
|
||||||
landData.landingType = packet.ParcelData.LandingType;
|
landData.landingType = packet.ParcelData.LandingType;
|
||||||
|
@ -176,8 +190,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
landData.userLocation = packet.ParcelData.UserLocation;
|
landData.userLocation = packet.ParcelData.UserLocation;
|
||||||
landData.userLookAt = packet.ParcelData.UserLookAt;
|
landData.userLookAt = packet.ParcelData.UserLookAt;
|
||||||
sendLandUpdateToAvatarsOverMe();
|
sendLandUpdateToAvatarsOverMe();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,17 +198,20 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].AbsolutePosition.X), (int)Math.Round(avatars[i].AbsolutePosition.Y));
|
Land over =
|
||||||
if (over.landData.localID == this.landData.localID)
|
m_scene.LandManager.getLandObject((int) Math.Round(avatars[i].AbsolutePosition.X),
|
||||||
|
(int) Math.Round(avatars[i].AbsolutePosition.Y));
|
||||||
|
if (over.landData.localID == landData.localID)
|
||||||
{
|
{
|
||||||
sendLandProperties(0, false, 0, avatars[i].ControllingClient);
|
sendLandProperties(0, false, 0, avatars[i].ControllingClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Update Functions
|
#region Update Functions
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates the AABBMin and AABBMax values after area/shape modification of the land object
|
/// Updates the AABBMin and AABBMax values after area/shape modification of the land object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -222,8 +237,12 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4)));
|
landData.AABBMin =
|
||||||
landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4)));
|
new LLVector3((float) (min_x*4), (float) (min_y*4),
|
||||||
|
(float) m_scene.Terrain.GetHeight((min_x*4), (min_y*4)));
|
||||||
|
landData.AABBMax =
|
||||||
|
new LLVector3((float) (max_x*4), (float) (max_y*4),
|
||||||
|
(float) m_scene.Terrain.GetHeight((max_x*4), (max_y*4)));
|
||||||
landData.area = tempArea;
|
landData.area = tempArea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,18 +256,19 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void forceUpdateLandInfo()
|
public void forceUpdateLandInfo()
|
||||||
{
|
{
|
||||||
this.updateAABBAndAreaValues();
|
updateAABBAndAreaValues();
|
||||||
this.updateLandBitmapByteArray();
|
updateLandBitmapByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLandBitmapFromByteArray()
|
public void setLandBitmapFromByteArray()
|
||||||
{
|
{
|
||||||
landBitmap = convertBytesToLandBitmap();
|
landBitmap = convertBytesToLandBitmap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Land Bitmap Functions
|
#region Land Bitmap Functions
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the land's bitmap manually
|
/// Sets the land's bitmap manually
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -265,9 +285,9 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
//Valid: Lets set it
|
//Valid: Lets set it
|
||||||
landBitmap = bitmap;
|
landBitmap = bitmap;
|
||||||
forceUpdateLandInfo();
|
forceUpdateLandInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the land's bitmap manually
|
/// Gets the land's bitmap manually
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -276,6 +296,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
return landBitmap;
|
return landBitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the land bitmap to a packet friendly byte array
|
/// Converts the land bitmap to a packet friendly byte array
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -322,12 +343,11 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
x = 0;
|
x = 0;
|
||||||
y++;
|
y++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return tempConvertMap;
|
return tempConvertMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Full sim land object creation
|
/// Full sim land object creation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -347,7 +367,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y)
|
public static bool[,] getSquareLandBitmap(int start_x, int start_y, int end_x, int end_y)
|
||||||
{
|
{
|
||||||
|
|
||||||
bool[,] tempBitmap = new bool[64,64];
|
bool[,] tempBitmap = new bool[64,64];
|
||||||
tempBitmap.Initialize();
|
tempBitmap.Initialize();
|
||||||
|
|
||||||
|
@ -365,7 +384,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// <param name="end_y"></param>
|
/// <param name="end_y"></param>
|
||||||
/// <param name="set_value"></param>
|
/// <param name="set_value"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value)
|
public static bool[,] modifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y,
|
||||||
|
bool set_value)
|
||||||
{
|
{
|
||||||
if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2)
|
if (land_bitmap.GetLength(0) != 64 || land_bitmap.GetLength(1) != 64 || land_bitmap.Rank != 2)
|
||||||
{
|
{
|
||||||
|
@ -387,6 +407,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
return land_bitmap;
|
return land_bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Join the true values of 2 bitmaps together
|
/// Join the true values of 2 bitmaps together
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -404,7 +425,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
//Throw an exception - The bitmap is not 64x64
|
//Throw an exception - The bitmap is not 64x64
|
||||||
throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeLandBitmaps");
|
throw new Exception("Error: Invalid Parcel Bitmap - Bitmap_add in mergeLandBitmaps");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
|
@ -420,9 +440,11 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
return bitmap_base;
|
return bitmap_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Object Select and Object Owner Listing
|
#region Object Select and Object Owner Listing
|
||||||
|
|
||||||
public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
|
public void sendForceObjectSelect(int local_id, int request_type, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
List<uint> resultLocalIDs = new List<uint>();
|
List<uint> resultLocalIDs = new List<uint>();
|
||||||
|
@ -430,15 +452,16 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
if (obj.LocalId > 0)
|
if (obj.LocalId > 0)
|
||||||
{
|
{
|
||||||
if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == this.landData.ownerID)
|
if (request_type == LandManager.LAND_SELECT_OBJECTS_OWNER && obj.OwnerID == landData.ownerID)
|
||||||
{
|
{
|
||||||
resultLocalIDs.Add(obj.LocalId);
|
resultLocalIDs.Add(obj.LocalId);
|
||||||
}
|
}
|
||||||
else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false) //TODO: change false to group support!
|
else if (request_type == LandManager.LAND_SELECT_OBJECTS_GROUP && false)
|
||||||
|
//TODO: change false to group support!
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER && obj.OwnerID != remote_client.AgentId)
|
else if (request_type == LandManager.LAND_SELECT_OBJECTS_OTHER &&
|
||||||
|
obj.OwnerID != remote_client.AgentId)
|
||||||
{
|
{
|
||||||
resultLocalIDs.Add(obj.LocalId);
|
resultLocalIDs.Add(obj.LocalId);
|
||||||
}
|
}
|
||||||
|
@ -481,8 +504,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
pack.Data = data;
|
pack.Data = data;
|
||||||
remote_client.OutPacket((Packet) pack);
|
remote_client.OutPacket((Packet) pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendLandObjectOwners(IClientAPI remote_client)
|
public void sendLandObjectOwners(IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
|
Dictionary<LLUUID, int> ownersAndCount = new Dictionary<LLUUID, int>();
|
||||||
|
@ -496,7 +519,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
if (ownersAndCount.Count > 0)
|
if (ownersAndCount.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32];
|
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock = new ParcelObjectOwnersReplyPacket.DataBlock[32];
|
||||||
|
|
||||||
if (ownersAndCount.Count < 32)
|
if (ownersAndCount.Count < 32)
|
||||||
|
@ -522,19 +544,23 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
remote_client.OutPacket(pack);
|
remote_client.OutPacket(pack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Object Returning
|
#region Object Returning
|
||||||
|
|
||||||
public void returnObject(SceneObjectGroup obj)
|
public void returnObject(SceneObjectGroup obj)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void returnLandObjects(int type, LLUUID owner)
|
public void returnLandObjects(int type, LLUUID owner)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Object Adding/Removing from Parcel
|
#region Object Adding/Removing from Parcel
|
||||||
|
|
||||||
public void resetLandPrimCounts()
|
public void resetLandPrimCounts()
|
||||||
{
|
{
|
||||||
landData.groupPrims = 0;
|
landData.groupPrims = 0;
|
||||||
|
@ -566,7 +592,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
|
|
||||||
primsOverMe.Add(obj);
|
primsOverMe.Add(obj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePrimFromCount(SceneObjectGroup obj)
|
public void removePrimFromCount(SceneObjectGroup obj)
|
||||||
|
@ -592,11 +617,11 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
primsOverMe.Remove(obj);
|
primsOverMe.Remove(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
|
@ -36,15 +36,15 @@ using OpenSim.Region.Environment.Scenes;
|
||||||
namespace OpenSim.Region.Environment.LandManagement
|
namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
#region LandManager Class
|
#region LandManager Class
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles Land objects and operations requiring information from other Land objects (divide, join, etc)
|
/// Handles Land objects and operations requiring information from other Land objects (divide, join, etc)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LandManager
|
public class LandManager
|
||||||
{
|
{
|
||||||
|
|
||||||
#region Constants
|
#region Constants
|
||||||
|
|
||||||
//Land types set with flags in ParcelOverlay.
|
//Land types set with flags in ParcelOverlay.
|
||||||
//Only one of these can be used.
|
//Only one of these can be used.
|
||||||
public const byte LAND_TYPE_PUBLIC = (byte) 0; //Equals 00000000
|
public const byte LAND_TYPE_PUBLIC = (byte) 0; //Equals 00000000
|
||||||
|
@ -73,9 +73,11 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
//These are other constants. Yay!
|
//These are other constants. Yay!
|
||||||
public const int START_LAND_LOCAL_ID = 1;
|
public const int START_LAND_LOCAL_ID = 1;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Member Variables
|
#region Member Variables
|
||||||
|
|
||||||
public Dictionary<int, Land> landList = new Dictionary<int, Land>();
|
public Dictionary<int, Land> landList = new Dictionary<int, Land>();
|
||||||
private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
|
private int lastLandLocalID = START_LAND_LOCAL_ID - 1;
|
||||||
private int[,] landIDList = new int[64,64];
|
private int[,] landIDList = new int[64,64];
|
||||||
|
@ -91,35 +93,37 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public LandManager(Scene scene, RegionInfo reginfo)
|
public LandManager(Scene scene, RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
m_regInfo = reginfo;
|
m_regInfo = reginfo;
|
||||||
landIDList.Initialize();
|
landIDList.Initialize();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Member Functions
|
#region Member Functions
|
||||||
|
|
||||||
#region Parcel From Storage Functions
|
#region Parcel From Storage Functions
|
||||||
|
|
||||||
public void LandFromStorage(LandData data)
|
public void LandFromStorage(LandData data)
|
||||||
{
|
{
|
||||||
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
|
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
|
||||||
new_land.landData = data.Copy();
|
new_land.landData = data.Copy();
|
||||||
new_land.setLandBitmapFromByteArray();
|
new_land.setLandBitmapFromByteArray();
|
||||||
addLandObject(new_land);
|
addLandObject(new_land);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void NoLandDataFromStorage()
|
public void NoLandDataFromStorage()
|
||||||
{
|
{
|
||||||
resetSimLandObjects();
|
resetSimLandObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Parcel Add/Remove/Get/Create
|
#region Parcel Add/Remove/Get/Create
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a basic Parcel object without an owner (a zeroed key)
|
/// Creates a basic Parcel object without an owner (a zeroed key)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -155,8 +159,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
landList[lastLandLocalID].forceUpdateLandInfo();
|
landList[lastLandLocalID].forceUpdateLandInfo();
|
||||||
|
|
||||||
return new_land;
|
return new_land;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Removes a land object from the list. Will not remove if local_id is still owning an area in landIDList
|
/// Removes a land object from the list. Will not remove if local_id is still owning an area in landIDList
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -194,6 +198,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
removeLandObject(slave.landData.localID);
|
removeLandObject(slave.landData.localID);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the land object at the specified point
|
/// Get the land object at the specified point
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -227,9 +232,11 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
return landList[landIDList[x/4, y/4]];
|
return landList[landIDList[x/4, y/4]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Parcel Modification
|
#region Parcel Modification
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Subdivides a piece of land
|
/// Subdivides a piece of land
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -241,7 +248,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
/// <returns>Returns true if successful</returns>
|
/// <returns>Returns true if successful</returns>
|
||||||
private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
|
private bool subdivide(int start_x, int start_y, int end_x, int end_y, LLUUID attempting_user_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
//First, lets loop through the points and make sure they are all in the same peice of land
|
//First, lets loop through the points and make sure they are all in the same peice of land
|
||||||
//Get the land object at start
|
//Get the land object at start
|
||||||
Land startLandObject = getLandObject(start_x, start_y);
|
Land startLandObject = getLandObject(start_x, start_y);
|
||||||
|
@ -284,21 +290,21 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
|
|
||||||
//Now, lets set the subdivision area of the original to false
|
//Now, lets set the subdivision area of the original to false
|
||||||
int startLandObjectIndex = startLandObject.landData.localID;
|
int startLandObjectIndex = startLandObject.landData.localID;
|
||||||
landList[startLandObjectIndex].setLandBitmap(Land.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false));
|
landList[startLandObjectIndex].setLandBitmap(
|
||||||
|
Land.modifyLandBitmapSquare(startLandObject.getLandBitmap(), start_x, start_y, end_x, end_y, false));
|
||||||
landList[startLandObjectIndex].forceUpdateLandInfo();
|
landList[startLandObjectIndex].forceUpdateLandInfo();
|
||||||
|
|
||||||
|
|
||||||
this.setPrimsTainted();
|
setPrimsTainted();
|
||||||
|
|
||||||
//Now add the new land object
|
//Now add the new land object
|
||||||
Land result = addLandObject(newLand);
|
Land result = addLandObject(newLand);
|
||||||
result.sendLandUpdateToAvatarsOverMe();
|
result.sendLandUpdateToAvatarsOverMe();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Join 2 land objects together
|
/// Join 2 land objects together
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -348,23 +354,23 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
foreach (Land slaveLandObject in selectedLandObjects)
|
foreach (Land slaveLandObject in selectedLandObjects)
|
||||||
{
|
{
|
||||||
landList[masterLandObject.landData.localID].setLandBitmap(Land.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap()));
|
landList[masterLandObject.landData.localID].setLandBitmap(
|
||||||
|
Land.mergeLandBitmaps(masterLandObject.getLandBitmap(), slaveLandObject.getLandBitmap()));
|
||||||
performFinalLandJoin(masterLandObject, slaveLandObject);
|
performFinalLandJoin(masterLandObject, slaveLandObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.setPrimsTainted();
|
setPrimsTainted();
|
||||||
|
|
||||||
masterLandObject.sendLandUpdateToAvatarsOverMe();
|
masterLandObject.sendLandUpdateToAvatarsOverMe();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Parcel Updating
|
#region Parcel Updating
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Where we send the ParcelOverlay packet to the client
|
/// Where we send the ParcelOverlay packet to the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -390,7 +396,9 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
//Owner Flag
|
//Owner Flag
|
||||||
tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_REQUESTER);
|
tempByte = Convert.ToByte(tempByte | LAND_TYPE_OWNED_BY_REQUESTER);
|
||||||
}
|
}
|
||||||
else if (currentParcelBlock.landData.salePrice > 0 && (currentParcelBlock.landData.authBuyerID == LLUUID.Zero || currentParcelBlock.landData.authBuyerID == remote_client.AgentId))
|
else if (currentParcelBlock.landData.salePrice > 0 &&
|
||||||
|
(currentParcelBlock.landData.authBuyerID == LLUUID.Zero ||
|
||||||
|
currentParcelBlock.landData.authBuyerID == remote_client.AgentId))
|
||||||
{
|
{
|
||||||
//Sale Flag
|
//Sale Flag
|
||||||
tempByte = Convert.ToByte(tempByte | LAND_TYPE_IS_FOR_SALE);
|
tempByte = Convert.ToByte(tempByte | LAND_TYPE_IS_FOR_SALE);
|
||||||
|
@ -440,11 +448,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id, bool snap_selection, IClientAPI remote_client)
|
public void handleParcelPropertiesRequest(int start_x, int start_y, int end_x, int end_y, int sequence_id,
|
||||||
|
bool snap_selection, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
//Get the land objects within the bounds
|
//Get the land objects within the bounds
|
||||||
List<Land> temp = new List<Land>();
|
List<Land> temp = new List<Land>();
|
||||||
|
@ -486,14 +493,15 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client);
|
landList[packet.ParcelData.LocalID].updateLandProperties(packet, remote_client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
|
public void handleParcelDivideRequest(int west, int south, int east, int north, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
subdivide(west, south, east, north, remote_client.AgentId);
|
subdivide(west, south, east, north, remote_client.AgentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
|
public void handleParcelJoinRequest(int west, int south, int east, int north, IClientAPI remote_client)
|
||||||
{
|
{
|
||||||
join(west, south, east, north, remote_client.AgentId);
|
join(west, south, east, north, remote_client.AgentId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
|
public void handleParcelSelectObjectsRequest(int local_id, int request_type, IClientAPI remote_client)
|
||||||
|
@ -505,6 +513,7 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
{
|
{
|
||||||
landList[local_id].sendLandObjectOwners(remote_client);
|
landList[local_id].sendLandObjectOwners(remote_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -523,7 +532,6 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
|
fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
|
||||||
|
|
||||||
addLandObject(fullSimParcel);
|
addLandObject(fullSimParcel);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -547,9 +555,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
p.resetLandPrimCounts();
|
p.resetLandPrimCounts();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrimsTainted()
|
public void setPrimsTainted()
|
||||||
{
|
{
|
||||||
this.landPrimCountTainted = true;
|
landPrimCountTainted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPrimToLandPrimCounts(SceneObjectGroup obj)
|
public void addPrimToLandPrimCounts(SceneObjectGroup obj)
|
||||||
|
@ -595,7 +604,8 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
foreach (Land p in landOwnersAndParcels[owner])
|
foreach (Land p in landOwnersAndParcels[owner])
|
||||||
{
|
{
|
||||||
simArea += p.landData.area;
|
simArea += p.landData.area;
|
||||||
simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims + p.landData.selectedPrims;
|
simPrims += p.landData.ownerPrims + p.landData.otherPrims + p.landData.groupPrims +
|
||||||
|
p.landData.selectedPrims;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Land p in landOwnersAndParcels[owner])
|
foreach (Land p in landOwnersAndParcels[owner])
|
||||||
|
@ -604,14 +614,10 @@ namespace OpenSim.Region.Environment.LandManagement
|
||||||
p.landData.simwidePrims = simPrims;
|
p.landData.simwidePrims = simPrims;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,17 +1,15 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
|
||||||
using OpenSim.Framework.Console;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
using OpenSim.Region.Environment.Modules;
|
using OpenSim.Region.Environment.Modules;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
public class ModuleLoader
|
public class ModuleLoader
|
||||||
{
|
{
|
||||||
|
|
||||||
public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>();
|
public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>();
|
||||||
|
|
||||||
public List<IRegionModule> LoadedModules = new List<IRegionModule>();
|
public List<IRegionModule> LoadedModules = new List<IRegionModule>();
|
||||||
|
@ -19,7 +17,6 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public ModuleLoader()
|
public ModuleLoader()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -37,23 +34,22 @@ namespace OpenSim.Region.Environment
|
||||||
module = new AvatarProfilesModule();
|
module = new AvatarProfilesModule();
|
||||||
InitialiseModule(module, scene);
|
InitialiseModule(module, scene);
|
||||||
|
|
||||||
this.LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene);
|
LoadRegionModule("OpenSim.Region.ExtensionsScriptModule.dll", "ExtensionsScriptingModule", scene);
|
||||||
|
|
||||||
string lslPath = System.IO.Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
|
|
||||||
this.LoadRegionModule(lslPath, "LSLScriptingModule", scene);
|
|
||||||
|
|
||||||
|
string lslPath = Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.DotNetEngine.dll");
|
||||||
|
LoadRegionModule(lslPath, "LSLScriptingModule", scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void LoadDefaultSharedModules(string exceptModules)
|
public void LoadDefaultSharedModules(string exceptModules)
|
||||||
{
|
{
|
||||||
DynamicTextureModule dynamicModule = new DynamicTextureModule();
|
DynamicTextureModule dynamicModule = new DynamicTextureModule();
|
||||||
this.LoadedSharedModules.Add(dynamicModule.GetName(), dynamicModule);
|
LoadedSharedModules.Add(dynamicModule.GetName(), dynamicModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitialiseSharedModules(Scene scene)
|
public void InitialiseSharedModules(Scene scene)
|
||||||
{
|
{
|
||||||
foreach (IRegionModule module in this.LoadedSharedModules.Values)
|
foreach (IRegionModule module in LoadedSharedModules.Values)
|
||||||
{
|
{
|
||||||
module.Initialise(scene);
|
module.Initialise(scene);
|
||||||
scene.AddModule(module.GetName(), module); //should be doing this?
|
scene.AddModule(module.GetName(), module); //should be doing this?
|
||||||
|
@ -75,19 +71,19 @@ namespace OpenSim.Region.Environment
|
||||||
/// <param name="scene"></param>
|
/// <param name="scene"></param>
|
||||||
public void LoadSharedModule(string dllName, string moduleName)
|
public void LoadSharedModule(string dllName, string moduleName)
|
||||||
{
|
{
|
||||||
IRegionModule module = this.LoadModule(dllName, moduleName);
|
IRegionModule module = LoadModule(dllName, moduleName);
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
this.LoadedSharedModules.Add(module.GetName(), module);
|
LoadedSharedModules.Add(module.GetName(), module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadRegionModule(string dllName, string moduleName, Scene scene)
|
public void LoadRegionModule(string dllName, string moduleName, Scene scene)
|
||||||
{
|
{
|
||||||
IRegionModule module = this.LoadModule(dllName, moduleName);
|
IRegionModule module = LoadModule(dllName, moduleName);
|
||||||
if (module != null)
|
if (module != null)
|
||||||
{
|
{
|
||||||
this.InitialiseModule(module, scene);
|
InitialiseModule(module, scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +103,7 @@ namespace OpenSim.Region.Environment
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pluginAssembly = Assembly.LoadFrom(dllName);
|
pluginAssembly = Assembly.LoadFrom(dllName);
|
||||||
this.LoadedAssemblys.Add(dllName, pluginAssembly);
|
LoadedAssemblys.Add(dllName, pluginAssembly);
|
||||||
}
|
}
|
||||||
|
|
||||||
IRegionModule module = null;
|
IRegionModule module = null;
|
||||||
|
@ -121,7 +117,8 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
if (typeInterface != null)
|
if (typeInterface != null)
|
||||||
{
|
{
|
||||||
module = (IRegionModule)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
module =
|
||||||
|
(IRegionModule) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
typeInterface = null;
|
typeInterface = null;
|
||||||
|
@ -136,17 +133,16 @@ namespace OpenSim.Region.Environment
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
foreach (IRegionModule module in this.LoadedSharedModules.Values)
|
foreach (IRegionModule module in LoadedSharedModules.Values)
|
||||||
{
|
{
|
||||||
module.PostInitialise();
|
module.PostInitialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (IRegionModule module in this.LoadedModules)
|
foreach (IRegionModule module in LoadedModules)
|
||||||
{
|
{
|
||||||
module.PostInitialise();
|
module.PostInitialise();
|
||||||
}
|
}
|
||||||
|
@ -154,7 +150,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public void ClearCache()
|
public void ClearCache()
|
||||||
{
|
{
|
||||||
this.LoadedAssemblys.Clear();
|
LoadedAssemblys.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,11 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -15,7 +10,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public AssetDownloadModule()
|
public AssetDownloadModule()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
|
@ -26,7 +20,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
|
|
@ -1,21 +1,16 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
public class AvatarProfilesModule : IRegionModule
|
public class AvatarProfilesModule : IRegionModule
|
||||||
{
|
{
|
||||||
|
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
|
|
||||||
public AvatarProfilesModule()
|
public AvatarProfilesModule()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
|
@ -26,12 +21,10 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetName()
|
public string GetName()
|
||||||
|
@ -65,7 +58,8 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
string bornOn = "Before now";
|
string bornOn = "Before now";
|
||||||
string flAbout = "First life? What is one of those? OpenSim is my life!";
|
string flAbout = "First life? What is one of those? OpenSim is my life!";
|
||||||
LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000");
|
LLUUID partner = new LLUUID("11111111-1111-0000-0000-000100bba000");
|
||||||
remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "", partner);
|
remoteClient.SendAvatarProperties(avatarID, about, bornOn, "", flAbout, 0, LLUUID.Zero, LLUUID.Zero, "",
|
||||||
|
partner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,16 +1,12 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.IO;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -128,7 +124,8 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
string mess = inputLine.Substring(inputLine.IndexOf(m_channel));
|
string mess = inputLine.Substring(inputLine.IndexOf(m_channel));
|
||||||
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
m_scene.ForEachScenePresence(delegate(ScenePresence presence)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.SendChatMessage(Helpers.StringToField(mess), 255, pos, "IRC:",
|
presence.ControllingClient.SendChatMessage(
|
||||||
|
Helpers.StringToField(mess), 255, pos, "IRC:",
|
||||||
LLUUID.Zero);
|
LLUUID.Zero);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -136,7 +133,8 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName,
|
||||||
|
LLUUID fromAgentID)
|
||||||
{
|
{
|
||||||
ScenePresence avatar = null;
|
ScenePresence avatar = null;
|
||||||
avatar = m_scene.RequestAvatar(fromAgentID);
|
avatar = m_scene.RequestAvatar(fromAgentID);
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
using System.Text;
|
using System;
|
||||||
using System.Net;
|
|
||||||
using System.Net.Sockets;
|
|
||||||
using System.Threading;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Utilities;
|
|
||||||
using OpenSim.Framework.Console;
|
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
|
using OpenSim.Framework.Utilities;
|
||||||
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
|
public class DynamicTextureModule : IRegionModule, IDynamicTextureManager
|
||||||
{
|
{
|
||||||
private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
|
private Dictionary<LLUUID, Scene> RegisteredScenes = new Dictionary<LLUUID, Scene>();
|
||||||
private Dictionary<string, IDynamicTextureRender> RenderPlugins= new Dictionary<string, IDynamicTextureRender>();
|
|
||||||
|
private Dictionary<string, IDynamicTextureRender> RenderPlugins =
|
||||||
|
new Dictionary<string, IDynamicTextureRender>();
|
||||||
|
|
||||||
private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>();
|
private Dictionary<LLUUID, DynamicTextureUpdater> Updaters = new Dictionary<LLUUID, DynamicTextureUpdater>();
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
|
@ -31,7 +28,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
@ -69,10 +65,11 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url, string extraParams, int updateTimer)
|
public LLUUID AddDynamicTextureURL(LLUUID simID, LLUUID primID, string contentType, string url,
|
||||||
|
string extraParams, int updateTimer)
|
||||||
{
|
{
|
||||||
System.Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType);
|
Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType);
|
||||||
if (this.RenderPlugins.ContainsKey(contentType))
|
if (RenderPlugins.ContainsKey(contentType))
|
||||||
{
|
{
|
||||||
DynamicTextureUpdater updater = new DynamicTextureUpdater();
|
DynamicTextureUpdater updater = new DynamicTextureUpdater();
|
||||||
updater.SimUUID = simID;
|
updater.SimUUID = simID;
|
||||||
|
@ -83,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
updater.UpdaterID = LLUUID.Random();
|
updater.UpdaterID = LLUUID.Random();
|
||||||
updater.Params = extraParams;
|
updater.Params = extraParams;
|
||||||
|
|
||||||
if (!this.Updaters.ContainsKey(updater.UpdaterID))
|
if (!Updaters.ContainsKey(updater.UpdaterID))
|
||||||
{
|
{
|
||||||
Updaters.Add(updater.UpdaterID, updater);
|
Updaters.Add(updater.UpdaterID, updater);
|
||||||
}
|
}
|
||||||
|
@ -94,9 +91,10 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data, string extraParams, int updateTimer)
|
public LLUUID AddDynamicTextureData(LLUUID simID, LLUUID primID, string contentType, string data,
|
||||||
|
string extraParams, int updateTimer)
|
||||||
{
|
{
|
||||||
if (this.RenderPlugins.ContainsKey(contentType))
|
if (RenderPlugins.ContainsKey(contentType))
|
||||||
{
|
{
|
||||||
DynamicTextureUpdater updater = new DynamicTextureUpdater();
|
DynamicTextureUpdater updater = new DynamicTextureUpdater();
|
||||||
updater.SimUUID = simID;
|
updater.SimUUID = simID;
|
||||||
|
@ -107,7 +105,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
updater.UpdaterID = LLUUID.Random();
|
updater.UpdaterID = LLUUID.Random();
|
||||||
updater.Params = extraParams;
|
updater.Params = extraParams;
|
||||||
|
|
||||||
if (!this.Updaters.ContainsKey(updater.UpdaterID))
|
if (!Updaters.ContainsKey(updater.UpdaterID))
|
||||||
{
|
{
|
||||||
Updaters.Add(updater.UpdaterID, updater);
|
Updaters.Add(updater.UpdaterID, updater);
|
||||||
}
|
}
|
||||||
|
@ -148,7 +146,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
asset.Type = 0;
|
asset.Type = 0;
|
||||||
scene.commsManager.AssetCache.AddAsset(asset);
|
scene.commsManager.AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
this.LastAssetID = asset.FullID;
|
LastAssetID = asset.FullID;
|
||||||
|
|
||||||
SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
|
SceneObjectPart part = scene.GetSceneObjectPart(PrimID);
|
||||||
part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes();
|
part.Shape.TextureEntry = new LLObject.TextureEntry(asset.FullID).ToBytes();
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
class EmailModule
|
internal class EmailModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,11 +1,5 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -20,7 +14,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -19,7 +14,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
@ -37,4 +31,3 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -20,7 +14,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -20,7 +14,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
class ScriptsHttpRequests
|
internal class ScriptsHttpRequests
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,10 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
class TeleportModule
|
internal class TeleportModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,10 +1,7 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -14,7 +11,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public TextureDownloadModule()
|
public TextureDownloadModule()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
|
@ -25,7 +21,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
|
@ -48,7 +43,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void TextureAssetCallback(LLUUID texture, byte[] data)
|
public void TextureAssetCallback(LLUUID texture, byte[] data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,12 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Utilities;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Modules
|
namespace OpenSim.Region.Environment.Modules
|
||||||
{
|
{
|
||||||
|
@ -19,7 +16,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public XferModule()
|
public XferModule()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
|
@ -32,12 +28,10 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CloseDown()
|
public void CloseDown()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetName()
|
public string GetName()
|
||||||
|
@ -82,7 +76,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet)
|
public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet)
|
||||||
{
|
{
|
||||||
if (this.Transfers.ContainsKey(xferID))
|
if (Transfers.ContainsKey(xferID))
|
||||||
{
|
{
|
||||||
Transfers[xferID].AckPacket(packet);
|
Transfers[xferID].AckPacket(packet);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +120,6 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
|
|
||||||
public XferDownLoad()
|
public XferDownLoad()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartSend()
|
public void StartSend()
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.Framework.Communications;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Region.Capabilities;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.LandManagement;
|
|
||||||
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using OpenSim.Region.Environment.LandManagement;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
|
@ -20,6 +13,7 @@ namespace OpenSim.Region.Environment
|
||||||
// TODO: Change this to false when permissions are a desired default
|
// TODO: Change this to false when permissions are a desired default
|
||||||
// TODO: Move to configuration option.
|
// TODO: Move to configuration option.
|
||||||
private bool m_bypassPermissions = true;
|
private bool m_bypassPermissions = true;
|
||||||
|
|
||||||
public bool BypassPermissions
|
public bool BypassPermissions
|
||||||
{
|
{
|
||||||
get { return m_bypassPermissions; }
|
get { return m_bypassPermissions; }
|
||||||
|
@ -123,7 +117,8 @@ namespace OpenSim.Region.Environment
|
||||||
permission = true;
|
permission = true;
|
||||||
|
|
||||||
// Users should be able to edit what is over their land.
|
// Users should be able to edit what is over their land.
|
||||||
if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID == user)
|
if (m_scene.LandManager.getLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y).landData.ownerID ==
|
||||||
|
user)
|
||||||
permission = true;
|
permission = true;
|
||||||
|
|
||||||
// Estate users should be able to edit anything in the sim
|
// Estate users should be able to edit anything in the sim
|
||||||
|
@ -300,6 +295,5 @@ namespace OpenSim.Region.Environment
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,34 +1,3 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.Framework.Communications;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Region.Capabilities;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.LandManagement;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
public delegate TResult ModuleAPIMethod1<TResult, TParam0>(TParam0 param0);
|
|
||||||
public delegate TResult ModuleAPIMethod2<TResult, TParam0, TParam1>(TParam0 param0, TParam1 param1);
|
|
||||||
|
|
||||||
public class RegionManager
|
|
||||||
{
|
|
||||||
protected AgentCircuitManager authenticateHandler;
|
|
||||||
protected RegionCommsListener regionCommsHost;
|
|
||||||
protected CommunicationsManager commsManager;
|
|
||||||
protected List<Caps> capsHandlers = new List<Caps>();
|
|
||||||
protected BaseHttpServer httpListener;
|
|
||||||
|
|
||||||
protected Scene m_Scene;
|
|
||||||
|
|
||||||
public LandManager LandManager;
|
|
||||||
public EstateManager estateManager;
|
|
||||||
|
|
||||||
public RegionManager()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Axiom.Math;
|
using Axiom.Math;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Region.Environment.Scenes.Scripting;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -12,19 +11,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
protected Scene m_scene;
|
protected Scene m_scene;
|
||||||
|
|
||||||
public LLUUID m_uuid;
|
public LLUUID m_uuid;
|
||||||
|
|
||||||
public virtual LLUUID UUID
|
public virtual LLUUID UUID
|
||||||
{
|
{
|
||||||
get
|
get { return m_uuid; }
|
||||||
{
|
set { m_uuid = value; }
|
||||||
return m_uuid;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
m_uuid = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string m_name;
|
protected string m_name;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -35,6 +30,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_pos;
|
protected LLVector3 m_pos;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -45,6 +41,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLVector3 m_velocity;
|
public LLVector3 m_velocity;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -55,6 +52,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
|
protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
|
||||||
|
|
||||||
public virtual Quaternion Rotation
|
public virtual Quaternion Rotation
|
||||||
{
|
{
|
||||||
get { return m_rotation; }
|
get { return m_rotation; }
|
||||||
|
@ -62,6 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected uint m_localId;
|
protected uint m_localId;
|
||||||
|
|
||||||
public virtual uint LocalId
|
public virtual uint LocalId
|
||||||
{
|
{
|
||||||
get { return m_localId; }
|
get { return m_localId; }
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
using System;
|
using Axiom.Math;
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim.Framework.Interfaces;
|
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.Framework.Communications.Caches;
|
using OpenSim.Framework.Communications.Caches;
|
||||||
using OpenSim.Framework.Data;
|
using OpenSim.Framework.Data;
|
||||||
|
using OpenSim.Framework.Interfaces;
|
||||||
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
|
@ -19,9 +17,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void AddInventoryItem(LLUUID userID, InventoryItemBase item)
|
public void AddInventoryItem(LLUUID userID, InventoryItemBase item)
|
||||||
{
|
{
|
||||||
if (this.Avatars.ContainsKey(userID))
|
if (Avatars.ContainsKey(userID))
|
||||||
{
|
{
|
||||||
this.AddInventoryItem(this.Avatars[userID].ControllingClient, item);
|
AddInventoryItem(Avatars[userID].ControllingClient, item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +35,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public LLUUID CapsUpdateInventoryItemAsset(LLUUID userID, LLUUID itemID, byte[] data)
|
public LLUUID CapsUpdateInventoryItemAsset(LLUUID userID, LLUUID itemID, byte[] data)
|
||||||
{
|
{
|
||||||
if (this.Avatars.ContainsKey(userID))
|
if (Avatars.ContainsKey(userID))
|
||||||
{
|
{
|
||||||
return this.CapsUpdateInventoryItemAsset(this.Avatars[userID].ControllingClient, itemID, data);
|
return CapsUpdateInventoryItemAsset(Avatars[userID].ControllingClient, itemID, data);
|
||||||
}
|
}
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +81,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID, LLUUID itemID)
|
public void UDPUpdateInventoryItemAsset(IClientAPI remoteClient, LLUUID transactionID, LLUUID assetID,
|
||||||
|
LLUUID itemID)
|
||||||
{
|
{
|
||||||
CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
|
CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
|
||||||
if (userInfo != null)
|
if (userInfo != null)
|
||||||
|
@ -93,7 +92,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
|
InventoryItemBase item = userInfo.RootFolder.HasItem(itemID);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
AgentAssetTransactions transactions = commsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId);
|
AgentAssetTransactions transactions =
|
||||||
|
commsManager.TransactionsManager.GetUserTransActions(remoteClient.AgentId);
|
||||||
if (transactions != null)
|
if (transactions != null)
|
||||||
{
|
{
|
||||||
AssetBase asset = null;
|
AssetBase asset = null;
|
||||||
|
@ -143,7 +143,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <param name="wearableType"></param>
|
/// <param name="wearableType"></param>
|
||||||
/// <param name="nextOwnerMask"></param>
|
/// <param name="nextOwnerMask"></param>
|
||||||
public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask)
|
public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID,
|
||||||
|
uint callbackID, string description, string name, sbyte invType, sbyte type,
|
||||||
|
byte wearableType, uint nextOwnerMask)
|
||||||
{
|
{
|
||||||
if (transActionID == LLUUID.Zero)
|
if (transActionID == LLUUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -157,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
asset.Type = type;
|
asset.Type = type;
|
||||||
asset.FullID = LLUUID.Random();
|
asset.FullID = LLUUID.Random();
|
||||||
asset.Data = new byte[1];
|
asset.Data = new byte[1];
|
||||||
this.commsManager.AssetCache.AddAsset(asset);
|
commsManager.AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
InventoryItemBase item = new InventoryItemBase();
|
InventoryItemBase item = new InventoryItemBase();
|
||||||
item.avatarID = remoteClient.AgentId;
|
item.avatarID = remoteClient.AgentId;
|
||||||
|
@ -178,7 +180,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID, callbackID, description, name, invType, type, wearableType, nextOwnerMask);
|
commsManager.TransactionsManager.HandleInventoryFromTransaction(remoteClient, transActionID, folderID,
|
||||||
|
callbackID, description, name, invType,
|
||||||
|
type, wearableType, nextOwnerMask);
|
||||||
//System.Console.WriteLine("request to create inventory item from transaction " + transActionID);
|
//System.Console.WriteLine("request to create inventory item from transaction " + transActionID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -201,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
bool fileChange = ((SceneObjectGroup) ent).GetPartInventoryFileName(remoteClient, primLocalID);
|
bool fileChange = ((SceneObjectGroup) ent).GetPartInventoryFileName(remoteClient, primLocalID);
|
||||||
if (fileChange)
|
if (fileChange)
|
||||||
{
|
{
|
||||||
if (this.XferManager != null)
|
if (XferManager != null)
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) ent).RequestInventoryFile(primLocalID, XferManager);
|
((SceneObjectGroup) ent).RequestInventoryFile(primLocalID, XferManager);
|
||||||
}
|
}
|
||||||
|
@ -226,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
||||||
if (type == 10)
|
if (type == 10)
|
||||||
{
|
{
|
||||||
this.EventManager.TriggerRemoveScript(localID, itemID);
|
EventManager.TriggerRemoveScript(localID, itemID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -255,7 +259,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
string script = Util.FieldToString(rezAsset.Data);
|
string script = Util.FieldToString(rezAsset.Data);
|
||||||
//Console.WriteLine("rez script "+script);
|
//Console.WriteLine("rez script "+script);
|
||||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
EventManager.TriggerRezScript(localID, copyID, script);
|
||||||
rezzed = true;
|
rezzed = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -266,7 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
string script = Util.FieldToString(rezAsset.Data);
|
string script = Util.FieldToString(rezAsset.Data);
|
||||||
// Console.WriteLine("rez script " + script);
|
// Console.WriteLine("rez script " + script);
|
||||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
EventManager.TriggerRezScript(localID, copyID, script);
|
||||||
rezzed = true;
|
rezzed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,8 +285,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
|
hasPrim = ((SceneObjectGroup) ent).HasChildPrim(localID);
|
||||||
if (hasPrim != false)
|
if (hasPrim != false)
|
||||||
{
|
{
|
||||||
|
bool added =
|
||||||
bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
|
((SceneObjectGroup) ent).AddInventoryItem(remoteClient, localID, item,
|
||||||
|
copyID);
|
||||||
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +317,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
EntityBase selectedEnt = null;
|
EntityBase selectedEnt = null;
|
||||||
//OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
|
//OpenSim.Framework.Console.MainConsole.Instance.WriteLine("LocalID:" + Data.ObjectLocalID.ToString());
|
||||||
foreach (EntityBase ent in this.Entities.Values)
|
foreach (EntityBase ent in Entities.Values)
|
||||||
{
|
{
|
||||||
if (ent.LocalId == Data.ObjectLocalID)
|
if (ent.LocalId == Data.ObjectLocalID)
|
||||||
{
|
{
|
||||||
|
@ -330,7 +335,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
AssetBase asset = new AssetBase();
|
AssetBase asset = new AssetBase();
|
||||||
asset.Name = ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId);
|
asset.Name = ((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId);
|
||||||
asset.Description = ((SceneObjectGroup)selectedEnt).GetPartDescription(selectedEnt.LocalId);
|
asset.Description =
|
||||||
|
((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId);
|
||||||
asset.InvType = 6;
|
asset.InvType = 6;
|
||||||
asset.Type = 6;
|
asset.Type = 6;
|
||||||
asset.FullID = LLUUID.Random();
|
asset.FullID = LLUUID.Random();
|
||||||
|
@ -355,14 +361,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
remoteClient.SendInventoryItemUpdate(item);
|
remoteClient.SendInventoryItemUpdate(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
SceneObjectPart rootPart = ((SceneObjectGroup)selectedEnt).GetChildPart(((SceneObjectGroup)selectedEnt).UUID);
|
SceneObjectPart rootPart =
|
||||||
|
((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID);
|
||||||
if (rootPart.PhysActor != null)
|
if (rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
this.phyScene.RemovePrim(rootPart.PhysActor);
|
phyScene.RemovePrim(rootPart.PhysActor);
|
||||||
rootPart.PhysActor = null;
|
rootPart.PhysActor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
storageManager.DataStore.RemoveObject(((SceneObjectGroup)selectedEnt).UUID, m_regInfo.SimUUID);
|
storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID,
|
||||||
|
m_regInfo.SimUUID);
|
||||||
((SceneObjectGroup) selectedEnt).DeleteGroup();
|
((SceneObjectGroup) selectedEnt).DeleteGroup();
|
||||||
|
|
||||||
lock (Entities)
|
lock (Entities)
|
||||||
|
@ -389,7 +397,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false);
|
AssetBase rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false);
|
||||||
if (rezAsset != null)
|
if (rezAsset != null)
|
||||||
{
|
{
|
||||||
this.AddRezObject(Util.FieldToString(rezAsset.Data), pos);
|
AddRezObject(Util.FieldToString(rezAsset.Data), pos);
|
||||||
userInfo.DeleteItem(remoteClient.AgentId, item);
|
userInfo.DeleteItem(remoteClient.AgentId, item);
|
||||||
remoteClient.SendRemoveInventoryItem(itemID);
|
remoteClient.SendRemoveInventoryItem(itemID);
|
||||||
}
|
}
|
||||||
|
@ -399,7 +407,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false);
|
rezAsset = commsManager.AssetCache.GetAsset(item.assetID, false);
|
||||||
if (rezAsset != null)
|
if (rezAsset != null)
|
||||||
{
|
{
|
||||||
this.AddRezObject(Util.FieldToString(rezAsset.Data), pos);
|
AddRezObject(Util.FieldToString(rezAsset.Data), pos);
|
||||||
userInfo.DeleteItem(remoteClient.AgentId, item);
|
userInfo.DeleteItem(remoteClient.AgentId, item);
|
||||||
remoteClient.SendRemoveInventoryItem(itemID);
|
remoteClient.SendRemoveInventoryItem(itemID);
|
||||||
}
|
}
|
||||||
|
@ -411,17 +419,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
private void AddRezObject(string xmlData, LLVector3 pos)
|
private void AddRezObject(string xmlData, LLVector3 pos)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = new SceneObjectGroup(this, this.m_regionHandle, xmlData);
|
SceneObjectGroup group = new SceneObjectGroup(this, m_regionHandle, xmlData);
|
||||||
this.AddEntity(group);
|
AddEntity(group);
|
||||||
group.AbsolutePosition = pos;
|
group.AbsolutePosition = pos;
|
||||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||||
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
||||||
rootPart.PhysActor = phyScene.AddPrim(
|
rootPart.PhysActor = phyScene.AddPrim(
|
||||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
|
||||||
|
rootPart.AbsolutePosition.Z),
|
||||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -25,17 +25,11 @@
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
using System;
|
|
||||||
using System.IO;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
|
||||||
using OpenSim.Framework.Communications.Caches;
|
|
||||||
using OpenSim.Framework.Data;
|
|
||||||
using OpenSim.Framework.Utilities;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -50,7 +44,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="action">The action to be performed</param>
|
/// <param name="action">The action to be performed</param>
|
||||||
/// <param name="north">Distance from the north border where the cursor is located</param>
|
/// <param name="north">Distance from the north border where the cursor is located</param>
|
||||||
/// <param name="west">Distance from the west border where the cursor is located</param>
|
/// <param name="west">Distance from the west border where the cursor is located</param>
|
||||||
public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west, IClientAPI remoteUser)
|
public void ModifyTerrain(float height, float seconds, byte brushsize, byte action, float north, float west,
|
||||||
|
IClientAPI remoteUser)
|
||||||
{
|
{
|
||||||
// Do a permissions check before allowing terraforming.
|
// Do a permissions check before allowing terraforming.
|
||||||
// random users are now no longer allowed to terraform
|
// random users are now no longer allowed to terraform
|
||||||
|
@ -71,17 +66,19 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="timestamp"></param>
|
/// <param name="timestamp"></param>
|
||||||
/// <param name="fromAgentName"></param>
|
/// <param name="fromAgentName"></param>
|
||||||
/// <param name="message"></param>
|
/// <param name="message"></param>
|
||||||
public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp, string fromAgentName, string message, byte dialog)
|
public void InstantMessage(LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID,
|
||||||
|
uint timestamp, string fromAgentName, string message, byte dialog)
|
||||||
{
|
{
|
||||||
if (this.Avatars.ContainsKey(toAgentID))
|
if (Avatars.ContainsKey(toAgentID))
|
||||||
{
|
{
|
||||||
if (this.Avatars.ContainsKey(fromAgentID))
|
if (Avatars.ContainsKey(fromAgentID))
|
||||||
{
|
{
|
||||||
// Local sim message
|
// Local sim message
|
||||||
ScenePresence fromAvatar = this.Avatars[fromAgentID];
|
ScenePresence fromAvatar = Avatars[fromAgentID];
|
||||||
ScenePresence toAvatar = this.Avatars[toAgentID];
|
ScenePresence toAvatar = Avatars[toAgentID];
|
||||||
string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname;
|
string fromName = fromAvatar.Firstname + " " + fromAvatar.Lastname;
|
||||||
toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID, imSessionID, fromName, dialog, timestamp);
|
toAvatar.ControllingClient.SendInstantMessage(fromAgentID, fromAgentSession, message, toAgentID,
|
||||||
|
imSessionID, fromName, dialog, timestamp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -102,7 +99,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="fromPos"></param>
|
/// <param name="fromPos"></param>
|
||||||
/// <param name="fromName"></param>
|
/// <param name="fromName"></param>
|
||||||
/// <param name="fromAgentID"></param>
|
/// <param name="fromAgentID"></param>
|
||||||
public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
|
public void SimChat(byte[] message, byte type, int channel, LLVector3 fromPos, string fromName,
|
||||||
|
LLUUID fromAgentID)
|
||||||
{
|
{
|
||||||
if (m_simChatModule != null)
|
if (m_simChatModule != null)
|
||||||
{
|
{
|
||||||
|
@ -135,7 +133,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectGroup copy = originPrim.Copy();
|
SceneObjectGroup copy = originPrim.Copy();
|
||||||
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
copy.AbsolutePosition = copy.AbsolutePosition + offset;
|
||||||
this.Entities.Add(copy.UUID, copy);
|
Entities.Add(copy.UUID, copy);
|
||||||
|
|
||||||
copy.ScheduleGroupForFullUpdate();
|
copy.ScheduleGroupForFullUpdate();
|
||||||
/* List<ScenePresence> avatars = this.RequestAvatarList();
|
/* List<ScenePresence> avatars = this.RequestAvatarList();
|
||||||
|
@ -143,13 +141,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
// copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
|
// copy.SendAllChildPrimsToClient(avatars[i].ControllingClient);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim");
|
MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -250,7 +246,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
||||||
((SceneObjectGroup) ent).IsSelected = true;
|
((SceneObjectGroup) ent).IsSelected = true;
|
||||||
this.LandManager.setPrimsTainted();
|
LandManager.setPrimsTainted();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -271,7 +267,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
||||||
{
|
{
|
||||||
((SceneObjectGroup) ent).IsSelected = false;
|
((SceneObjectGroup) ent).IsSelected = false;
|
||||||
this.LandManager.setPrimsTainted();
|
LandManager.setPrimsTainted();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -350,7 +346,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
|
public void UpdatePrimFlags(uint localID, Packet packet, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -511,7 +506,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void StartAnimation(IClientAPI client, LLUUID animID, int seq)
|
public void StartAnimation(IClientAPI client, LLUUID animID, int seq)
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.RequestAvatarList();
|
List<ScenePresence> avatars = RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].ControllingClient.SendAnimation(animID, seq, client.AgentId);
|
avatars[i].ControllingClient.SendAnimation(animID, seq, client.AgentId);
|
||||||
|
@ -520,7 +515,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
|
public virtual void ProcessObjectGrab(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
this.EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
|
EventManager.TriggerObjectGrab(localID, offsetPos, remoteClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,27 +27,27 @@
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using System.IO;
|
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
using Axiom.Math;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
|
using OpenSim.Framework.Communications.Caches;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Region.Physics.Manager;
|
using OpenSim.Region.Capabilities;
|
||||||
using OpenSim.Framework.Communications.Caches;
|
|
||||||
using OpenSim.Region.Environment.LandManagement;
|
|
||||||
using OpenSim.Region.Environment;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.LandManagement;
|
||||||
|
using OpenSim.Region.Environment.Scenes.Scripting;
|
||||||
using OpenSim.Region.Environment.Types;
|
using OpenSim.Region.Environment.Types;
|
||||||
|
using OpenSim.Region.Physics.Manager;
|
||||||
using OpenSim.Region.Terrain;
|
using OpenSim.Region.Terrain;
|
||||||
using OpenSim.Framework.Data;
|
|
||||||
using Caps = OpenSim.Region.Capabilities.Caps;
|
|
||||||
using Timer=System.Timers.Timer;
|
using Timer=System.Timers.Timer;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
|
@ -61,8 +61,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
protected Timer m_heartbeatTimer = new Timer();
|
protected Timer m_heartbeatTimer = new Timer();
|
||||||
protected Dictionary<LLUUID, ScenePresence> Avatars;
|
protected Dictionary<LLUUID, ScenePresence> Avatars;
|
||||||
protected Dictionary<LLUUID, SceneObjectGroup> Prims;
|
protected Dictionary<LLUUID, SceneObjectGroup> Prims;
|
||||||
public PhysicsScene phyScene; /// publicized so it can be accessed from SceneObjectGroup.
|
public PhysicsScene phyScene;
|
||||||
|
|
||||||
|
/// publicized so it can be accessed from SceneObjectGroup.
|
||||||
protected float timeStep = 0.1f;
|
protected float timeStep = 0.1f;
|
||||||
|
|
||||||
private Random Rand = new Random();
|
private Random Rand = new Random();
|
||||||
private uint _primCount = 702000;
|
private uint _primCount = 702000;
|
||||||
private Mutex _primAllocateMutex = new Mutex(false);
|
private Mutex _primAllocateMutex = new Mutex(false);
|
||||||
|
@ -102,8 +105,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public AgentCircuitManager AuthenticateHandler
|
public AgentCircuitManager AuthenticateHandler
|
||||||
{
|
{
|
||||||
get { return this.authenticateHandler; }
|
get { return authenticateHandler; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -141,7 +145,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public int TimePhase
|
public int TimePhase
|
||||||
{
|
{
|
||||||
get { return this.m_timePhase; }
|
get { return m_timePhase; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -155,7 +159,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <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 Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan,
|
public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan,
|
||||||
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, ModuleLoader moduleLoader)
|
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
|
||||||
|
ModuleLoader moduleLoader)
|
||||||
{
|
{
|
||||||
updateLock = new Mutex(false);
|
updateLock = new Mutex(false);
|
||||||
|
|
||||||
|
@ -190,22 +195,21 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Prims = new Dictionary<LLUUID, SceneObjectGroup>();
|
Prims = new Dictionary<LLUUID, SceneObjectGroup>();
|
||||||
|
|
||||||
MainLog.Instance.Verbose("Creating LandMap");
|
MainLog.Instance.Verbose("Creating LandMap");
|
||||||
Terrain = new TerrainEngine((int)this.RegionInfo.RegionLocX, (int)this.RegionInfo.RegionLocY);
|
Terrain = new TerrainEngine((int) RegionInfo.RegionLocX, (int) RegionInfo.RegionLocY);
|
||||||
|
|
||||||
ScenePresence.LoadAnims();
|
ScenePresence.LoadAnims();
|
||||||
|
|
||||||
httpListener = httpServer;
|
httpListener = httpServer;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void SetModuleInterfaces()
|
public void SetModuleInterfaces()
|
||||||
{
|
{
|
||||||
m_simChatModule = this.RequestModuleInterface<ISimChat>();
|
m_simChatModule = RequestModuleInterface<ISimChat>();
|
||||||
m_httpRequestModule = this.RequestModuleInterface<IHttpRequests>();
|
m_httpRequestModule = RequestModuleInterface<IHttpRequests>();
|
||||||
|
|
||||||
XferManager = this.RequestModuleInterface<IXfer>();
|
XferManager = RequestModuleInterface<IXfer>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Script Handling Methods
|
#region Script Handling Methods
|
||||||
|
@ -249,7 +253,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (phyScene.IsThreaded)
|
if (phyScene.IsThreaded)
|
||||||
{
|
{
|
||||||
phyScene.GetResults(); /// no engines implement this, and what does it have to do with threading? possible DEAD CODE
|
phyScene.GetResults();
|
||||||
|
/// no engines implement this, and what does it have to do with threading? possible DEAD CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
List<EntityBase> moveEntities = new List<EntityBase>(Entities.Values);
|
List<EntityBase> moveEntities = new List<EntityBase>(Entities.Values);
|
||||||
|
@ -310,7 +315,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (Terrain.Tainted(x*16, y*16))
|
if (Terrain.Tainted(x*16, y*16))
|
||||||
{
|
{
|
||||||
SendLayerData(x, y, presence.ControllingClient, terData);
|
SendLayerData(x, y, presence.ControllingClient,
|
||||||
|
terData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,7 +346,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_timeUpdateCount++;
|
m_timeUpdateCount++;
|
||||||
if (m_timeUpdateCount > 600)
|
if (m_timeUpdateCount > 600)
|
||||||
{
|
{
|
||||||
List<ScenePresence> Avatars = this.RequestAvatarList();
|
List<ScenePresence> Avatars = RequestAvatarList();
|
||||||
foreach (ScenePresence avatar in Avatars)
|
foreach (ScenePresence avatar in Avatars)
|
||||||
{
|
{
|
||||||
if (!avatar.childAgent)
|
if (!avatar.childAgent)
|
||||||
|
@ -398,10 +404,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
|
storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
|
||||||
|
|
||||||
ForEachScenePresence(delegate(ScenePresence presence)
|
ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); });
|
||||||
{
|
|
||||||
SendLayerData(presence.ControllingClient);
|
|
||||||
});
|
|
||||||
|
|
||||||
foreach (LLUUID UUID in Entities.Keys)
|
foreach (LLUUID UUID in Entities.Keys)
|
||||||
{
|
{
|
||||||
|
@ -429,10 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
|
storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD());
|
||||||
|
|
||||||
ForEachScenePresence(delegate(ScenePresence presence)
|
ForEachScenePresence(delegate(ScenePresence presence) { SendLayerData(presence.ControllingClient); });
|
||||||
{
|
|
||||||
SendLayerData(presence.ControllingClient);
|
|
||||||
});
|
|
||||||
|
|
||||||
foreach (LLUUID UUID in Entities.Keys)
|
foreach (LLUUID UUID in Entities.Keys)
|
||||||
{
|
{
|
||||||
|
@ -521,23 +521,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void LoadPrimsFromStorage()
|
public void LoadPrimsFromStorage()
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose("Loading objects from datastore");
|
MainLog.Instance.Verbose("Loading objects from datastore");
|
||||||
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(this.m_regInfo.SimUUID);
|
List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID);
|
||||||
foreach (SceneObjectGroup prim in PrimsFromDB)
|
foreach (SceneObjectGroup prim in PrimsFromDB)
|
||||||
{
|
{
|
||||||
AddEntityFromStorage(prim);
|
AddEntityFromStorage(prim);
|
||||||
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
|
SceneObjectPart rootPart = prim.GetChildPart(prim.UUID);
|
||||||
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
||||||
rootPart.PhysActor = phyScene.AddPrim(
|
rootPart.PhysActor = phyScene.AddPrim(
|
||||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
|
||||||
|
rootPart.AbsolutePosition.Z),
|
||||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||||
}
|
}
|
||||||
MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a new unallocated primitive ID
|
/// Returns a new unallocated primitive ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -561,9 +561,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="ownerID"></param>
|
/// <param name="ownerID"></param>
|
||||||
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
|
public void AddNewPrim(LLUUID ownerID, LLVector3 pos, PrimitiveBaseShape shape)
|
||||||
{
|
{
|
||||||
if (this.PermissionsMngr.CanRezObject(ownerID, pos))
|
if (PermissionsMngr.CanRezObject(ownerID, pos))
|
||||||
{
|
{
|
||||||
SceneObjectGroup sceneOb = new SceneObjectGroup(this, this.m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
SceneObjectGroup sceneOb =
|
||||||
|
new SceneObjectGroup(this, m_regionHandle, ownerID, PrimIDAllocate(), pos, shape);
|
||||||
AddEntity(sceneOb);
|
AddEntity(sceneOb);
|
||||||
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
||||||
// if grass or tree, make phantom
|
// if grass or tree, make phantom
|
||||||
|
@ -573,8 +574,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
// if not phantom, add to physics
|
// if not phantom, add to physics
|
||||||
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
||||||
rootPart.PhysActor = phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z), new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
rootPart.PhysActor =
|
||||||
new Axiom.Math.Quaternion());
|
phyScene.AddPrim(new PhysicsVector(pos.X, pos.Y, pos.Z),
|
||||||
|
new PhysicsVector(shape.Scale.X, shape.Scale.Y, shape.Scale.Z),
|
||||||
|
new Quaternion());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -595,14 +598,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void AddEntityFromStorage(SceneObjectGroup sceneObject)
|
public void AddEntityFromStorage(SceneObjectGroup sceneObject)
|
||||||
{
|
{
|
||||||
sceneObject.RegionHandle = this.m_regionHandle;
|
sceneObject.RegionHandle = m_regionHandle;
|
||||||
sceneObject.SetScene(this);
|
sceneObject.SetScene(this);
|
||||||
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
foreach (SceneObjectPart part in sceneObject.Children.Values)
|
||||||
{
|
{
|
||||||
part.LocalID = this.PrimIDAllocate();
|
part.LocalID = PrimIDAllocate();
|
||||||
}
|
}
|
||||||
sceneObject.UpdateParentIDs();
|
sceneObject.UpdateParentIDs();
|
||||||
this.AddEntity(sceneObject);
|
AddEntity(sceneObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddEntity(SceneObjectGroup sceneObject)
|
public void AddEntity(SceneObjectGroup sceneObject)
|
||||||
|
@ -648,7 +651,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
foreach (XmlNode aPrimNode in rootNode.ChildNodes)
|
||||||
{
|
{
|
||||||
SceneObjectGroup obj = new SceneObjectGroup(this,
|
SceneObjectGroup obj = new SceneObjectGroup(this,
|
||||||
this.m_regionHandle, aPrimNode.OuterXml);
|
m_regionHandle, aPrimNode.OuterXml);
|
||||||
//if we want this to be a import method then we need new uuids for the object to avoid any clashes
|
//if we want this to be a import method then we need new uuids for the object to avoid any clashes
|
||||||
//obj.RegenerateFullIDs();
|
//obj.RegenerateFullIDs();
|
||||||
AddEntity(obj);
|
AddEntity(obj);
|
||||||
|
@ -656,9 +659,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
|
SceneObjectPart rootPart = obj.GetChildPart(obj.UUID);
|
||||||
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
if ((rootPart.ObjectFlags & (uint) LLObject.ObjectFlags.Phantom) == 0)
|
||||||
rootPart.PhysActor = phyScene.AddPrim(
|
rootPart.PhysActor = phyScene.AddPrim(
|
||||||
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y, rootPart.AbsolutePosition.Z),
|
new PhysicsVector(rootPart.AbsolutePosition.X, rootPart.AbsolutePosition.Y,
|
||||||
|
rootPart.AbsolutePosition.Z),
|
||||||
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
new PhysicsVector(rootPart.Scale.X, rootPart.Scale.Y, rootPart.Scale.Z),
|
||||||
new Axiom.Math.Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
new Quaternion(rootPart.RotationOffset.W, rootPart.RotationOffset.X,
|
||||||
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
rootPart.RotationOffset.Y, rootPart.RotationOffset.Z));
|
||||||
primCount++;
|
primCount++;
|
||||||
}
|
}
|
||||||
|
@ -688,7 +692,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
file.Close();
|
file.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add/Remove Avatar Methods
|
#region Add/Remove Avatar Methods
|
||||||
|
@ -744,9 +747,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest);
|
client.OnParcelPropertiesRequest += new ParcelPropertiesRequest(m_LandManager.handleParcelPropertiesRequest);
|
||||||
client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest);
|
client.OnParcelDivideRequest += new ParcelDivideRequest(m_LandManager.handleParcelDivideRequest);
|
||||||
client.OnParcelJoinRequest += new ParcelJoinRequest(m_LandManager.handleParcelJoinRequest);
|
client.OnParcelJoinRequest += new ParcelJoinRequest(m_LandManager.handleParcelJoinRequest);
|
||||||
client.OnParcelPropertiesUpdateRequest += new ParcelPropertiesUpdateRequest(m_LandManager.handleParcelPropertiesUpdateRequest);
|
client.OnParcelPropertiesUpdateRequest +=
|
||||||
|
new ParcelPropertiesUpdateRequest(m_LandManager.handleParcelPropertiesUpdateRequest);
|
||||||
client.OnParcelSelectObjects += new ParcelSelectObjects(m_LandManager.handleParcelSelectObjectsRequest);
|
client.OnParcelSelectObjects += new ParcelSelectObjects(m_LandManager.handleParcelSelectObjectsRequest);
|
||||||
client.OnParcelObjectOwnerRequest += new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
|
client.OnParcelObjectOwnerRequest +=
|
||||||
|
new ParcelObjectOwnerRequest(m_LandManager.handleParcelObjectOwnersRequest);
|
||||||
|
|
||||||
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
|
client.OnEstateOwnerMessage += new EstateOwnerMessageRequest(m_estateManager.handleEstateOwnerMessage);
|
||||||
|
|
||||||
|
@ -777,16 +782,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (child)
|
if (child)
|
||||||
{
|
{
|
||||||
MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Creating new child agent.");
|
MainLog.Instance.Verbose(RegionInfo.RegionName + ": Creating new child agent.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement;
|
newAvatar.OnSignificantClientMovement += m_LandManager.handleSignificantClientMovement;
|
||||||
|
|
||||||
MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Creating new root agent.");
|
MainLog.Instance.Verbose(RegionInfo.RegionName + ": Creating new root agent.");
|
||||||
MainLog.Instance.Verbose(this.RegionInfo.RegionName + ": Adding Physical agent.");
|
MainLog.Instance.Verbose(RegionInfo.RegionName + ": Adding Physical agent.");
|
||||||
|
|
||||||
PhysicsVector pVec = new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, newAvatar.AbsolutePosition.Z);
|
PhysicsVector pVec =
|
||||||
|
new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y,
|
||||||
|
newAvatar.AbsolutePosition.Z);
|
||||||
lock (m_syncRoot)
|
lock (m_syncRoot)
|
||||||
{
|
{
|
||||||
newAvatar.PhysActor = phyScene.AddAvatar(pVec);
|
newAvatar.PhysActor = phyScene.AddAvatar(pVec);
|
||||||
|
@ -943,7 +950,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (Entities.ContainsKey(entID))
|
if (Entities.ContainsKey(entID))
|
||||||
{
|
{
|
||||||
Entities.Remove(entID);
|
Entities.Remove(entID);
|
||||||
storageManager.DataStore.RemoveObject(entID, this.m_regInfo.SimUUID);
|
storageManager.DataStore.RemoveObject(entID, m_regInfo.SimUUID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -951,10 +958,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SendKillObject(uint localID)
|
public void SendKillObject(uint localID)
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.RequestAvatarList();
|
List<ScenePresence> avatars = RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].ControllingClient.SendKillObject(this.m_regionHandle, localID);
|
avatars[i].ControllingClient.SendKillObject(m_regionHandle, localID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -999,11 +1006,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
if (agent.CapsPath != "")
|
if (agent.CapsPath != "")
|
||||||
{
|
{
|
||||||
//Console.WriteLine("new user, so creating caps handler for it");
|
//Console.WriteLine("new user, so creating caps handler for it");
|
||||||
Caps cap = new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port, agent.CapsPath, agent.AgentID);
|
Caps cap =
|
||||||
Util.SetCapsURL(agent.AgentID, "http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() + "/CAPS/" + agent.CapsPath + "0000/");
|
new Caps(commsManager.AssetCache, httpListener, m_regInfo.ExternalHostName, httpListener.Port,
|
||||||
|
agent.CapsPath, agent.AgentID);
|
||||||
|
Util.SetCapsURL(agent.AgentID,
|
||||||
|
"http://" + m_regInfo.ExternalHostName + ":" + httpListener.Port.ToString() +
|
||||||
|
"/CAPS/" + agent.CapsPath + "0000/");
|
||||||
cap.RegisterHandlers();
|
cap.RegisterHandlers();
|
||||||
cap.AddNewInventoryItem = this.AddInventoryItem;
|
cap.AddNewInventoryItem = AddInventoryItem;
|
||||||
cap.ItemUpdatedCall = this.CapsUpdateInventoryItemAsset;
|
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
|
||||||
if (capsHandlers.ContainsKey(agent.AgentID))
|
if (capsHandlers.ContainsKey(agent.AgentID))
|
||||||
{
|
{
|
||||||
MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
|
MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
|
||||||
|
@ -1142,33 +1153,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void AddModule(string name, IRegionModule module)
|
public void AddModule(string name, IRegionModule module)
|
||||||
{
|
{
|
||||||
if (!this.Modules.ContainsKey(name))
|
if (!Modules.ContainsKey(name))
|
||||||
{
|
{
|
||||||
Modules.Add(name, module);
|
Modules.Add(name, module);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//following delegate methods will be removed, so use the interface methods (below these)
|
|
||||||
public void RegisterAPIMethod(string name, object method)
|
|
||||||
{
|
|
||||||
if (!this.ModuleAPIMethods.ContainsKey(name))
|
|
||||||
{
|
|
||||||
this.ModuleAPIMethods.Add(name, method);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object RequestAPIMethod(string name)
|
|
||||||
{
|
|
||||||
if (this.ModuleAPIMethods.ContainsKey(name))
|
|
||||||
{
|
|
||||||
return ModuleAPIMethods[name];
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RegisterModuleInterface<M>(M mod)
|
public void RegisterModuleInterface<M>(M mod)
|
||||||
{
|
{
|
||||||
if (!this.ModuleInterfaces.ContainsKey(typeof(M)))
|
if (!ModuleInterfaces.ContainsKey(typeof (M)))
|
||||||
{
|
{
|
||||||
ModuleInterfaces.Add(typeof (M), mod);
|
ModuleInterfaces.Add(typeof (M), mod);
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1184,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_timePhase = phase;
|
m_timePhase = phase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url)
|
public void SendUrlToUser(LLUUID avatarID, string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned,
|
||||||
|
string message, string url)
|
||||||
{
|
{
|
||||||
if (Avatars.ContainsKey(avatarID))
|
if (Avatars.ContainsKey(avatarID))
|
||||||
{
|
{
|
||||||
|
@ -1201,7 +1195,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
#region Alert Methods
|
#region Alert Methods
|
||||||
|
|
||||||
void SendPermissionAlert(LLUUID user, string reason)
|
private void SendPermissionAlert(LLUUID user, string reason)
|
||||||
{
|
{
|
||||||
SendAlertToUser(user, reason, false);
|
SendAlertToUser(user, reason, false);
|
||||||
}
|
}
|
||||||
|
@ -1209,7 +1203,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SendGeneralAlert(string message)
|
public void SendGeneralAlert(string message)
|
||||||
{
|
{
|
||||||
foreach (ScenePresence presence in this.Avatars.Values)
|
foreach (ScenePresence presence in Avatars.Values)
|
||||||
{
|
{
|
||||||
presence.ControllingClient.SendAlertMessage(message);
|
presence.ControllingClient.SendAlertMessage(message);
|
||||||
}
|
}
|
||||||
|
@ -1217,15 +1211,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SendAlertToUser(LLUUID agentID, string message, bool modal)
|
public void SendAlertToUser(LLUUID agentID, string message, bool modal)
|
||||||
{
|
{
|
||||||
if (this.Avatars.ContainsKey(agentID))
|
if (Avatars.ContainsKey(agentID))
|
||||||
{
|
{
|
||||||
this.Avatars[agentID].ControllingClient.SendAgentAlertMessage(message, modal);
|
Avatars[agentID].ControllingClient.SendAgentAlertMessage(message, modal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||||
{
|
{
|
||||||
foreach (ScenePresence presence in this.Avatars.Values)
|
foreach (ScenePresence presence in Avatars.Values)
|
||||||
{
|
{
|
||||||
if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
|
if ((presence.Firstname == firstName) && (presence.Lastname == lastName))
|
||||||
{
|
{
|
||||||
|
@ -1239,13 +1233,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (commandParams[0] == "general")
|
if (commandParams[0] == "general")
|
||||||
{
|
{
|
||||||
string message = this.CombineParams(commandParams, 1);
|
string message = CombineParams(commandParams, 1);
|
||||||
this.SendGeneralAlert(message);
|
SendGeneralAlert(message);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
string message = this.CombineParams(commandParams, 2);
|
string message = CombineParams(commandParams, 2);
|
||||||
this.SendAlertToUser(commandParams[0], commandParams[1], message, false);
|
SendAlertToUser(commandParams[0], commandParams[1], message, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1258,11 +1252,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void ForceClientUpdate()
|
public void ForceClientUpdate()
|
||||||
{
|
{
|
||||||
foreach (EntityBase ent in this.Entities.Values)
|
foreach (EntityBase ent in Entities.Values)
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
|
@ -1274,7 +1269,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void HandleEditCommand(string[] cmmdparams)
|
public void HandleEditCommand(string[] cmmdparams)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");
|
Console.WriteLine("Searching for Primitive: '" + cmmdparams[0] + "'");
|
||||||
foreach (EntityBase ent in this.Entities.Values)
|
foreach (EntityBase ent in Entities.Values)
|
||||||
{
|
{
|
||||||
if (ent is SceneObjectGroup)
|
if (ent is SceneObjectGroup)
|
||||||
{
|
{
|
||||||
|
@ -1283,7 +1278,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (part.Name == cmmdparams[0])
|
if (part.Name == cmmdparams[0])
|
||||||
{
|
{
|
||||||
part.Resize( new LLVector3(Convert.ToSingle(cmmdparams[1]), Convert.ToSingle(cmmdparams[2]), Convert.ToSingle(cmmdparams[3])));
|
part.Resize(
|
||||||
|
new LLVector3(Convert.ToSingle(cmmdparams[1]), Convert.ToSingle(cmmdparams[2]),
|
||||||
|
Convert.ToSingle(cmmdparams[3])));
|
||||||
|
|
||||||
Console.WriteLine("Edited scale of Primitive: " + part.Name);
|
Console.WriteLine("Edited scale of Primitive: " + part.Name);
|
||||||
}
|
}
|
||||||
|
@ -1298,7 +1295,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
case "users":
|
case "users":
|
||||||
MainLog.Instance.Error("Current Region: " + RegionInfo.RegionName);
|
MainLog.Instance.Error("Current Region: " + RegionInfo.RegionName);
|
||||||
MainLog.Instance.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
|
MainLog.Instance.Error(
|
||||||
|
String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname",
|
||||||
|
"Agent ID", "Session ID", "Circuit", "IP", "World"));
|
||||||
|
|
||||||
foreach (EntityBase entity in Entities.Values)
|
foreach (EntityBase entity in Entities.Values)
|
||||||
{
|
{
|
||||||
|
@ -1321,8 +1320,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "modules":
|
case "modules":
|
||||||
MainLog.Instance.Error("The currently loaded modules in " + this.RegionInfo.RegionName + " are:");
|
MainLog.Instance.Error("The currently loaded modules in " + RegionInfo.RegionName + " are:");
|
||||||
foreach (OpenSim.Region.Environment.Interfaces.IRegionModule module in this.Modules.Values)
|
foreach (IRegionModule module in Modules.Values)
|
||||||
{
|
{
|
||||||
if (!module.IsSharedModule())
|
if (!module.IsSharedModule())
|
||||||
{
|
{
|
||||||
|
@ -1343,13 +1342,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Script Engine
|
#region Script Engine
|
||||||
private List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface> ScriptEngines = new List<OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface>();
|
|
||||||
public void AddScriptEngine(OpenSim.Region.Environment.Scenes.Scripting.ScriptEngineInterface ScriptEngine, LogBase m_logger)
|
private List<ScriptEngineInterface> ScriptEngines = new List<ScriptEngineInterface>();
|
||||||
|
|
||||||
|
public void AddScriptEngine(ScriptEngineInterface ScriptEngine, LogBase m_logger)
|
||||||
{
|
{
|
||||||
ScriptEngines.Add(ScriptEngine);
|
ScriptEngines.Add(ScriptEngine);
|
||||||
|
|
||||||
ScriptEngine.InitializeEngine(this, m_logger);
|
ScriptEngine.InitializeEngine(this, m_logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public LLUUID ConvertLocalIDToFullID(uint localID)
|
public LLUUID ConvertLocalIDToFullID(uint localID)
|
||||||
|
|
|
@ -27,15 +27,12 @@
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using OpenSim.Framework.Communications.Caches;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Communications.Caches;
|
|
||||||
using OpenSim.Region.Terrain;
|
using OpenSim.Region.Terrain;
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -67,6 +64,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
protected AssetCache assetCache;
|
protected AssetCache assetCache;
|
||||||
|
|
||||||
#region Update Methods
|
#region Update Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
|
/// Normally called once every frame/tick to let the world preform anything required (like running the physics simulation)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -104,6 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Add/Remove Agent/Avatar
|
#region Add/Remove Agent/Avatar
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -126,7 +125,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public virtual RegionInfo RegionInfo
|
public virtual RegionInfo RegionInfo
|
||||||
{
|
{
|
||||||
get { return this.m_regInfo; }
|
get { return m_regInfo; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public object SyncRoot
|
public object SyncRoot
|
||||||
|
@ -140,6 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Shutdown
|
#region Shutdown
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tidy before shutdown
|
/// Tidy before shutdown
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -147,7 +147,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
this.EventManager.TriggerShutdown();
|
EventManager.TriggerShutdown();
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -156,7 +156,5 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -9,41 +10,54 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public class EventManager
|
public class EventManager
|
||||||
{
|
{
|
||||||
public delegate void OnFrameDelegate();
|
public delegate void OnFrameDelegate();
|
||||||
|
|
||||||
public event OnFrameDelegate OnFrame;
|
public event OnFrameDelegate OnFrame;
|
||||||
|
|
||||||
public delegate void OnBackupDelegate(Interfaces.IRegionDataStore datastore);
|
public delegate void OnBackupDelegate(IRegionDataStore datastore);
|
||||||
|
|
||||||
public event OnBackupDelegate OnBackup;
|
public event OnBackupDelegate OnBackup;
|
||||||
|
|
||||||
public delegate void OnNewClientDelegate(IClientAPI client);
|
public delegate void OnNewClientDelegate(IClientAPI client);
|
||||||
|
|
||||||
public event OnNewClientDelegate OnNewClient;
|
public event OnNewClientDelegate OnNewClient;
|
||||||
|
|
||||||
public delegate void OnNewPresenceDelegate(ScenePresence presence);
|
public delegate void OnNewPresenceDelegate(ScenePresence presence);
|
||||||
|
|
||||||
public event OnNewPresenceDelegate OnNewPresence;
|
public event OnNewPresenceDelegate OnNewPresence;
|
||||||
|
|
||||||
public delegate void OnRemovePresenceDelegate(LLUUID uuid);
|
public delegate void OnRemovePresenceDelegate(LLUUID uuid);
|
||||||
|
|
||||||
public event OnRemovePresenceDelegate OnRemovePresence;
|
public event OnRemovePresenceDelegate OnRemovePresence;
|
||||||
|
|
||||||
public delegate void OnParcelPrimCountUpdateDelegate();
|
public delegate void OnParcelPrimCountUpdateDelegate();
|
||||||
|
|
||||||
public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
|
public event OnParcelPrimCountUpdateDelegate OnParcelPrimCountUpdate;
|
||||||
|
|
||||||
public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
|
public delegate void OnParcelPrimCountAddDelegate(SceneObjectGroup obj);
|
||||||
|
|
||||||
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
|
public event OnParcelPrimCountAddDelegate OnParcelPrimCountAdd;
|
||||||
|
|
||||||
public delegate void OnScriptConsoleDelegate(string[] args);
|
public delegate void OnScriptConsoleDelegate(string[] args);
|
||||||
|
|
||||||
public event OnScriptConsoleDelegate OnScriptConsole;
|
public event OnScriptConsoleDelegate OnScriptConsole;
|
||||||
|
|
||||||
public delegate void OnShutdownDelegate();
|
public delegate void OnShutdownDelegate();
|
||||||
|
|
||||||
public event OnShutdownDelegate OnShutdown;
|
public event OnShutdownDelegate OnShutdown;
|
||||||
|
|
||||||
public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
|
public delegate void ObjectGrabDelegate(uint localID, LLVector3 offsetPos, IClientAPI remoteClient);
|
||||||
|
|
||||||
public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
|
public delegate void OnPermissionErrorDelegate(LLUUID user, string reason);
|
||||||
|
|
||||||
public event ObjectGrabDelegate OnObjectGrab;
|
public event ObjectGrabDelegate OnObjectGrab;
|
||||||
public event OnPermissionErrorDelegate OnPermissionError;
|
public event OnPermissionErrorDelegate OnPermissionError;
|
||||||
|
|
||||||
public delegate void NewRezScript(uint localID, LLUUID itemID, string script);
|
public delegate void NewRezScript(uint localID, LLUUID itemID, string script);
|
||||||
|
|
||||||
public event NewRezScript OnRezScript;
|
public event NewRezScript OnRezScript;
|
||||||
|
|
||||||
public delegate void RemoveScript(uint localID, LLUUID itemID);
|
public delegate void RemoveScript(uint localID, LLUUID itemID);
|
||||||
|
|
||||||
public event RemoveScript OnRemoveScript;
|
public event RemoveScript OnRemoveScript;
|
||||||
|
|
||||||
public void TriggerPermissionError(LLUUID user, string reason)
|
public void TriggerPermissionError(LLUUID user, string reason)
|
||||||
|
@ -86,7 +100,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TriggerOnBackup(Interfaces.IRegionDataStore dstore)
|
public void TriggerOnBackup(IRegionDataStore dstore)
|
||||||
{
|
{
|
||||||
if (OnBackup != null)
|
if (OnBackup != null)
|
||||||
{
|
{
|
||||||
|
@ -101,6 +115,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
OnParcelPrimCountUpdate();
|
OnParcelPrimCountUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
|
public void TriggerParcelPrimCountAdd(SceneObjectGroup obj)
|
||||||
{
|
{
|
||||||
if (OnParcelPrimCountAdd != null)
|
if (OnParcelPrimCountAdd != null)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
|
|
||||||
|
@ -9,12 +9,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
private readonly List<Scene> m_localScenes;
|
private readonly List<Scene> m_localScenes;
|
||||||
private Scene m_currentScene = null;
|
private Scene m_currentScene = null;
|
||||||
|
|
||||||
public Scene CurrentScene
|
public Scene CurrentScene
|
||||||
{
|
{
|
||||||
get
|
get { return m_currentScene; }
|
||||||
{
|
|
||||||
return m_currentScene;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Scene CurrentOrFirstScene
|
private Scene CurrentOrFirstScene
|
||||||
|
@ -83,18 +81,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SendCommandToScripts(string[] cmdparams)
|
public void SendCommandToScripts(string[] cmdparams)
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.SendCommandToScripts(cmdparams); });
|
||||||
{
|
|
||||||
scene.SendCommandToScripts(cmdparams);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BypassPermissions(bool bypassPermissions)
|
public void BypassPermissions(bool bypassPermissions)
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.PermissionsMngr.BypassPermissions = bypassPermissions; });
|
||||||
{
|
|
||||||
scene.PermissionsMngr.BypassPermissions = bypassPermissions;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForEach(Action<Scene> func)
|
private void ForEach(Action<Scene> func)
|
||||||
|
@ -111,18 +103,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void Backup()
|
public void Backup()
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.Backup(); });
|
||||||
{
|
|
||||||
scene.Backup();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleAlertCommand(string[] cmdparams)
|
public void HandleAlertCommand(string[] cmdparams)
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.HandleAlertCommand(cmdparams); });
|
||||||
{
|
|
||||||
scene.HandleAlertCommand(cmdparams);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TrySetCurrentRegion(string regionName)
|
public bool TrySetCurrentRegion(string regionName)
|
||||||
|
@ -219,18 +205,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void ForceClientUpdate()
|
public void ForceClientUpdate()
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.ForceClientUpdate(); });
|
||||||
{
|
|
||||||
scene.ForceClientUpdate();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleEditCommand(string[] cmdparams)
|
public void HandleEditCommand(string[] cmdparams)
|
||||||
{
|
{
|
||||||
ForEach(delegate(Scene scene)
|
ForEach(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
|
||||||
{
|
|
||||||
scene.HandleEditCommand(cmdparams);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,17 +1,16 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
|
||||||
using System.IO;
|
|
||||||
using System;
|
|
||||||
using Axiom.Math;
|
using Axiom.Math;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
|
using OpenSim.Framework.Data;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Region.Physics.Manager;
|
|
||||||
using OpenSim.Framework.Data;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
@ -31,6 +30,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public bool HasChanged = false;
|
public bool HasChanged = false;
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -54,13 +54,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public Dictionary<LLUUID, SceneObjectPart> Children
|
public Dictionary<LLUUID, SceneObjectPart> Children
|
||||||
{
|
{
|
||||||
get { return this.m_parts; }
|
get { return m_parts; }
|
||||||
set { m_parts = value; }
|
set { m_parts = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public SceneObjectPart RootPart
|
public SceneObjectPart RootPart
|
||||||
{
|
{
|
||||||
get { return this.m_rootPart; }
|
get { return m_rootPart; }
|
||||||
set { m_rootPart = value; }
|
set { m_rootPart = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
m_regionHandle = value;
|
m_regionHandle = value;
|
||||||
lock (this.m_parts)
|
lock (m_parts)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.RegionHandle = m_regionHandle;
|
part.RegionHandle = m_regionHandle;
|
||||||
}
|
}
|
||||||
|
@ -104,16 +104,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
val.Y = 0.4f;
|
val.Y = 0.4f;
|
||||||
}
|
}
|
||||||
|
|
||||||
lock (this.m_parts)
|
lock (m_parts)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.GroupPosition = val;
|
part.GroupPosition = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_rootPart.PhysActor != null)
|
if (m_rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
m_rootPart.PhysActor.Position = new PhysicsVector(m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y, m_rootPart.GroupPosition.Z);
|
m_rootPart.PhysActor.Position =
|
||||||
|
new PhysicsVector(m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y,
|
||||||
|
m_rootPart.GroupPosition.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -152,10 +154,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
protected virtual bool InSceneBackup
|
protected virtual bool InSceneBackup
|
||||||
{
|
{
|
||||||
get
|
get { return true; }
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSelected
|
public bool IsSelected
|
||||||
|
@ -170,19 +169,22 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (m_scene != null)
|
if (m_scene != null)
|
||||||
{ return m_scene.RegionInfo.SimUUID; }
|
{
|
||||||
|
return m_scene.RegionInfo.SimUUID;
|
||||||
|
}
|
||||||
return LLUUID.Zero;
|
return LLUUID.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SceneObjectGroup()
|
public SceneObjectGroup()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -198,7 +200,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
reader.Read();
|
reader.Read();
|
||||||
reader.ReadStartElement("SceneObjectGroup");
|
reader.ReadStartElement("SceneObjectGroup");
|
||||||
reader.ReadStartElement("RootPart");
|
reader.ReadStartElement("RootPart");
|
||||||
this.m_rootPart = SceneObjectPart.FromXml(reader);
|
m_rootPart = SceneObjectPart.FromXml(reader);
|
||||||
reader.ReadEndElement();
|
reader.ReadEndElement();
|
||||||
|
|
||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
|
@ -211,7 +213,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
reader.Read();
|
reader.Read();
|
||||||
SceneObjectPart Part = SceneObjectPart.FromXml(reader);
|
SceneObjectPart Part = SceneObjectPart.FromXml(reader);
|
||||||
Part.LocalID = m_scene.PrimIDAllocate();
|
Part.LocalID = m_scene.PrimIDAllocate();
|
||||||
this.AddPart(Part);
|
AddPart(Part);
|
||||||
Part.RegionHandle = m_regionHandle;
|
Part.RegionHandle = m_regionHandle;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -221,23 +223,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
reader.Close();
|
reader.Close();
|
||||||
sr.Close();
|
sr.Close();
|
||||||
this.m_rootPart.SetParent(this);
|
m_rootPart.SetParent(this);
|
||||||
this.m_parts.Add(m_rootPart.UUID, m_rootPart);
|
m_parts.Add(m_rootPart.UUID, m_rootPart);
|
||||||
this.m_rootPart.LocalID = m_scene.PrimIDAllocate();
|
m_rootPart.LocalID = m_scene.PrimIDAllocate();
|
||||||
this.m_rootPart.ParentID = 0;
|
m_rootPart.ParentID = 0;
|
||||||
this.m_rootPart.RegionHandle = m_regionHandle;
|
m_rootPart.RegionHandle = m_regionHandle;
|
||||||
this.UpdateParentIDs();
|
UpdateParentIDs();
|
||||||
|
|
||||||
AttachToBackup();
|
AttachToBackup();
|
||||||
|
|
||||||
this.ScheduleGroupForFullUpdate();
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AttachToBackup()
|
private void AttachToBackup()
|
||||||
{
|
{
|
||||||
if (InSceneBackup)
|
if (InSceneBackup)
|
||||||
{
|
{
|
||||||
m_scene.EventManager.OnBackup += this.ProcessBackup;
|
m_scene.EventManager.OnBackup += ProcessBackup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,25 +248,27 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SceneObjectGroup(byte[] data)
|
public SceneObjectGroup(byte[] data)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
|
public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
|
||||||
|
PrimitiveBaseShape shape)
|
||||||
{
|
{
|
||||||
m_regionHandle = regionHandle;
|
m_regionHandle = regionHandle;
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
|
||||||
// this.Pos = pos;
|
// this.Pos = pos;
|
||||||
LLVector3 rootOffset = new LLVector3(0, 0, 0);
|
LLVector3 rootOffset = new LLVector3(0, 0, 0);
|
||||||
SceneObjectPart newPart = new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset);
|
SceneObjectPart newPart =
|
||||||
this.m_parts.Add(newPart.UUID, newPart);
|
new SceneObjectPart(m_regionHandle, this, ownerID, localID, shape, pos, rootOffset);
|
||||||
this.SetPartAsRoot(newPart);
|
m_parts.Add(newPart.UUID, newPart);
|
||||||
|
SetPartAsRoot(newPart);
|
||||||
|
|
||||||
AttachToBackup();
|
AttachToBackup();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public string ToXmlString()
|
public string ToXmlString()
|
||||||
|
@ -276,9 +280,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_rootPart.ToXml(writer);
|
m_rootPart.ToXml(writer);
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
writer.WriteStartElement(String.Empty, "OtherParts", String.Empty);
|
writer.WriteStartElement(String.Empty, "OtherParts", String.Empty);
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (part.UUID != this.m_rootPart.UUID)
|
if (part.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
writer.WriteStartElement(String.Empty, "Part", String.Empty);
|
writer.WriteStartElement(String.Empty, "Part", String.Empty);
|
||||||
part.ToXml(writer);
|
part.ToXml(writer);
|
||||||
|
@ -292,35 +296,36 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Copying
|
#region Copying
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public new SceneObjectGroup Copy()
|
public new SceneObjectGroup Copy()
|
||||||
{
|
{
|
||||||
SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone();
|
SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone();
|
||||||
dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
|
dupe.m_parts = new Dictionary<LLUUID, SceneObjectPart>();
|
||||||
dupe.m_parts.Clear();
|
dupe.m_parts.Clear();
|
||||||
dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
|
||||||
dupe.m_scene = m_scene;
|
dupe.m_scene = m_scene;
|
||||||
dupe.m_regionHandle = this.m_regionHandle;
|
dupe.m_regionHandle = m_regionHandle;
|
||||||
dupe.CopyRootPart(this.m_rootPart);
|
dupe.CopyRootPart(m_rootPart);
|
||||||
|
|
||||||
/// may need to create a new Physics actor.
|
/// may need to create a new Physics actor.
|
||||||
if (dupe.RootPart.PhysActor != null)
|
if (dupe.RootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
dupe.RootPart.PhysActor = m_scene.phyScene.AddPrim(
|
dupe.RootPart.PhysActor = m_scene.phyScene.AddPrim(
|
||||||
new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y, dupe.RootPart.AbsolutePosition.Z),
|
new PhysicsVector(dupe.RootPart.AbsolutePosition.X, dupe.RootPart.AbsolutePosition.Y,
|
||||||
|
dupe.RootPart.AbsolutePosition.Z),
|
||||||
new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
|
new PhysicsVector(dupe.RootPart.Scale.X, dupe.RootPart.Scale.Y, dupe.RootPart.Scale.Z),
|
||||||
new Axiom.Math.Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
|
new Quaternion(dupe.RootPart.RotationOffset.W, dupe.RootPart.RotationOffset.X,
|
||||||
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
|
dupe.RootPart.RotationOffset.Y, dupe.RootPart.RotationOffset.Z));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<SceneObjectPart> partList = new List<SceneObjectPart>(this.m_parts.Values);
|
List<SceneObjectPart> partList = new List<SceneObjectPart>(m_parts.Values);
|
||||||
foreach (SceneObjectPart part in partList)
|
foreach (SceneObjectPart part in partList)
|
||||||
{
|
{
|
||||||
if (part.UUID != this.m_rootPart.UUID)
|
if (part.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
dupe.CopyPart(part);
|
dupe.CopyPart(part);
|
||||||
}
|
}
|
||||||
|
@ -340,8 +345,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
||||||
newPart.SetParent(this);
|
newPart.SetParent(this);
|
||||||
this.m_parts.Add(newPart.UUID, newPart);
|
m_parts.Add(newPart.UUID, newPart);
|
||||||
this.SetPartAsRoot(newPart);
|
SetPartAsRoot(newPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -352,18 +357,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
SceneObjectPart newPart = part.Copy(m_scene.PrimIDAllocate());
|
||||||
newPart.SetParent(this);
|
newPart.SetParent(this);
|
||||||
this.m_parts.Add(newPart.UUID, newPart);
|
m_parts.Add(newPart.UUID, newPart);
|
||||||
this.SetPartAsNonRoot(newPart);
|
SetPartAsNonRoot(newPart);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Scheduling
|
#region Scheduling
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.SendScheduledUpdates();
|
part.SendScheduledUpdates();
|
||||||
}
|
}
|
||||||
|
@ -371,7 +378,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
|
public void ScheduleFullUpdateToAvatar(ScenePresence presence)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.AddFullUpdateToAvatar(presence);
|
part.AddFullUpdateToAvatar(presence);
|
||||||
}
|
}
|
||||||
|
@ -379,7 +386,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
|
public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.AddTerseUpdateToAvatar(presence);
|
part.AddTerseUpdateToAvatar(presence);
|
||||||
}
|
}
|
||||||
|
@ -391,7 +398,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void ScheduleGroupForFullUpdate()
|
public void ScheduleGroupForFullUpdate()
|
||||||
{
|
{
|
||||||
HasChanged = true;
|
HasChanged = true;
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.ScheduleFullUpdate();
|
part.ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
@ -403,7 +410,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void ScheduleGroupForTerseUpdate()
|
public void ScheduleGroupForTerseUpdate()
|
||||||
{
|
{
|
||||||
HasChanged = true;
|
HasChanged = true;
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.ScheduleTerseUpdate();
|
part.ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
@ -415,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SendGroupFullUpdate()
|
public void SendGroupFullUpdate()
|
||||||
{
|
{
|
||||||
HasChanged = true;
|
HasChanged = true;
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.SendFullUpdateToAllClients();
|
part.SendFullUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
@ -427,7 +434,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SendGroupTerseUpdate()
|
public void SendGroupTerseUpdate()
|
||||||
{
|
{
|
||||||
HasChanged = true;
|
HasChanged = true;
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.SendTerseUpdateToAllClients();
|
part.SendTerseUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
@ -436,6 +443,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region SceneGroupPart Methods
|
#region SceneGroupPart Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -444,9 +452,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public SceneObjectPart GetChildPart(LLUUID primID)
|
public SceneObjectPart GetChildPart(LLUUID primID)
|
||||||
{
|
{
|
||||||
SceneObjectPart childPart = null;
|
SceneObjectPart childPart = null;
|
||||||
if (this.m_parts.ContainsKey(primID))
|
if (m_parts.ContainsKey(primID))
|
||||||
{
|
{
|
||||||
childPart = this.m_parts[primID];
|
childPart = m_parts[primID];
|
||||||
}
|
}
|
||||||
return childPart;
|
return childPart;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +466,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public SceneObjectPart GetChildPart(uint localID)
|
public SceneObjectPart GetChildPart(uint localID)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (part.LocalID == localID)
|
if (part.LocalID == localID)
|
||||||
{
|
{
|
||||||
|
@ -477,9 +485,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public bool HasChildPrim(LLUUID primID)
|
public bool HasChildPrim(LLUUID primID)
|
||||||
{
|
{
|
||||||
SceneObjectPart childPart = null;
|
SceneObjectPart childPart = null;
|
||||||
if (this.m_parts.ContainsKey(primID))
|
if (m_parts.ContainsKey(primID))
|
||||||
{
|
{
|
||||||
childPart = this.m_parts[primID];
|
childPart = m_parts[primID];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -493,7 +501,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool HasChildPrim(uint localID)
|
public bool HasChildPrim(uint localID)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (part.LocalID == localID)
|
if (part.LocalID == localID)
|
||||||
{
|
{
|
||||||
|
@ -502,9 +510,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Packet Handlers
|
#region Packet Handlers
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -512,21 +522,28 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void LinkToGroup(SceneObjectGroup objectGroup)
|
public void LinkToGroup(SceneObjectGroup objectGroup)
|
||||||
{
|
{
|
||||||
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
||||||
Axiom.Math.Vector3 oldGroupPosition = new Vector3(linkPart.GroupPosition.X, linkPart.GroupPosition.Y, linkPart.GroupPosition.Z);
|
Vector3 oldGroupPosition =
|
||||||
Axiom.Math.Quaternion oldRootRotation = new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, linkPart.RotationOffset.Z);
|
new Vector3(linkPart.GroupPosition.X, linkPart.GroupPosition.Y, linkPart.GroupPosition.Z);
|
||||||
|
Quaternion oldRootRotation =
|
||||||
|
new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
|
||||||
|
linkPart.RotationOffset.Z);
|
||||||
|
|
||||||
linkPart.OffsetPosition = linkPart.GroupPosition - this.AbsolutePosition;
|
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
|
||||||
linkPart.GroupPosition = this.AbsolutePosition;
|
linkPart.GroupPosition = AbsolutePosition;
|
||||||
|
|
||||||
Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z);
|
Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z);
|
||||||
Quaternion parentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
|
Quaternion parentRot =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
axPos = parentRot.Inverse()*axPos;
|
axPos = parentRot.Inverse()*axPos;
|
||||||
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
linkPart.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
||||||
Quaternion oldRot = new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y, linkPart.RotationOffset.Z);
|
Quaternion oldRot =
|
||||||
|
new Quaternion(linkPart.RotationOffset.W, linkPart.RotationOffset.X, linkPart.RotationOffset.Y,
|
||||||
|
linkPart.RotationOffset.Z);
|
||||||
Quaternion newRot = parentRot.Inverse()*oldRot;
|
Quaternion newRot = parentRot.Inverse()*oldRot;
|
||||||
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
linkPart.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
||||||
linkPart.ParentID = this.m_rootPart.LocalID;
|
linkPart.ParentID = m_rootPart.LocalID;
|
||||||
this.m_parts.Add(linkPart.UUID, linkPart);
|
m_parts.Add(linkPart.UUID, linkPart);
|
||||||
linkPart.SetParent(this);
|
linkPart.SetParent(this);
|
||||||
|
|
||||||
if (linkPart.PhysActor != null)
|
if (linkPart.PhysActor != null)
|
||||||
|
@ -540,7 +557,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (part.UUID != objectGroup.m_rootPart.UUID)
|
if (part.UUID != objectGroup.m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
this.LinkNonRootPart(part, oldGroupPosition, oldRootRotation);
|
LinkNonRootPart(part, oldGroupPosition, oldRootRotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -549,7 +566,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_scene.DeleteEntity(objectGroup.UUID);
|
m_scene.DeleteEntity(objectGroup.UUID);
|
||||||
|
|
||||||
objectGroup.DeleteParts();
|
objectGroup.DeleteParts();
|
||||||
this.ScheduleGroupForFullUpdate();
|
ScheduleGroupForFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DetachFromBackup(SceneObjectGroup objectGroup)
|
private void DetachFromBackup(SceneObjectGroup objectGroup)
|
||||||
|
@ -561,26 +578,31 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation)
|
private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation)
|
||||||
{
|
{
|
||||||
part.SetParent(this);
|
part.SetParent(this);
|
||||||
part.ParentID = this.m_rootPart.LocalID;
|
part.ParentID = m_rootPart.LocalID;
|
||||||
this.m_parts.Add(part.UUID, part);
|
m_parts.Add(part.UUID, part);
|
||||||
|
|
||||||
Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
Vector3 axiomOldPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
||||||
axiomOldPos = oldGroupRotation*axiomOldPos;
|
axiomOldPos = oldGroupRotation*axiomOldPos;
|
||||||
axiomOldPos += oldGroupPosition;
|
axiomOldPos += oldGroupPosition;
|
||||||
LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z);
|
LLVector3 oldAbsolutePosition = new LLVector3(axiomOldPos.x, axiomOldPos.y, axiomOldPos.z);
|
||||||
part.OffsetPosition = oldAbsolutePosition - this.AbsolutePosition;
|
part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
|
||||||
|
|
||||||
Quaternion axiomRootRotation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
|
Quaternion axiomRootRotation =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
|
|
||||||
Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
Vector3 axiomPos = new Vector3(part.OffsetPosition.X, part.OffsetPosition.Y, part.OffsetPosition.Z);
|
||||||
axiomPos = axiomRootRotation.Inverse()*axiomPos;
|
axiomPos = axiomRootRotation.Inverse()*axiomPos;
|
||||||
part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z);
|
part.OffsetPosition = new LLVector3(axiomPos.x, axiomPos.y, axiomPos.z);
|
||||||
|
|
||||||
Quaternion axiomPartRotation = new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y, part.RotationOffset.Z);
|
Quaternion axiomPartRotation =
|
||||||
|
new Quaternion(part.RotationOffset.W, part.RotationOffset.X, part.RotationOffset.Y,
|
||||||
|
part.RotationOffset.Z);
|
||||||
|
|
||||||
axiomPartRotation = oldGroupRotation*axiomPartRotation;
|
axiomPartRotation = oldGroupRotation*axiomPartRotation;
|
||||||
axiomPartRotation = axiomRootRotation.Inverse()*axiomPartRotation;
|
axiomPartRotation = axiomRootRotation.Inverse()*axiomPartRotation;
|
||||||
part.RotationOffset = new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
|
part.RotationOffset =
|
||||||
|
new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -591,8 +613,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="remoteClient"></param>
|
/// <param name="remoteClient"></param>
|
||||||
public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
|
public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
this.AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
this.m_rootPart.SendTerseUpdateToAllClients();
|
m_rootPart.SendTerseUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -605,25 +627,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
|
proper.ObjectData = new ObjectPropertiesPacket.ObjectDataBlock[1];
|
||||||
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
|
proper.ObjectData[0] = new ObjectPropertiesPacket.ObjectDataBlock();
|
||||||
proper.ObjectData[0].ItemID = LLUUID.Zero;
|
proper.ObjectData[0].ItemID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].CreationDate = (ulong)this.m_rootPart.CreationDate;
|
proper.ObjectData[0].CreationDate = (ulong) m_rootPart.CreationDate;
|
||||||
proper.ObjectData[0].CreatorID = this.m_rootPart.CreatorID;
|
proper.ObjectData[0].CreatorID = m_rootPart.CreatorID;
|
||||||
proper.ObjectData[0].FolderID = LLUUID.Zero;
|
proper.ObjectData[0].FolderID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].FromTaskID = LLUUID.Zero;
|
proper.ObjectData[0].FromTaskID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].GroupID = LLUUID.Zero;
|
proper.ObjectData[0].GroupID = LLUUID.Zero;
|
||||||
proper.ObjectData[0].InventorySerial = (short)this.m_rootPart.InventorySerial;
|
proper.ObjectData[0].InventorySerial = (short) m_rootPart.InventorySerial;
|
||||||
proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID;
|
proper.ObjectData[0].LastOwnerID = m_rootPart.LastOwnerID;
|
||||||
proper.ObjectData[0].ObjectID = this.UUID;
|
proper.ObjectData[0].ObjectID = UUID;
|
||||||
proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID;
|
proper.ObjectData[0].OwnerID = m_rootPart.OwnerID;
|
||||||
proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0");
|
proper.ObjectData[0].TouchName = enc.GetBytes(m_rootPart.TouchName + "\0");
|
||||||
proper.ObjectData[0].TextureID = new byte[0];
|
proper.ObjectData[0].TextureID = new byte[0];
|
||||||
proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0");
|
proper.ObjectData[0].SitName = enc.GetBytes(m_rootPart.SitName + "\0");
|
||||||
proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.Name + "\0");
|
proper.ObjectData[0].Name = enc.GetBytes(m_rootPart.Name + "\0");
|
||||||
proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0");
|
proper.ObjectData[0].Description = enc.GetBytes(m_rootPart.Description + "\0");
|
||||||
proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask;
|
proper.ObjectData[0].OwnerMask = m_rootPart.OwnerMask;
|
||||||
proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask;
|
proper.ObjectData[0].NextOwnerMask = m_rootPart.NextOwnerMask;
|
||||||
proper.ObjectData[0].GroupMask = this.m_rootPart.GroupMask;
|
proper.ObjectData[0].GroupMask = m_rootPart.GroupMask;
|
||||||
proper.ObjectData[0].EveryoneMask = this.m_rootPart.EveryoneMask;
|
proper.ObjectData[0].EveryoneMask = m_rootPart.EveryoneMask;
|
||||||
proper.ObjectData[0].BaseMask = this.m_rootPart.BaseMask;
|
proper.ObjectData[0].BaseMask = m_rootPart.BaseMask;
|
||||||
|
|
||||||
client.OutPacket(proper);
|
client.OutPacket(proper);
|
||||||
}
|
}
|
||||||
|
@ -635,7 +657,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SetPartName(string name, uint localID)
|
public void SetPartName(string name, uint localID)
|
||||||
{
|
{
|
||||||
name = name.Remove(name.Length - 1, 1);
|
name = name.Remove(name.Length - 1, 1);
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.Name = name;
|
part.Name = name;
|
||||||
|
@ -644,7 +666,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SetPartDescription(string des, uint localID)
|
public void SetPartDescription(string des, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.Description = des;
|
part.Description = des;
|
||||||
|
@ -653,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SetPartText(string text, uint localID)
|
public void SetPartText(string text, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.Text = text;
|
part.Text = text;
|
||||||
|
@ -662,7 +684,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void SetPartText(string text, LLUUID partID)
|
public void SetPartText(string text, LLUUID partID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(partID);
|
SceneObjectPart part = GetChildPart(partID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.Text = text;
|
part.Text = text;
|
||||||
|
@ -671,7 +693,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public string GetPartName(uint localID)
|
public string GetPartName(uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
return part.Name;
|
return part.Name;
|
||||||
|
@ -681,7 +703,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public string GetPartDescription(uint localID)
|
public string GetPartDescription(uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
return part.Description;
|
return part.Description;
|
||||||
|
@ -696,7 +718,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID)
|
public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
return part.GetInventoryFileName(remoteClient, localID);
|
return part.GetInventoryFileName(remoteClient, localID);
|
||||||
|
@ -706,7 +728,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public string RequestInventoryFile(uint localID, IXfer xferManager)
|
public string RequestInventoryFile(uint localID, IXfer xferManager)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.RequestInventoryFile(xferManager);
|
part.RequestInventoryFile(xferManager);
|
||||||
|
@ -716,7 +738,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item)
|
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
|
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
|
||||||
|
@ -732,14 +754,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item, LLUUID copyItemID)
|
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item, LLUUID copyItemID)
|
||||||
{
|
{
|
||||||
if (copyItemID != LLUUID.Zero)
|
if (copyItemID != LLUUID.Zero)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
|
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
|
||||||
|
@ -764,7 +785,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
|
public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
return part.RemoveInventoryItem(remoteClient, localID, itemID);
|
return part.RemoveInventoryItem(remoteClient, localID, itemID);
|
||||||
|
@ -781,7 +802,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="data"></param>
|
/// <param name="data"></param>
|
||||||
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
|
public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.UpdateExtraParam(type, inUse, data);
|
part.UpdateExtraParam(type, inUse, data);
|
||||||
|
@ -795,30 +816,34 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="textureEntry"></param>
|
/// <param name="textureEntry"></param>
|
||||||
public void UpdateTextureEntry(uint localID, byte[] textureEntry)
|
public void UpdateTextureEntry(uint localID, byte[] textureEntry)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.UpdateTextureEntry(textureEntry);
|
part.UpdateTextureEntry(textureEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Shape
|
#region Shape
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shapeBlock"></param>
|
/// <param name="shapeBlock"></param>
|
||||||
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
|
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.UpdateShape(shapeBlock);
|
part.UpdateShape(shapeBlock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Resize
|
#region Resize
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -826,30 +851,33 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
public void Resize(LLVector3 scale, uint localID)
|
public void Resize(LLVector3 scale, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
part.Resize(scale);
|
part.Resize(scale);
|
||||||
if (part.UUID == this.m_rootPart.UUID)
|
if (part.UUID == m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
if (m_rootPart.PhysActor != null)
|
if (m_rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
m_rootPart.PhysActor.Size = new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z);
|
m_rootPart.PhysActor.Size =
|
||||||
|
new PhysicsVector(m_rootPart.Scale.X, m_rootPart.Scale.Y, m_rootPart.Scale.Z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Position
|
#region Position
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
public void UpdateGroupPosition(LLVector3 pos)
|
public void UpdateGroupPosition(LLVector3 pos)
|
||||||
{
|
{
|
||||||
this.AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
this.ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -859,12 +887,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
public void UpdateSinglePosition(LLVector3 pos, uint localID)
|
public void UpdateSinglePosition(LLVector3 pos, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
if (part.UUID == this.m_rootPart.UUID)
|
if (part.UUID == m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
this.UpdateRootPosition(pos);
|
UpdateRootPosition(pos);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -880,40 +908,49 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private void UpdateRootPosition(LLVector3 pos)
|
private void UpdateRootPosition(LLVector3 pos)
|
||||||
{
|
{
|
||||||
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
||||||
LLVector3 oldPos = new LLVector3(this.AbsolutePosition.X + this.m_rootPart.OffsetPosition.X, this.AbsolutePosition.Y + this.m_rootPart.OffsetPosition.Y, this.AbsolutePosition.Z + this.m_rootPart.OffsetPosition.Z);
|
LLVector3 oldPos =
|
||||||
|
new LLVector3(AbsolutePosition.X + m_rootPart.OffsetPosition.X,
|
||||||
|
AbsolutePosition.Y + m_rootPart.OffsetPosition.Y,
|
||||||
|
AbsolutePosition.Z + m_rootPart.OffsetPosition.Z);
|
||||||
LLVector3 diff = oldPos - newPos;
|
LLVector3 diff = oldPos - newPos;
|
||||||
Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
|
Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z);
|
||||||
Axiom.Math.Quaternion partRotation = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
|
Quaternion partRotation =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
axDiff = partRotation.Inverse()*axDiff;
|
axDiff = partRotation.Inverse()*axDiff;
|
||||||
diff.X = axDiff.x;
|
diff.X = axDiff.x;
|
||||||
diff.Y = axDiff.y;
|
diff.Y = axDiff.y;
|
||||||
diff.Z = axDiff.z;
|
diff.Z = axDiff.z;
|
||||||
|
|
||||||
foreach (SceneObjectPart obPart in this.m_parts.Values)
|
foreach (SceneObjectPart obPart in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (obPart.UUID != this.m_rootPart.UUID)
|
if (obPart.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
obPart.OffsetPosition = obPart.OffsetPosition + diff;
|
obPart.OffsetPosition = obPart.OffsetPosition + diff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.AbsolutePosition = newPos;
|
AbsolutePosition = newPos;
|
||||||
this.ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Rotation
|
#region Rotation
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rot"></param>
|
/// <param name="rot"></param>
|
||||||
public void UpdateGroupRotation(LLQuaternion rot)
|
public void UpdateGroupRotation(LLQuaternion rot)
|
||||||
{
|
{
|
||||||
this.m_rootPart.UpdateRotation(rot);
|
m_rootPart.UpdateRotation(rot);
|
||||||
if (m_rootPart.PhysActor != null)
|
if (m_rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
|
m_rootPart.PhysActor.Orientation =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
}
|
}
|
||||||
this.ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -923,13 +960,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="rot"></param>
|
/// <param name="rot"></param>
|
||||||
public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot)
|
public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot)
|
||||||
{
|
{
|
||||||
this.m_rootPart.UpdateRotation(rot);
|
m_rootPart.UpdateRotation(rot);
|
||||||
if (m_rootPart.PhysActor != null)
|
if (m_rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
|
m_rootPart.PhysActor.Orientation =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
}
|
}
|
||||||
this.AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
this.ScheduleGroupForTerseUpdate();
|
ScheduleGroupForTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -939,12 +978,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
public void UpdateSingleRotation(LLQuaternion rot, uint localID)
|
public void UpdateSingleRotation(LLQuaternion rot, uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
if (part.UUID == this.m_rootPart.UUID)
|
if (part.UUID == m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
this.UpdateRootRotation(rot);
|
UpdateRootRotation(rot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -959,40 +998,48 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="rot"></param>
|
/// <param name="rot"></param>
|
||||||
private void UpdateRootRotation(LLQuaternion rot)
|
private void UpdateRootRotation(LLQuaternion rot)
|
||||||
{
|
{
|
||||||
Axiom.Math.Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
|
Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z);
|
||||||
Axiom.Math.Quaternion oldParentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z);
|
Quaternion oldParentRot =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
|
|
||||||
this.m_rootPart.UpdateRotation(rot);
|
m_rootPart.UpdateRotation(rot);
|
||||||
if (m_rootPart.PhysActor != null)
|
if (m_rootPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
m_rootPart.PhysActor.Orientation = new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y, m_rootPart.RotationOffset.Z);
|
m_rootPart.PhysActor.Orientation =
|
||||||
|
new Quaternion(m_rootPart.RotationOffset.W, m_rootPart.RotationOffset.X, m_rootPart.RotationOffset.Y,
|
||||||
|
m_rootPart.RotationOffset.Z);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (SceneObjectPart prim in this.m_parts.Values)
|
foreach (SceneObjectPart prim in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (prim.UUID != this.m_rootPart.UUID)
|
if (prim.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
|
Vector3 axPos = new Vector3(prim.OffsetPosition.X, prim.OffsetPosition.Y, prim.OffsetPosition.Z);
|
||||||
axPos = oldParentRot*axPos;
|
axPos = oldParentRot*axPos;
|
||||||
axPos = axRot.Inverse()*axPos;
|
axPos = axRot.Inverse()*axPos;
|
||||||
prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
prim.OffsetPosition = new LLVector3(axPos.x, axPos.y, axPos.z);
|
||||||
Axiom.Math.Quaternion primsRot = new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y, prim.RotationOffset.Z);
|
Quaternion primsRot =
|
||||||
Axiom.Math.Quaternion newRot = oldParentRot * primsRot;
|
new Quaternion(prim.RotationOffset.W, prim.RotationOffset.X, prim.RotationOffset.Y,
|
||||||
|
prim.RotationOffset.Z);
|
||||||
|
Quaternion newRot = oldParentRot*primsRot;
|
||||||
newRot = axRot.Inverse()*newRot;
|
newRot = axRot.Inverse()*newRot;
|
||||||
prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
prim.RotationOffset = new LLQuaternion(newRot.x, newRot.y, newRot.z, newRot.w);
|
||||||
prim.ScheduleTerseUpdate();
|
prim.ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.m_rootPart.ScheduleTerseUpdate();
|
m_rootPart.ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
private void SetPartAsRoot(SceneObjectPart part)
|
private void SetPartAsRoot(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
this.m_rootPart = part;
|
m_rootPart = part;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1001,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
private void SetPartAsNonRoot(SceneObjectPart part)
|
private void SetPartAsNonRoot(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
part.ParentID = this.m_rootPart.LocalID;
|
part.ParentID = m_rootPart.LocalID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1014,6 +1061,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1021,7 +1069,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (OnPrimCountTainted != null)
|
if (OnPrimCountTainted != null)
|
||||||
{
|
{
|
||||||
this.OnPrimCountTainted();
|
OnPrimCountTainted();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,7 +1077,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// Processes backup
|
/// Processes backup
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="datastore"></param>
|
/// <param name="datastore"></param>
|
||||||
public void ProcessBackup(OpenSim.Region.Environment.Interfaces.IRegionDataStore datastore)
|
public void ProcessBackup(IRegionDataStore datastore)
|
||||||
{
|
{
|
||||||
if (HasChanged)
|
if (HasChanged)
|
||||||
{
|
{
|
||||||
|
@ -1037,16 +1085,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
HasChanged = false;
|
HasChanged = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Client Updating
|
#region Client Updating
|
||||||
|
|
||||||
public void SendFullUpdateToClient(IClientAPI remoteClient)
|
public void SendFullUpdateToClient(IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
lock (this.m_parts)
|
lock (m_parts)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
this.SendPartFullUpdate(remoteClient, part);
|
SendPartFullUpdate(remoteClient, part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1084,6 +1134,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
part.SendTerseUpdateToClient(remoteClient);
|
part.SendTerseUpdateToClient(remoteClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public override void UpdateMovement()
|
public override void UpdateMovement()
|
||||||
|
@ -1114,7 +1165,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void AddPart(SceneObjectPart part)
|
public void AddPart(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
part.SetParent(this);
|
part.SetParent(this);
|
||||||
this.m_parts.Add(part.UUID, part);
|
m_parts.Add(part.UUID, part);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1122,18 +1173,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateParentIDs()
|
public void UpdateParentIDs()
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
if (part.UUID != this.m_rootPart.UUID)
|
if (part.UUID != m_rootPart.UUID)
|
||||||
{
|
{
|
||||||
part.ParentID = this.m_rootPart.LocalID;
|
part.ParentID = m_rootPart.LocalID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegenerateFullIDs()
|
public void RegenerateFullIDs()
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
part.UUID = LLUUID.Random();
|
part.UUID = LLUUID.Random();
|
||||||
}
|
}
|
||||||
|
@ -1141,7 +1192,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public LLUUID GetPartsFullID(uint localID)
|
public LLUUID GetPartsFullID(uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = this.GetChildPart(localID);
|
SceneObjectPart part = GetChildPart(localID);
|
||||||
if (part != null)
|
if (part != null)
|
||||||
{
|
{
|
||||||
return part.UUID;
|
return part.UUID;
|
||||||
|
@ -1175,26 +1226,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
|
public virtual void OnGrabGroup(LLVector3 offsetPos, IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteGroup()
|
public void DeleteGroup()
|
||||||
{
|
{
|
||||||
DetachFromBackup(this);
|
DetachFromBackup(this);
|
||||||
foreach (SceneObjectPart part in this.m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.RequestSceneAvatars();
|
List<ScenePresence> avatars = RequestSceneAvatars();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].ControllingClient.SendKillObject(this.m_regionHandle, part.LocalID);
|
avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteParts()
|
public void DeleteParts()
|
||||||
{
|
{
|
||||||
this.m_rootPart = null;
|
m_rootPart = null;
|
||||||
this.m_parts.Clear();
|
m_parts.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SetText(string text, Vector3 color, double alpha)
|
public override void SetText(string text, Vector3 color, double alpha)
|
||||||
|
|
|
@ -1,23 +1,19 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using System.IO;
|
|
||||||
using System;
|
|
||||||
using Axiom.Math;
|
using Axiom.Math;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
using OpenSim.Framework.Interfaces;
|
using OpenSim.Framework.Interfaces;
|
||||||
using OpenSim.Framework.Types;
|
using OpenSim.Framework.Types;
|
||||||
using OpenSim.Framework.Utilities;
|
using OpenSim.Framework.Utilities;
|
||||||
using OpenSim.Region.Environment.Scenes.Scripting;
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Region.Physics.Manager;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes.Scripting;
|
||||||
|
using OpenSim.Region.Physics.Manager;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes
|
namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
|
|
||||||
public class SceneObjectPart : IScriptHost
|
public class SceneObjectPart : IScriptHost
|
||||||
{
|
{
|
||||||
private const uint FULL_MASK_PERMISSIONS = 2147483647;
|
private const uint FULL_MASK_PERMISSIONS = 2147483647;
|
||||||
|
@ -25,8 +21,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private string m_inventoryFileName = "";
|
private string m_inventoryFileName = "";
|
||||||
private LLUUID m_folderID = LLUUID.Zero;
|
private LLUUID m_folderID = LLUUID.Zero;
|
||||||
|
|
||||||
[XmlIgnore]
|
[XmlIgnore] public PhysicsActor PhysActor = null;
|
||||||
public PhysicsActor PhysActor = null;
|
|
||||||
|
|
||||||
protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>();
|
protected Dictionary<LLUUID, TaskInventoryItem> TaskInventory = new Dictionary<LLUUID, TaskInventoryItem>();
|
||||||
|
|
||||||
|
@ -57,19 +52,25 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
public LLUUID CreatorID;
|
public LLUUID CreatorID;
|
||||||
public LLUUID ObjectCreator { get { return CreatorID; } }
|
|
||||||
|
public LLUUID ObjectCreator
|
||||||
|
{
|
||||||
|
get { return CreatorID; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serial count for inventory file , used to tell if inventory has changed
|
/// Serial count for inventory file , used to tell if inventory has changed
|
||||||
/// no need for this to be part of Database backup
|
/// no need for this to be part of Database backup
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected uint m_inventorySerial = 0;
|
protected uint m_inventorySerial = 0;
|
||||||
|
|
||||||
public uint InventorySerial
|
public uint InventorySerial
|
||||||
{
|
{
|
||||||
get { return m_inventorySerial; }
|
get { return m_inventorySerial; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLUUID m_uuid;
|
protected LLUUID m_uuid;
|
||||||
|
|
||||||
public LLUUID UUID
|
public LLUUID UUID
|
||||||
{
|
{
|
||||||
get { return m_uuid; }
|
get { return m_uuid; }
|
||||||
|
@ -77,6 +78,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected uint m_localID;
|
protected uint m_localID;
|
||||||
|
|
||||||
public uint LocalID
|
public uint LocalID
|
||||||
{
|
{
|
||||||
get { return m_localID; }
|
get { return m_localID; }
|
||||||
|
@ -84,6 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected string m_name;
|
protected string m_name;
|
||||||
|
|
||||||
public virtual string Name
|
public virtual string Name
|
||||||
{
|
{
|
||||||
get { return m_name; }
|
get { return m_name; }
|
||||||
|
@ -91,6 +94,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLObject.ObjectFlags m_flags;
|
protected LLObject.ObjectFlags m_flags;
|
||||||
|
|
||||||
public uint ObjectFlags
|
public uint ObjectFlags
|
||||||
{
|
{
|
||||||
get { return (uint) m_flags; }
|
get { return (uint) m_flags; }
|
||||||
|
@ -98,6 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLObject.MaterialType m_material;
|
protected LLObject.MaterialType m_material;
|
||||||
|
|
||||||
public byte Material
|
public byte Material
|
||||||
{
|
{
|
||||||
get { return (byte) m_material; }
|
get { return (byte) m_material; }
|
||||||
|
@ -105,6 +110,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ulong m_regionHandle;
|
protected ulong m_regionHandle;
|
||||||
|
|
||||||
public ulong RegionHandle
|
public ulong RegionHandle
|
||||||
{
|
{
|
||||||
get { return m_regionHandle; }
|
get { return m_regionHandle; }
|
||||||
|
@ -113,6 +119,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
//unkown if this will be kept, added as a way of removing the group position from the group class
|
//unkown if this will be kept, added as a way of removing the group position from the group class
|
||||||
protected LLVector3 m_groupPosition;
|
protected LLVector3 m_groupPosition;
|
||||||
|
|
||||||
public LLVector3 GroupPosition
|
public LLVector3 GroupPosition
|
||||||
{
|
{
|
||||||
get { return m_groupPosition; }
|
get { return m_groupPosition; }
|
||||||
|
@ -120,6 +127,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_offsetPosition;
|
protected LLVector3 m_offsetPosition;
|
||||||
|
|
||||||
public LLVector3 OffsetPosition
|
public LLVector3 OffsetPosition
|
||||||
{
|
{
|
||||||
get { return m_offsetPosition; }
|
get { return m_offsetPosition; }
|
||||||
|
@ -132,6 +140,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLQuaternion m_rotationOffset;
|
protected LLQuaternion m_rotationOffset;
|
||||||
|
|
||||||
public LLQuaternion RotationOffset
|
public LLQuaternion RotationOffset
|
||||||
{
|
{
|
||||||
get { return m_rotationOffset; }
|
get { return m_rotationOffset; }
|
||||||
|
@ -139,6 +148,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_velocity;
|
protected LLVector3 m_velocity;
|
||||||
|
|
||||||
/// <summary></summary>
|
/// <summary></summary>
|
||||||
public LLVector3 Velocity
|
public LLVector3 Velocity
|
||||||
{
|
{
|
||||||
|
@ -147,6 +157,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_angularVelocity;
|
protected LLVector3 m_angularVelocity;
|
||||||
|
|
||||||
/// <summary></summary>
|
/// <summary></summary>
|
||||||
public LLVector3 AngularVelocity
|
public LLVector3 AngularVelocity
|
||||||
{
|
{
|
||||||
|
@ -155,6 +166,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLVector3 m_acceleration;
|
protected LLVector3 m_acceleration;
|
||||||
|
|
||||||
/// <summary></summary>
|
/// <summary></summary>
|
||||||
public LLVector3 Acceleration
|
public LLVector3 Acceleration
|
||||||
{
|
{
|
||||||
|
@ -163,13 +175,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_description = "";
|
private string m_description = "";
|
||||||
|
|
||||||
public string Description
|
public string Description
|
||||||
{
|
{
|
||||||
get { return this.m_description; }
|
get { return m_description; }
|
||||||
set { this.m_description = value; }
|
set { m_description = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_text = "";
|
private string m_text = "";
|
||||||
|
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get { return m_text; }
|
get { return m_text; }
|
||||||
|
@ -181,6 +195,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_sitName = "";
|
private string m_sitName = "";
|
||||||
|
|
||||||
public string SitName
|
public string SitName
|
||||||
{
|
{
|
||||||
get { return m_sitName; }
|
get { return m_sitName; }
|
||||||
|
@ -188,6 +203,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_touchName = "";
|
private string m_touchName = "";
|
||||||
|
|
||||||
public string TouchName
|
public string TouchName
|
||||||
{
|
{
|
||||||
get { return m_touchName; }
|
get { return m_touchName; }
|
||||||
|
@ -195,17 +211,19 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
protected PrimitiveBaseShape m_shape;
|
protected PrimitiveBaseShape m_shape;
|
||||||
|
|
||||||
public PrimitiveBaseShape Shape
|
public PrimitiveBaseShape Shape
|
||||||
{
|
{
|
||||||
get { return this.m_shape; }
|
get { return m_shape; }
|
||||||
set { m_shape = value; }
|
set { m_shape = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLVector3 Scale
|
public LLVector3 Scale
|
||||||
{
|
{
|
||||||
set { this.m_shape.Scale = value; }
|
set { m_shape.Scale = value; }
|
||||||
get { return this.m_shape.Scale; }
|
get { return m_shape.Scale; }
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public LLUUID ObjectOwner
|
public LLUUID ObjectOwner
|
||||||
|
@ -219,12 +237,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public SceneObjectPart()
|
public SceneObjectPart()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -236,26 +254,27 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
/// <param name="shape"></param>
|
/// <param name="shape"></param>
|
||||||
/// <param name="position"></param>
|
/// <param name="position"></param>
|
||||||
public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition)
|
public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
|
||||||
|
PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition)
|
||||||
{
|
{
|
||||||
this.m_name = "Primitive";
|
m_name = "Primitive";
|
||||||
this.m_regionHandle = regionHandle;
|
m_regionHandle = regionHandle;
|
||||||
this.m_parentGroup = parent;
|
m_parentGroup = parent;
|
||||||
|
|
||||||
this.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
|
||||||
this.OwnerID = ownerID;
|
OwnerID = ownerID;
|
||||||
this.CreatorID = this.OwnerID;
|
CreatorID = OwnerID;
|
||||||
this.LastOwnerID = LLUUID.Zero;
|
LastOwnerID = LLUUID.Zero;
|
||||||
this.UUID = LLUUID.Random();
|
UUID = LLUUID.Random();
|
||||||
this.LocalID = (uint)(localID);
|
LocalID = (uint) (localID);
|
||||||
this.Shape = shape;
|
Shape = shape;
|
||||||
|
|
||||||
this.GroupPosition = groupPosition;
|
GroupPosition = groupPosition;
|
||||||
this.OffsetPosition = offsetPosition;
|
OffsetPosition = offsetPosition;
|
||||||
this.RotationOffset = LLQuaternion.Identity;
|
RotationOffset = LLQuaternion.Identity;
|
||||||
this.Velocity = new LLVector3(0, 0, 0);
|
Velocity = new LLVector3(0, 0, 0);
|
||||||
this.AngularVelocity = new LLVector3(0, 0, 0);
|
AngularVelocity = new LLVector3(0, 0, 0);
|
||||||
this.Acceleration = new LLVector3(0, 0, 0);
|
Acceleration = new LLVector3(0, 0, 0);
|
||||||
|
|
||||||
m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
|
m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
|
||||||
m_folderID = LLUUID.Random();
|
m_folderID = LLUUID.Random();
|
||||||
|
@ -283,23 +302,26 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
/// <param name="shape"></param>
|
/// <param name="shape"></param>
|
||||||
/// <param name="position"></param>
|
/// <param name="position"></param>
|
||||||
public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, LLUUID ownerID, LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, LLVector3 position, LLQuaternion rotation, uint flags)
|
public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, LLUUID ownerID,
|
||||||
|
LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape,
|
||||||
|
LLVector3 position, LLQuaternion rotation, uint flags)
|
||||||
{
|
{
|
||||||
this.m_regionHandle = regionHandle;
|
m_regionHandle = regionHandle;
|
||||||
this.m_parentGroup = parent;
|
m_parentGroup = parent;
|
||||||
|
|
||||||
this.CreationDate = creationDate;
|
CreationDate = creationDate;
|
||||||
this.OwnerID = ownerID;
|
OwnerID = ownerID;
|
||||||
this.CreatorID = creatorID;
|
CreatorID = creatorID;
|
||||||
this.LastOwnerID = lastOwnerID;
|
LastOwnerID = lastOwnerID;
|
||||||
this.UUID = LLUUID.Random();
|
UUID = LLUUID.Random();
|
||||||
this.LocalID = (uint)(localID);
|
LocalID = (uint) (localID);
|
||||||
this.Shape = shape;
|
Shape = shape;
|
||||||
|
|
||||||
this.OffsetPosition = position;
|
OffsetPosition = position;
|
||||||
this.RotationOffset = rotation;
|
RotationOffset = rotation;
|
||||||
this.ObjectFlags = flags;
|
ObjectFlags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -329,7 +351,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SetParent(SceneObjectGroup parent)
|
public void SetParent(SceneObjectGroup parent)
|
||||||
{
|
{
|
||||||
m_parentGroup = parent;
|
m_parentGroup = parent;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID GetRootPartUUID()
|
public LLUUID GetRootPartUUID()
|
||||||
|
@ -342,34 +363,38 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Copying
|
#region Copying
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public SceneObjectPart Copy(uint localID)
|
public SceneObjectPart Copy(uint localID)
|
||||||
{
|
{
|
||||||
SceneObjectPart dupe = (SceneObjectPart)this.MemberwiseClone();
|
SceneObjectPart dupe = (SceneObjectPart) MemberwiseClone();
|
||||||
dupe.m_shape = m_shape.Copy();
|
dupe.m_shape = m_shape.Copy();
|
||||||
dupe.m_regionHandle = m_regionHandle;
|
dupe.m_regionHandle = m_regionHandle;
|
||||||
dupe.UUID = LLUUID.Random();
|
dupe.UUID = LLUUID.Random();
|
||||||
dupe.LocalID = localID;
|
dupe.LocalID = localID;
|
||||||
dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z);
|
dupe.GroupPosition = new LLVector3(GroupPosition.X, GroupPosition.Y, GroupPosition.Z);
|
||||||
dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z);
|
dupe.OffsetPosition = new LLVector3(OffsetPosition.X, OffsetPosition.Y, OffsetPosition.Z);
|
||||||
dupe.RotationOffset = new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W);
|
dupe.RotationOffset =
|
||||||
|
new LLQuaternion(RotationOffset.X, RotationOffset.Y, RotationOffset.Z, RotationOffset.W);
|
||||||
dupe.Velocity = new LLVector3(0, 0, 0);
|
dupe.Velocity = new LLVector3(0, 0, 0);
|
||||||
dupe.Acceleration = new LLVector3(0, 0, 0);
|
dupe.Acceleration = new LLVector3(0, 0, 0);
|
||||||
dupe.AngularVelocity = new LLVector3(0, 0, 0);
|
dupe.AngularVelocity = new LLVector3(0, 0, 0);
|
||||||
dupe.ObjectFlags = this.ObjectFlags;
|
dupe.ObjectFlags = ObjectFlags;
|
||||||
|
|
||||||
byte[] extraP = new byte[this.Shape.ExtraParams.Length];
|
byte[] extraP = new byte[Shape.ExtraParams.Length];
|
||||||
Array.Copy(this.Shape.ExtraParams, extraP, extraP.Length);
|
Array.Copy(Shape.ExtraParams, extraP, extraP.Length);
|
||||||
dupe.Shape.ExtraParams = extraP;
|
dupe.Shape.ExtraParams = extraP;
|
||||||
|
|
||||||
return dupe;
|
return dupe;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Update Scheduling
|
#region Update Scheduling
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -387,7 +412,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
m_parentGroup.HasChanged = true;
|
m_parentGroup.HasChanged = true;
|
||||||
}
|
}
|
||||||
this.TimeStampFull =(uint) Util.UnixTimeSinceEpoch();
|
TimeStampFull = (uint) Util.UnixTimeSinceEpoch();
|
||||||
m_updateFlag = 2;
|
m_updateFlag = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
m_parentGroup.HasChanged = true;
|
m_parentGroup.HasChanged = true;
|
||||||
}
|
}
|
||||||
this.TimeStampTerse = (uint)Util.UnixTimeSinceEpoch();
|
TimeStampTerse = (uint) Util.UnixTimeSinceEpoch();
|
||||||
m_updateFlag = 1;
|
m_updateFlag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -426,56 +451,60 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Shape
|
#region Shape
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="shapeBlock"></param>
|
/// <param name="shapeBlock"></param>
|
||||||
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
|
public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
|
||||||
{
|
{
|
||||||
this.m_shape.PathBegin = shapeBlock.PathBegin;
|
m_shape.PathBegin = shapeBlock.PathBegin;
|
||||||
this.m_shape.PathEnd = shapeBlock.PathEnd;
|
m_shape.PathEnd = shapeBlock.PathEnd;
|
||||||
this.m_shape.PathScaleX = shapeBlock.PathScaleX;
|
m_shape.PathScaleX = shapeBlock.PathScaleX;
|
||||||
this.m_shape.PathScaleY = shapeBlock.PathScaleY;
|
m_shape.PathScaleY = shapeBlock.PathScaleY;
|
||||||
this.m_shape.PathShearX = shapeBlock.PathShearX;
|
m_shape.PathShearX = shapeBlock.PathShearX;
|
||||||
this.m_shape.PathShearY = shapeBlock.PathShearY;
|
m_shape.PathShearY = shapeBlock.PathShearY;
|
||||||
this.m_shape.PathSkew = shapeBlock.PathSkew;
|
m_shape.PathSkew = shapeBlock.PathSkew;
|
||||||
this.m_shape.ProfileBegin = shapeBlock.ProfileBegin;
|
m_shape.ProfileBegin = shapeBlock.ProfileBegin;
|
||||||
this.m_shape.ProfileEnd = shapeBlock.ProfileEnd;
|
m_shape.ProfileEnd = shapeBlock.ProfileEnd;
|
||||||
this.m_shape.PathCurve = shapeBlock.PathCurve;
|
m_shape.PathCurve = shapeBlock.PathCurve;
|
||||||
this.m_shape.ProfileCurve = shapeBlock.ProfileCurve;
|
m_shape.ProfileCurve = shapeBlock.ProfileCurve;
|
||||||
this.m_shape.ProfileHollow = shapeBlock.ProfileHollow;
|
m_shape.ProfileHollow = shapeBlock.ProfileHollow;
|
||||||
this.m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
|
m_shape.PathRadiusOffset = shapeBlock.PathRadiusOffset;
|
||||||
this.m_shape.PathRevolutions = shapeBlock.PathRevolutions;
|
m_shape.PathRevolutions = shapeBlock.PathRevolutions;
|
||||||
this.m_shape.PathTaperX = shapeBlock.PathTaperX;
|
m_shape.PathTaperX = shapeBlock.PathTaperX;
|
||||||
this.m_shape.PathTaperY = shapeBlock.PathTaperY;
|
m_shape.PathTaperY = shapeBlock.PathTaperY;
|
||||||
this.m_shape.PathTwist = shapeBlock.PathTwist;
|
m_shape.PathTwist = shapeBlock.PathTwist;
|
||||||
this.m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
|
m_shape.PathTwistBegin = shapeBlock.PathTwistBegin;
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Inventory
|
#region Inventory
|
||||||
|
|
||||||
public void AddInventoryItem(TaskInventoryItem item)
|
public void AddInventoryItem(TaskInventoryItem item)
|
||||||
{
|
{
|
||||||
item.parent_id = m_folderID;
|
item.parent_id = m_folderID;
|
||||||
item.creation_date = 1000;
|
item.creation_date = 1000;
|
||||||
item.ParentPartID = this.UUID;
|
item.ParentPartID = UUID;
|
||||||
this.TaskInventory.Add(item.item_id, item);
|
TaskInventory.Add(item.item_id, item);
|
||||||
this.m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
|
public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
|
||||||
{
|
{
|
||||||
if (localID == this.LocalID)
|
if (localID == LocalID)
|
||||||
{
|
{
|
||||||
if (this.TaskInventory.ContainsKey(itemID))
|
if (TaskInventory.ContainsKey(itemID))
|
||||||
{
|
{
|
||||||
string type = TaskInventory[itemID].inv_type;
|
string type = TaskInventory[itemID].inv_type;
|
||||||
this.TaskInventory.Remove(itemID);
|
TaskInventory.Remove(itemID);
|
||||||
this.m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
if (type == "lsltext")
|
if (type == "lsltext")
|
||||||
{
|
{
|
||||||
return 10;
|
return 10;
|
||||||
|
@ -496,16 +525,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="localID"></param>
|
/// <param name="localID"></param>
|
||||||
public bool GetInventoryFileName(IClientAPI client, uint localID)
|
public bool GetInventoryFileName(IClientAPI client, uint localID)
|
||||||
{
|
{
|
||||||
if (localID == this.m_localID)
|
if (localID == m_localID)
|
||||||
{
|
{
|
||||||
if (this.m_inventorySerial > 0)
|
if (m_inventorySerial > 0)
|
||||||
{
|
{
|
||||||
client.SendTaskInventory(this.m_uuid, (short)m_inventorySerial, Helpers.StringToField(m_inventoryFileName));
|
client.SendTaskInventory(m_uuid, (short) m_inventorySerial,
|
||||||
|
Helpers.StringToField(m_inventoryFileName));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
client.SendTaskInventory(this.m_uuid, 0, new byte[0]);
|
client.SendTaskInventory(m_uuid, 0, new byte[0]);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,8 +545,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public string RequestInventoryFile(IXfer xferManager)
|
public string RequestInventoryFile(IXfer xferManager)
|
||||||
{
|
{
|
||||||
byte[] fileData = new byte[0];
|
byte[] fileData = new byte[0];
|
||||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, this.UUID);
|
InventoryStringBuilder invString = new InventoryStringBuilder(m_folderID, UUID);
|
||||||
foreach (TaskInventoryItem item in this.TaskInventory.Values)
|
foreach (TaskInventoryItem item in TaskInventory.Values)
|
||||||
{
|
{
|
||||||
invString.AddItemStart();
|
invString.AddItemStart();
|
||||||
invString.AddNameValueLine("item_id", item.item_id.ToStringHyphenated());
|
invString.AddNameValueLine("item_id", item.item_id.ToStringHyphenated());
|
||||||
|
@ -550,49 +580,56 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ExtraParams
|
#region ExtraParams
|
||||||
|
|
||||||
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
|
public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
|
||||||
{
|
{
|
||||||
this.m_shape.ExtraParams = new byte[data.Length + 7];
|
m_shape.ExtraParams = new byte[data.Length + 7];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
uint length = (uint) data.Length;
|
uint length = (uint) data.Length;
|
||||||
this.m_shape.ExtraParams[i++] = 1;
|
m_shape.ExtraParams[i++] = 1;
|
||||||
this.m_shape.ExtraParams[i++] = (byte)(type % 256);
|
m_shape.ExtraParams[i++] = (byte) (type%256);
|
||||||
this.m_shape.ExtraParams[i++] = (byte)((type >> 8) % 256);
|
m_shape.ExtraParams[i++] = (byte) ((type >> 8)%256);
|
||||||
|
|
||||||
this.m_shape.ExtraParams[i++] = (byte)(length % 256);
|
m_shape.ExtraParams[i++] = (byte) (length%256);
|
||||||
this.m_shape.ExtraParams[i++] = (byte)((length >> 8) % 256);
|
m_shape.ExtraParams[i++] = (byte) ((length >> 8)%256);
|
||||||
this.m_shape.ExtraParams[i++] = (byte)((length >> 16) % 256);
|
m_shape.ExtraParams[i++] = (byte) ((length >> 16)%256);
|
||||||
this.m_shape.ExtraParams[i++] = (byte)((length >> 24) % 256);
|
m_shape.ExtraParams[i++] = (byte) ((length >> 24)%256);
|
||||||
Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length);
|
Array.Copy(data, 0, m_shape.ExtraParams, i, data.Length);
|
||||||
|
|
||||||
this.ScheduleFullUpdate();
|
|
||||||
|
|
||||||
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Texture
|
#region Texture
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="textureEntry"></param>
|
/// <param name="textureEntry"></param>
|
||||||
public void UpdateTextureEntry(byte[] textureEntry)
|
public void UpdateTextureEntry(byte[] textureEntry)
|
||||||
{
|
{
|
||||||
this.m_shape.TextureEntry = textureEntry;
|
m_shape.TextureEntry = textureEntry;
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ParticleSystem
|
#region ParticleSystem
|
||||||
public void AddNewParticleSystem(libsecondlife.Primitive.ParticleSystem pSystem)
|
|
||||||
|
public void AddNewParticleSystem(Primitive.ParticleSystem pSystem)
|
||||||
{
|
{
|
||||||
this.m_particleSystem = pSystem.GetBytes();
|
m_particleSystem = pSystem.GetBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Position
|
#region Position
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -600,42 +637,48 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void UpdateOffSet(LLVector3 pos)
|
public void UpdateOffSet(LLVector3 pos)
|
||||||
{
|
{
|
||||||
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
||||||
this.OffsetPosition = newPos;
|
OffsetPosition = newPos;
|
||||||
ScheduleTerseUpdate();
|
ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateGroupPosition(LLVector3 pos)
|
public void UpdateGroupPosition(LLVector3 pos)
|
||||||
{
|
{
|
||||||
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
|
||||||
this.GroupPosition = newPos;
|
GroupPosition = newPos;
|
||||||
ScheduleTerseUpdate();
|
ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region rotation
|
#region rotation
|
||||||
|
|
||||||
public void UpdateRotation(LLQuaternion rot)
|
public void UpdateRotation(LLQuaternion rot)
|
||||||
{
|
{
|
||||||
this.RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W);
|
RotationOffset = new LLQuaternion(rot.X, rot.Y, rot.Z, rot.W);
|
||||||
ScheduleTerseUpdate();
|
ScheduleTerseUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Resizing/Scale
|
#region Resizing/Scale
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scale"></param>
|
/// <param name="scale"></param>
|
||||||
public void Resize(LLVector3 scale)
|
public void Resize(LLVector3 scale)
|
||||||
{
|
{
|
||||||
this.m_shape.Scale = scale;
|
m_shape.Scale = scale;
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Client Update Methods
|
#region Client Update Methods
|
||||||
|
|
||||||
public void AddFullUpdateToAllAvatars()
|
public void AddFullUpdateToAllAvatars()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
|
List<ScenePresence> avatars = m_parentGroup.RequestSceneAvatars();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].AddFullPart(this);
|
avatars[i].AddFullPart(this);
|
||||||
|
@ -654,7 +697,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendFullUpdateToAllClients()
|
public void SendFullUpdateToAllClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
|
List<ScenePresence> avatars = m_parentGroup.RequestSceneAvatars();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this);
|
m_parentGroup.SendPartFullUpdate(avatars[i].ControllingClient, this);
|
||||||
|
@ -691,15 +734,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
LLQuaternion lRot;
|
LLQuaternion lRot;
|
||||||
lRot = RotationOffset;
|
lRot = RotationOffset;
|
||||||
|
|
||||||
remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, this.ObjectFlags, m_uuid, OwnerID,
|
remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, ObjectFlags, m_uuid,
|
||||||
m_text, ParentID, this.m_particleSystem, lRot);
|
OwnerID,
|
||||||
|
m_text, ParentID, m_particleSystem, lRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Terse updates
|
/// Terse updates
|
||||||
|
|
||||||
public void AddTerseUpdateToAllAvatars()
|
public void AddTerseUpdateToAllAvatars()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
|
List<ScenePresence> avatars = m_parentGroup.RequestSceneAvatars();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].AddTersePart(this);
|
avatars[i].AddTersePart(this);
|
||||||
|
@ -718,7 +761,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendTerseUpdateToAllClients()
|
public void SendTerseUpdateToAllClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_parentGroup.RequestSceneAvatars();
|
List<ScenePresence> avatars = m_parentGroup.RequestSceneAvatars();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this);
|
m_parentGroup.SendPartTerseUpdate(avatars[i].ControllingClient, this);
|
||||||
|
@ -741,8 +784,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
public void SendTerseUpdateToClient(IClientAPI remoteClient)
|
||||||
{
|
{
|
||||||
LLVector3 lPos;
|
LLVector3 lPos;
|
||||||
lPos = this.OffsetPosition;
|
lPos = OffsetPosition;
|
||||||
LLQuaternion mRot = this.RotationOffset;
|
LLQuaternion mRot = RotationOffset;
|
||||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -753,9 +796,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="lPos"></param>
|
/// <param name="lPos"></param>
|
||||||
public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos)
|
public void SendTerseUpdateToClient(IClientAPI remoteClient, LLVector3 lPos)
|
||||||
{
|
{
|
||||||
LLQuaternion mRot = this.RotationOffset;
|
LLQuaternion mRot = RotationOffset;
|
||||||
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
remoteClient.SendPrimTerseUpdate(m_regionHandle, 64096, LocalID, lPos, mRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public virtual void UpdateMovement()
|
public virtual void UpdateMovement()
|
||||||
|
@ -778,11 +822,11 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public InventoryStringBuilder(LLUUID folderID, LLUUID parentID)
|
public InventoryStringBuilder(LLUUID folderID, LLUUID parentID)
|
||||||
{
|
{
|
||||||
BuildString += "\tinv_object\t0\n\t{\n";
|
BuildString += "\tinv_object\t0\n\t{\n";
|
||||||
this.AddNameValueLine("obj_id", folderID.ToStringHyphenated());
|
AddNameValueLine("obj_id", folderID.ToStringHyphenated());
|
||||||
this.AddNameValueLine("parent_id", parentID.ToStringHyphenated());
|
AddNameValueLine("parent_id", parentID.ToStringHyphenated());
|
||||||
this.AddNameValueLine("type", "category");
|
AddNameValueLine("type", "category");
|
||||||
this.AddNameValueLine("name", "Contents");
|
AddNameValueLine("name", "Contents");
|
||||||
this.AddSectionEnd();
|
AddSectionEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddItemStart()
|
public void AddItemStart()
|
||||||
|
@ -866,4 +910,3 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
public class AvatarAnimations
|
public class AvatarAnimations
|
||||||
{
|
{
|
||||||
|
|
||||||
public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
|
public Dictionary<string, LLUUID> AnimsLLUUID = new Dictionary<string, LLUUID>();
|
||||||
public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
|
public Dictionary<LLUUID, string> AnimsNames = new Dictionary<LLUUID, string>();
|
||||||
|
|
||||||
|
@ -52,12 +51,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
doc.Load(reader);
|
doc.Load(reader);
|
||||||
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
|
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (nod.Attributes["name"] != null)
|
if (nod.Attributes["name"] != null)
|
||||||
{
|
{
|
||||||
AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText);
|
AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reader.Close();
|
reader.Close();
|
||||||
|
|
|
@ -37,7 +37,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
public Avatar()
|
public Avatar()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
|
public void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
|
||||||
|
@ -61,7 +60,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
public ChildAgent()
|
public ChildAgent()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
|
public void processMovement(IClientAPI remoteClient, uint flags, LLQuaternion bodyRotation)
|
||||||
|
@ -81,5 +79,4 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -27,7 +27,6 @@
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using Axiom.Math;
|
using Axiom.Math;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using libsecondlife.Packets;
|
using libsecondlife.Packets;
|
||||||
|
@ -72,7 +71,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private IScenePresenceBody m_body;
|
private IScenePresenceBody m_body;
|
||||||
|
|
||||||
private Vector3[] Dir_Vectors = new Vector3[6];
|
private Vector3[] Dir_Vectors = new Vector3[6];
|
||||||
private libsecondlife.LLVector3 lastPhysPos = new libsecondlife.LLVector3();
|
private LLVector3 lastPhysPos = new LLVector3();
|
||||||
|
|
||||||
private enum Dir_ControlFlags
|
private enum Dir_ControlFlags
|
||||||
{
|
{
|
||||||
DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
|
DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
|
||||||
|
@ -82,12 +82,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
|
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
|
||||||
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
|
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Position at which a significant movement was made
|
/// Position at which a significant movement was made
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private LLVector3 posLastSignificantMove = new LLVector3();
|
private LLVector3 posLastSignificantMove = new LLVector3();
|
||||||
|
|
||||||
public delegate void SignificantClientMovement(IClientAPI remote_client);
|
public delegate void SignificantClientMovement(IClientAPI remote_client);
|
||||||
|
|
||||||
public event SignificantClientMovement OnSignificantClientMovement;
|
public event SignificantClientMovement OnSignificantClientMovement;
|
||||||
|
|
||||||
//public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>();
|
//public List<SceneObjectGroup> InterestList = new List<SceneObjectGroup>();
|
||||||
|
@ -99,31 +101,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>();
|
private Queue<SceneObjectPart> m_tersePartUpdates = new Queue<SceneObjectPart>();
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public PhysicsActor PhysActor
|
public PhysicsActor PhysActor
|
||||||
{
|
{
|
||||||
set
|
set { _physActor = value; }
|
||||||
{
|
get { return _physActor; }
|
||||||
this._physActor = value;
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _physActor;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Updated
|
public bool Updated
|
||||||
{
|
{
|
||||||
set
|
set { updateflag = value; }
|
||||||
{
|
get { return updateflag; }
|
||||||
this.updateflag = value;
|
|
||||||
}
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.updateflag;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong RegionHandle
|
public ulong RegionHandle
|
||||||
|
@ -132,12 +123,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_firstname;
|
private string m_firstname;
|
||||||
|
|
||||||
public string Firstname
|
public string Firstname
|
||||||
{
|
{
|
||||||
get { return m_firstname; }
|
get { return m_firstname; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private string m_lastname;
|
private string m_lastname;
|
||||||
|
|
||||||
public string Lastname
|
public string Lastname
|
||||||
{
|
{
|
||||||
get { return m_lastname; }
|
get { return m_lastname; }
|
||||||
|
@ -146,6 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor(s)
|
#region Constructor(s)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -155,16 +149,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="regionDat"></param>
|
/// <param name="regionDat"></param>
|
||||||
public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
|
public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_scene = world;
|
m_scene = world;
|
||||||
this.m_uuid = theClient.AgentId;
|
m_uuid = theClient.AgentId;
|
||||||
|
|
||||||
m_regionInfo = reginfo;
|
m_regionInfo = reginfo;
|
||||||
m_regionHandle = reginfo.RegionHandle;
|
m_regionHandle = reginfo.RegionHandle;
|
||||||
MainLog.Instance.Verbose("Avatar.cs ");
|
MainLog.Instance.Verbose("Avatar.cs ");
|
||||||
ControllingClient = theClient;
|
ControllingClient = theClient;
|
||||||
this.m_firstname = ControllingClient.FirstName;
|
m_firstname = ControllingClient.FirstName;
|
||||||
this.m_lastname = ControllingClient.LastName;
|
m_lastname = ControllingClient.LastName;
|
||||||
m_localId = m_scene.NextLocalId;
|
m_localId = m_scene.NextLocalId;
|
||||||
AbsolutePosition = ControllingClient.StartPos;
|
AbsolutePosition = ControllingClient.StartPos;
|
||||||
|
|
||||||
|
@ -175,15 +168,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
Wearables = AvatarWearable.DefaultWearables;
|
Wearables = AvatarWearable.DefaultWearables;
|
||||||
Animations = new ScenePresence.AvatarAnimations();
|
Animations = new AvatarAnimations();
|
||||||
Animations.LoadAnims();
|
Animations.LoadAnims();
|
||||||
|
|
||||||
//register for events
|
//register for events
|
||||||
ControllingClient.OnRequestWearables += this.SendOurAppearance;
|
ControllingClient.OnRequestWearables += SendOurAppearance;
|
||||||
ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
|
ControllingClient.OnSetAppearance += new SetAppearance(SetAppearance);
|
||||||
ControllingClient.OnCompleteMovementToRegion += this.CompleteMovement;
|
ControllingClient.OnCompleteMovementToRegion += CompleteMovement;
|
||||||
ControllingClient.OnCompleteMovementToRegion += this.SendInitialData;
|
ControllingClient.OnCompleteMovementToRegion += SendInitialData;
|
||||||
ControllingClient.OnAgentUpdate += this.HandleAgentUpdate;
|
ControllingClient.OnAgentUpdate += HandleAgentUpdate;
|
||||||
// ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
|
// ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
|
||||||
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
||||||
//ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
//ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
||||||
|
@ -195,17 +188,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Dir_Vectors[4] = new Vector3(0, 0, 1); //UP
|
Dir_Vectors[4] = new Vector3(0, 0, 1); //UP
|
||||||
Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN
|
Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN
|
||||||
|
|
||||||
this.m_textureEntry = new LLObject.TextureEntry(DefaultTexture, 0, DefaultTexture.Length);
|
m_textureEntry = new LLObject.TextureEntry(DefaultTexture, 0, DefaultTexture.Length);
|
||||||
|
|
||||||
//temporary until we move some code into the body classes
|
//temporary until we move some code into the body classes
|
||||||
this.m_body = new ChildAgent();
|
m_body = new ChildAgent();
|
||||||
|
|
||||||
if (newAvatar)
|
if (newAvatar)
|
||||||
{
|
{
|
||||||
//do we need to use newAvatar? not sure so have added this to kill the compile warning
|
//do we need to use newAvatar? not sure so have added this to kill the compile warning
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public void AddTersePart(SceneObjectPart part)
|
public void AddTersePart(SceneObjectPart part)
|
||||||
|
@ -228,7 +221,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
while (terse)
|
while (terse)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_tersePartUpdates.Dequeue();
|
SceneObjectPart part = m_tersePartUpdates.Dequeue();
|
||||||
part.SendTerseUpdate(this.ControllingClient);
|
part.SendTerseUpdate(ControllingClient);
|
||||||
terseCount++;
|
terseCount++;
|
||||||
|
|
||||||
if ((m_tersePartUpdates.Count < 1) | (terseCount > 30))
|
if ((m_tersePartUpdates.Count < 1) | (terseCount > 30))
|
||||||
|
@ -245,31 +238,30 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
while (full)
|
while (full)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_fullPartUpdates.Dequeue();
|
SceneObjectPart part = m_fullPartUpdates.Dequeue();
|
||||||
part.SendFullUpdate(this.ControllingClient);
|
part.SendFullUpdate(ControllingClient);
|
||||||
fullCount++;
|
fullCount++;
|
||||||
if ((m_fullPartUpdates.Count < 1) | (fullCount > 40))
|
if ((m_fullPartUpdates.Count < 1) | (fullCount > 40))
|
||||||
{
|
{
|
||||||
full = false;
|
full = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Status Methods
|
#region Status Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Not Used, most likely can be deleted
|
/// Not Used, most likely can be deleted
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="status"></param>
|
/// <param name="status"></param>
|
||||||
public void ChildStatusChange(bool status)
|
public void ChildStatusChange(bool status)
|
||||||
{
|
{
|
||||||
this.childAgent = status;
|
childAgent = status;
|
||||||
|
|
||||||
if (this.childAgent == true)
|
if (childAgent == true)
|
||||||
{
|
{
|
||||||
this.Velocity = new LLVector3(0, 0, 0);
|
Velocity = new LLVector3(0, 0, 0);
|
||||||
this.AbsolutePosition = new LLVector3(128, 128, 70);
|
AbsolutePosition = new LLVector3(128, 128, 70);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,17 +272,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void MakeAvatar(LLVector3 pos, bool isFlying)
|
public void MakeAvatar(LLVector3 pos, bool isFlying)
|
||||||
{
|
{
|
||||||
//this.childAvatar = false;
|
//this.childAvatar = false;
|
||||||
this.AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
this._physActor.Flying = isFlying;
|
_physActor.Flying = isFlying;
|
||||||
this.newAvatar = true;
|
newAvatar = true;
|
||||||
this.childAgent = false;
|
childAgent = false;
|
||||||
this.m_scene.SendAllSceneObjectsToClient(this);
|
m_scene.SendAllSceneObjectsToClient(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void MakeChildAgent()
|
protected void MakeChildAgent()
|
||||||
{
|
{
|
||||||
this.Velocity = new LLVector3(0, 0, 0);
|
Velocity = new LLVector3(0, 0, 0);
|
||||||
this.childAgent = true;
|
childAgent = true;
|
||||||
//this.Pos = new LLVector3(128, 128, 70);
|
//this.Pos = new LLVector3(128, 128, 70);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +292,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
public void Teleport(LLVector3 pos)
|
public void Teleport(LLVector3 pos)
|
||||||
{
|
{
|
||||||
this.AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
this.SendTerseUpdateToALLClients();
|
SendTerseUpdateToALLClients();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -309,11 +301,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void StopMovement()
|
public void StopMovement()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Event Handlers
|
#region Event Handlers
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -322,14 +315,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
|
public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
|
||||||
{
|
{
|
||||||
LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length);
|
LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length);
|
||||||
this.m_textureEntry = textureEnt;
|
m_textureEntry = textureEnt;
|
||||||
|
|
||||||
for (int i = 0; i < visualParam.Length; i++)
|
for (int i = 0; i < visualParam.Length; i++)
|
||||||
{
|
{
|
||||||
this.visualParams[i] = visualParam[i].ParamValue;
|
visualParams[i] = visualParam[i].ParamValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.SendArrearanceToAllOtherAgents();
|
SendArrearanceToAllOtherAgents();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -337,15 +330,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CompleteMovement()
|
public void CompleteMovement()
|
||||||
{
|
{
|
||||||
LLVector3 look = this.Velocity;
|
LLVector3 look = Velocity;
|
||||||
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
|
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
|
||||||
{
|
{
|
||||||
look = new LLVector3(0.99f, 0.042f, 0);
|
look = new LLVector3(0.99f, 0.042f, 0);
|
||||||
}
|
}
|
||||||
this.ControllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
|
ControllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look);
|
||||||
if (this.childAgent)
|
if (childAgent)
|
||||||
{
|
{
|
||||||
this.childAgent = false;
|
childAgent = false;
|
||||||
|
|
||||||
//this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
|
//this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
|
||||||
}
|
}
|
||||||
|
@ -363,16 +356,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
bool DCFlagKeyPressed = false;
|
bool DCFlagKeyPressed = false;
|
||||||
Vector3 agent_control_v3 = new Vector3(0, 0, 0);
|
Vector3 agent_control_v3 = new Vector3(0, 0, 0);
|
||||||
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
||||||
bool oldflying = this.PhysActor.Flying;
|
bool oldflying = PhysActor.Flying;
|
||||||
this.PhysActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
PhysActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
||||||
if (this.PhysActor.Flying != oldflying)
|
if (PhysActor.Flying != oldflying)
|
||||||
{
|
{
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (q != this.bodyRot)
|
if (q != bodyRot)
|
||||||
{
|
{
|
||||||
this.bodyRot = q;
|
bodyRot = q;
|
||||||
update_rotation = true;
|
update_rotation = true;
|
||||||
}
|
}
|
||||||
foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags)))
|
foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags)))
|
||||||
|
@ -393,17 +386,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
movementflag -= (byte) (uint) DCF;
|
movementflag -= (byte) (uint) DCF;
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if ((update_movementflag) || (update_rotation && DCFlagKeyPressed))
|
if ((update_movementflag) || (update_rotation && DCFlagKeyPressed))
|
||||||
{
|
{
|
||||||
this.AddNewMovement(agent_control_v3, q);
|
AddNewMovement(agent_control_v3, q);
|
||||||
}
|
}
|
||||||
UpdateMovementAnimations(update_movementflag);
|
UpdateMovementAnimations(update_movementflag);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void UpdateMovementAnimations(bool update_movementflag)
|
protected void UpdateMovementAnimations(bool update_movementflag)
|
||||||
|
@ -412,21 +403,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
if (movementflag != 0)
|
if (movementflag != 0)
|
||||||
{
|
{
|
||||||
if (this._physActor.Flying)
|
if (_physActor.Flying)
|
||||||
{
|
{
|
||||||
this.SendAnimPack(Animations.AnimsLLUUID["FLY"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["FLY"], 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.SendAnimPack(Animations.AnimsLLUUID["WALK"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["WALK"], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.SendAnimPack(Animations.AnimsLLUUID["STAND"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["STAND"], 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -437,24 +427,24 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
direc.Normalize();
|
direc.Normalize();
|
||||||
|
|
||||||
direc = direc*((0.03f)*128f);
|
direc = direc*((0.03f)*128f);
|
||||||
if (this._physActor.Flying)
|
if (_physActor.Flying)
|
||||||
direc *= 4;
|
direc *= 4;
|
||||||
|
|
||||||
newVelocity.X = direc.x;
|
newVelocity.X = direc.x;
|
||||||
newVelocity.Y = direc.y;
|
newVelocity.Y = direc.y;
|
||||||
newVelocity.Z = direc.z;
|
newVelocity.Z = direc.z;
|
||||||
this.forcesList.Add(newVelocity);
|
forcesList.Add(newVelocity);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Overridden Methods
|
#region Overridden Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void LandRenegerated()
|
public override void LandRenegerated()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -462,20 +452,20 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
this.SendPrimUpdates();
|
SendPrimUpdates();
|
||||||
|
|
||||||
if (this.newCoarseLocations) {
|
if (newCoarseLocations)
|
||||||
this.SendCoarseLocations();
|
{
|
||||||
this.newCoarseLocations = false;
|
SendCoarseLocations();
|
||||||
|
newCoarseLocations = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.childAgent == false)
|
if (childAgent == false)
|
||||||
{
|
{
|
||||||
|
|
||||||
/// check for user movement 'forces' (ie commands to move)
|
/// check for user movement 'forces' (ie commands to move)
|
||||||
if (this.newForce)
|
if (newForce)
|
||||||
{
|
{
|
||||||
this.SendTerseUpdateToALLClients();
|
SendTerseUpdateToALLClients();
|
||||||
_updateCount = 0;
|
_updateCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -485,40 +475,42 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
_updateCount++;
|
_updateCount++;
|
||||||
if (_updateCount > 3)
|
if (_updateCount > 3)
|
||||||
{
|
{
|
||||||
this.SendTerseUpdateToALLClients();
|
SendTerseUpdateToALLClients();
|
||||||
_updateCount = 0;
|
_updateCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// check for physics-related movement
|
/// check for physics-related movement
|
||||||
else if (this.lastPhysPos.GetDistanceTo(this.AbsolutePosition) > 0.02 )
|
else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02)
|
||||||
{
|
{
|
||||||
this.SendTerseUpdateToALLClients();
|
SendTerseUpdateToALLClients();
|
||||||
_updateCount = 0;
|
_updateCount = 0;
|
||||||
this.lastPhysPos = this.AbsolutePosition;
|
lastPhysPos = AbsolutePosition;
|
||||||
|
}
|
||||||
|
CheckForSignificantMovement();
|
||||||
|
CheckForBorderCrossing();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.CheckForSignificantMovement();
|
|
||||||
this.CheckForBorderCrossing();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Update Client(s)
|
#region Update Client(s)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="RemoteClient"></param>
|
/// <param name="RemoteClient"></param>
|
||||||
public void SendTerseUpdateToClient(IClientAPI RemoteClient)
|
public void SendTerseUpdateToClient(IClientAPI RemoteClient)
|
||||||
{
|
{
|
||||||
LLVector3 pos = this.AbsolutePosition;
|
LLVector3 pos = AbsolutePosition;
|
||||||
LLVector3 vel = this.Velocity;
|
LLVector3 vel = Velocity;
|
||||||
LLQuaternion rot;
|
LLQuaternion rot;
|
||||||
rot.X = this.bodyRot.x;
|
rot.X = bodyRot.x;
|
||||||
rot.Y = this.bodyRot.y;
|
rot.Y = bodyRot.y;
|
||||||
rot.Z = this.bodyRot.z;
|
rot.Z = bodyRot.z;
|
||||||
rot.W = this.bodyRot.w;
|
rot.W = bodyRot.w;
|
||||||
RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z), rot);
|
RemoteClient.SendAvatarTerseUpdate(m_regionHandle, 64096, LocalId, new LLVector3(pos.X, pos.Y, pos.Z),
|
||||||
|
new LLVector3(vel.X, vel.Y, vel.Z), rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -526,10 +518,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendTerseUpdateToALLClients()
|
public void SendTerseUpdateToALLClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
this.SendTerseUpdateToClient(avatars[i].ControllingClient);
|
SendTerseUpdateToClient(avatars[i].ControllingClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -537,14 +529,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SendCoarseLocations()
|
public void SendCoarseLocations()
|
||||||
{
|
{
|
||||||
List<LLVector3> CoarseLocations = new List<LLVector3>();
|
List<LLVector3> CoarseLocations = new List<LLVector3>();
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
if (avatars[i] != this && (!avatars[i].childAgent) ) {
|
if (avatars[i] != this && (!avatars[i].childAgent))
|
||||||
|
{
|
||||||
CoarseLocations.Add(avatars[i].AbsolutePosition);
|
CoarseLocations.Add(avatars[i].AbsolutePosition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.ControllingClient.SendCoarseLocationUpdate(CoarseLocations);
|
ControllingClient.SendCoarseLocationUpdate(CoarseLocations);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CoarseLocationChange(ScenePresence avatar)
|
public void CoarseLocationChange(ScenePresence avatar)
|
||||||
|
@ -554,13 +547,14 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
private void NotifyMyCoarseLocationChange()
|
private void NotifyMyCoarseLocationChange()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++) {
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
if (avatars[i] != this) {
|
{
|
||||||
|
if (avatars[i] != this)
|
||||||
|
{
|
||||||
avatars[i].CoarseLocationChange(this);
|
avatars[i].CoarseLocationChange(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -570,16 +564,17 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="remoteAvatar"></param>
|
/// <param name="remoteAvatar"></param>
|
||||||
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
|
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
|
||||||
{
|
{
|
||||||
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.AbsolutePosition, this.m_textureEntry.ToBytes());
|
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
|
||||||
|
LocalId, AbsolutePosition, m_textureEntry.ToBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendFullUpdateToALLClients()
|
public void SendFullUpdateToALLClients()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
|
foreach (ScenePresence avatar in m_scene.RequestAvatarList())
|
||||||
{
|
{
|
||||||
this.SendFullUpdateToOtherClient(avatar);
|
SendFullUpdateToOtherClient(avatar);
|
||||||
if (avatar.LocalId != this.LocalId)
|
if (avatar.LocalId != LocalId)
|
||||||
{
|
{
|
||||||
if (!avatar.childAgent)
|
if (!avatar.childAgent)
|
||||||
{
|
{
|
||||||
|
@ -595,15 +590,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendInitialData()
|
public void SendInitialData()
|
||||||
{
|
{
|
||||||
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.AbsolutePosition, this.m_textureEntry.ToBytes());
|
ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, LocalId,
|
||||||
if (!this.childAgent)
|
AbsolutePosition, m_textureEntry.ToBytes());
|
||||||
|
if (!childAgent)
|
||||||
{
|
{
|
||||||
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
|
m_scene.InformClientOfNeighbours(ControllingClient);
|
||||||
this.newAvatar = false;
|
newAvatar = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.SendFullUpdateToALLClients();
|
SendFullUpdateToALLClients();
|
||||||
this.SendArrearanceToAllOtherAgents();
|
SendArrearanceToAllOtherAgents();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -612,13 +608,13 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="OurClient"></param>
|
/// <param name="OurClient"></param>
|
||||||
public void SendOurAppearance(IClientAPI OurClient)
|
public void SendOurAppearance(IClientAPI OurClient)
|
||||||
{
|
{
|
||||||
this.ControllingClient.SendWearables(this.Wearables);
|
ControllingClient.SendWearables(Wearables);
|
||||||
|
|
||||||
//this.SendFullUpdateToALLClients();
|
//this.SendFullUpdateToALLClients();
|
||||||
//this.SendArrearanceToAllOtherAgents();
|
//this.SendArrearanceToAllOtherAgents();
|
||||||
|
|
||||||
this.m_scene.SendAllSceneObjectsToClient(this);
|
m_scene.SendAllSceneObjectsToClient(this);
|
||||||
this.ControllingClient.SendViewerTime(this.m_scene.TimePhase);
|
ControllingClient.SendViewerTime(m_scene.TimePhase);
|
||||||
|
|
||||||
//Please don't remove the following code (at least not yet), just leave it commented out
|
//Please don't remove the following code (at least not yet), just leave it commented out
|
||||||
//gives the user god powers, should help with debuging things in the future
|
//gives the user god powers, should help with debuging things in the future
|
||||||
|
@ -636,10 +632,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendArrearanceToAllOtherAgents()
|
public void SendArrearanceToAllOtherAgents()
|
||||||
{
|
{
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
|
foreach (ScenePresence avatar in m_scene.RequestAvatarList())
|
||||||
{
|
{
|
||||||
this.SendAppearanceToOtherAgent(avatar);
|
SendAppearanceToOtherAgent(avatar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -649,7 +645,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="avatarInfo"></param>
|
/// <param name="avatarInfo"></param>
|
||||||
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
|
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
|
||||||
{
|
{
|
||||||
avatarInfo.ControllingClient.SendAppearance(this.ControllingClient.AgentId, this.visualParams, this.m_textureEntry.ToBytes());
|
avatarInfo.ControllingClient.SendAppearance(ControllingClient.AgentId, visualParams,
|
||||||
|
m_textureEntry.ToBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -659,12 +656,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="seq"></param>
|
/// <param name="seq"></param>
|
||||||
public void SendAnimPack(LLUUID animID, int seq)
|
public void SendAnimPack(LLUUID animID, int seq)
|
||||||
{
|
{
|
||||||
this.current_anim = animID;
|
current_anim = animID;
|
||||||
this.anim_seq = seq;
|
anim_seq = seq;
|
||||||
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
List<ScenePresence> avatars = m_scene.RequestAvatarList();
|
||||||
for (int i = 0; i < avatars.Count; i++)
|
for (int i = 0; i < avatars.Count; i++)
|
||||||
{
|
{
|
||||||
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
|
avatars[i].ControllingClient.SendAnimation(animID, seq, ControllingClient.AgentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,34 +670,37 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendAnimPack()
|
public void SendAnimPack()
|
||||||
{
|
{
|
||||||
this.SendAnimPack(this.current_anim, this.anim_seq);
|
SendAnimPack(current_anim, anim_seq);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Significant Movement Method
|
#region Significant Movement Method
|
||||||
|
|
||||||
protected void CheckForSignificantMovement()
|
protected void CheckForSignificantMovement()
|
||||||
{
|
{
|
||||||
if (libsecondlife.Helpers.VecDist(this.AbsolutePosition, this.posLastSignificantMove) > 2.0)
|
if (Helpers.VecDist(AbsolutePosition, posLastSignificantMove) > 2.0)
|
||||||
{
|
{
|
||||||
this.posLastSignificantMove = this.AbsolutePosition;
|
posLastSignificantMove = AbsolutePosition;
|
||||||
if (OnSignificantClientMovement != null)
|
if (OnSignificantClientMovement != null)
|
||||||
{
|
{
|
||||||
OnSignificantClientMovement(this.ControllingClient);
|
OnSignificantClientMovement(ControllingClient);
|
||||||
NotifyMyCoarseLocationChange();
|
NotifyMyCoarseLocationChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Border Crossing Methods
|
#region Border Crossing Methods
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void CheckForBorderCrossing()
|
protected void CheckForBorderCrossing()
|
||||||
{
|
{
|
||||||
LLVector3 pos2 = this.AbsolutePosition;
|
LLVector3 pos2 = AbsolutePosition;
|
||||||
LLVector3 vel = this.Velocity;
|
LLVector3 vel = Velocity;
|
||||||
|
|
||||||
float timeStep = 0.1f;
|
float timeStep = 0.1f;
|
||||||
pos2.X = pos2.X + (vel.X*timeStep);
|
pos2.X = pos2.X + (vel.X*timeStep);
|
||||||
|
@ -709,12 +709,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if ((pos2.X < 0) || (pos2.X > 256))
|
if ((pos2.X < 0) || (pos2.X > 256))
|
||||||
{
|
{
|
||||||
this.CrossToNewRegion();
|
CrossToNewRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pos2.Y < 0) || (pos2.Y > 256))
|
if ((pos2.Y < 0) || (pos2.Y > 256))
|
||||||
{
|
{
|
||||||
this.CrossToNewRegion();
|
CrossToNewRegion();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,10 +723,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected void CrossToNewRegion()
|
protected void CrossToNewRegion()
|
||||||
{
|
{
|
||||||
LLVector3 pos = this.AbsolutePosition;
|
LLVector3 pos = AbsolutePosition;
|
||||||
LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z);
|
LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z);
|
||||||
uint neighbourx = this.m_regionInfo.RegionLocX;
|
uint neighbourx = m_regionInfo.RegionLocX;
|
||||||
uint neighboury = this.m_regionInfo.RegionLocY;
|
uint neighboury = m_regionInfo.RegionLocY;
|
||||||
|
|
||||||
if (pos.X < 1.7F)
|
if (pos.X < 1.7F)
|
||||||
{
|
{
|
||||||
|
@ -749,24 +749,28 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
newpos.Y = 0.1F;
|
newpos.Y = 0.1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLVector3 vel = this.m_velocity;
|
LLVector3 vel = m_velocity;
|
||||||
ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256));
|
ulong neighbourHandle = Helpers.UIntsToLong((uint) (neighbourx*256), (uint) (neighboury*256));
|
||||||
RegionInfo neighbourRegion = this.m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
|
RegionInfo neighbourRegion = m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
|
||||||
if (neighbourRegion != null)
|
if (neighbourRegion != null)
|
||||||
{
|
{
|
||||||
bool res = this.m_scene.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
|
bool res =
|
||||||
|
m_scene.InformNeighbourOfCrossing(neighbourHandle, ControllingClient.AgentId, newpos,
|
||||||
|
_physActor.Flying);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
//TODO: following line is hard coded to port 9000, really need to change this as soon as possible
|
//TODO: following line is hard coded to port 9000, really need to change this as soon as possible
|
||||||
AgentCircuitData circuitdata = this.ControllingClient.RequestClientInfo();
|
AgentCircuitData circuitdata = ControllingClient.RequestClientInfo();
|
||||||
string capsPath = Util.GetCapsURL(this.ControllingClient.AgentId);
|
string capsPath = Util.GetCapsURL(ControllingClient.AgentId);
|
||||||
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath);
|
ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
|
||||||
this.MakeChildAgent();
|
capsPath);
|
||||||
this.m_scene.SendKillObject(this.m_localId);
|
MakeChildAgent();
|
||||||
this.NotifyMyCoarseLocationChange();
|
m_scene.SendKillObject(m_localId);
|
||||||
|
NotifyMyCoarseLocationChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -774,7 +778,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LoadAnims()
|
public static void LoadAnims()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -783,21 +786,21 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public override void UpdateMovement()
|
public override void UpdateMovement()
|
||||||
{
|
{
|
||||||
newForce = false;
|
newForce = false;
|
||||||
lock (this.forcesList)
|
lock (forcesList)
|
||||||
{
|
{
|
||||||
if (this.forcesList.Count > 0)
|
if (forcesList.Count > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < this.forcesList.Count; i++)
|
for (int i = 0; i < forcesList.Count; i++)
|
||||||
{
|
{
|
||||||
NewForce force = this.forcesList[i];
|
NewForce force = forcesList[i];
|
||||||
|
|
||||||
this.updateflag = true;
|
updateflag = true;
|
||||||
this.Velocity = new LLVector3(force.X, force.Y, force.Z);
|
Velocity = new LLVector3(force.X, force.Y, force.Z);
|
||||||
this.newForce = true;
|
newForce = true;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < this.forcesList.Count; i++)
|
for (int i = 0; i < forcesList.Count; i++)
|
||||||
{
|
{
|
||||||
this.forcesList.RemoveAt(0);
|
forcesList.RemoveAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -824,7 +827,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public NewForce()
|
public NewForce()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -833,5 +835,4 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
throw new Exception("The method or operation is not implemented.");
|
throw new Exception("The method or operation is not implemented.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
using Axiom.Math;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes.Scripting
|
namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
|
@ -15,6 +13,6 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
LLUUID ObjectOwner { get; }
|
LLUUID ObjectOwner { get; }
|
||||||
LLUUID ObjectCreator { get; }
|
LLUUID ObjectCreator { get; }
|
||||||
LLVector3 AbsolutePosition { get; }
|
LLVector3 AbsolutePosition { get; }
|
||||||
void SetText(string text, Axiom.Math.Vector3 color, double alpha);
|
void SetText(string text, Vector3 color, double alpha);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,14 +1,13 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using Axiom.Math;
|
||||||
using System.Text;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes.Scripting
|
namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
{
|
{
|
||||||
public class NullScriptHost : IScriptHost
|
public class NullScriptHost : IScriptHost
|
||||||
{
|
{
|
||||||
|
private LLVector3 m_pos = new LLVector3(128, 128, 30);
|
||||||
|
|
||||||
LLVector3 m_pos = new LLVector3( 128, 128, 30 );
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "Object"; }
|
get { return "Object"; }
|
||||||
|
@ -39,16 +38,21 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
}
|
}
|
||||||
|
|
||||||
public LLUUID ObjectOwner
|
public LLUUID ObjectOwner
|
||||||
{ get { return LLUUID.Zero; } }
|
{
|
||||||
|
get { return LLUUID.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
public LLUUID ObjectCreator { get { return LLUUID.Zero; } }
|
public LLUUID ObjectCreator
|
||||||
|
{
|
||||||
|
get { return LLUUID.Zero; }
|
||||||
|
}
|
||||||
|
|
||||||
public LLVector3 AbsolutePosition
|
public LLVector3 AbsolutePosition
|
||||||
{
|
{
|
||||||
get { return m_pos; }
|
get { return m_pos; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetText(string text, Axiom.Math.Vector3 color, double alpha)
|
public void SetText(string text, Vector3 color, double alpha)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text);
|
Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,17 +26,15 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
/* Original code: Tedd Hansen */
|
/* Original code: Tedd Hansen */
|
||||||
using System;
|
using OpenSim.Framework.Console;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
using OpenSim.Region.Environment.Scenes.Scripting;
|
|
||||||
|
|
||||||
//TODO: WHERE TO PLACE THIS?
|
//TODO: WHERE TO PLACE THIS?
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes.Scripting
|
namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
{
|
{
|
||||||
public interface ScriptEngineInterface
|
public interface ScriptEngineInterface
|
||||||
{
|
{
|
||||||
void InitializeEngine(OpenSim.Region.Environment.Scenes.Scene Sceneworld, OpenSim.Framework.Console.LogBase logger);
|
void InitializeEngine(Scene Sceneworld, LogBase logger);
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
// void StartScript(string ScriptID, IScriptHost ObjectID);
|
// void StartScript(string ScriptID, IScriptHost ObjectID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,17 +27,17 @@
|
||||||
*/
|
*/
|
||||||
/* Original code: Tedd Hansen */
|
/* Original code: Tedd Hansen */
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Scenes.Scripting
|
namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
{
|
{
|
||||||
public class ScriptEngineLoader
|
public class ScriptEngineLoader
|
||||||
{
|
{
|
||||||
private OpenSim.Framework.Console.LogBase m_log;
|
private LogBase m_log;
|
||||||
public ScriptEngineLoader(OpenSim.Framework.Console.LogBase logger)
|
|
||||||
|
public ScriptEngineLoader(LogBase logger)
|
||||||
{
|
{
|
||||||
m_log = logger;
|
m_log = logger;
|
||||||
}
|
}
|
||||||
|
@ -47,12 +47,16 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
ScriptEngineInterface ret = null;
|
ScriptEngineInterface ret = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ret = LoadAndInitAssembly(Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"),
|
ret =
|
||||||
|
LoadAndInitAssembly(
|
||||||
|
Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine." + EngineName + ".dll"),
|
||||||
"OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine");
|
"OpenSim.Region.ScriptEngine." + EngineName + ".ScriptEngine");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.Error("ScriptEngine", "Error loading assembly \"" + EngineName + "\": " + e.Message + ", " + e.StackTrace.ToString());
|
m_log.Error("ScriptEngine",
|
||||||
|
"Error loading assembly \"" + EngineName + "\": " + e.Message + ", " +
|
||||||
|
e.StackTrace.ToString());
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -115,10 +119,6 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
|
||||||
//}
|
//}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Communications;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Region.Capabilities;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using OpenSim.Framework.Console;
|
||||||
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment
|
namespace OpenSim.Region.Environment
|
||||||
{
|
{
|
||||||
|
@ -19,10 +11,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public IRegionDataStore DataStore
|
public IRegionDataStore DataStore
|
||||||
{
|
{
|
||||||
get
|
get { return m_dataStore; }
|
||||||
{
|
|
||||||
return m_dataStore;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public StorageManager(IRegionDataStore storage)
|
public StorageManager(IRegionDataStore storage)
|
||||||
|
@ -32,7 +21,7 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
|
public StorageManager(string dllName, string dataStoreFile, string dataStoreDB)
|
||||||
{
|
{
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
|
MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
|
||||||
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
|
||||||
|
|
||||||
foreach (Type pluginType in pluginAssembly.GetTypes())
|
foreach (Type pluginType in pluginAssembly.GetTypes())
|
||||||
|
@ -43,12 +32,13 @@ namespace OpenSim.Region.Environment
|
||||||
|
|
||||||
if (typeInterface != null)
|
if (typeInterface != null)
|
||||||
{
|
{
|
||||||
IRegionDataStore plug = (IRegionDataStore)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
IRegionDataStore plug =
|
||||||
|
(IRegionDataStore) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
|
||||||
plug.Initialise(dataStoreFile, dataStoreDB);
|
plug.Initialise(dataStoreFile, dataStoreDB);
|
||||||
|
|
||||||
m_dataStore = plug;
|
m_dataStore = plug;
|
||||||
|
|
||||||
OpenSim.Framework.Console.MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
|
MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
|
||||||
}
|
}
|
||||||
|
|
||||||
typeInterface = null;
|
typeInterface = null;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Types
|
namespace OpenSim.Region.Environment.Types
|
||||||
|
@ -66,10 +64,17 @@ namespace OpenSim.Region.Environment.Types
|
||||||
if (m_childNodes == null)
|
if (m_childNodes == null)
|
||||||
{
|
{
|
||||||
m_childNodes = new BasicQuadTreeNode[4];
|
m_childNodes = new BasicQuadTreeNode[4];
|
||||||
m_childNodes[0] = new BasicQuadTreeNode(this, m_leftX, m_leftY,(short) (m_width / 2), (short)( m_height / 2));
|
m_childNodes[0] =
|
||||||
m_childNodes[1] = new BasicQuadTreeNode(this,(short)( m_leftX + (m_width / 2)), m_leftY,(short)( m_width / 2),(short) (m_height / 2));
|
new BasicQuadTreeNode(this, m_leftX, m_leftY, (short) (m_width/2), (short) (m_height/2));
|
||||||
m_childNodes[2] = new BasicQuadTreeNode(this, m_leftX, (short)( m_leftY + (m_height / 2)), (short)(m_width / 2),(short)( m_height / 2));
|
m_childNodes[1] =
|
||||||
m_childNodes[3] = new BasicQuadTreeNode(this, (short)( m_leftX + (m_width / 2)),(short)( m_height + (m_height / 2)),(short)( m_width / 2), (short)(m_height / 2));
|
new BasicQuadTreeNode(this, (short) (m_leftX + (m_width/2)), m_leftY, (short) (m_width/2),
|
||||||
|
(short) (m_height/2));
|
||||||
|
m_childNodes[2] =
|
||||||
|
new BasicQuadTreeNode(this, m_leftX, (short) (m_leftY + (m_height/2)), (short) (m_width/2),
|
||||||
|
(short) (m_height/2));
|
||||||
|
m_childNodes[3] =
|
||||||
|
new BasicQuadTreeNode(this, (short) (m_leftX + (m_width/2)), (short) (m_height + (m_height/2)),
|
||||||
|
(short) (m_width/2), (short) (m_height/2));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -127,7 +132,8 @@ namespace OpenSim.Region.Environment.Types
|
||||||
List<SceneObjectGroup> outBounds = new List<SceneObjectGroup>();
|
List<SceneObjectGroup> outBounds = new List<SceneObjectGroup>();
|
||||||
foreach (SceneObjectGroup group in m_objects)
|
foreach (SceneObjectGroup group in m_objects)
|
||||||
{
|
{
|
||||||
if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
|
if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
|
||||||
|
((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
|
||||||
{
|
{
|
||||||
//still in bounds
|
//still in bounds
|
||||||
}
|
}
|
||||||
|
@ -151,9 +157,10 @@ namespace OpenSim.Region.Environment.Types
|
||||||
|
|
||||||
public void PassUp(SceneObjectGroup group)
|
public void PassUp(SceneObjectGroup group)
|
||||||
{
|
{
|
||||||
if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
|
if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) &&
|
||||||
|
((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height))))
|
||||||
{
|
{
|
||||||
this.AddObject(group);
|
AddObject(group);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.Environment.Types
|
namespace OpenSim.Region.Environment.Types
|
||||||
{
|
{
|
||||||
|
@ -49,6 +47,5 @@ namespace OpenSim.Region.Environment.Types
|
||||||
|
|
||||||
return part;
|
return part;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -27,20 +27,19 @@
|
||||||
*/
|
*/
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Region.Environment;
|
|
||||||
using OpenSim.Region.Environment.Scenes;
|
|
||||||
using OpenSim.Region.Environment.Interfaces;
|
using OpenSim.Region.Environment.Interfaces;
|
||||||
|
using OpenSim.Region.Environment.Scenes;
|
||||||
using OpenSim.Region.ExtensionsScriptModule.CSharp;
|
using OpenSim.Region.ExtensionsScriptModule.CSharp;
|
||||||
using OpenSim.Region.ExtensionsScriptModule.JScript;
|
using OpenSim.Region.ExtensionsScriptModule.JScript;
|
||||||
using OpenSim.Region.ExtensionsScriptModule.JVMEngine;
|
using OpenSim.Region.ExtensionsScriptModule.JVMEngine;
|
||||||
|
|
||||||
namespace OpenSim.Region.ExtensionsScriptModule
|
namespace OpenSim.Region.ExtensionsScriptModule
|
||||||
{
|
{
|
||||||
public class ScriptManager : IRegionModule
|
public class ScriptManager : IRegionModule, IExtensionScriptModule
|
||||||
{
|
{
|
||||||
List<IScript> scripts = new List<IScript>();
|
readonly List<IScript> scripts = new List<IScript>();
|
||||||
Scene m_scene;
|
Scene m_scene;
|
||||||
Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>();
|
readonly Dictionary<string, IScriptCompiler> compilers = new Dictionary<string, IScriptCompiler>();
|
||||||
|
|
||||||
private void LoadFromCompiler(Dictionary<string, IScript> compiledscripts)
|
private void LoadFromCompiler(Dictionary<string, IScript> compiledscripts)
|
||||||
{
|
{
|
||||||
|
@ -67,13 +66,15 @@ namespace OpenSim.Region.ExtensionsScriptModule
|
||||||
compilers.Add(javaCompiler.FileExt(), javaCompiler);
|
compilers.Add(javaCompiler.FileExt(), javaCompiler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public delegate TResult ModuleAPIMethod1<TResult, TParam0>(TParam0 param0);
|
||||||
|
public delegate TResult ModuleAPIMethod2<TResult, TParam0, TParam1>(TParam0 param0, TParam1 param1);
|
||||||
|
|
||||||
public void Initialise(Scene scene)
|
public void Initialise(Scene scene)
|
||||||
{
|
{
|
||||||
System.Console.WriteLine("Initialising Extensions Scripting Module");
|
System.Console.WriteLine("Initialising Extensions Scripting Module");
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
|
|
||||||
m_scene.RegisterAPIMethod("API_CompileExtensionScript", new ModuleAPIMethod1<bool, string>(Compile));
|
m_scene.RegisterModuleInterface<IExtensionScriptModule>(this);
|
||||||
m_scene.RegisterAPIMethod("API_AddExtensionScript", new ModuleAPIMethod1<bool, IScript>(AddPreCompiledScript));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
|
@ -135,6 +136,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public interface IExtensionScriptModule
|
||||||
|
{
|
||||||
|
bool Compile(string filename);
|
||||||
|
bool AddPreCompiledScript(IScript script);
|
||||||
|
}
|
||||||
|
|
||||||
interface IScriptCompiler
|
interface IScriptCompiler
|
||||||
{
|
{
|
||||||
Dictionary<string, IScript> compile(string filename);
|
Dictionary<string, IScript> compile(string filename);
|
||||||
|
|
Loading…
Reference in New Issue