Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' through 6/19/2024 into…
Browse files Browse the repository at this point in the history
… develop
  • Loading branch information
mdickson committed Jun 22, 2024
2 parents 201d8e6 + c4635d8 commit 8dc009d
Show file tree
Hide file tree
Showing 37 changed files with 540 additions and 248 deletions.
3 changes: 2 additions & 1 deletion OpenSim/Capabilities/Caps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ public enum CapsFlags: uint
WLEnv = 0x200,
AdvEnv = 0x400,
PBR = 0x800,
ViewerBenefits = 0x1000
ViewerBenefits = 0x1000,
TPBR = 0x2000
}

public CapsFlags Flags { get; set;}
Expand Down
16 changes: 14 additions & 2 deletions OpenSim/Data/MySQL/MySQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,8 @@ public virtual void StoreRegionSettings(RegionSettings rs)
"covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " +
"sunvectorz, loaded_creation_datetime, " +
"loaded_creation_id, map_tile_ID, block_search, casino, " +
"TelehubObject, parcel_tile_ID, cacheID) " +
"TelehubObject, parcel_tile_ID, cacheID, " +
"TerrainPBR1, TerrainPBR2, TerrainPBR3, TerrainPBR4)" +
"values (?RegionUUID, ?BlockTerraform, " +
"?BlockFly, ?AllowDamage, ?RestrictPushing, " +
"?AllowLandResell, ?AllowLandJoinDivide, " +
Expand All @@ -910,7 +911,8 @@ public virtual void StoreRegionSettings(RegionSettings rs)
"?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
"?loaded_creation_datetime, ?loaded_creation_id, " +
"?map_tile_ID, ?block_search, ?casino, " +
"?TelehubObject, ?parcel_tile_ID, ?cacheID)";
"?TelehubObject, ?parcel_tile_ID, ?cacheID, " +
"?TerrainPBR1, ?TerrainPBR2, ?TerrainPBR3, ?TerrainPBR4)";

FillRegionSettingsCommand(cmd, rs);
ExecuteNonQuery(cmd);
Expand Down Expand Up @@ -1295,6 +1297,11 @@ private static RegionSettings BuildRegionSettings(IDataReader row)
if (row["cacheID"] is not DBNull)
newSettings.CacheID = DBGuid.FromDB(row["cacheID"]);

newSettings.TerrainPBR1 = DBGuid.FromDB(row["TerrainPBR1"]);
newSettings.TerrainPBR2 = DBGuid.FromDB(row["TerrainPBR2"]);
newSettings.TerrainPBR3 = DBGuid.FromDB(row["TerrainPBR3"]);
newSettings.TerrainPBR4 = DBGuid.FromDB(row["TerrainPBR4"]);


return newSettings;
}
Expand Down Expand Up @@ -1701,6 +1708,11 @@ private static void FillRegionSettingsCommand(MySqlCommand cmd, RegionSettings s
cmd.Parameters.AddWithValue("parcel_tile_ID", settings.ParcelImageID.ToString());
cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject.ToString());
cmd.Parameters.AddWithValue("cacheID", settings.CacheID.ToString());

cmd.Parameters.AddWithValue("TerrainPBR1", settings.TerrainPBR1.ToString());
cmd.Parameters.AddWithValue("TerrainPBR2", settings.TerrainPBR2.ToString());
cmd.Parameters.AddWithValue("TerrainPBR3", settings.TerrainPBR3.ToString());
cmd.Parameters.AddWithValue("TerrainPBR4", settings.TerrainPBR4.ToString());
}

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions OpenSim/Data/MySQL/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -558,4 +558,11 @@ COMMIT;
:VERSION 65 #----- add linkset data storage column
BEGIN;
ALTER TABLE `prims` ADD COLUMN `linksetdata` MEDIUMTEXT default NULL;
COMMIT;
:VERSION 66 #----- add PBR Terrain storage column
BEGIN;
ALTER TABLE `regionsettings` ADD COLUMN `TerrainPBR1` varchar(36) NOT NULL;
ALTER TABLE `regionsettings` ADD COLUMN `TerrainPBR2` varchar(36) NOT NULL;
ALTER TABLE `regionsettings` ADD COLUMN `TerrainPBR3` varchar(36) NOT NULL;
ALTER TABLE `regionsettings` ADD COLUMN `TerrainPBR4` varchar(36) NOT NULL;
COMMIT;
107 changes: 59 additions & 48 deletions OpenSim/Data/PGSQL/PGSQLSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,8 @@ public void StoreRegionSettings(RegionSettings regionSettings)
,block_show_in_search = :block_show_in_search ,agent_limit = :agent_limit ,object_bonus = :object_bonus ,maturity = :maturity
,disable_scripts = :disable_scripts ,disable_collisions = :disable_collisions ,disable_physics = :disable_physics
,terrain_texture_1 = :terrain_texture_1 ,terrain_texture_2 = :terrain_texture_2 ,terrain_texture_3 = :terrain_texture_3
,terrain_texture_4 = :terrain_texture_4 ,elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw
,terrain_texture_4 = :terrain_texture_4 , TerrainPBR1 = :TerrainPBR1, TerrainPBR2 = :TerrainPBR2, TerrainPBR3 = :TerrainPBR3
,TerrainPBR4 = :TerrainPBR4, elevation_1_nw = :elevation_1_nw ,elevation_2_nw = :elevation_2_nw
,elevation_1_ne = :elevation_1_ne ,elevation_2_ne = :elevation_2_ne ,elevation_1_se = :elevation_1_se ,elevation_2_se = :elevation_2_se
,elevation_1_sw = :elevation_1_sw ,elevation_2_sw = :elevation_2_sw ,water_height = :water_height ,terrain_raise_limit = :terrain_raise_limit
,terrain_lower_limit = :terrain_lower_limit ,use_estate_sun = :use_estate_sun ,fixed_sun = :fixed_sun ,sun_position = :sun_position
Expand Down Expand Up @@ -1074,6 +1075,12 @@ private static RegionSettings BuildRegionSettings(IDataRecord row)

if (!(row["cacheID"] is DBNull))
newSettings.CacheID = new UUID((Guid)row["cacheID"]);

newSettings.TerrainPBR1 = new UUID((Guid)row["TerrainPBR1"]);
newSettings.TerrainPBR2 = new UUID((Guid)row["TerrainPBR2"]);
newSettings.TerrainPBR3 = new UUID((Guid)row["TerrainPBR3"]);
newSettings.TerrainPBR4 = new UUID((Guid)row["TerrainPBR4"]);

return newSettings;
}

Expand Down Expand Up @@ -1551,53 +1558,57 @@ private NpgsqlParameter[] CreatePrimInventoryParameters(TaskInventoryItem taskIt
/// <returns></returns>
private NpgsqlParameter[] CreateRegionSettingParameters(RegionSettings settings)
{
List<NpgsqlParameter> parameters = new List<NpgsqlParameter>();

parameters.Add(_Database.CreateParameter("regionUUID", settings.RegionUUID));
parameters.Add(_Database.CreateParameter("block_terraform", settings.BlockTerraform));
parameters.Add(_Database.CreateParameter("block_fly", settings.BlockFly));
parameters.Add(_Database.CreateParameter("allow_damage", settings.AllowDamage));
parameters.Add(_Database.CreateParameter("restrict_pushing", settings.RestrictPushing));
parameters.Add(_Database.CreateParameter("allow_land_resell", settings.AllowLandResell));
parameters.Add(_Database.CreateParameter("allow_land_join_divide", settings.AllowLandJoinDivide));
parameters.Add(_Database.CreateParameter("block_show_in_search", settings.BlockShowInSearch));
parameters.Add(_Database.CreateParameter("agent_limit", settings.AgentLimit));
parameters.Add(_Database.CreateParameter("object_bonus", settings.ObjectBonus));
parameters.Add(_Database.CreateParameter("maturity", settings.Maturity));
parameters.Add(_Database.CreateParameter("disable_scripts", settings.DisableScripts));
parameters.Add(_Database.CreateParameter("disable_collisions", settings.DisableCollisions));
parameters.Add(_Database.CreateParameter("disable_physics", settings.DisablePhysics));
parameters.Add(_Database.CreateParameter("terrain_texture_1", settings.TerrainTexture1));
parameters.Add(_Database.CreateParameter("terrain_texture_2", settings.TerrainTexture2));
parameters.Add(_Database.CreateParameter("terrain_texture_3", settings.TerrainTexture3));
parameters.Add(_Database.CreateParameter("terrain_texture_4", settings.TerrainTexture4));
parameters.Add(_Database.CreateParameter("elevation_1_nw", settings.Elevation1NW));
parameters.Add(_Database.CreateParameter("elevation_2_nw", settings.Elevation2NW));
parameters.Add(_Database.CreateParameter("elevation_1_ne", settings.Elevation1NE));
parameters.Add(_Database.CreateParameter("elevation_2_ne", settings.Elevation2NE));
parameters.Add(_Database.CreateParameter("elevation_1_se", settings.Elevation1SE));
parameters.Add(_Database.CreateParameter("elevation_2_se", settings.Elevation2SE));
parameters.Add(_Database.CreateParameter("elevation_1_sw", settings.Elevation1SW));
parameters.Add(_Database.CreateParameter("elevation_2_sw", settings.Elevation2SW));
parameters.Add(_Database.CreateParameter("water_height", settings.WaterHeight));
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun));
parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox));
parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun));
parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition));
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));
parameters.Add(_Database.CreateParameter("sunvectory", settings.SunVector.Y));
parameters.Add(_Database.CreateParameter("sunvectorz", settings.SunVector.Z));
parameters.Add(_Database.CreateParameter("covenant", settings.Covenant));
parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID));
parameters.Add(_Database.CreateParameter("TerrainImageID", settings.TerrainImageID));
parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID));
parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject));

parameters.Add(_Database.CreateParameter("cacheID", settings.CacheID));
List<NpgsqlParameter> parameters =
[
_Database.CreateParameter("regionUUID", settings.RegionUUID),
_Database.CreateParameter("block_terraform", settings.BlockTerraform),
_Database.CreateParameter("block_fly", settings.BlockFly),
_Database.CreateParameter("allow_damage", settings.AllowDamage),
_Database.CreateParameter("restrict_pushing", settings.RestrictPushing),
_Database.CreateParameter("allow_land_resell", settings.AllowLandResell),
_Database.CreateParameter("allow_land_join_divide", settings.AllowLandJoinDivide),
_Database.CreateParameter("block_show_in_search", settings.BlockShowInSearch),
_Database.CreateParameter("agent_limit", settings.AgentLimit),
_Database.CreateParameter("object_bonus", settings.ObjectBonus),
_Database.CreateParameter("maturity", settings.Maturity),
_Database.CreateParameter("disable_scripts", settings.DisableScripts),
_Database.CreateParameter("disable_collisions", settings.DisableCollisions),
_Database.CreateParameter("disable_physics", settings.DisablePhysics),
_Database.CreateParameter("terrain_texture_1", settings.TerrainTexture1),
_Database.CreateParameter("terrain_texture_2", settings.TerrainTexture2),
_Database.CreateParameter("terrain_texture_3", settings.TerrainTexture3),
_Database.CreateParameter("terrain_texture_4", settings.TerrainTexture4),
_Database.CreateParameter("elevation_1_nw", settings.Elevation1NW),
_Database.CreateParameter("elevation_2_nw", settings.Elevation2NW),
_Database.CreateParameter("elevation_1_ne", settings.Elevation1NE),
_Database.CreateParameter("elevation_2_ne", settings.Elevation2NE),
_Database.CreateParameter("elevation_1_se", settings.Elevation1SE),
_Database.CreateParameter("elevation_2_se", settings.Elevation2SE),
_Database.CreateParameter("elevation_1_sw", settings.Elevation1SW),
_Database.CreateParameter("elevation_2_sw", settings.Elevation2SW),
_Database.CreateParameter("water_height", settings.WaterHeight),
_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit),
_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit),
_Database.CreateParameter("use_estate_sun", settings.UseEstateSun),
_Database.CreateParameter("Sandbox", settings.Sandbox),
_Database.CreateParameter("fixed_sun", settings.FixedSun),
_Database.CreateParameter("sun_position", settings.SunPosition),
_Database.CreateParameter("sunvectorx", settings.SunVector.X),
_Database.CreateParameter("sunvectory", settings.SunVector.Y),
_Database.CreateParameter("sunvectorz", settings.SunVector.Z),
_Database.CreateParameter("covenant", settings.Covenant),
_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime),
_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime),
_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID),
_Database.CreateParameter("TerrainImageID", settings.TerrainImageID),
_Database.CreateParameter("ParcelImageID", settings.ParcelImageID),
_Database.CreateParameter("TelehubObject", settings.TelehubObject),
_Database.CreateParameter("cacheID", settings.CacheID),
_Database.CreateParameter("TerrainPBR1", settings.TerrainPBR1),
_Database.CreateParameter("TerrainPBR2", settings.TerrainPBR2),
_Database.CreateParameter("TerrainPBR3", settings.TerrainPBR3),
_Database.CreateParameter("TerrainPBR4", settings.TerrainPBR4),
];

return parameters.ToArray();
}
Expand Down
8 changes: 8 additions & 0 deletions OpenSim/Data/PGSQL/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -1259,3 +1259,11 @@ COMMIT;
BEGIN;
ALTER TABLE "public".`prims` ADD COLUMN `linksetdata` varchar default NULL;
COMMIT;

:VERSION 54 #----- add pbr terrain storage
BEGIN;
ALTER TABLE regionsettings ADD COLUMN "TerrainPBR1" uuid NOT NULL;
ALTER TABLE regionsettings ADD COLUMN "TerrainPBR2" uuid NOT NULL;
ALTER TABLE regionsettings ADD COLUMN "TerrainPBR3" uuid NOT NULL;
ALTER TABLE regionsettings ADD COLUMN "TerrainPBR4" uuid NOT NULL;
COMMIT;
10 changes: 9 additions & 1 deletion OpenSim/Data/SQLite/Resources/RegionStore.migrations
Original file line number Diff line number Diff line change
Expand Up @@ -409,4 +409,12 @@ COMMIT;
:VERSION 41 #----- add linkset data storage column
BEGIN;
ALTER TABLE `prims` ADD COLUMN `linksetdata` TEXT default NULL;
COMMIT;
COMMIT;

:VERSION 42 #----- add pbr terrain storage
BEGIN;
ALTER TABLE regionsettings ADD COLUMN TerrainPBR1 char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE regionsettings ADD COLUMN TerrainPBR2 char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE regionsettings ADD COLUMN TerrainPBR3 char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
ALTER TABLE regionsettings ADD COLUMN TerrainPBR4 char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
COMMIT;
15 changes: 15 additions & 0 deletions OpenSim/Data/SQLite/SQLiteSimulationData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,10 @@ private static DataTable createRegionSettingsTable()
createCol(regionsettings, "terrain_texture_2", typeof(String));
createCol(regionsettings, "terrain_texture_3", typeof(String));
createCol(regionsettings, "terrain_texture_4", typeof(String));
createCol(regionsettings, "TerrainPBR1", typeof(String));
createCol(regionsettings, "TerrainPBR2", typeof(String));
createCol(regionsettings, "TerrainPBR3", typeof(String));
createCol(regionsettings, "TerrainPBR4", typeof(String));
createCol(regionsettings, "elevation_1_nw", typeof(Double));
createCol(regionsettings, "elevation_2_nw", typeof(Double));
createCol(regionsettings, "elevation_1_ne", typeof(Double));
Expand Down Expand Up @@ -2004,6 +2008,11 @@ private RegionSettings buildRegionSettings(DataRow row)
if (row["cacheID"] is not System.DBNull)
newSettings.CacheID = new UUID((String)row["cacheID"]);

newSettings.TerrainPBR1 = new UUID((String)row["TerrainPBR1"]);
newSettings.TerrainPBR2 = new UUID((String)row["TerrainPBR2"]);
newSettings.TerrainPBR3 = new UUID((String)row["TerrainPBR3"]);
newSettings.TerrainPBR4 = new UUID((String)row["TerrainPBR4"]);

return newSettings;
}

Expand Down Expand Up @@ -2364,6 +2373,12 @@ private static void fillRegionSettingsRow(DataRow row, RegionSettings settings)
row["block_search"] = settings.GodBlockSearch;
row["casino"] = settings.Casino;
row["cacheID"] = settings.CacheID;

row["TerrainPBR1"] = settings.TerrainPBR1.ToString();
row["TerrainPBR2"] = settings.TerrainPBR2.ToString();
row["TerrainPBR3"] = settings.TerrainPBR3.ToString();
row["TerrainPBR4"] = settings.TerrainPBR4.ToString();

}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion OpenSim/Framework/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public class Constants
public const float MinWaterHeight = 0;
public const float MaxWaterHeight = 8000f;

public const int MaxTextureResolution = 1024;
public const int MaxTextureResolution = 2048;

public static readonly string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f"; //plywood
public static readonly UUID DefaultTextureID = new UUID(DefaultTexture);
Expand Down
14 changes: 14 additions & 0 deletions OpenSim/Framework/IClientAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,18 @@ public class PlacesReplyData
public int Price;
}

[Flags]
public enum ViewerFlags:uint
{
SentSeeds = 0x1000,
ObjectAnim = 0x2000,
WLEnv = 0x4000,
AdvEnv = 0x8000,
PBR = 0x10000,
TPBR = 0x20000,
SentTPBR = 0x40000,
}

/// <summary>
/// Specifies the fields that have been changed when sending a prim or
/// avatar update
Expand Down Expand Up @@ -671,6 +683,8 @@ public interface IClientAPI

ulong ActiveGroupPowers { get; set;}

ViewerFlags ViewerFlags { get;}

Dictionary<UUID, ulong> GetGroupPowers();

void SetGroupPowers(Dictionary<UUID, ulong> powers);
Expand Down
4 changes: 2 additions & 2 deletions OpenSim/Framework/RegionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,8 @@ private void DoRegionSizeSanityChecks()
// There is a practical limit to region size.
if (RegionSizeX > Constants.MaximumRegionSize || RegionSizeY > Constants.MaximumRegionSize)
{
RegionSizeX = Util.Clamp<uint>(RegionSizeX, Constants.RegionSize, Constants.MaximumRegionSize);
RegionSizeY = Util.Clamp<uint>(RegionSizeY, Constants.RegionSize, Constants.MaximumRegionSize);
RegionSizeX = Math.Clamp(RegionSizeX, Constants.RegionSize, Constants.MaximumRegionSize);
RegionSizeY = Math.Clamp(RegionSizeY, Constants.RegionSize, Constants.MaximumRegionSize);
m_log.ErrorFormat("{0} Region dimensions must be less than {1}. Clamping {2}'s size to <{3},{4}>",
LogHeader, Constants.MaximumRegionSize, m_regionName, RegionSizeX, RegionSizeY);
}
Expand Down
Loading

0 comments on commit 8dc009d

Please sign in to comment.