Compare commits
42 Commits
master
...
0.6.9-post
Author | SHA1 | Date |
---|---|---|
Kevin Cozens | 7b1ee34784 | |
Justin Clark-Casey (justincc) | 2db53df6fa | |
Justin Clark-Casey (justincc) | ce39ec9005 | |
Justin Clark-Casey (justincc) | 7c2e34e5f6 | |
Justin Clark-Casey (justincc) | 21bb27193a | |
Teravus Ovares (Dan Olivares) | aa8e7ae68b | |
Teravus Ovares (Dan Olivares) | 30b301482e | |
Melanie | e619aceebc | |
Melanie | 76fd4cf7b5 | |
Melanie | 5f1c1e281a | |
Melanie | 87e17d3f61 | |
Melanie | 2e7b27db1f | |
Melanie | 60d2eac5ee | |
Melanie | f0dd530e76 | |
Melanie | 8deaa1ead2 | |
Melanie | 817f2245b4 | |
Melanie | e7e9e6706e | |
Melanie | 6a4c2ca24f | |
Melanie | f799678d6c | |
Melanie | accdd9d554 | |
Melanie | 52edbf4626 | |
Melanie | 9cde4fa52b | |
Melanie | d7086a776a | |
Diva Canto | 2b4af70db0 | |
Diva Canto | 828ba2e2b6 | |
Diva Canto | f575ae56cf | |
Melanie | d6f14d5443 | |
Melanie | 116bcb298f | |
Melanie Thielker | 1103c7c773 | |
Melanie Thielker | 7022c76d56 | |
Melanie | 2eeddc63d7 | |
Justin Clark-Casey (justincc) | bf107b0207 | |
Justin Clark-Casey (justincc) | 489da41b3c | |
Melanie | c313126bc3 | |
Melanie | 8501e34c59 | |
Melanie | 4f48afd990 | |
Melanie | 2de3972ece | |
Justin Clark-Casey (justincc) | c39a0bc4c5 | |
Melanie | b4ce78796b | |
Melanie | 95230bee6d | |
Justin Clark-Casey (justincc) | d7154d279b | |
Justin Clark-Casey (justincc) | 04a8c82951 |
|
@ -20,6 +20,7 @@
|
|||
<delete dir="${distbindir}/.nant"/>
|
||||
<delete>
|
||||
<fileset basedir="${distbindir}">
|
||||
<include name="compile.bat"/>
|
||||
<include name="BUILDING.txt"/>
|
||||
<include name="Makefile"/>
|
||||
<include name="nant-color"/>
|
||||
|
@ -29,7 +30,7 @@
|
|||
<include name="TESTING.txt"/>
|
||||
<include name="TestResult.xml"/>
|
||||
<include name="bin/OpenSim.Server.ini"/>
|
||||
<include name="bin/Regions/*"/>
|
||||
<include name="bin/Regions/*.xml"/>
|
||||
<include name="bin/*.db"/>
|
||||
<include name="**/.git/**"/>
|
||||
<include name=".gitignore"/>
|
||||
|
|
|
@ -123,14 +123,14 @@ namespace OpenSim.Data.MySQL
|
|||
|
||||
public EstateSettings LoadEstateSettings(UUID regionID)
|
||||
{
|
||||
bool create = true;
|
||||
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
|
||||
string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) +
|
||||
" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID";
|
||||
|
||||
bool migration = true;
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
@ -144,7 +144,7 @@ namespace OpenSim.Data.MySQL
|
|||
{
|
||||
if (r.Read())
|
||||
{
|
||||
migration = false;
|
||||
create = false;
|
||||
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
|
@ -172,7 +172,7 @@ namespace OpenSim.Data.MySQL
|
|||
}
|
||||
}
|
||||
|
||||
if (migration)
|
||||
if (create)
|
||||
{
|
||||
// Migration case
|
||||
List<string> names = new List<string>(FieldList);
|
||||
|
@ -264,6 +264,7 @@ namespace OpenSim.Data.MySQL
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("Adding field '{0}'", name);
|
||||
cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace OpenSim.Framework
|
|||
public class EstateSettings
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private readonly ConfigurationMember configMember;
|
||||
|
||||
public delegate void SaveDelegate(EstateSettings rs);
|
||||
|
||||
public event SaveDelegate OnSave;
|
||||
|
@ -51,7 +49,7 @@ namespace OpenSim.Framework
|
|||
set { m_EstateID = value; }
|
||||
}
|
||||
|
||||
private string m_EstateName;
|
||||
private string m_EstateName = "My Estate";
|
||||
|
||||
public string EstateName
|
||||
{
|
||||
|
@ -59,7 +57,7 @@ namespace OpenSim.Framework
|
|||
set { m_EstateName = value; }
|
||||
}
|
||||
|
||||
private uint m_ParentEstateID = 100;
|
||||
private uint m_ParentEstateID = 1;
|
||||
|
||||
public uint ParentEstateID
|
||||
{
|
||||
|
@ -273,25 +271,6 @@ namespace OpenSim.Framework
|
|||
|
||||
public EstateSettings()
|
||||
{
|
||||
if (configMember == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Load legacy defaults
|
||||
//
|
||||
configMember =
|
||||
new ConfigurationMember(Path.Combine(Util.configDir(),
|
||||
"estate_settings.xml"), "ESTATE SETTINGS",
|
||||
loadConfigurationOptions,
|
||||
handleIncomingConfiguration, true);
|
||||
|
||||
l_EstateManagers.Clear();
|
||||
configMember.performConfigurationRetrieve();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Save()
|
||||
|
@ -393,165 +372,5 @@ namespace OpenSim.Framework
|
|||
|
||||
return l_EstateAccess.Contains(user);
|
||||
}
|
||||
|
||||
public void loadConfigurationOptions()
|
||||
{
|
||||
configMember.addConfigurationOption("billable_factor",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
|
||||
String.Empty, "0.0", true);
|
||||
|
||||
// configMember.addConfigurationOption("estate_id",
|
||||
// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
|
||||
// String.Empty, "100", true);
|
||||
|
||||
// configMember.addConfigurationOption("parent_estate_id",
|
||||
// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
|
||||
// String.Empty, "1", true);
|
||||
|
||||
configMember.addConfigurationOption("redirect_grid_x",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
String.Empty, "0", true);
|
||||
|
||||
configMember.addConfigurationOption("redirect_grid_y",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
String.Empty, "0", true);
|
||||
|
||||
configMember.addConfigurationOption("price_per_meter",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
|
||||
String.Empty, "1", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_name",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
|
||||
String.Empty, "My Estate", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_0",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_1",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_2",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_3",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_4",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_5",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_6",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_7",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_8",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("estate_manager_9",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, "00000000-0000-0000-0000-000000000000", true);
|
||||
|
||||
configMember.addConfigurationOption("region_flags",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
|
||||
String.Empty, "336723974", true);
|
||||
}
|
||||
|
||||
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
|
||||
{
|
||||
switch (configuration_key)
|
||||
{
|
||||
case "region_flags":
|
||||
RegionFlags flags = (RegionFlags)(uint)configuration_result;
|
||||
if ((flags & (RegionFlags)(1<<29)) != 0)
|
||||
m_AllowVoice = true;
|
||||
if ((flags & RegionFlags.AllowDirectTeleport) != 0)
|
||||
m_AllowDirectTeleport = true;
|
||||
if ((flags & RegionFlags.DenyAnonymous) != 0)
|
||||
m_DenyAnonymous = true;
|
||||
if ((flags & RegionFlags.DenyIdentified) != 0)
|
||||
m_DenyIdentified = true;
|
||||
if ((flags & RegionFlags.DenyTransacted) != 0)
|
||||
m_DenyTransacted = true;
|
||||
if ((flags & RegionFlags.AbuseEmailToEstateOwner) != 0)
|
||||
m_AbuseEmailToEstateOwner = true;
|
||||
if ((flags & RegionFlags.BlockDwell) != 0)
|
||||
m_BlockDwell = true;
|
||||
if ((flags & RegionFlags.EstateSkipScripts) != 0)
|
||||
m_EstateSkipScripts = true;
|
||||
if ((flags & RegionFlags.ResetHomeOnTeleport) != 0)
|
||||
m_ResetHomeOnTeleport = true;
|
||||
if ((flags & RegionFlags.TaxFree) != 0)
|
||||
m_TaxFree = true;
|
||||
if ((flags & RegionFlags.PublicAllowed) != 0)
|
||||
m_PublicAccess = true;
|
||||
break;
|
||||
case "billable_factor":
|
||||
m_BillableFactor = (float) configuration_result;
|
||||
break;
|
||||
// case "estate_id":
|
||||
// m_EstateID = (uint) configuration_result;
|
||||
// break;
|
||||
// case "parent_estate_id":
|
||||
// m_ParentEstateID = (uint) configuration_result;
|
||||
// break;
|
||||
case "redirect_grid_x":
|
||||
m_RedirectGridX = (int) configuration_result;
|
||||
break;
|
||||
case "redirect_grid_y":
|
||||
m_RedirectGridY = (int) configuration_result;
|
||||
break;
|
||||
case "price_per_meter":
|
||||
m_PricePerMeter = Convert.ToInt32(configuration_result);
|
||||
break;
|
||||
case "estate_name":
|
||||
m_EstateName = (string) configuration_result;
|
||||
break;
|
||||
case "estate_manager_0":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_1":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_2":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_3":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_4":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_5":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_6":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_7":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_8":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
case "estate_manager_9":
|
||||
AddEstateManager((UUID)configuration_result);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,8 +33,6 @@ namespace OpenSim.Framework
|
|||
{
|
||||
public class RegionSettings
|
||||
{
|
||||
private ConfigurationMember configMember;
|
||||
|
||||
public delegate void SaveDelegate(RegionSettings rs);
|
||||
|
||||
public event SaveDelegate OnSave;
|
||||
|
@ -47,202 +45,6 @@ namespace OpenSim.Framework
|
|||
public static readonly UUID DEFAULT_TERRAIN_TEXTURE_3 = new UUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
|
||||
public static readonly UUID DEFAULT_TERRAIN_TEXTURE_4 = new UUID("beb169c7-11ea-fff2-efe5-0f24dc881df2");
|
||||
|
||||
public RegionSettings()
|
||||
{
|
||||
if (configMember == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true);
|
||||
configMember.performConfigurationRetrieve();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadConfigurationOptions()
|
||||
{
|
||||
configMember.addConfigurationOption("region_flags",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
|
||||
String.Empty, "336723974", true);
|
||||
|
||||
configMember.addConfigurationOption("max_agents",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
String.Empty, "40", true);
|
||||
|
||||
configMember.addConfigurationOption("object_bonus_factor",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "1.0", true);
|
||||
|
||||
configMember.addConfigurationOption("sim_access",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
|
||||
String.Empty, "21", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_base_0",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, DEFAULT_TERRAIN_TEXTURE_1.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_base_1",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, DEFAULT_TERRAIN_TEXTURE_2.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_base_2",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, DEFAULT_TERRAIN_TEXTURE_3.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_base_3",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
|
||||
String.Empty, DEFAULT_TERRAIN_TEXTURE_4.ToString(), true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_start_height_0",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "10.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_start_height_1",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "10.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_start_height_2",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "10.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_start_height_3",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "10.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_height_range_0",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "60.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_height_range_1",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "60.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_height_range_2",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "60.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_height_range_3",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "60.0", true);
|
||||
|
||||
configMember.addConfigurationOption("region_water_height",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "20.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_raise_limit",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "100.0", true);
|
||||
|
||||
configMember.addConfigurationOption("terrain_lower_limit",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "-100.0", true);
|
||||
|
||||
configMember.addConfigurationOption("sun_hour",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE,
|
||||
String.Empty, "0.0", true);
|
||||
}
|
||||
|
||||
public bool HandleIncomingConfiguration(string key, object value)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case "region_flags":
|
||||
RegionFlags flags = (RegionFlags)(uint)value;
|
||||
|
||||
m_BlockTerraform =
|
||||
(flags & RegionFlags.BlockTerraform) != 0;
|
||||
m_BlockFly =
|
||||
(flags & RegionFlags.NoFly) != 0;
|
||||
m_AllowDamage =
|
||||
(flags & RegionFlags.AllowDamage) != 0;
|
||||
m_RestrictPushing =
|
||||
(flags & RegionFlags.RestrictPushObject) != 0;
|
||||
m_AllowLandResell =
|
||||
(flags & RegionFlags.BlockLandResell) == 0;
|
||||
m_AllowLandJoinDivide =
|
||||
(flags & RegionFlags.AllowParcelChanges) != 0;
|
||||
m_BlockShowInSearch =
|
||||
((uint)flags & (1 << 29)) != 0;
|
||||
m_DisableScripts =
|
||||
(flags & RegionFlags.SkipScripts) != 0;
|
||||
m_DisableCollisions =
|
||||
(flags & RegionFlags.SkipCollisions) != 0;
|
||||
m_DisablePhysics =
|
||||
(flags & RegionFlags.SkipPhysics) != 0;
|
||||
m_FixedSun =
|
||||
(flags & RegionFlags.SunFixed) != 0;
|
||||
m_Sandbox =
|
||||
(flags & RegionFlags.Sandbox) != 0;
|
||||
break;
|
||||
case "max_agents":
|
||||
m_AgentLimit = (int)value;
|
||||
break;
|
||||
case "object_bonus_factor":
|
||||
m_ObjectBonus = (double)value;
|
||||
break;
|
||||
case "sim_access":
|
||||
int access = (int)value;
|
||||
if (access <= 13)
|
||||
m_Maturity = 0;
|
||||
else
|
||||
m_Maturity = 1;
|
||||
break;
|
||||
case "terrain_base_0":
|
||||
m_TerrainTexture1 = (UUID)value;
|
||||
break;
|
||||
case "terrain_base_1":
|
||||
m_TerrainTexture2 = (UUID)value;
|
||||
break;
|
||||
case "terrain_base_2":
|
||||
m_TerrainTexture3 = (UUID)value;
|
||||
break;
|
||||
case "terrain_base_3":
|
||||
m_TerrainTexture4 = (UUID)value;
|
||||
break;
|
||||
case "terrain_start_height_0":
|
||||
m_Elevation1SW = (double)value;
|
||||
break;
|
||||
case "terrain_start_height_1":
|
||||
m_Elevation1NW = (double)value;
|
||||
break;
|
||||
case "terrain_start_height_2":
|
||||
m_Elevation1SE = (double)value;
|
||||
break;
|
||||
case "terrain_start_height_3":
|
||||
m_Elevation1NE = (double)value;
|
||||
break;
|
||||
case "terrain_height_range_0":
|
||||
m_Elevation2SW = (double)value;
|
||||
break;
|
||||
case "terrain_height_range_1":
|
||||
m_Elevation2NW = (double)value;
|
||||
break;
|
||||
case "terrain_height_range_2":
|
||||
m_Elevation2SE = (double)value;
|
||||
break;
|
||||
case "terrain_height_range_3":
|
||||
m_Elevation2NE = (double)value;
|
||||
break;
|
||||
case "region_water_height":
|
||||
m_WaterHeight = (double)value;
|
||||
break;
|
||||
case "terrain_raise_limit":
|
||||
m_TerrainRaiseLimit = (double)value;
|
||||
break;
|
||||
case "terrain_lower_limit":
|
||||
m_TerrainLowerLimit = (double)value;
|
||||
break;
|
||||
case "sun_hour":
|
||||
m_SunPosition = (double)value;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
if (OnSave != null)
|
||||
|
|
|
@ -1170,6 +1170,16 @@ namespace OpenSim.Framework
|
|||
|
||||
}
|
||||
|
||||
public static uint ConvertAccessLevelToMaturity(byte maturity)
|
||||
{
|
||||
if (maturity <= 13)
|
||||
return 0;
|
||||
else if (maturity <= 21)
|
||||
return 1;
|
||||
else
|
||||
return 2;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Produces an OSDMap from its string representation on a stream
|
||||
/// </summary>
|
||||
|
|
|
@ -2659,7 +2659,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
|
||||
// Bit 0: Mature, bit 7: on sale, other bits: no idea
|
||||
reply.Data.Flags = (byte)(
|
||||
((land.Flags & (uint)ParcelFlags.MaturePublish) != 0 ? (1 << 0) : 0) +
|
||||
(info.AccessLevel > 13 ? (1 << 0) : 0) +
|
||||
((land.Flags & (uint)ParcelFlags.ForSale) != 0 ? (1 << 7) : 0));
|
||||
|
||||
Vector3 pos = land.UserLocation;
|
||||
|
@ -2667,8 +2667,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
{
|
||||
pos = (land.AABBMax + land.AABBMin) * 0.5f;
|
||||
}
|
||||
reply.Data.GlobalX = info.RegionLocX * Constants.RegionSize + x;
|
||||
reply.Data.GlobalY = info.RegionLocY * Constants.RegionSize + y;
|
||||
reply.Data.GlobalX = info.RegionLocX + x;
|
||||
reply.Data.GlobalY = info.RegionLocY + y;
|
||||
reply.Data.GlobalZ = pos.Z;
|
||||
reply.Data.SimName = Utils.StringToBytes(info.RegionName);
|
||||
reply.Data.SnapshotID = land.SnapshotID;
|
||||
|
@ -2700,31 +2700,56 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
|
||||
packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
|
||||
|
||||
packet.QueryReplies =
|
||||
new DirPlacesReplyPacket.QueryRepliesBlock[data.Length];
|
||||
packet.AgentData.AgentID = AgentId;
|
||||
|
||||
packet.StatusData = new DirPlacesReplyPacket.StatusDataBlock[
|
||||
data.Length];
|
||||
packet.QueryData[0].QueryID = queryID;
|
||||
|
||||
DirPlacesReplyPacket.QueryRepliesBlock[] replies =
|
||||
new DirPlacesReplyPacket.QueryRepliesBlock[0];
|
||||
DirPlacesReplyPacket.StatusDataBlock[] status =
|
||||
new DirPlacesReplyPacket.StatusDataBlock[0];
|
||||
|
||||
int i = 0;
|
||||
foreach (DirPlacesReplyData d in data)
|
||||
{
|
||||
int idx = replies.Length;
|
||||
Array.Resize(ref replies, idx + 1);
|
||||
Array.Resize(ref status, idx + 1);
|
||||
|
||||
replies[idx] = new DirPlacesReplyPacket.QueryRepliesBlock();
|
||||
status[idx] = new DirPlacesReplyPacket.StatusDataBlock();
|
||||
replies[idx].ParcelID = d.parcelID;
|
||||
replies[idx].Name = Utils.StringToBytes(d.name);
|
||||
replies[idx].ForSale = d.forSale;
|
||||
replies[idx].Auction = d.auction;
|
||||
replies[idx].Dwell = d.dwell;
|
||||
status[idx].Status = d.Status;
|
||||
|
||||
packet.QueryReplies = replies;
|
||||
packet.StatusData = status;
|
||||
|
||||
if (packet.Length >= 1000)
|
||||
{
|
||||
OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
|
||||
packet = (DirPlacesReplyPacket)PacketPool.Instance.GetPacket(PacketType.DirPlacesReply);
|
||||
|
||||
packet.AgentData = new DirPlacesReplyPacket.AgentDataBlock();
|
||||
|
||||
packet.QueryData = new DirPlacesReplyPacket.QueryDataBlock[1];
|
||||
packet.QueryData[0] = new DirPlacesReplyPacket.QueryDataBlock();
|
||||
|
||||
packet.AgentData.AgentID = AgentId;
|
||||
|
||||
packet.QueryData[0].QueryID = queryID;
|
||||
|
||||
int i = 0;
|
||||
foreach (DirPlacesReplyData d in data)
|
||||
{
|
||||
packet.QueryReplies[i] =
|
||||
new DirPlacesReplyPacket.QueryRepliesBlock();
|
||||
packet.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock();
|
||||
packet.QueryReplies[i].ParcelID = d.parcelID;
|
||||
packet.QueryReplies[i].Name = Utils.StringToBytes(d.name);
|
||||
packet.QueryReplies[i].ForSale = d.forSale;
|
||||
packet.QueryReplies[i].Auction = d.auction;
|
||||
packet.QueryReplies[i].Dwell = d.dwell;
|
||||
packet.StatusData[i].Status = d.Status;
|
||||
i++;
|
||||
replies = new DirPlacesReplyPacket.QueryRepliesBlock[0];
|
||||
status = new DirPlacesReplyPacket.StatusDataBlock[0];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (replies.Length > 0)
|
||||
OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
|
@ -4738,7 +4763,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale);
|
||||
AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation);
|
||||
AddLocalPacketHandler(PacketType.ObjectFlagUpdate, HandleObjectFlagUpdate);
|
||||
AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage);
|
||||
|
||||
// Handle ObjectImage (TextureEntry) updates synchronously, since when updating multiple prim faces at once,
|
||||
// some clients will send out a separate ObjectImage packet for each face
|
||||
AddLocalPacketHandler(PacketType.ObjectImage, HandleObjectImage, false);
|
||||
|
||||
AddLocalPacketHandler(PacketType.ObjectGrab, HandleObjectGrab, false);
|
||||
AddLocalPacketHandler(PacketType.ObjectGrabUpdate, HandleObjectGrabUpdate, false);
|
||||
AddLocalPacketHandler(PacketType.ObjectDeGrab, HandleObjectDeGrab);
|
||||
|
|
|
@ -126,6 +126,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
|||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
if (client != null)
|
||||
im.fromAgentName = client.FirstName + " " + client.LastName;
|
||||
m_TransferModule.SendInstantMessage(im,
|
||||
delegate(bool success)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// The maximum major version of archive that we can read. Minor versions shouldn't need a max number since version
|
||||
/// bumps here should be compatible.
|
||||
/// </summary>
|
||||
public static int MAX_MAJOR_VERSION = 0;
|
||||
|
||||
protected TarArchiveReader archive;
|
||||
|
||||
private CachedUserInfo m_userInfo;
|
||||
|
@ -126,7 +132,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
{
|
||||
while ((data = archive.ReadEntry(out filePath, out entryType)) != null)
|
||||
{
|
||||
if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
||||
if (filePath == ArchiveConstants.CONTROL_FILE_PATH)
|
||||
{
|
||||
LoadControlFile(filePath, data);
|
||||
}
|
||||
else if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH))
|
||||
{
|
||||
if (LoadAsset(filePath, data))
|
||||
successfulAssetRestores++;
|
||||
|
@ -432,5 +442,44 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load control file
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <param name="data"></param>
|
||||
protected void LoadControlFile(string path, byte[] data)
|
||||
{
|
||||
int majorVersion = -1;
|
||||
int minorVersion = -1;
|
||||
string version = "ERROR";
|
||||
|
||||
NameTable nt = new NameTable();
|
||||
XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt);
|
||||
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
|
||||
XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
|
||||
while (xtr.Read())
|
||||
{
|
||||
if (xtr.NodeType == XmlNodeType.Element)
|
||||
{
|
||||
if (xtr.Name.ToString() == "archive")
|
||||
{
|
||||
majorVersion = int.Parse(xtr["major_version"]);
|
||||
minorVersion = int.Parse(xtr["minor_version"]);
|
||||
version = string.Format("{0}.{1}", majorVersion, minorVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (majorVersion > MAX_MAJOR_VERSION)
|
||||
{
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"The IAR you are trying to load has major version number of {0} but this version of OpenSim can only load IARs with major version number {1} and below",
|
||||
majorVersion, MAX_MAJOR_VERSION));
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Loading IAR with version {0}", version);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
|
|||
|
||||
#region ILandService
|
||||
|
||||
public LandData GetLandData(ulong regionHandle, uint x, uint y)
|
||||
public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
|
||||
{
|
||||
m_log.DebugFormat("[LAND IN CONNECTOR]: GetLandData for {0}. Count = {1}",
|
||||
regionHandle, m_Scenes.Count);
|
||||
|
@ -130,10 +130,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Land
|
|||
if (s.RegionInfo.RegionHandle == regionHandle)
|
||||
{
|
||||
m_log.Debug("[LAND IN CONNECTOR]: Found region to GetLandData from");
|
||||
regionAccess = s.RegionInfo.AccessLevel;
|
||||
return s.GetLandData(x, y);
|
||||
}
|
||||
}
|
||||
m_log.DebugFormat("[LAND IN CONNECTOR]: region handle {0} not found", regionHandle);
|
||||
regionAccess = 42;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -116,8 +116,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
|
|||
|
||||
#region ILandService
|
||||
|
||||
public LandData GetLandData(ulong regionHandle, uint x, uint y)
|
||||
public LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
|
||||
{
|
||||
regionAccess = 2;
|
||||
m_log.DebugFormat("[LAND CONNECTOR]: request for land data in {0} at {1}, {2}",
|
||||
regionHandle, x, y);
|
||||
|
||||
|
@ -126,6 +127,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
|
|||
if (s.RegionInfo.RegionHandle == regionHandle)
|
||||
{
|
||||
LandData land = s.GetLandData(x, y);
|
||||
regionAccess = s.RegionInfo.AccessLevel;
|
||||
return land;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
|
|||
if (!m_Enabled)
|
||||
return;
|
||||
|
||||
m_GridService = scene.GridService;
|
||||
m_LocalService.AddRegion(scene);
|
||||
scene.RegisterModuleInterface<ILandService>(this);
|
||||
}
|
||||
|
@ -103,18 +102,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land
|
|||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if (m_Enabled)
|
||||
m_GridService = scene.GridService;
|
||||
}
|
||||
|
||||
|
||||
#region ILandService
|
||||
|
||||
public override LandData GetLandData(ulong regionHandle, uint x, uint y)
|
||||
public override LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
|
||||
{
|
||||
LandData land = m_LocalService.GetLandData(regionHandle, x, y);
|
||||
LandData land = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
|
||||
if (land != null)
|
||||
return land;
|
||||
|
||||
return base.GetLandData(regionHandle, x, y);
|
||||
return base.GetLandData(regionHandle, x, y, out regionAccess);
|
||||
|
||||
}
|
||||
#endregion ILandService
|
||||
|
|
|
@ -52,6 +52,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// The maximum major version of OAR that we can read. Minor versions shouldn't need a number since version
|
||||
/// bumps here should be compatible.
|
||||
/// </summary>
|
||||
public static int MAX_MAJOR_VERSION = 0;
|
||||
|
||||
private static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding();
|
||||
private static UTF8Encoding m_utf8Encoding = new UTF8Encoding();
|
||||
|
||||
|
@ -556,6 +562,22 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
|||
{
|
||||
if (xtr.NodeType == XmlNodeType.Element)
|
||||
{
|
||||
if (xtr.Name.ToString() == "archive")
|
||||
{
|
||||
int majorVersion = int.Parse(xtr["major_version"]);
|
||||
int minorVersion = int.Parse(xtr["minor_version"]);
|
||||
string version = string.Format("{0}.{1}", majorVersion, minorVersion);
|
||||
|
||||
if (majorVersion > MAX_MAJOR_VERSION)
|
||||
{
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below",
|
||||
majorVersion, MAX_MAJOR_VERSION));
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version);
|
||||
}
|
||||
if (xtr.Name.ToString() == "datetime")
|
||||
{
|
||||
int value;
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
public LandData LandData;
|
||||
public ulong RegionHandle;
|
||||
public uint X, Y;
|
||||
public byte RegionAccess;
|
||||
}
|
||||
|
||||
public class LandManagementModule : INonSharedRegionModule
|
||||
|
@ -1376,13 +1377,15 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
|
||||
extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
ILandService landService = m_scene.RequestModuleInterface<ILandService>();
|
||||
extLandData.LandData = landService.GetLandData(extLandData.RegionHandle,
|
||||
extLandData.X,
|
||||
extLandData.Y);
|
||||
extLandData.Y,
|
||||
out extLandData.RegionAccess);
|
||||
if (extLandData.LandData == null)
|
||||
{
|
||||
// we didn't find the region/land => don't cache
|
||||
|
@ -1414,6 +1417,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
|||
r.RegionName = info.RegionName;
|
||||
r.RegionLocX = (uint)info.RegionLocX;
|
||||
r.RegionLocY = (uint)info.RegionLocY;
|
||||
r.RegionSettings.Maturity = (int)Util.ConvertAccessLevelToMaturity(data.RegionAccess);
|
||||
remoteClient.SendParcelInfo(r, data.LandData, parcelID, data.X, data.Y);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -142,9 +142,18 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
|||
node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString();
|
||||
xmlobject.AppendChild(node);
|
||||
|
||||
if (land != null && land.LandData != null)
|
||||
{
|
||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", "");
|
||||
node.InnerText = land.LandData.GlobalID.ToString();
|
||||
xmlobject.AppendChild(node);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Something is wrong with this object. Let's not list it.
|
||||
m_log.WarnFormat("[DATASNAPSHOT]: Bad data for object {0} ({1}) in region {2}", obj.Name, obj.UUID, m_scene.RegionInfo.RegionName);
|
||||
continue;
|
||||
}
|
||||
|
||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
|
||||
Vector3 loc = obj.AbsolutePosition;
|
||||
|
|
|
@ -30,6 +30,7 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using OpenSim.Region.DataSnapshot.Interfaces;
|
||||
|
@ -98,6 +99,8 @@ namespace OpenSim.Region.DataSnapshot
|
|||
{
|
||||
String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
|
||||
|
||||
try
|
||||
{
|
||||
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
||||
{
|
||||
snapXWriter.Formatting = Formatting.Indented;
|
||||
|
@ -106,6 +109,12 @@ namespace OpenSim.Region.DataSnapshot
|
|||
snapXWriter.WriteEndDocument();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//mark provider as not stale, parent scene as stale
|
||||
provider.Stale = false;
|
||||
|
@ -185,6 +194,8 @@ namespace OpenSim.Region.DataSnapshot
|
|||
//save snapshot
|
||||
String path = DataFileNameScene(scene);
|
||||
|
||||
try
|
||||
{
|
||||
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
|
||||
{
|
||||
snapXWriter.Formatting = Formatting.Indented;
|
||||
|
@ -192,6 +203,11 @@ namespace OpenSim.Region.DataSnapshot
|
|||
regionElement.WriteTo(snapXWriter);
|
||||
snapXWriter.WriteEndDocument();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
|
||||
}
|
||||
|
||||
m_scenes[scene] = false;
|
||||
|
||||
|
@ -206,15 +222,23 @@ namespace OpenSim.Region.DataSnapshot
|
|||
#region Helpers
|
||||
private string DataFileNameFragment(Scene scene, String fragmentName)
|
||||
{
|
||||
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName + "_" + fragmentName, "xml"));
|
||||
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml"));
|
||||
}
|
||||
|
||||
private string DataFileNameScene(Scene scene)
|
||||
{
|
||||
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName, "xml"));
|
||||
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName), "xml"));
|
||||
//return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml");
|
||||
}
|
||||
|
||||
private static string Sanitize(string name)
|
||||
{
|
||||
string invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars()));
|
||||
string invalidReStr = string.Format(@"[{0}]", invalidChars);
|
||||
string newname = Regex.Replace(name, invalidReStr, "_");
|
||||
return newname.Replace('.', '_');
|
||||
}
|
||||
|
||||
private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc)
|
||||
{
|
||||
XmlNode docElement = basedoc.CreateNode(XmlNodeType.Element, "region", "");
|
||||
|
|
|
@ -744,6 +744,12 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
InventoryFolderBase f = new InventoryFolderBase(folderID, remoteClient.AgentId);
|
||||
InventoryFolderBase folder = InventoryService.GetFolder(f);
|
||||
|
||||
if (folder == null || folder.Owner != remoteClient.AgentId)
|
||||
return;
|
||||
|
||||
if (transactionID == UUID.Zero)
|
||||
{
|
||||
CachedUserInfo userInfo
|
||||
|
@ -853,6 +859,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
SceneObjectGroup group = part.ParentGroup;
|
||||
if (group != null)
|
||||
{
|
||||
if (!Permissions.CanEditObjectInventory(part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
TaskInventoryItem item = group.GetInventoryItem(localID, itemID);
|
||||
if (item == null)
|
||||
return;
|
||||
|
|
|
@ -494,6 +494,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public void HandleFetchInventoryDescendents(IClientAPI remoteClient, UUID folderID, UUID ownerID,
|
||||
bool fetchFolders, bool fetchItems, int sortOrder)
|
||||
{
|
||||
if (folderID == UUID.Zero)
|
||||
return;
|
||||
|
||||
// FIXME MAYBE: We're not handling sortOrder!
|
||||
|
||||
// TODO: This code for looking in the folder for the library should be folded back into the
|
||||
|
|
|
@ -4602,6 +4602,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (part.ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
if (part.OwnerID != client.AgentId)
|
||||
return;
|
||||
|
||||
part = part.ParentGroup.RootPart;
|
||||
|
||||
part.ObjectSaleType = saleType;
|
||||
|
|
|
@ -386,8 +386,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
|
||||
// the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
|
||||
|
||||
_flags = 0;
|
||||
_flags |= PrimFlags.CreateSelected;
|
||||
_flags = PrimFlags.CreateSelected;
|
||||
|
||||
TrimPermissions();
|
||||
//m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());
|
||||
|
@ -843,7 +842,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
set
|
||||
{
|
||||
m_color = value;
|
||||
TriggerScriptChangedEvent(Changed.COLOR);
|
||||
|
||||
/* ScheduleFullUpdate() need not be called b/c after
|
||||
* setting the color, the text will be set, so then
|
||||
|
@ -1912,8 +1910,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public void GetProperties(IClientAPI client)
|
||||
{
|
||||
//Viewer wants date in microseconds so multiply it by 1,000,000.
|
||||
client.SendObjectPropertiesReply(
|
||||
m_fromUserInventoryItemID, (ulong)_creationDate, _creatorID, UUID.Zero, UUID.Zero,
|
||||
m_fromUserInventoryItemID, (ulong)_creationDate*(ulong)1e6, _creatorID, UUID.Zero, UUID.Zero,
|
||||
_groupID, (short)InventorySerial, _lastOwnerID, UUID, _ownerID,
|
||||
ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description,
|
||||
ParentGroup.RootPart._ownerMask, ParentGroup.RootPart._nextOwnerMask, ParentGroup.RootPart._groupMask, ParentGroup.RootPart._everyoneMask,
|
||||
|
|
|
@ -772,6 +772,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// isn't available (such as drag from prim inventory to agent inventory)
|
||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
||||
|
||||
bool includeAssets = false;
|
||||
if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
|
||||
includeAssets = true;
|
||||
|
||||
lock (m_items)
|
||||
{
|
||||
foreach (TaskInventoryItem item in m_items.Values)
|
||||
|
@ -802,7 +806,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
invString.AddNameValueLine("group_id", item.GroupID.ToString());
|
||||
invString.AddSectionEnd();
|
||||
|
||||
if (includeAssets)
|
||||
invString.AddNameValueLine("asset_id", item.AssetID.ToString());
|
||||
else
|
||||
invString.AddNameValueLine("asset_id", UUID.Zero.ToString());
|
||||
invString.AddNameValueLine("type", TaskInventoryItem.Types[item.Type]);
|
||||
invString.AddNameValueLine("inv_type", TaskInventoryItem.InvTypes[item.InvType]);
|
||||
invString.AddNameValueLine("flags", Utils.UIntToHexString(item.Flags));
|
||||
|
|
|
@ -85,6 +85,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
/// <param name="assetType">The type of the asset for the uuid given</param>
|
||||
/// <param name="assetUuids">The assets gathered</param>
|
||||
public void GatherAssetUuids(UUID assetUuid, AssetType assetType, IDictionary<UUID, int> assetUuids)
|
||||
{
|
||||
try
|
||||
{
|
||||
assetUuids[assetUuid] = 1;
|
||||
|
||||
|
@ -105,6 +107,14 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
GetSceneObjectAssetUuids(assetUuid, assetUuids);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[UUID GATHERER]: Failed to gather uuids for asset id {0}, type {1}",
|
||||
assetUuid, assetType);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gather all the asset uuids associated with a given object.
|
||||
|
|
|
@ -844,12 +844,37 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
|
|||
}
|
||||
|
||||
Scene s = LocateSceneClientIn(remoteClient.AgentId);
|
||||
|
||||
// Implmenting base sale data checking here so the default OpenSimulator implementation isn't useless
|
||||
// combined with other implementations. We're actually validating that the client is sending the data
|
||||
// that it should. In theory, the client should already know what to send here because it'll see it when it
|
||||
// gets the object data. If the data sent by the client doesn't match the object, the viewer probably has an
|
||||
// old idea of what the object properties are. Viewer developer Hazim informed us that the base module
|
||||
// didn't check the client sent data against the object do any. Since the base modules are the
|
||||
// 'crowning glory' examples of good practice..
|
||||
|
||||
// Validate that the object exists in the scene the user is in
|
||||
SceneObjectPart part = s.GetSceneObjectPart(localID);
|
||||
if (part == null)
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Unable to buy now. The object was not found.", false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate that the client sent the price that the object is being sold for
|
||||
if (part.SalePrice != salePrice)
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Cannot buy at this price. Buy Failed. If you continue to get this relog.", false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Validate that the client sent the proper sale type the object has set
|
||||
if (part.ObjectSaleType != saleType)
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Cannot buy this way. Buy Failed. If you continue to get this relog.", false);
|
||||
return;
|
||||
}
|
||||
|
||||
s.PerformObjectBuy(remoteClient, categoryID, localID, saleType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,6 +68,13 @@ using System.Reflection;
|
|||
|
||||
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
// MUST be a ref type
|
||||
public class UserInfoCacheEntry
|
||||
{
|
||||
public int time;
|
||||
public UserProfileData userProfile;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains all LSL ll-functions. This class will be in Default AppDomain.
|
||||
/// </summary>
|
||||
|
@ -92,6 +99,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
protected int m_scriptConsoleChannel = 0;
|
||||
protected bool m_scriptConsoleChannelEnabled = false;
|
||||
protected IUrlModule m_UrlModule = null;
|
||||
protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache =
|
||||
new Dictionary<UUID, UserInfoCacheEntry>();
|
||||
|
||||
public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID)
|
||||
{
|
||||
|
@ -1902,16 +1911,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
else
|
||||
{
|
||||
//it's late... i think this is right ?
|
||||
if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f)
|
||||
{
|
||||
part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z);
|
||||
LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos);
|
||||
part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z);
|
||||
SceneObjectGroup parent = part.ParentGroup;
|
||||
parent.HasGroupChanged = true;
|
||||
parent.ScheduleGroupForTerseUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_Vector llGetPos()
|
||||
{
|
||||
|
@ -3882,8 +3888,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
UUID uuid = (UUID)id;
|
||||
|
||||
UserProfileData userProfile =
|
||||
World.CommsManager.UserService.GetUserProfile(uuid);
|
||||
UserProfileData userProfile;
|
||||
|
||||
UserInfoCacheEntry ce;
|
||||
if (!m_userInfoCache.TryGetValue(uuid, out ce))
|
||||
{
|
||||
userProfile = World.CommsManager.UserService.GetUserProfile(uuid);
|
||||
if (userProfile == null)
|
||||
{
|
||||
m_userInfoCache[uuid] = null; // Cache negative
|
||||
return UUID.Zero.ToString();
|
||||
}
|
||||
|
||||
UserAgentData userAgent =
|
||||
World.CommsManager.UserService.GetAgentByUUID(uuid);
|
||||
|
@ -3891,6 +3906,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (userProfile == null || userAgent == null)
|
||||
return UUID.Zero.ToString();
|
||||
|
||||
ce = new UserInfoCacheEntry();
|
||||
ce.time = Util.EnvironmentTickCount();
|
||||
ce.userProfile = userProfile;
|
||||
m_userInfoCache[uuid] = ce;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ce == null)
|
||||
return UUID.Zero.ToString();
|
||||
|
||||
userProfile = ce.userProfile;
|
||||
}
|
||||
|
||||
if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000)
|
||||
{
|
||||
userProfile = World.CommsManager.UserService.GetUserProfile(uuid);
|
||||
ce.time = Util.EnvironmentTickCount();
|
||||
ce.userProfile = userProfile;
|
||||
}
|
||||
|
||||
string reply = String.Empty;
|
||||
|
||||
switch (data)
|
||||
|
|
|
@ -66,7 +66,8 @@ namespace OpenSim.Server.Handlers.Land
|
|||
uint y = Convert.ToUInt32(requestData["y"]);
|
||||
m_log.DebugFormat("[LAND HANDLER]: Got request for land data at {0}, {1} for region {2}", x, y, regionHandle);
|
||||
|
||||
LandData landData = m_LocalService.GetLandData(regionHandle, x, y);
|
||||
byte regionAccess;
|
||||
LandData landData = m_LocalService.GetLandData(regionHandle, x, y, out regionAccess);
|
||||
Hashtable hash = new Hashtable();
|
||||
if (landData != null)
|
||||
{
|
||||
|
@ -83,6 +84,7 @@ namespace OpenSim.Server.Handlers.Land
|
|||
hash["SalePrice"] = landData.SalePrice.ToString();
|
||||
hash["SnapshotID"] = landData.SnapshotID.ToString();
|
||||
hash["UserLocation"] = landData.UserLocation.ToString();
|
||||
hash["RegionAccess"] = regionAccess.ToString();
|
||||
}
|
||||
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace OpenSim.Services.Connectors
|
|||
m_GridService = gridServices;
|
||||
}
|
||||
|
||||
public virtual LandData GetLandData(ulong regionHandle, uint x, uint y)
|
||||
public virtual LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess)
|
||||
{
|
||||
LandData landData = null;
|
||||
Hashtable hash = new Hashtable();
|
||||
|
@ -74,6 +74,7 @@ namespace OpenSim.Services.Connectors
|
|||
|
||||
IList paramList = new ArrayList();
|
||||
paramList.Add(hash);
|
||||
regionAccess = 42; // Default to adult. Better safe...
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -107,6 +108,8 @@ namespace OpenSim.Services.Connectors
|
|||
landData.SalePrice = Convert.ToInt32(hash["SalePrice"]);
|
||||
landData.SnapshotID = new UUID((string)hash["SnapshotID"]);
|
||||
landData.UserLocation = Vector3.Parse((string)hash["UserLocation"]);
|
||||
if (hash["RegionAccess"] != null)
|
||||
regionAccess = (byte)Convert.ToInt32((string)hash["RegionAccess"]);
|
||||
m_log.DebugFormat("[OGS1 GRID SERVICES] Got land data for parcel {0}", landData.Name);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -33,6 +33,6 @@ namespace OpenSim.Services.Interfaces
|
|||
{
|
||||
public interface ILandService
|
||||
{
|
||||
LandData GetLandData(ulong regionHandle, uint x, uint y);
|
||||
LandData GetLandData(ulong regionHandle, uint x, uint y, out byte regionAccess);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService
|
|||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected IXInventoryData m_Database;
|
||||
protected bool m_AllowDelete = true;
|
||||
|
||||
public XInventoryService(IConfigSource config) : base(config)
|
||||
{
|
||||
|
@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService
|
|||
{
|
||||
dllName = authConfig.GetString("StorageProvider", dllName);
|
||||
connString = authConfig.GetString("ConnectionString", connString);
|
||||
m_AllowDelete = authConfig.GetBoolean("AllowDelete", true);
|
||||
// realm = authConfig.GetString("Realm", realm);
|
||||
}
|
||||
|
||||
|
@ -268,13 +270,35 @@ namespace OpenSim.Services.InventoryService
|
|||
|
||||
public bool AddFolder(InventoryFolderBase folder)
|
||||
{
|
||||
InventoryFolderBase check = GetFolder(folder);
|
||||
if (check != null)
|
||||
return false;
|
||||
|
||||
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
|
||||
return m_Database.StoreFolder(xFolder);
|
||||
}
|
||||
|
||||
public bool UpdateFolder(InventoryFolderBase folder)
|
||||
{
|
||||
XInventoryFolder xFolder = ConvertFromOpenSim(folder);
|
||||
InventoryFolderBase check = GetFolder(folder);
|
||||
if (check == null)
|
||||
return AddFolder(folder);
|
||||
|
||||
if (check.Type != -1 || xFolder.type != -1)
|
||||
{
|
||||
if (xFolder.version > check.Version)
|
||||
return false;
|
||||
check.Version = (ushort)xFolder.version;
|
||||
xFolder = ConvertFromOpenSim(check);
|
||||
return m_Database.StoreFolder(xFolder);
|
||||
}
|
||||
|
||||
if (xFolder.version < check.Version)
|
||||
xFolder.version = check.Version;
|
||||
xFolder.folderID = check.ID;
|
||||
|
||||
return m_Database.StoreFolder(xFolder);
|
||||
}
|
||||
|
||||
public bool MoveFolder(InventoryFolderBase folder)
|
||||
|
@ -295,10 +319,15 @@ namespace OpenSim.Services.InventoryService
|
|||
//
|
||||
public bool DeleteFolders(UUID principalID, List<UUID> folderIDs)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
// Ignore principal ID, it's bogus at connector level
|
||||
//
|
||||
foreach (UUID id in folderIDs)
|
||||
{
|
||||
if (!ParentIsTrash(id))
|
||||
continue;
|
||||
InventoryFolderBase f = new InventoryFolderBase();
|
||||
f.ID = id;
|
||||
PurgeFolder(f);
|
||||
|
@ -310,6 +339,12 @@ namespace OpenSim.Services.InventoryService
|
|||
|
||||
public bool PurgeFolder(InventoryFolderBase folder)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
if (!ParentIsTrash(folder.ID))
|
||||
return false;
|
||||
|
||||
XInventoryFolder[] subFolders = m_Database.GetFolders(
|
||||
new string[] { "parentFolderID" },
|
||||
new string[] { folder.ID.ToString() });
|
||||
|
@ -349,6 +384,9 @@ namespace OpenSim.Services.InventoryService
|
|||
|
||||
public bool DeleteItems(UUID principalID, List<UUID> itemIDs)
|
||||
{
|
||||
if (!m_AllowDelete)
|
||||
return false;
|
||||
|
||||
// Just use the ID... *facepalms*
|
||||
//
|
||||
foreach (UUID id in itemIDs)
|
||||
|
@ -504,5 +542,29 @@ namespace OpenSim.Services.InventoryService
|
|||
|
||||
return newItem;
|
||||
}
|
||||
|
||||
private bool ParentIsTrash(UUID folderID)
|
||||
{
|
||||
XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()});
|
||||
if (folder.Length < 1)
|
||||
return false;
|
||||
|
||||
UUID parentFolder = folder[0].parentFolderID;
|
||||
|
||||
while (parentFolder != UUID.Zero)
|
||||
{
|
||||
XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()});
|
||||
if (parent.Length < 1)
|
||||
return false;
|
||||
|
||||
if (parent[0].type == (int)AssetType.TrashFolder)
|
||||
return true;
|
||||
if (parent[0].type == (int)AssetType.RootFolder)
|
||||
return false;
|
||||
|
||||
parentFolder = parent[0].parentFolderID;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue