diff --git a/.gitignore b/.gitignore
index fae7509131..e04c219d90 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,14 +29,9 @@ addon-modules/
bin/Debug/*.dll
bin/*.dll.mdb
bin/*.db
-bin/*.db-journal
bin/addin-db-*
bin/*.dll
bin/OpenSim.vshost.exe.config
-bin/OpenSim.32BitLaunch.vshost.exe.config
-bin/OpenSim.32BitLaunch.log
-UpgradeLog.XML
-_UpgradeReport_Files/
bin/ScriptEngines/*-*-*-*-*
bin/ScriptEngines/*.dll
bin/ScriptEngines/*/*.dll
@@ -69,7 +64,6 @@ Examples/*.dll
OpenSim.build
OpenSim.sln
OpenSim.suo
-OpenSim.userprefs
Prebuild/Prebuild.build
Prebuild/Prebuild.sln
TestResult.xml
diff --git a/.nant/local.include b/.nant/local.include
index 35f00589e8..6d3e97228f 100644
--- a/.nant/local.include
+++ b/.nant/local.include
@@ -135,25 +135,14 @@
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/BUILDING.md b/BUILDING.txt
similarity index 58%
rename from BUILDING.md
rename to BUILDING.txt
index 5210b58f1f..12e5ea53cf 100644
--- a/BUILDING.md
+++ b/BUILDING.txt
@@ -1,4 +1,6 @@
-# Building on Windows
+==== Building OpenSim ====
+
+=== Building on Windows ===
Steps:
* runprebuild.bat
@@ -7,15 +9,16 @@ Steps:
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* run OpenSim.exe
-# Building on Linux
+=== Building on Linux ===
Prereqs:
-* Mono >= 2.4.3
-* Nant >= 0.85
-* On some Linux distributions you may need to install additional packages.
- See http://opensimulator.org/wiki/Dependencies for more information.
-* May also use xbuild (included in mono distributions)
-* May use Monodevelop, a cross-platform IDE
+ * Mono >= 2.4.3
+ * Nant >= 0.85
+ * On some Linux distributions you may need to install additional packages.
+ See http://opensimulator.org/wiki/Dependencies for more information.
+
+ * May also use xbuild (included in mono distributions)
+ * May use Monodevelop, a cross-platform IDE
From the distribution type:
* ./runprebuild.sh
@@ -24,13 +27,13 @@ From the distribution type:
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
* run mono OpenSim.exe
-# Using Monodevelop
+=== Using Monodevelop ===
From the distribution type:
* ./runprebuild.sh
* type monodevelop OpenSim.sln
-# References
+=== References ===
Helpful resources:
* http://opensimulator.org/wiki/Build_Instructions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index e5a6d49413..9dd0797411 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -1,5 +1,5 @@
- <<<>>>>The following people have contributed to OpenSim (Thank you
-for your effort!)
+<<<>>>>The following people have contributed to OpenSim (Thank you
+for your effort!)
= Current OpenSim Developers (in very rough order of appearance) =
These folks represent the current core team for OpenSim, and are the
@@ -16,7 +16,7 @@ people that make the day to day of OpenSim happen.
* BlueWall (James Hughes)
* Nebadon Izumi (Michael Cerquoni, OSgrid)
* Snoopy Pfeffer
-* Robert Adams (Intel)
+* Richard Adams (Intel)
= Core Developers Following the White Rabbit =
Core developers who have temporarily (we hope) gone chasing the white rabbit.
@@ -92,7 +92,6 @@ what it is today.
* Flyte Xevious
* Garmin Kawaguichi
* Gryc Ueusp
-* Hiro Lecker
* Imaze Rhiano
* Intimidated
* Jeremy Bongio (IBM)
@@ -182,14 +181,12 @@ what it is today.
This software uses components from the following developers:
* Sleepycat Software (Berkeley DB)
-* Aurora-Sim (http://aurora-sim.org)
* SQLite (Public Domain)
* XmlRpcCS (http://xmlrpccs.sf.net/)
* MySQL, Inc. (MySQL Connector/NET)
* NUnit (http://www.nunit.org)
* AGEIA Inc. (PhysX)
* Russel L. Smith (ODE)
-* Erwin Coumans (Bullet)
* Prebuild (http://sourceforge.net/projects/dnpb/)
* LibOpenMetaverse (http://lib.openmetaverse.org/)
* DotNetOpenMail v0.5.8b (http://dotnetopenmail.sourceforge.net)
@@ -211,4 +208,3 @@ In addition, we would like to thank:
* The NANT Developers
* Microsoft (.NET, MSSQL-Adapters)
*x
-
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 9c933eee35..437d150097 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -696,7 +696,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
region.ExternalHostName = (string) requestData["external_address"];
- bool persist = Convert.ToBoolean(requestData["persist"]);
+ bool persist = Convert.ToBoolean((string) requestData["persist"]);
if (persist)
{
// default place for region configuration files is in the
@@ -852,6 +852,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = true;
responseData["region_name"] = region.RegionName;
responseData["region_id"] = region.RegionID.ToString();
+ responseData["region_uuid"] = region.RegionID.ToString(); //Deprecate July 2012
m_log.Info("[RADMIN]: CreateRegion: request complete");
}
@@ -1105,8 +1106,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
string lastName = (string) requestData["user_lastname"];
string password = (string) requestData["user_password"];
- uint regionXLocation = Convert.ToUInt32(requestData["start_region_x"]);
- uint regionYLocation = Convert.ToUInt32(requestData["start_region_y"]);
+ uint regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]);
+ uint regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]);
string email = ""; // empty string for email
if (requestData.Contains("user_email"))
@@ -1303,9 +1304,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requestData.ContainsKey("user_password")) password = (string) requestData["user_password"];
if (requestData.ContainsKey("start_region_x"))
- regionXLocation = Convert.ToUInt32(requestData["start_region_x"]);
+ regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]);
if (requestData.ContainsKey("start_region_y"))
- regionYLocation = Convert.ToUInt32(requestData["start_region_y"]);
+ regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]);
// if (requestData.ContainsKey("start_lookat_x"))
// ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]);
@@ -1492,8 +1493,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// profile url
/// - noassets
/// true if no assets should be saved
- /// - all
- /// true to save all the regions in the simulator
/// - perm
/// C and/or T
///
@@ -1550,11 +1549,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
options["checkPermissions"] = (string)requestData["perm"];
}
- if ((string)requestData["all"] == "true")
- {
- options["all"] = (string)requestData["all"];
- }
-
IRegionArchiverModule archiver = scene.RequestModuleInterface();
if (archiver != null)
@@ -2014,6 +2008,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
return;
}
+ #region Deprecate July 2012
+ //region_ID, regionid, region_uuid will be deprecated in July 2012!!!!!!
+ else if (requestData.ContainsKey("regionid") &&
+ !String.IsNullOrEmpty((string)requestData["regionid"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
+ }
+ else if (requestData.ContainsKey("region_ID") &&
+ !String.IsNullOrEmpty((string)requestData["region_ID"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
+ }
+ else if (requestData.ContainsKey("regionID") &&
+ !String.IsNullOrEmpty((string)requestData["regionID"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
+ }
+ else if (requestData.ContainsKey("region_uuid") &&
+ !String.IsNullOrEmpty((string)requestData["region_uuid"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
+ }
+ #endregion
else
{
responseData["accepted"] = false;
@@ -2035,6 +2052,56 @@ namespace OpenSim.ApplicationPlugins.RemoteController
throw new Exception(String.Format("Region ID {0} not found", regionID));
}
}
+ #region Deprecate July 2012
+ else if (requestData.ContainsKey("regionid") &&
+ !String.IsNullOrEmpty((string)requestData["regionid"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter regionid will be deprecated as of July 2012. Use region_id instead");
+
+ UUID regionID = (UUID)(string)requestData["regionid"];
+ if (!m_application.SceneManager.TryGetScene(regionID, out scene))
+ {
+ responseData["error"] = String.Format("Region ID {0} not found", regionID);
+ throw new Exception(String.Format("Region ID {0} not found", regionID));
+ }
+ }
+ else if (requestData.ContainsKey("region_ID") &&
+ !String.IsNullOrEmpty((string)requestData["region_ID"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter region_ID will be deprecated as of July 2012. Use region_id instead");
+
+ UUID regionID = (UUID)(string)requestData["region_ID"];
+ if (!m_application.SceneManager.TryGetScene(regionID, out scene))
+ {
+ responseData["error"] = String.Format("Region ID {0} not found", regionID);
+ throw new Exception(String.Format("Region ID {0} not found", regionID));
+ }
+ }
+ else if (requestData.ContainsKey("regionID") &&
+ !String.IsNullOrEmpty((string)requestData["regionID"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter regionID will be deprecated as of July 2012. Use region_id instead");
+
+ UUID regionID = (UUID)(string)requestData["regionID"];
+ if (!m_application.SceneManager.TryGetScene(regionID, out scene))
+ {
+ responseData["error"] = String.Format("Region ID {0} not found", regionID);
+ throw new Exception(String.Format("Region ID {0} not found", regionID));
+ }
+ }
+ else if (requestData.ContainsKey("region_uuid") &&
+ !String.IsNullOrEmpty((string)requestData["region_uuid"]))
+ {
+ m_log.WarnFormat("[RADMIN]: Use of parameter region_uuid will be deprecated as of July 2012. Use region_id instead");
+
+ UUID regionID = (UUID)(string)requestData["region_uuid"];
+ if (!m_application.SceneManager.TryGetScene(regionID, out scene))
+ {
+ responseData["error"] = String.Format("Region ID {0} not found", regionID);
+ throw new Exception(String.Format("Region ID {0} not found", regionID));
+ }
+ }
+ #endregion
else if (requestData.ContainsKey("region_name") &&
!String.IsNullOrEmpty((string)requestData["region_name"]))
{
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
index 072bd6f010..cb88695600 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestHandler.cs
@@ -312,16 +312,14 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
// Now that everything is setup we can proceed to
// add THIS agent to the HTTP server's handler list
- // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
- // have to be handled through the AddHttpHandler interface.
-// if (!AddAgentHandler(Rest.Name,this))
-// {
-// Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
-// foreach (IRest handler in handlers)
-// {
-// handler.Close();
-// }
-// }
+ if (!AddAgentHandler(Rest.Name,this))
+ {
+ Rest.Log.ErrorFormat("{0} Unable to activate handler interface", MsgId);
+ foreach (IRest handler in handlers)
+ {
+ handler.Close();
+ }
+ }
}
catch (Exception e)
@@ -344,13 +342,11 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
{
Rest.Log.InfoFormat("{0} Plugin is terminating", MsgId);
- // FIXME: If this code is ever to be re-enabled (most of it is disabled already) then this will
- // have to be handled through the AddHttpHandler interface.
-// try
-// {
-// RemoveAgentHandler(Rest.Name, this);
-// }
-// catch (KeyNotFoundException){}
+ try
+ {
+ RemoveAgentHandler(Rest.Name, this);
+ }
+ catch (KeyNotFoundException){}
foreach (IRest handler in handlers)
{
diff --git a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
index a2425b5cf3..eb167502b0 100644
--- a/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
+++ b/OpenSim/ApplicationPlugins/Rest/RestPlugin.cs
@@ -297,9 +297,7 @@ namespace OpenSim.ApplicationPlugins.Rest
{
if (!IsEnabled) return false;
_agents.Add(agentName, handler);
-// return _httpd.AddAgentHandler(agentName, handler);
-
- return false;
+ return _httpd.AddAgentHandler(agentName, handler);
}
///
@@ -318,7 +316,7 @@ namespace OpenSim.ApplicationPlugins.Rest
if (_agents[agentName] == handler)
{
_agents.Remove(agentName);
-// return _httpd.RemoveAgentHandler(agentName, handler);
+ return _httpd.RemoveAgentHandler(agentName, handler);
}
return false;
}
@@ -360,10 +358,10 @@ namespace OpenSim.ApplicationPlugins.Rest
_httpd.RemoveStreamHandler(h.HttpMethod, h.Path);
}
_handlers = null;
-// foreach (KeyValuePair h in _agents)
-// {
-// _httpd.RemoveAgentHandler(h.Key, h.Value);
-// }
+ foreach (KeyValuePair h in _agents)
+ {
+ _httpd.RemoveAgentHandler(h.Key, h.Value);
+ }
_agents = null;
}
diff --git a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
index 6437d0b7b0..86e7aa08f3 100644
--- a/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
+++ b/OpenSim/Capabilities/Handlers/GetTexture/GetTextureHandler.cs
@@ -200,25 +200,11 @@ namespace OpenSim.Capabilities.Handlers
int start, end;
if (TryParseRange(range, out start, out end))
{
+
// Before clamping start make sure we can satisfy it in order to avoid
// sending back the last byte instead of an error status
if (start >= texture.Data.Length)
{
-// m_log.DebugFormat(
-// "[GETTEXTURE]: Client requested range for texture {0} starting at {1} but texture has end of {2}",
-// texture.ID, start, texture.Data.Length);
-
- // Stricly speaking, as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, we should be sending back
- // Requested Range Not Satisfiable (416) here. However, it appears that at least recent implementations
- // of the Linden Lab viewer (3.2.1 and 3.3.4 and probably earlier), a viewer that has previously
- // received a very small texture may attempt to fetch bytes from the server past the
- // range of data that it received originally. Whether this happens appears to depend on whether
- // the viewer's estimation of how large a request it needs to make for certain discard levels
- // (http://wiki.secondlife.com/wiki/Image_System#Discard_Level_and_Mip_Mapping), chiefly discard
- // level 2. If this estimate is greater than the total texture size, returning a RequestedRangeNotSatisfiable
- // here will cause the viewer to treat the texture as bad and never display the full resolution
- // However, if we return PartialContent (or OK) instead, the viewer will display that resolution.
-
// response.StatusCode = (int)System.Net.HttpStatusCode.RequestedRangeNotSatisfiable;
// viewers don't seem to handle RequestedRangeNotSatisfiable and keep retrying with same parameters
response["int_response_code"] = (int)System.Net.HttpStatusCode.NotFound;
@@ -229,7 +215,7 @@ namespace OpenSim.Capabilities.Handlers
start = Utils.Clamp(start, 0, end);
int len = end - start + 1;
-// m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
+ //m_log.Debug("Serving " + start + " to " + end + " of " + texture.Data.Length + " bytes for texture " + texture.ID);
response["content-type"] = texture.Metadata.ContentType;
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs
index 70e10653de..546b5e8cba 100644
--- a/OpenSim/Data/IRegionData.cs
+++ b/OpenSim/Data/IRegionData.cs
@@ -85,6 +85,21 @@ namespace OpenSim.Data
List GetHyperlinks(UUID scopeID);
}
+ [Flags]
+ public enum RegionFlags : int
+ {
+ DefaultRegion = 1, // Used for new Rez. Random if multiple defined
+ FallbackRegion = 2, // Regions we redirect to when the destination is down
+ RegionOnline = 4, // Set when a region comes online, unset when it unregisters and DeleteOnUnregister is false
+ NoDirectLogin = 8, // Region unavailable for direct logins (by name)
+ Persistent = 16, // Don't remove on unregister
+ LockedOut = 32, // Don't allow registration
+ NoMove = 64, // Don't allow moving this region
+ Reservation = 128, // This is an inactive reservation
+ Authenticate = 256, // Require authentication
+ Hyperlink = 512 // Record represents a HG link
+ }
+
public class RegionDataDistanceCompare : IComparer
{
private Vector2 m_origin;
diff --git a/OpenSim/Data/IXInventoryData.cs b/OpenSim/Data/IXInventoryData.cs
index e64a82820d..85a5c08d37 100644
--- a/OpenSim/Data/IXInventoryData.cs
+++ b/OpenSim/Data/IXInventoryData.cs
@@ -40,11 +40,6 @@ namespace OpenSim.Data
public UUID folderID;
public UUID agentID;
public UUID parentFolderID;
-
- public XInventoryFolder Clone()
- {
- return (XInventoryFolder)MemberwiseClone();
- }
}
public class XInventoryItem
@@ -69,11 +64,6 @@ namespace OpenSim.Data
public UUID avatarID;
public UUID parentFolderID;
public int inventoryGroupPermissions;
-
- public XInventoryItem Clone()
- {
- return (XInventoryItem)MemberwiseClone();
- }
}
public interface IXInventoryData
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 0d89706566..3ae87c3804 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -37,7 +37,6 @@ using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
-using RegionFlags = OpenSim.Framework.RegionFlags;
namespace OpenSim.Data.MSSQL
{
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs
index a2d4ae4647..0614879061 100644
--- a/OpenSim/Data/MySQL/MySQLRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLRegionData.cs
@@ -30,11 +30,11 @@ using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Reflection;
-using MySql.Data.MySqlClient;
+
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Data;
-using RegionFlags = OpenSim.Framework.RegionFlags;
+using MySql.Data.MySqlClient;
namespace OpenSim.Data.MySQL
{
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 12c979aa50..4d7c0c937c 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -747,99 +747,95 @@ namespace OpenSim.Data.MySQL
RegionLightShareData nWP = new RegionLightShareData();
nWP.OnSave += StoreRegionWindlightSettings;
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ string command = "select * from `regionwindlight` where region_id = ?regionID";
+
+ using (MySqlCommand cmd = new MySqlCommand(command))
{
- dbcon.Open();
-
- string command = "select * from `regionwindlight` where region_id = ?regionID";
-
- using (MySqlCommand cmd = new MySqlCommand(command))
+ cmd.Connection = dbcon;
+
+ cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
+
+ IDataReader result = ExecuteReader(cmd);
+ if (!result.Read())
{
- cmd.Connection = dbcon;
-
- cmd.Parameters.AddWithValue("?regionID", regionUUID.ToString());
-
- IDataReader result = ExecuteReader(cmd);
- if (!result.Read())
- {
- //No result, so store our default windlight profile and return it
- nWP.regionID = regionUUID;
-// StoreRegionWindlightSettings(nWP);
- return nWP;
- }
- else
- {
- nWP.regionID = DBGuid.FromDB(result["region_id"]);
- nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
- nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
- nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
- nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
- nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
- nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
- nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
- nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
- nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
- nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
- nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
- nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
- nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
- nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
- nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
- nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
- nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
- UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture);
- nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
- nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
- nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
- nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
- nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
- nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
- nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
- nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
- nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
- nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
- nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
- nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
- nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
- nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
- nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
- nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
- nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
- nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
- nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
- nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
- nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
- nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
- nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
- nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
- nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
- nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
- nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
- nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
- nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
- nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
- nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
- nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
- nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
- nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
- nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
- nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
- nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
- nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
- nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
- nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
- nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
- nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
- nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
- nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
- nWP.valid = true;
- }
+ //No result, so store our default windlight profile and return it
+ nWP.regionID = regionUUID;
+ // StoreRegionWindlightSettings(nWP);
+ return nWP;
+ }
+ else
+ {
+ nWP.regionID = DBGuid.FromDB(result["region_id"]);
+ nWP.waterColor.X = Convert.ToSingle(result["water_color_r"]);
+ nWP.waterColor.Y = Convert.ToSingle(result["water_color_g"]);
+ nWP.waterColor.Z = Convert.ToSingle(result["water_color_b"]);
+ nWP.waterFogDensityExponent = Convert.ToSingle(result["water_fog_density_exponent"]);
+ nWP.underwaterFogModifier = Convert.ToSingle(result["underwater_fog_modifier"]);
+ nWP.reflectionWaveletScale.X = Convert.ToSingle(result["reflection_wavelet_scale_1"]);
+ nWP.reflectionWaveletScale.Y = Convert.ToSingle(result["reflection_wavelet_scale_2"]);
+ nWP.reflectionWaveletScale.Z = Convert.ToSingle(result["reflection_wavelet_scale_3"]);
+ nWP.fresnelScale = Convert.ToSingle(result["fresnel_scale"]);
+ nWP.fresnelOffset = Convert.ToSingle(result["fresnel_offset"]);
+ nWP.refractScaleAbove = Convert.ToSingle(result["refract_scale_above"]);
+ nWP.refractScaleBelow = Convert.ToSingle(result["refract_scale_below"]);
+ nWP.blurMultiplier = Convert.ToSingle(result["blur_multiplier"]);
+ nWP.bigWaveDirection.X = Convert.ToSingle(result["big_wave_direction_x"]);
+ nWP.bigWaveDirection.Y = Convert.ToSingle(result["big_wave_direction_y"]);
+ nWP.littleWaveDirection.X = Convert.ToSingle(result["little_wave_direction_x"]);
+ nWP.littleWaveDirection.Y = Convert.ToSingle(result["little_wave_direction_y"]);
+ UUID.TryParse(result["normal_map_texture"].ToString(), out nWP.normalMapTexture);
+ nWP.horizon.X = Convert.ToSingle(result["horizon_r"]);
+ nWP.horizon.Y = Convert.ToSingle(result["horizon_g"]);
+ nWP.horizon.Z = Convert.ToSingle(result["horizon_b"]);
+ nWP.horizon.W = Convert.ToSingle(result["horizon_i"]);
+ nWP.hazeHorizon = Convert.ToSingle(result["haze_horizon"]);
+ nWP.blueDensity.X = Convert.ToSingle(result["blue_density_r"]);
+ nWP.blueDensity.Y = Convert.ToSingle(result["blue_density_g"]);
+ nWP.blueDensity.Z = Convert.ToSingle(result["blue_density_b"]);
+ nWP.blueDensity.W = Convert.ToSingle(result["blue_density_i"]);
+ nWP.hazeDensity = Convert.ToSingle(result["haze_density"]);
+ nWP.densityMultiplier = Convert.ToSingle(result["density_multiplier"]);
+ nWP.distanceMultiplier = Convert.ToSingle(result["distance_multiplier"]);
+ nWP.maxAltitude = Convert.ToUInt16(result["max_altitude"]);
+ nWP.sunMoonColor.X = Convert.ToSingle(result["sun_moon_color_r"]);
+ nWP.sunMoonColor.Y = Convert.ToSingle(result["sun_moon_color_g"]);
+ nWP.sunMoonColor.Z = Convert.ToSingle(result["sun_moon_color_b"]);
+ nWP.sunMoonColor.W = Convert.ToSingle(result["sun_moon_color_i"]);
+ nWP.sunMoonPosition = Convert.ToSingle(result["sun_moon_position"]);
+ nWP.ambient.X = Convert.ToSingle(result["ambient_r"]);
+ nWP.ambient.Y = Convert.ToSingle(result["ambient_g"]);
+ nWP.ambient.Z = Convert.ToSingle(result["ambient_b"]);
+ nWP.ambient.W = Convert.ToSingle(result["ambient_i"]);
+ nWP.eastAngle = Convert.ToSingle(result["east_angle"]);
+ nWP.sunGlowFocus = Convert.ToSingle(result["sun_glow_focus"]);
+ nWP.sunGlowSize = Convert.ToSingle(result["sun_glow_size"]);
+ nWP.sceneGamma = Convert.ToSingle(result["scene_gamma"]);
+ nWP.starBrightness = Convert.ToSingle(result["star_brightness"]);
+ nWP.cloudColor.X = Convert.ToSingle(result["cloud_color_r"]);
+ nWP.cloudColor.Y = Convert.ToSingle(result["cloud_color_g"]);
+ nWP.cloudColor.Z = Convert.ToSingle(result["cloud_color_b"]);
+ nWP.cloudColor.W = Convert.ToSingle(result["cloud_color_i"]);
+ nWP.cloudXYDensity.X = Convert.ToSingle(result["cloud_x"]);
+ nWP.cloudXYDensity.Y = Convert.ToSingle(result["cloud_y"]);
+ nWP.cloudXYDensity.Z = Convert.ToSingle(result["cloud_density"]);
+ nWP.cloudCoverage = Convert.ToSingle(result["cloud_coverage"]);
+ nWP.cloudScale = Convert.ToSingle(result["cloud_scale"]);
+ nWP.cloudDetailXYDensity.X = Convert.ToSingle(result["cloud_detail_x"]);
+ nWP.cloudDetailXYDensity.Y = Convert.ToSingle(result["cloud_detail_y"]);
+ nWP.cloudDetailXYDensity.Z = Convert.ToSingle(result["cloud_detail_density"]);
+ nWP.cloudScrollX = Convert.ToSingle(result["cloud_scroll_x"]);
+ nWP.cloudScrollXLock = Convert.ToBoolean(result["cloud_scroll_x_lock"]);
+ nWP.cloudScrollY = Convert.ToSingle(result["cloud_scroll_y"]);
+ nWP.cloudScrollYLock = Convert.ToBoolean(result["cloud_scroll_y_lock"]);
+ nWP.drawClassicClouds = Convert.ToBoolean(result["draw_classic_clouds"]);
+ nWP.valid = true;
}
}
}
-
return nWP;
}
@@ -885,124 +881,118 @@ namespace OpenSim.Data.MySQL
public virtual void StoreRegionWindlightSettings(RegionLightShareData wl)
{
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ using (MySqlCommand cmd = dbcon.CreateCommand())
{
- dbcon.Open();
-
- using (MySqlCommand cmd = dbcon.CreateCommand())
- {
- cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, ";
- cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, ";
- cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, ";
- cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, ";
- cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, ";
- cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, ";
- cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, ";
- cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, ";
- cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, ";
- cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, ";
- cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, ";
- cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, ";
- cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, ";
- cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, ";
- cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, ";
- cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, ";
- cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, ";
- cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, ";
- cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, ";
- cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, ";
- cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, ";
- cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, ";
- cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, ";
- cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, ";
- cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)";
-
- cmd.Parameters.AddWithValue("region_id", wl.regionID);
- cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
- cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y);
- cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z);
- cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent);
- cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier);
- cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X);
- cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y);
- cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z);
- cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale);
- cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset);
- cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove);
- cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow);
- cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier);
- cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X);
- cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y);
- cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X);
- cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y);
- cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture);
- cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X);
- cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y);
- cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z);
- cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W);
- cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon);
- cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X);
- cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y);
- cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z);
- cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W);
- cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity);
- cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier);
- cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier);
- cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude);
- cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X);
- cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y);
- cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z);
- cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W);
- cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition);
- cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X);
- cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y);
- cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z);
- cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W);
- cmd.Parameters.AddWithValue("east_angle", wl.eastAngle);
- cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus);
- cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize);
- cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma);
- cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness);
- cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X);
- cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y);
- cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z);
- cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W);
- cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X);
- cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y);
- cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z);
- cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage);
- cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale);
- cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X);
- cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y);
- cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z);
- cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX);
- cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock);
- cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
- cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
- cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
-
- ExecuteNonQuery(cmd);
- }
+ cmd.CommandText = "REPLACE INTO `regionwindlight` (`region_id`, `water_color_r`, `water_color_g`, ";
+ cmd.CommandText += "`water_color_b`, `water_fog_density_exponent`, `underwater_fog_modifier`, ";
+ cmd.CommandText += "`reflection_wavelet_scale_1`, `reflection_wavelet_scale_2`, `reflection_wavelet_scale_3`, ";
+ cmd.CommandText += "`fresnel_scale`, `fresnel_offset`, `refract_scale_above`, `refract_scale_below`, ";
+ cmd.CommandText += "`blur_multiplier`, `big_wave_direction_x`, `big_wave_direction_y`, `little_wave_direction_x`, ";
+ cmd.CommandText += "`little_wave_direction_y`, `normal_map_texture`, `horizon_r`, `horizon_g`, `horizon_b`, ";
+ cmd.CommandText += "`horizon_i`, `haze_horizon`, `blue_density_r`, `blue_density_g`, `blue_density_b`, ";
+ cmd.CommandText += "`blue_density_i`, `haze_density`, `density_multiplier`, `distance_multiplier`, `max_altitude`, ";
+ cmd.CommandText += "`sun_moon_color_r`, `sun_moon_color_g`, `sun_moon_color_b`, `sun_moon_color_i`, `sun_moon_position`, ";
+ cmd.CommandText += "`ambient_r`, `ambient_g`, `ambient_b`, `ambient_i`, `east_angle`, `sun_glow_focus`, `sun_glow_size`, ";
+ cmd.CommandText += "`scene_gamma`, `star_brightness`, `cloud_color_r`, `cloud_color_g`, `cloud_color_b`, `cloud_color_i`, ";
+ cmd.CommandText += "`cloud_x`, `cloud_y`, `cloud_density`, `cloud_coverage`, `cloud_scale`, `cloud_detail_x`, ";
+ cmd.CommandText += "`cloud_detail_y`, `cloud_detail_density`, `cloud_scroll_x`, `cloud_scroll_x_lock`, `cloud_scroll_y`, ";
+ cmd.CommandText += "`cloud_scroll_y_lock`, `draw_classic_clouds`) VALUES (?region_id, ?water_color_r, ";
+ cmd.CommandText += "?water_color_g, ?water_color_b, ?water_fog_density_exponent, ?underwater_fog_modifier, ?reflection_wavelet_scale_1, ";
+ cmd.CommandText += "?reflection_wavelet_scale_2, ?reflection_wavelet_scale_3, ?fresnel_scale, ?fresnel_offset, ?refract_scale_above, ";
+ cmd.CommandText += "?refract_scale_below, ?blur_multiplier, ?big_wave_direction_x, ?big_wave_direction_y, ?little_wave_direction_x, ";
+ cmd.CommandText += "?little_wave_direction_y, ?normal_map_texture, ?horizon_r, ?horizon_g, ?horizon_b, ?horizon_i, ?haze_horizon, ";
+ cmd.CommandText += "?blue_density_r, ?blue_density_g, ?blue_density_b, ?blue_density_i, ?haze_density, ?density_multiplier, ";
+ cmd.CommandText += "?distance_multiplier, ?max_altitude, ?sun_moon_color_r, ?sun_moon_color_g, ?sun_moon_color_b, ";
+ cmd.CommandText += "?sun_moon_color_i, ?sun_moon_position, ?ambient_r, ?ambient_g, ?ambient_b, ?ambient_i, ?east_angle, ";
+ cmd.CommandText += "?sun_glow_focus, ?sun_glow_size, ?scene_gamma, ?star_brightness, ?cloud_color_r, ?cloud_color_g, ";
+ cmd.CommandText += "?cloud_color_b, ?cloud_color_i, ?cloud_x, ?cloud_y, ?cloud_density, ?cloud_coverage, ?cloud_scale, ";
+ cmd.CommandText += "?cloud_detail_x, ?cloud_detail_y, ?cloud_detail_density, ?cloud_scroll_x, ?cloud_scroll_x_lock, ";
+ cmd.CommandText += "?cloud_scroll_y, ?cloud_scroll_y_lock, ?draw_classic_clouds)";
+
+ cmd.Parameters.AddWithValue("region_id", wl.regionID);
+ cmd.Parameters.AddWithValue("water_color_r", wl.waterColor.X);
+ cmd.Parameters.AddWithValue("water_color_g", wl.waterColor.Y);
+ cmd.Parameters.AddWithValue("water_color_b", wl.waterColor.Z);
+ cmd.Parameters.AddWithValue("water_fog_density_exponent", wl.waterFogDensityExponent);
+ cmd.Parameters.AddWithValue("underwater_fog_modifier", wl.underwaterFogModifier);
+ cmd.Parameters.AddWithValue("reflection_wavelet_scale_1", wl.reflectionWaveletScale.X);
+ cmd.Parameters.AddWithValue("reflection_wavelet_scale_2", wl.reflectionWaveletScale.Y);
+ cmd.Parameters.AddWithValue("reflection_wavelet_scale_3", wl.reflectionWaveletScale.Z);
+ cmd.Parameters.AddWithValue("fresnel_scale", wl.fresnelScale);
+ cmd.Parameters.AddWithValue("fresnel_offset", wl.fresnelOffset);
+ cmd.Parameters.AddWithValue("refract_scale_above", wl.refractScaleAbove);
+ cmd.Parameters.AddWithValue("refract_scale_below", wl.refractScaleBelow);
+ cmd.Parameters.AddWithValue("blur_multiplier", wl.blurMultiplier);
+ cmd.Parameters.AddWithValue("big_wave_direction_x", wl.bigWaveDirection.X);
+ cmd.Parameters.AddWithValue("big_wave_direction_y", wl.bigWaveDirection.Y);
+ cmd.Parameters.AddWithValue("little_wave_direction_x", wl.littleWaveDirection.X);
+ cmd.Parameters.AddWithValue("little_wave_direction_y", wl.littleWaveDirection.Y);
+ cmd.Parameters.AddWithValue("normal_map_texture", wl.normalMapTexture);
+ cmd.Parameters.AddWithValue("horizon_r", wl.horizon.X);
+ cmd.Parameters.AddWithValue("horizon_g", wl.horizon.Y);
+ cmd.Parameters.AddWithValue("horizon_b", wl.horizon.Z);
+ cmd.Parameters.AddWithValue("horizon_i", wl.horizon.W);
+ cmd.Parameters.AddWithValue("haze_horizon", wl.hazeHorizon);
+ cmd.Parameters.AddWithValue("blue_density_r", wl.blueDensity.X);
+ cmd.Parameters.AddWithValue("blue_density_g", wl.blueDensity.Y);
+ cmd.Parameters.AddWithValue("blue_density_b", wl.blueDensity.Z);
+ cmd.Parameters.AddWithValue("blue_density_i", wl.blueDensity.W);
+ cmd.Parameters.AddWithValue("haze_density", wl.hazeDensity);
+ cmd.Parameters.AddWithValue("density_multiplier", wl.densityMultiplier);
+ cmd.Parameters.AddWithValue("distance_multiplier", wl.distanceMultiplier);
+ cmd.Parameters.AddWithValue("max_altitude", wl.maxAltitude);
+ cmd.Parameters.AddWithValue("sun_moon_color_r", wl.sunMoonColor.X);
+ cmd.Parameters.AddWithValue("sun_moon_color_g", wl.sunMoonColor.Y);
+ cmd.Parameters.AddWithValue("sun_moon_color_b", wl.sunMoonColor.Z);
+ cmd.Parameters.AddWithValue("sun_moon_color_i", wl.sunMoonColor.W);
+ cmd.Parameters.AddWithValue("sun_moon_position", wl.sunMoonPosition);
+ cmd.Parameters.AddWithValue("ambient_r", wl.ambient.X);
+ cmd.Parameters.AddWithValue("ambient_g", wl.ambient.Y);
+ cmd.Parameters.AddWithValue("ambient_b", wl.ambient.Z);
+ cmd.Parameters.AddWithValue("ambient_i", wl.ambient.W);
+ cmd.Parameters.AddWithValue("east_angle", wl.eastAngle);
+ cmd.Parameters.AddWithValue("sun_glow_focus", wl.sunGlowFocus);
+ cmd.Parameters.AddWithValue("sun_glow_size", wl.sunGlowSize);
+ cmd.Parameters.AddWithValue("scene_gamma", wl.sceneGamma);
+ cmd.Parameters.AddWithValue("star_brightness", wl.starBrightness);
+ cmd.Parameters.AddWithValue("cloud_color_r", wl.cloudColor.X);
+ cmd.Parameters.AddWithValue("cloud_color_g", wl.cloudColor.Y);
+ cmd.Parameters.AddWithValue("cloud_color_b", wl.cloudColor.Z);
+ cmd.Parameters.AddWithValue("cloud_color_i", wl.cloudColor.W);
+ cmd.Parameters.AddWithValue("cloud_x", wl.cloudXYDensity.X);
+ cmd.Parameters.AddWithValue("cloud_y", wl.cloudXYDensity.Y);
+ cmd.Parameters.AddWithValue("cloud_density", wl.cloudXYDensity.Z);
+ cmd.Parameters.AddWithValue("cloud_coverage", wl.cloudCoverage);
+ cmd.Parameters.AddWithValue("cloud_scale", wl.cloudScale);
+ cmd.Parameters.AddWithValue("cloud_detail_x", wl.cloudDetailXYDensity.X);
+ cmd.Parameters.AddWithValue("cloud_detail_y", wl.cloudDetailXYDensity.Y);
+ cmd.Parameters.AddWithValue("cloud_detail_density", wl.cloudDetailXYDensity.Z);
+ cmd.Parameters.AddWithValue("cloud_scroll_x", wl.cloudScrollX);
+ cmd.Parameters.AddWithValue("cloud_scroll_x_lock", wl.cloudScrollXLock);
+ cmd.Parameters.AddWithValue("cloud_scroll_y", wl.cloudScrollY);
+ cmd.Parameters.AddWithValue("cloud_scroll_y_lock", wl.cloudScrollYLock);
+ cmd.Parameters.AddWithValue("draw_classic_clouds", wl.drawClassicClouds);
+
+ ExecuteNonQuery(cmd);
}
}
}
public virtual void RemoveRegionWindlightSettings(UUID regionID)
{
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ using (MySqlCommand cmd = dbcon.CreateCommand())
{
- dbcon.Open();
-
- using (MySqlCommand cmd = dbcon.CreateCommand())
- {
- cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID";
- cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
- ExecuteNonQuery(cmd);
- }
+ cmd.CommandText = "delete from `regionwindlight` where `region_id`=?regionID";
+ cmd.Parameters.AddWithValue("?regionID", regionID.ToString());
+ ExecuteNonQuery(cmd);
}
}
}
@@ -1010,29 +1000,26 @@ namespace OpenSim.Data.MySQL
#region RegionEnvironmentSettings
public string LoadRegionEnvironmentSettings(UUID regionUUID)
{
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ string command = "select * from `regionenvironment` where region_id = ?region_id";
+
+ using (MySqlCommand cmd = new MySqlCommand(command))
{
- dbcon.Open();
-
- string command = "select * from `regionenvironment` where region_id = ?region_id";
-
- using (MySqlCommand cmd = new MySqlCommand(command))
+ cmd.Connection = dbcon;
+
+ cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
+
+ IDataReader result = ExecuteReader(cmd);
+ if (!result.Read())
{
- cmd.Connection = dbcon;
-
- cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
-
- IDataReader result = ExecuteReader(cmd);
- if (!result.Read())
- {
- return String.Empty;
- }
- else
- {
- return Convert.ToString(result["llsd_settings"]);
- }
+ return String.Empty;
+ }
+ else
+ {
+ return Convert.ToString(result["llsd_settings"]);
}
}
}
@@ -1040,39 +1027,33 @@ namespace OpenSim.Data.MySQL
public void StoreRegionEnvironmentSettings(UUID regionUUID, string settings)
{
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ using (MySqlCommand cmd = dbcon.CreateCommand())
{
- dbcon.Open();
-
- using (MySqlCommand cmd = dbcon.CreateCommand())
- {
- cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
-
- cmd.Parameters.AddWithValue("region_id", regionUUID);
- cmd.Parameters.AddWithValue("llsd_settings", settings);
-
- ExecuteNonQuery(cmd);
- }
+ cmd.CommandText = "REPLACE INTO `regionenvironment` (`region_id`, `llsd_settings`) VALUES (?region_id, ?llsd_settings)";
+
+ cmd.Parameters.AddWithValue("region_id", regionUUID);
+ cmd.Parameters.AddWithValue("llsd_settings", settings);
+
+ ExecuteNonQuery(cmd);
}
}
}
public void RemoveRegionEnvironmentSettings(UUID regionUUID)
{
- lock (m_dbLock)
+ using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
- using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
+ dbcon.Open();
+
+ using (MySqlCommand cmd = dbcon.CreateCommand())
{
- dbcon.Open();
-
- using (MySqlCommand cmd = dbcon.CreateCommand())
- {
- cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
- cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
- ExecuteNonQuery(cmd);
- }
+ cmd.CommandText = "delete from `regionenvironment` where region_id = ?region_id";
+ cmd.Parameters.AddWithValue("?region_id", regionUUID.ToString());
+ ExecuteNonQuery(cmd);
}
}
}
diff --git a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
index d08e096364..32b85ee8c1 100644
--- a/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/GridUserStore.migrations
@@ -17,8 +17,3 @@ CREATE TABLE `GridUser` (
) ENGINE=InnoDB;
COMMIT;
-
-:VERSION 2 # --------------------------
-BEGIN;
-
-COMMIT;
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index b4d701af50..deb50cb4df 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -33,7 +33,6 @@ using OpenSim.Framework;
using OpenSim.Data;
using System.Reflection;
using log4net;
-using RegionFlags = OpenSim.Framework.RegionFlags;
namespace OpenSim.Data.Null
{
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 42cd59de31..431709f8d5 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -1366,13 +1366,6 @@ namespace OpenSim.Data.SQLite
createCol(land, "UserLookAtZ", typeof(Double));
createCol(land, "AuthbuyerID", typeof(String));
createCol(land, "OtherCleanTime", typeof(Int32));
- createCol(land, "Dwell", typeof(Int32));
- createCol(land, "MediaType", typeof(String));
- createCol(land, "MediaDescription", typeof(String));
- createCol(land, "MediaSize", typeof(String));
- createCol(land, "MediaLoop", typeof(Boolean));
- createCol(land, "ObscureMedia", typeof(Boolean));
- createCol(land, "ObscureMusic", typeof(Boolean));
land.PrimaryKey = new DataColumn[] { land.Columns["UUID"] };
@@ -1788,16 +1781,9 @@ namespace OpenSim.Data.SQLite
newData.PassHours = Convert.ToSingle(row["PassHours"]);
newData.PassPrice = Convert.ToInt32(row["PassPrice"]);
newData.SnapshotID = (UUID)(String)row["SnapshotUUID"];
- newData.Dwell = Convert.ToInt32(row["Dwell"]);
- newData.MediaType = (String)row["MediaType"];
- newData.MediaDescription = (String)row["MediaDescription"];
- newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
- newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
- newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
- newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
- newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
try
{
+
newData.UserLocation =
new Vector3(Convert.ToSingle(row["UserLocationX"]), Convert.ToSingle(row["UserLocationY"]),
Convert.ToSingle(row["UserLocationZ"]));
@@ -2209,13 +2195,12 @@ namespace OpenSim.Data.SQLite
row["UserLookAtZ"] = land.UserLookAt.Z;
row["AuthbuyerID"] = land.AuthBuyerID.ToString();
row["OtherCleanTime"] = land.OtherCleanTime;
- row["Dwell"] = land.Dwell;
row["MediaType"] = land.MediaType;
row["MediaDescription"] = land.MediaDescription;
- row["MediaSize"] = String.Format("{0},{1}", land.MediaWidth, land.MediaHeight);
- row["MediaLoop"] = land.MediaLoop;
- row["ObscureMusic"] = land.ObscureMusic;
- row["ObscureMedia"] = land.ObscureMedia;
+ row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString();
+ row["MediaLoop"] = land.MediaLoop.ToString();
+ row["ObscureMusic"] = land.ObscureMusic.ToString();
+ row["ObscureMedia"] = land.ObscureMedia.ToString();
}
///
diff --git a/OpenSim/Framework/AssetPermissions.cs b/OpenSim/Framework/AssetPermissions.cs
deleted file mode 100644
index 4a905c2f5d..0000000000
--- a/OpenSim/Framework/AssetPermissions.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-
-using Nini.Config;
-using log4net;
-
-using OpenMetaverse;
-
-namespace OpenSim.Framework
-{
- public class AssetPermissions
- {
- private static readonly ILog m_log =
- LogManager.GetLogger(
- MethodBase.GetCurrentMethod().DeclaringType);
-
- private bool[] m_DisallowExport, m_DisallowImport;
- private string[] m_AssetTypeNames;
-
- public AssetPermissions(IConfig config)
- {
- Type enumType = typeof(AssetType);
- m_AssetTypeNames = Enum.GetNames(enumType);
- for (int i = 0; i < m_AssetTypeNames.Length; i++)
- m_AssetTypeNames[i] = m_AssetTypeNames[i].ToLower();
- int n = Enum.GetValues(enumType).Length;
- m_DisallowExport = new bool[n];
- m_DisallowImport = new bool[n];
-
- LoadPermsFromConfig(config, "DisallowExport", m_DisallowExport);
- LoadPermsFromConfig(config, "DisallowImport", m_DisallowImport);
-
- }
-
- private void LoadPermsFromConfig(IConfig assetConfig, string variable, bool[] bitArray)
- {
- if (assetConfig == null)
- return;
-
- string perms = assetConfig.GetString(variable, String.Empty);
- string[] parts = perms.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- foreach (string s in parts)
- {
- int index = Array.IndexOf(m_AssetTypeNames, s.Trim().ToLower());
- if (index >= 0)
- bitArray[index] = true;
- else
- m_log.WarnFormat("[Asset Permissions]: Invalid AssetType {0}", s);
- }
-
- }
-
- public bool AllowedExport(sbyte type)
- {
- string assetTypeName = ((AssetType)type).ToString();
-
- int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower());
- if (index >= 0 && m_DisallowExport[index])
- {
- m_log.DebugFormat("[Asset Permissions]: Export denied: configuration does not allow export of AssetType {0}", assetTypeName);
- return false;
- }
-
- return true;
- }
-
- public bool AllowedImport(sbyte type)
- {
- string assetTypeName = ((AssetType)type).ToString();
-
- int index = Array.IndexOf(m_AssetTypeNames, assetTypeName.ToLower());
- if (index >= 0 && m_DisallowImport[index])
- {
- m_log.DebugFormat("[Asset Permissions]: Import denied: configuration does not allow import of AssetType {0}", assetTypeName);
- return false;
- }
-
- return true;
- }
-
-
- }
-}
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 16385417e6..c5d9641da7 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -358,9 +358,6 @@ namespace OpenSim.Framework
SetVisualParams(visualParams);
}
- ///
- /// Set avatar height by a calculation based on their visual parameters.
- ///
public virtual void SetHeight()
{
// Start with shortest possible female avatar height
diff --git a/OpenSim/Framework/Cache.cs b/OpenSim/Framework/Cache.cs
index 31cab4a021..79e20fc88e 100644
--- a/OpenSim/Framework/Cache.cs
+++ b/OpenSim/Framework/Cache.cs
@@ -199,14 +199,7 @@ namespace OpenSim.Framework
//
public class Cache
{
- ///
- /// Must only be accessed under lock.
- ///
private List m_Index = new List();
-
- ///
- /// Must only be accessed under m_Index lock.
- ///
private Dictionary m_Lookup =
new Dictionary();
@@ -327,19 +320,19 @@ namespace OpenSim.Framework
{
if (m_Lookup.ContainsKey(index))
item = m_Lookup[index];
-
- if (item == null)
- {
- Expire(true);
- return null;
- }
-
- item.hits++;
- item.lastUsed = DateTime.Now;
-
- Expire(true);
}
+ if (item == null)
+ {
+ Expire(true);
+ return null;
+ }
+
+ item.hits++;
+ item.lastUsed = DateTime.Now;
+
+ Expire(true);
+
return item;
}
@@ -392,10 +385,7 @@ namespace OpenSim.Framework
//
public Object Find(Predicate d)
{
- CacheItemBase item;
-
- lock (m_Index)
- item = m_Index.Find(d);
+ CacheItemBase item = m_Index.Find(d);
if (item == null)
return null;
@@ -429,12 +419,12 @@ namespace OpenSim.Framework
public virtual void Store(string index, Object data, Type container,
Object[] parameters)
{
+ Expire(false);
+
CacheItemBase item;
lock (m_Index)
{
- Expire(false);
-
if (m_Index.Contains(new CacheItemBase(index)))
{
if ((m_Flags & CacheFlags.AllowUpdate) != 0)
@@ -460,17 +450,9 @@ namespace OpenSim.Framework
m_Index.Add(item);
m_Lookup[index] = item;
}
-
item.Store(data);
}
- ///
- /// Expire items as appropriate.
- ///
- ///
- /// Callers must lock m_Index.
- ///
- ///
protected virtual void Expire(bool getting)
{
if (getting && (m_Strategy == CacheStrategy.Aggressive))
@@ -493,10 +475,12 @@ namespace OpenSim.Framework
switch (m_Strategy)
{
- case CacheStrategy.Aggressive:
- if (Count < Size)
- return;
+ case CacheStrategy.Aggressive:
+ if (Count < Size)
+ return;
+ lock (m_Index)
+ {
m_Index.Sort(new SortLRU());
m_Index.Reverse();
@@ -506,7 +490,7 @@ namespace OpenSim.Framework
ExpireDelegate doExpire = OnExpire;
- if (doExpire != null)
+ if (doExpire != null)
{
List candidates =
m_Index.GetRange(target, Count - target);
@@ -529,34 +513,27 @@ namespace OpenSim.Framework
foreach (CacheItemBase item in m_Index)
m_Lookup[item.uuid] = item;
}
-
- break;
-
- default:
- break;
+ }
+ break;
+ default:
+ break;
}
}
public void Invalidate(string uuid)
{
- lock (m_Index)
- {
- if (!m_Lookup.ContainsKey(uuid))
- return;
+ if (!m_Lookup.ContainsKey(uuid))
+ return;
- CacheItemBase item = m_Lookup[uuid];
- m_Lookup.Remove(uuid);
- m_Index.Remove(item);
- }
+ CacheItemBase item = m_Lookup[uuid];
+ m_Lookup.Remove(uuid);
+ m_Index.Remove(item);
}
public void Clear()
{
- lock (m_Index)
- {
- m_Index.Clear();
- m_Lookup.Clear();
- }
+ m_Index.Clear();
+ m_Lookup.Clear();
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Client/IClientChat.cs b/OpenSim/Framework/Client/IClientChat.cs
index 86b1faa8f6..078ea9b668 100644
--- a/OpenSim/Framework/Client/IClientChat.cs
+++ b/OpenSim/Framework/Client/IClientChat.cs
@@ -33,8 +33,7 @@ namespace OpenSim.Framework.Client
{
event ChatMessage OnChatFromClient;
- void SendChatMessage(
- string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
- byte audible);
+ void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source,
+ byte audible);
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs
deleted file mode 100644
index 16a63e0ca5..0000000000
--- a/OpenSim/Framework/Console/ConsoleUtil.cs
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) Contributors, http://opensimulator.org/
- * See CONTRIBUTORS.TXT for a full list of copyright holders.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of the OpenSimulator Project nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using log4net;
-using OpenMetaverse;
-
-namespace OpenSim.Framework.Console
-{
- public class ConsoleUtil
- {
- // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
- public const int LocalIdNotFound = 0;
-
- ///
- /// Used by modules to display stock co-ordinate help, though possibly this should be under some general section
- /// rather than in each help summary.
- ///
- public const string CoordHelp
- = @"Each component of the coord is comma separated. There must be no spaces between the commas.
- If you don't care about the z component you can simply omit it.
- If you don't care about the x or y components then you can leave them blank (though a comma is still required)
- If you want to specify the maxmimum value of a component then you can use ~ instead of a number
- If you want to specify the minimum value of a component then you can use -~ instead of a number
- e.g.
- delete object pos 20,20,20 to 40,40,40
- delete object pos 20,20 to 40,40
- delete object pos ,20,20 to ,40,40
- delete object pos ,,30 to ,,~
- delete object pos ,,-~ to ,,30";
-
- public const string MinRawConsoleVectorValue = "-~";
- public const string MaxRawConsoleVectorValue = "~";
-
- public const string VectorSeparator = ",";
- public static char[] VectorSeparatorChars = VectorSeparator.ToCharArray();
-
- ///
- /// Check if the given file path exists.
- ///
- /// If not, warning is printed to the given console.
- /// true if the file does not exist, false otherwise.
- ///
- ///
- public static bool CheckFileDoesNotExist(ICommandConsole console, string path)
- {
- if (File.Exists(path))
- {
- console.OutputFormat("File {0} already exists. Please move or remove it.", path);
- return false;
- }
-
- return true;
- }
-
- ///
- /// Try to parse a console UUID from the console.
- ///
- ///
- /// Will complain to the console if parsing fails.
- ///
- ///
- /// If null then no complaint is printed.
- ///
- ///
- public static bool TryParseConsoleUuid(ICommandConsole console, string rawUuid, out UUID uuid)
- {
- if (!UUID.TryParse(rawUuid, out uuid))
- {
- if (console != null)
- console.OutputFormat("{0} is not a valid uuid", rawUuid);
-
- return false;
- }
-
- return true;
- }
-
- public static bool TryParseConsoleLocalId(ICommandConsole console, string rawLocalId, out uint localId)
- {
- if (!uint.TryParse(rawLocalId, out localId))
- {
- if (console != null)
- console.OutputFormat("{0} is not a valid local id", localId);
-
- return false;
- }
-
- if (localId == 0)
- {
- if (console != null)
- console.OutputFormat("{0} is not a valid local id - it must be greater than 0", localId);
-
- return false;
- }
-
- return true;
- }
-
- ///
- /// Tries to parse the input as either a UUID or a local ID.
- ///
- /// true if parsing succeeded, false otherwise.
- ///
- ///
- ///
- ///
- /// Will be set to ConsoleUtil.LocalIdNotFound if parsing result was a UUID or no parse succeeded.
- ///
- public static bool TryParseConsoleId(ICommandConsole console, string rawId, out UUID uuid, out uint localId)
- {
- if (TryParseConsoleUuid(null, rawId, out uuid))
- {
- localId = LocalIdNotFound;
- return true;
- }
-
- if (TryParseConsoleLocalId(null, rawId, out localId))
- {
- return true;
- }
-
- if (console != null)
- console.OutputFormat("{0} is not a valid UUID or local id", rawId);
-
- return false;
- }
-
- ///
- /// Convert a minimum vector input from the console to an OpenMetaverse.Vector3
- ///
- /// /param>
- ///
- ///
- public static bool TryParseConsoleMinVector(string rawConsoleVector, out Vector3 vector)
- {
- return TryParseConsoleVector(rawConsoleVector, c => float.MinValue.ToString(), out vector);
- }
-
- ///
- /// Convert a maximum vector input from the console to an OpenMetaverse.Vector3
- ///
- /// /param>
- ///
- ///
- public static bool TryParseConsoleMaxVector(string rawConsoleVector, out Vector3 vector)
- {
- return TryParseConsoleVector(rawConsoleVector, c => float.MaxValue.ToString(), out vector);
- }
-
- ///
- /// Convert a vector input from the console to an OpenMetaverse.Vector3
- ///
- ///
- /// A string in the form ,, where there is no space between values.
- /// Any component can be missing (e.g. ,,40). blankComponentFunc is invoked to replace the blank with a suitable value
- /// Also, if the blank component is at the end, then the comma can be missed off entirely (e.g. 40,30 or 40)
- /// The strings "~" and "-~" are valid in components. The first substitutes float.MaxValue whilst the second is float.MinValue
- /// Other than that, component values must be numeric.
- ///
- ///
- ///
- ///
- public static bool TryParseConsoleVector(
- string rawConsoleVector, Func blankComponentFunc, out Vector3 vector)
- {
- List components = rawConsoleVector.Split(VectorSeparatorChars).ToList();
-
- if (components.Count < 1 || components.Count > 3)
- {
- vector = Vector3.Zero;
- return false;
- }
-
- for (int i = components.Count; i < 3; i++)
- components.Add("");
-
- List semiDigestedComponents
- = components.ConvertAll(
- c =>
- {
- if (c == "")
- return blankComponentFunc.Invoke(c);
- else if (c == MaxRawConsoleVectorValue)
- return float.MaxValue.ToString();
- else if (c == MinRawConsoleVectorValue)
- return float.MinValue.ToString();
- else
- return c;
- });
-
- string semiDigestedConsoleVector = string.Join(VectorSeparator, semiDigestedComponents.ToArray());
-
- // m_log.DebugFormat("[CONSOLE UTIL]: Parsing {0} into OpenMetaverse.Vector3", semiDigestedConsoleVector);
-
- return Vector3.TryParse(semiDigestedConsoleVector, out vector);
- }
- }
-}
\ No newline at end of file
diff --git a/OpenSim/Framework/Constants.cs b/OpenSim/Framework/Constants.cs
index a2eb5ee18e..1b1aaf2bc4 100644
--- a/OpenSim/Framework/Constants.cs
+++ b/OpenSim/Framework/Constants.cs
@@ -31,7 +31,6 @@ namespace OpenSim.Framework
public class Constants
{
public const uint RegionSize = 256;
- public const uint RegionHeight = 4096;
public const byte TerrainPatchSize = 16;
public const string DefaultTexture = "89556747-24cb-43ed-920b-47caed15465f";
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index e03750bcc5..9020761cad 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -419,11 +419,11 @@ namespace OpenSim.Framework
public void SetFromFlags(ulong regionFlags)
{
- ResetHomeOnTeleport = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.ResetHomeOnTeleport) == (ulong)OpenMetaverse.RegionFlags.ResetHomeOnTeleport);
- BlockDwell = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.BlockDwell) == (ulong)OpenMetaverse.RegionFlags.BlockDwell);
- AllowLandmark = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowLandmark) == (ulong)OpenMetaverse.RegionFlags.AllowLandmark);
- AllowParcelChanges = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowParcelChanges) == (ulong)OpenMetaverse.RegionFlags.AllowParcelChanges);
- AllowSetHome = ((regionFlags & (ulong)OpenMetaverse.RegionFlags.AllowSetHome) == (ulong)OpenMetaverse.RegionFlags.AllowSetHome);
+ ResetHomeOnTeleport = ((regionFlags & (ulong)RegionFlags.ResetHomeOnTeleport) == (ulong)RegionFlags.ResetHomeOnTeleport);
+ BlockDwell = ((regionFlags & (ulong)RegionFlags.BlockDwell) == (ulong)RegionFlags.BlockDwell);
+ AllowLandmark = ((regionFlags & (ulong)RegionFlags.AllowLandmark) == (ulong)RegionFlags.AllowLandmark);
+ AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges);
+ AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome);
}
public bool GroupAccess(UUID groupID)
diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs
index 6ae0488fc2..a6bf6e3c32 100644
--- a/OpenSim/Framework/GridInstantMessage.cs
+++ b/OpenSim/Framework/GridInstantMessage.cs
@@ -44,6 +44,7 @@ namespace OpenSim.Framework
public Vector3 Position;
public byte[] binaryBucket;
+
public uint ParentEstateID;
public Guid RegionID;
public uint timestamp;
@@ -57,7 +58,7 @@ namespace OpenSim.Framework
string _fromAgentName, UUID _toAgentID,
byte _dialog, bool _fromGroup, string _message,
UUID _imSessionID, bool _offline, Vector3 _position,
- byte[] _binaryBucket, bool addTimestamp)
+ byte[] _binaryBucket)
{
fromAgentID = _fromAgentID.Guid;
fromAgentName = _fromAgentName;
@@ -78,9 +79,7 @@ namespace OpenSim.Framework
ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID;
RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid;
}
-
- if (addTimestamp)
- timestamp = (uint)Util.UnixTimeSinceEpoch();
+ timestamp = (uint)Util.UnixTimeSinceEpoch();
}
public GridInstantMessage(IScene scene, UUID _fromAgentID,
@@ -88,7 +87,7 @@ namespace OpenSim.Framework
string _message, bool _offline,
Vector3 _position) : this(scene, _fromAgentID, _fromAgentName,
_toAgentID, _dialog, false, _message,
- _fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true)
+ _fromAgentID ^ _toAgentID, _offline, _position, new byte[0])
{
}
}
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 1c6685aec6..e31c7f6d23 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -815,23 +815,8 @@ namespace OpenSim.Framework
event Action OnRegionHandShakeReply;
event GenericCall1 OnRequestWearables;
event Action OnCompleteMovementToRegion;
-
- ///
- /// Called when an AgentUpdate message is received and before OnAgentUpdate.
- ///
- ///
- /// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
- ///
event UpdateAgent OnPreAgentUpdate;
-
- ///
- /// Called when an AgentUpdate message is received and after OnPreAgentUpdate.
- ///
- ///
- /// Listeners must not retain a reference to AgentUpdateArgs since this object may be reused for subsequent AgentUpdates.
- ///
event UpdateAgent OnAgentUpdate;
-
event AgentRequestSit OnAgentRequestSit;
event AgentSit OnAgentSit;
event AvatarPickerRequest OnAvatarPickerRequest;
@@ -1061,21 +1046,8 @@ namespace OpenSim.Framework
void InPacket(object NewPack);
void ProcessInPacket(Packet NewPack);
-
- ///
- /// Close this client
- ///
void Close();
-
- ///
- /// Close this client
- ///
- ///
- /// If true, attempts the close without checking active status. You do not want to try this except as a last
- /// ditch attempt where Active == false but the ScenePresence still exists.
- ///
- void Close(bool sendStop, bool force);
-
+ void Close(bool sendStop);
void Kick(string message);
///
@@ -1112,20 +1084,8 @@ namespace OpenSim.Framework
void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs);
void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args);
- ///
- /// Send chat to the viewer.
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- void SendChatMessage(
- string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, UUID ownerID, byte source,
- byte audible);
+ void SendChatMessage(string message, byte type, Vector3 fromPos, string fromName, UUID fromAgentID, byte source,
+ byte audible);
void SendInstantMessage(GridInstantMessage im);
diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs
index b3457a65b9..a12183c535 100644
--- a/OpenSim/Framework/InventoryFolderBase.cs
+++ b/OpenSim/Framework/InventoryFolderBase.cs
@@ -73,27 +73,33 @@ namespace OpenSim.Framework
{
}
- public InventoryFolderBase(UUID id) : this()
+ public InventoryFolderBase(UUID id)
{
ID = id;
}
- public InventoryFolderBase(UUID id, UUID owner) : this(id)
+ public InventoryFolderBase(UUID id, UUID owner)
{
+ ID = id;
Owner = owner;
}
- public InventoryFolderBase(UUID id, string name, UUID owner, UUID parent) : this(id, owner)
+ public InventoryFolderBase(UUID id, string name, UUID owner, UUID parent)
{
+ ID = id;
Name = name;
+ Owner = owner;
ParentID = parent;
}
- public InventoryFolderBase(
- UUID id, string name, UUID owner, short type, UUID parent, ushort version) : this(id, name, owner, parent)
+ public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version)
{
+ ID = id;
+ Name = name;
+ Owner = owner;
Type = type;
+ ParentID = parent;
Version = version;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
index 4dffd3f22d..dcaa46d960 100644
--- a/OpenSim/Framework/LandData.cs
+++ b/OpenSim/Framework/LandData.cs
@@ -49,8 +49,8 @@ namespace OpenSim.Framework
// use only one serializer to give the runtime a chance to
// optimize it (it won't do that if you use a new instance
// every time)
- private static XmlSerializer serializer = new XmlSerializer(typeof(LandData));
-
+ private static XmlSerializer serializer = new XmlSerializer(typeof (LandData));
+
private Vector3 _AABBMax = new Vector3();
private Vector3 _AABBMin = new Vector3();
private int _area = 0;
@@ -65,11 +65,11 @@ namespace OpenSim.Framework
private byte[] _bitmap = new byte[512];
private string _description = String.Empty;
- private uint _flags = (uint)ParcelFlags.AllowFly | (uint)ParcelFlags.AllowLandmark |
- (uint)ParcelFlags.AllowAPrimitiveEntry |
- (uint)ParcelFlags.AllowDeedToGroup |
- (uint)ParcelFlags.CreateObjects | (uint)ParcelFlags.AllowOtherScripts |
- (uint)ParcelFlags.AllowVoiceChat;
+ private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark |
+ (uint) ParcelFlags.AllowAPrimitiveEntry |
+ (uint) ParcelFlags.AllowDeedToGroup |
+ (uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
+ (uint) ParcelFlags.SoundLocal | (uint) ParcelFlags.AllowVoiceChat;
private byte _landingType = 0;
private string _name = "Your Parcel";
@@ -97,36 +97,16 @@ namespace OpenSim.Framework
private bool _mediaLoop = false;
private bool _obscureMusic = false;
private bool _obscureMedia = false;
- private float _dwell = 0;
-
- ///
- /// Traffic count of parcel
- ///
- [XmlIgnore]
- public float Dwell
- {
- get
- {
- return _dwell;
- }
- set
- {
- _dwell = value;
- }
- }
///
/// Whether to obscure parcel media URL
///
[XmlIgnore]
- public bool ObscureMedia
- {
- get
- {
+ public bool ObscureMedia {
+ get {
return _obscureMedia;
}
- set
- {
+ set {
_obscureMedia = value;
}
}
@@ -135,14 +115,11 @@ namespace OpenSim.Framework
/// Whether to obscure parcel music URL
///
[XmlIgnore]
- public bool ObscureMusic
- {
- get
- {
+ public bool ObscureMusic {
+ get {
return _obscureMusic;
}
- set
- {
+ set {
_obscureMusic = value;
}
}
@@ -151,14 +128,11 @@ namespace OpenSim.Framework
/// Whether to loop parcel media
///
[XmlIgnore]
- public bool MediaLoop
- {
- get
- {
+ public bool MediaLoop {
+ get {
return _mediaLoop;
}
- set
- {
+ set {
_mediaLoop = value;
}
}
@@ -167,14 +141,11 @@ namespace OpenSim.Framework
/// Height of parcel media render
///
[XmlIgnore]
- public int MediaHeight
- {
- get
- {
+ public int MediaHeight {
+ get {
return _mediaHeight;
}
- set
- {
+ set {
_mediaHeight = value;
}
}
@@ -183,14 +154,11 @@ namespace OpenSim.Framework
/// Width of parcel media render
///
[XmlIgnore]
- public int MediaWidth
- {
- get
- {
+ public int MediaWidth {
+ get {
return _mediaWidth;
}
- set
- {
+ set {
_mediaWidth = value;
}
}
@@ -199,14 +167,11 @@ namespace OpenSim.Framework
/// Upper corner of the AABB for the parcel
///
[XmlIgnore]
- public Vector3 AABBMax
- {
- get
- {
+ public Vector3 AABBMax {
+ get {
return _AABBMax;
}
- set
- {
+ set {
_AABBMax = value;
}
}
@@ -214,14 +179,11 @@ namespace OpenSim.Framework
/// Lower corner of the AABB for the parcel
///
[XmlIgnore]
- public Vector3 AABBMin
- {
- get
- {
+ public Vector3 AABBMin {
+ get {
return _AABBMin;
}
- set
- {
+ set {
_AABBMin = value;
}
}
@@ -229,14 +191,11 @@ namespace OpenSim.Framework
///
/// Area in meters^2 the parcel contains
///
- public int Area
- {
- get
- {
+ public int Area {
+ get {
return _area;
}
- set
- {
+ set {
_area = value;
}
}
@@ -244,14 +203,11 @@ namespace OpenSim.Framework
///
/// ID of auction (3rd Party Integration) when parcel is being auctioned
///
- public uint AuctionID
- {
- get
- {
+ public uint AuctionID {
+ get {
return _auctionID;
}
- set
- {
+ set {
_auctionID = value;
}
}
@@ -259,14 +215,11 @@ namespace OpenSim.Framework
///
/// UUID of authorized buyer of parcel. This is UUID.Zero if anyone can buy it.
///
- public UUID AuthBuyerID
- {
- get
- {
+ public UUID AuthBuyerID {
+ get {
return _authBuyerID;
}
- set
- {
+ set {
_authBuyerID = value;
}
}
@@ -274,14 +227,11 @@ namespace OpenSim.Framework
///
/// Category of parcel. Used for classifying the parcel in classified listings
///
- public ParcelCategory Category
- {
- get
- {
+ public ParcelCategory Category {
+ get {
return _category;
}
- set
- {
+ set {
_category = value;
}
}
@@ -289,14 +239,11 @@ namespace OpenSim.Framework
///
/// Date that the current owner purchased or claimed the parcel
///
- public int ClaimDate
- {
- get
- {
+ public int ClaimDate {
+ get {
return _claimDate;
}
- set
- {
+ set {
_claimDate = value;
}
}
@@ -304,14 +251,11 @@ namespace OpenSim.Framework
///
/// The last price that the parcel was sold at
///
- public int ClaimPrice
- {
- get
- {
+ public int ClaimPrice {
+ get {
return _claimPrice;
}
- set
- {
+ set {
_claimPrice = value;
}
}
@@ -319,14 +263,11 @@ namespace OpenSim.Framework
///
/// Global ID for the parcel. (3rd Party Integration)
///
- public UUID GlobalID
- {
- get
- {
+ public UUID GlobalID {
+ get {
return _globalID;
}
- set
- {
+ set {
_globalID = value;
}
}
@@ -334,14 +275,11 @@ namespace OpenSim.Framework
///
/// Unique ID of the Group that owns
///
- public UUID GroupID
- {
- get
- {
+ public UUID GroupID {
+ get {
return _groupID;
}
- set
- {
+ set {
_groupID = value;
}
}
@@ -349,14 +287,11 @@ namespace OpenSim.Framework
///
/// Returns true if the Land Parcel is owned by a group
///
- public bool IsGroupOwned
- {
- get
- {
+ public bool IsGroupOwned {
+ get {
return _isGroupOwned;
}
- set
- {
+ set {
_isGroupOwned = value;
}
}
@@ -364,14 +299,11 @@ namespace OpenSim.Framework
///
/// jp2 data for the image representative of the parcel in the parcel dialog
///
- public byte[] Bitmap
- {
- get
- {
+ public byte[] Bitmap {
+ get {
return _bitmap;
}
- set
- {
+ set {
_bitmap = value;
}
}
@@ -379,14 +311,11 @@ namespace OpenSim.Framework
///
/// Parcel Description
///
- public string Description
- {
- get
- {
+ public string Description {
+ get {
return _description;
}
- set
- {
+ set {
_description = value;
}
}
@@ -394,14 +323,11 @@ namespace OpenSim.Framework
///
/// Parcel settings. Access flags, Fly, NoPush, Voice, Scripts allowed, etc. ParcelFlags
///
- public uint Flags
- {
- get
- {
+ public uint Flags {
+ get {
return _flags;
}
- set
- {
+ set {
_flags = value;
}
}
@@ -410,14 +336,11 @@ namespace OpenSim.Framework
/// Determines if people are able to teleport where they please on the parcel or if they
/// get constrainted to a specific point on teleport within the parcel
///
- public byte LandingType
- {
- get
- {
+ public byte LandingType {
+ get {
return _landingType;
}
- set
- {
+ set {
_landingType = value;
}
}
@@ -425,14 +348,11 @@ namespace OpenSim.Framework
///
/// Parcel Name
///
- public string Name
- {
- get
- {
+ public string Name {
+ get {
return _name;
}
- set
- {
+ set {
_name = value;
}
}
@@ -440,14 +360,11 @@ namespace OpenSim.Framework
///
/// Status of Parcel, Leased, Abandoned, For Sale
///
- public ParcelStatus Status
- {
- get
- {
+ public ParcelStatus Status {
+ get {
return _status;
}
- set
- {
+ set {
_status = value;
}
}
@@ -455,14 +372,11 @@ namespace OpenSim.Framework
///
/// Internal ID of the parcel. Sometimes the client will try to use this value
///
- public int LocalID
- {
- get
- {
+ public int LocalID {
+ get {
return _localID;
}
- set
- {
+ set {
_localID = value;
}
}
@@ -470,14 +384,11 @@ namespace OpenSim.Framework
///
/// Determines if we scale the media based on the surface it's on
///
- public byte MediaAutoScale
- {
- get
- {
+ public byte MediaAutoScale {
+ get {
return _mediaAutoScale;
}
- set
- {
+ set {
_mediaAutoScale = value;
}
}
@@ -485,14 +396,11 @@ namespace OpenSim.Framework
///
/// Texture Guid to replace with the output of the media stream
///
- public UUID MediaID
- {
- get
- {
+ public UUID MediaID {
+ get {
return _mediaID;
}
- set
- {
+ set {
_mediaID = value;
}
}
@@ -500,14 +408,11 @@ namespace OpenSim.Framework
///
/// URL to the media file to display
///
- public string MediaURL
- {
- get
- {
+ public string MediaURL {
+ get {
return _mediaURL;
}
- set
- {
+ set {
_mediaURL = value;
}
}
@@ -527,14 +432,11 @@ namespace OpenSim.Framework
///
/// URL to the shoutcast music stream to play on the parcel
///
- public string MusicURL
- {
- get
- {
+ public string MusicURL {
+ get {
return _musicURL;
}
- set
- {
+ set {
_musicURL = value;
}
}
@@ -543,14 +445,11 @@ namespace OpenSim.Framework
/// Owner Avatar or Group of the parcel. Naturally, all land masses must be
/// owned by someone
///
- public UUID OwnerID
- {
- get
- {
+ public UUID OwnerID {
+ get {
return _ownerID;
}
- set
- {
+ set {
_ownerID = value;
}
}
@@ -558,14 +457,11 @@ namespace OpenSim.Framework
///
/// List of access data for the parcel. User data, some bitflags, and a time
///
- public List ParcelAccessList
- {
- get
- {
+ public List ParcelAccessList {
+ get {
return _parcelAccessList;
}
- set
- {
+ set {
_parcelAccessList = value;
}
}
@@ -573,14 +469,11 @@ namespace OpenSim.Framework
///
/// How long in hours a Pass to the parcel is given
///
- public float PassHours
- {
- get
- {
+ public float PassHours {
+ get {
return _passHours;
}
- set
- {
+ set {
_passHours = value;
}
}
@@ -588,14 +481,11 @@ namespace OpenSim.Framework
///
/// Price to purchase a Pass to a restricted parcel
///
- public int PassPrice
- {
- get
- {
+ public int PassPrice {
+ get {
return _passPrice;
}
- set
- {
+ set {
_passPrice = value;
}
}
@@ -603,14 +493,11 @@ namespace OpenSim.Framework
///
/// When the parcel is being sold, this is the price to purchase the parcel
///
- public int SalePrice
- {
- get
- {
+ public int SalePrice {
+ get {
return _salePrice;
}
- set
- {
+ set {
_salePrice = value;
}
}
@@ -619,14 +506,11 @@ namespace OpenSim.Framework
/// Number of meters^2 in the Simulator
///
[XmlIgnore]
- public int SimwideArea
- {
- get
- {
+ public int SimwideArea {
+ get {
return _simwideArea;
}
- set
- {
+ set {
_simwideArea = value;
}
}
@@ -635,14 +519,11 @@ namespace OpenSim.Framework
/// Number of SceneObjectPart in the Simulator
///
[XmlIgnore]
- public int SimwidePrims
- {
- get
- {
+ public int SimwidePrims {
+ get {
return _simwidePrims;
}
- set
- {
+ set {
_simwidePrims = value;
}
}
@@ -650,14 +531,11 @@ namespace OpenSim.Framework
///
/// ID of the snapshot used in the client parcel dialog of the parcel
///
- public UUID SnapshotID
- {
- get
- {
+ public UUID SnapshotID {
+ get {
return _snapshotID;
}
- set
- {
+ set {
_snapshotID = value;
}
}
@@ -666,14 +544,11 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the location
/// that the user will be redirected to
///
- public Vector3 UserLocation
- {
- get
- {
+ public Vector3 UserLocation {
+ get {
return _userLocation;
}
- set
- {
+ set {
_userLocation = value;
}
}
@@ -682,14 +557,11 @@ namespace OpenSim.Framework
/// When teleporting is restricted to a certain point, this is the rotation
/// that the user will be positioned
///
- public Vector3 UserLookAt
- {
- get
- {
+ public Vector3 UserLookAt {
+ get {
return _userLookAt;
}
- set
- {
+ set {
_userLookAt = value;
}
}
@@ -698,14 +570,11 @@ namespace OpenSim.Framework
/// Autoreturn number of minutes to return SceneObjectGroup that are owned by someone who doesn't own
/// the parcel and isn't set to the same 'group' as the parcel.
///
- public int OtherCleanTime
- {
- get
- {
+ public int OtherCleanTime {
+ get {
return _otherCleanTime;
}
- set
- {
+ set {
_otherCleanTime = value;
}
}
@@ -713,14 +582,11 @@ namespace OpenSim.Framework
///
/// parcel media description
///
- public string MediaDescription
- {
- get
- {
+ public string MediaDescription {
+ get {
return _mediaDescription;
}
- set
- {
+ set {
_mediaDescription = value;
}
}
@@ -756,7 +622,7 @@ namespace OpenSim.Framework
landData._mediaURL = _mediaURL;
landData._musicURL = _musicURL;
landData._ownerID = _ownerID;
- landData._bitmap = (byte[])_bitmap.Clone();
+ landData._bitmap = (byte[]) _bitmap.Clone();
landData._description = _description;
landData._flags = _flags;
landData._name = _name;
@@ -777,7 +643,6 @@ namespace OpenSim.Framework
landData._obscureMedia = _obscureMedia;
landData._simwideArea = _simwideArea;
landData._simwidePrims = _simwidePrims;
- landData._dwell = _dwell;
landData._parcelAccessList.Clear();
foreach (LandAccessEntry entry in _parcelAccessList)
diff --git a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
index 446e3c0697..9ee087694b 100644
--- a/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/BaseStatsCollector.cs
@@ -43,32 +43,27 @@ namespace OpenSim.Framework.Monitoring
StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("MEMORY STATISTICS");
sb.Append(Environment.NewLine);
- sb.AppendFormat(
+ sb.Append(
+ string.Format(
"Allocated to OpenSim objects: {0} MB\n",
- Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0));
-
- sb.AppendFormat(
- "OpenSim last object memory churn : {0} MB/s\n",
- Math.Round((MemoryWatchdog.LastMemoryChurn * 1000) / 1024.0 / 1024, 3));
-
- sb.AppendFormat(
- "OpenSim average object memory churn : {0} MB/s\n",
- Math.Round((MemoryWatchdog.AverageMemoryChurn * 1000) / 1024.0 / 1024, 3));
+ Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
Process myprocess = Process.GetCurrentProcess();
if (!myprocess.HasExited)
{
myprocess.Refresh();
- sb.AppendFormat(
+ sb.Append(
+ string.Format(
"Process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PagedMemorySize64 / 1024.0 / 1024.0),
- Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0));
- sb.AppendFormat(
+ Math.Round(Process.GetCurrentProcess().VirtualMemorySize64 / 1024.0 / 1024.0)));
+ sb.Append(
+ string.Format(
"Peak process memory: Physical {0} MB \t Paged {1} MB \t Virtual {2} MB\n",
Math.Round(Process.GetCurrentProcess().PeakWorkingSet64 / 1024.0 / 1024.0),
Math.Round(Process.GetCurrentProcess().PeakPagedMemorySize64 / 1024.0 / 1024.0),
- Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0));
+ Math.Round(Process.GetCurrentProcess().PeakVirtualMemorySize64 / 1024.0 / 1024.0)));
}
else
sb.Append("Process reported as Exited \n");
diff --git a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
index c6010cd092..a23cf1fea8 100644
--- a/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
+++ b/OpenSim/Framework/Monitoring/MemoryWatchdog.cs
@@ -60,21 +60,13 @@ namespace OpenSim.Framework.Monitoring
private static bool m_enabled;
///
- /// Last memory churn in bytes per millisecond.
+ /// Average memory churn in bytes per millisecond.
///
public static double AverageMemoryChurn
{
get { if (m_samples.Count > 0) return m_samples.Average(); else return 0; }
}
- ///
- /// Average memory churn in bytes per millisecond.
- ///
- public static double LastMemoryChurn
- {
- get { if (m_samples.Count > 0) return m_samples.Last(); else return 0; }
- }
-
///
/// Maximum number of statistical samples.
///
diff --git a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
index aa862027b8..cdd7cc711e 100644
--- a/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
+++ b/OpenSim/Framework/Monitoring/SimExtraStatsCollector.cs
@@ -355,25 +355,10 @@ Asset service request failures: {3}" + Environment.NewLine,
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
- "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}\n\n",
+ "{0,6:0} {1,6:0} {2,6:0} {3,6:0} {4,6:0} {5,6:0.0} {6,6:0.0} {7,6:0.0} {8,6:0.0} {9,6:0.0} {10,6:0.0}",
inPacketsPerSecond, outPacketsPerSecond, pendingDownloads, pendingUploads, unackedBytes, totalFrameTime,
netFrameTime, physicsFrameTime, otherFrameTime, agentFrameTime, imageFrameTime));
-
- Dictionary> sceneStats;
-
- if (StatsManager.TryGetStats("scene", out sceneStats))
- {
- foreach (KeyValuePair> kvp in sceneStats)
- {
- foreach (Stat stat in kvp.Value.Values)
- {
- if (stat.Verbosity == StatVerbosity.Info)
- {
- sb.AppendFormat("{0} ({1}): {2}{3}\n", stat.Name, stat.Container, stat.Value, stat.UnitName);
- }
- }
- }
- }
+ sb.Append(Environment.NewLine);
/*
sb.Append(Environment.NewLine);
diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs
index 4844336e31..d78fa6a1f0 100644
--- a/OpenSim/Framework/Monitoring/StatsManager.cs
+++ b/OpenSim/Framework/Monitoring/StatsManager.cs
@@ -25,9 +25,6 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-using System;
-using System.Collections.Generic;
-
namespace OpenSim.Framework.Monitoring
{
///
@@ -35,24 +32,6 @@ namespace OpenSim.Framework.Monitoring
///
public class StatsManager
{
- // Subcommand used to list other stats.
- public const string AllSubCommand = "all";
-
- // Subcommand used to list other stats.
- public const string ListSubCommand = "list";
-
- // All subcommands
- public static HashSet SubCommands = new HashSet { AllSubCommand, ListSubCommand };
-
- ///
- /// Registered stats categorized by category/container/shortname
- ///
- ///
- /// Do not add or remove directly from this dictionary.
- ///
- public static Dictionary>> RegisteredStats
- = new Dictionary>>();
-
private static AssetStatsCollector assetStats;
private static UserStatsCollector userStats;
private static SimExtraStatsCollector simExtraStats = new SimExtraStatsCollector();
@@ -61,75 +40,6 @@ namespace OpenSim.Framework.Monitoring
public static UserStatsCollector UserStats { get { return userStats; } }
public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } }
- public static void RegisterConsoleCommands(ICommandConsole console)
- {
- console.Commands.AddCommand(
- "General",
- false,
- "show stats",
- "show stats [list|all|]",
- "Show statistical information for this server",
- "If no final argument is specified then legacy statistics information is currently shown.\n"
- + "If list is specified then statistic categories are shown.\n"
- + "If all is specified then all registered statistics are shown.\n"
- + "If a category name is specified then only statistics from that category are shown.\n"
- + "THIS STATS FACILITY IS EXPERIMENTAL AND DOES NOT YET CONTAIN ALL STATS",
- HandleShowStatsCommand);
- }
-
- public static void HandleShowStatsCommand(string module, string[] cmd)
- {
- ICommandConsole con = MainConsole.Instance;
-
- if (cmd.Length > 2)
- {
- var categoryName = cmd[2];
-
- if (categoryName == AllSubCommand)
- {
- foreach (var category in RegisteredStats.Values)
- {
- OutputCategoryStatsToConsole(con, category);
- }
- }
- else if (categoryName == ListSubCommand)
- {
- con.Output("Statistic categories available are:");
- foreach (string category in RegisteredStats.Keys)
- con.OutputFormat(" {0}", category);
- }
- else
- {
- Dictionary> category;
- if (!RegisteredStats.TryGetValue(categoryName, out category))
- {
- con.OutputFormat("No such category as {0}", categoryName);
- }
- else
- {
- OutputCategoryStatsToConsole(con, category);
- }
- }
- }
- else
- {
- // Legacy
- con.Output(SimExtraStats.Report());
- }
- }
-
- private static void OutputCategoryStatsToConsole(
- ICommandConsole con, Dictionary> category)
- {
- foreach (var container in category.Values)
- {
- foreach (Stat stat in container.Values)
- {
- con.Output(stat.ToConsoleString());
- }
- }
- }
-
///
/// Start collecting statistics related to assets.
/// Should only be called once.
@@ -151,275 +61,5 @@ namespace OpenSim.Framework.Monitoring
return userStats;
}
-
- ///
- /// Registers a statistic.
- ///
- ///
- ///
- public static bool RegisterStat(Stat stat)
- {
- Dictionary> category = null, newCategory;
- Dictionary container = null, newContainer;
-
- lock (RegisteredStats)
- {
- // Stat name is not unique across category/container/shortname key.
- // XXX: For now just return false. This is to avoid problems in regression tests where all tests
- // in a class are run in the same instance of the VM.
- if (TryGetStat(stat, out category, out container))
- return false;
-
- // We take a copy-on-write approach here of replacing dictionaries when keys are added or removed.
- // This means that we don't need to lock or copy them on iteration, which will be a much more
- // common operation after startup.
- if (container != null)
- newContainer = new Dictionary(container);
- else
- newContainer = new Dictionary();
-
- if (category != null)
- newCategory = new Dictionary>(category);
- else
- newCategory = new Dictionary>();
-
- newContainer[stat.ShortName] = stat;
- newCategory[stat.Container] = newContainer;
- RegisteredStats[stat.Category] = newCategory;
- }
-
- return true;
- }
-
- ///
- /// Deregister a statistic
- /// >
- ///
- /// > category = null, newCategory;
- Dictionary container = null, newContainer;
-
- lock (RegisteredStats)
- {
- if (!TryGetStat(stat, out category, out container))
- return false;
-
- newContainer = new Dictionary(container);
- newContainer.Remove(stat.ShortName);
-
- newCategory = new Dictionary>(category);
- newCategory.Remove(stat.Container);
-
- newCategory[stat.Container] = newContainer;
- RegisteredStats[stat.Category] = newCategory;
-
- return true;
- }
- }
-
- public static bool TryGetStats(string category, out Dictionary> stats)
- {
- return RegisteredStats.TryGetValue(category, out stats);
- }
-
- public static bool TryGetStat(
- Stat stat,
- out Dictionary> category,
- out Dictionary container)
- {
- category = null;
- container = null;
-
- lock (RegisteredStats)
- {
- if (RegisteredStats.TryGetValue(stat.Category, out category))
- {
- if (category.TryGetValue(stat.Container, out container))
- {
- if (container.ContainsKey(stat.ShortName))
- return true;
- }
- }
- }
-
- return false;
- }
- }
-
- ///
- /// Stat type.
- ///
- ///
- /// A push stat is one which is continually updated and so it's value can simply by read.
- /// A pull stat is one where reading the value triggers a collection method - the stat is not continually updated.
- ///
- public enum StatType
- {
- Push,
- Pull
- }
-
- ///
- /// Verbosity of stat.
- ///
- ///
- /// Info will always be displayed.
- ///
- public enum StatVerbosity
- {
- Debug,
- Info
- }
-
- ///
- /// Holds individual static details
- ///
- public class Stat
- {
- ///
- /// Category of this stat (e.g. cache, scene, etc).
- ///
- public string Category { get; private set; }
-
- ///
- /// Containing name for this stat.
- /// FIXME: In the case of a scene, this is currently the scene name (though this leaves
- /// us with a to-be-resolved problem of non-unique region names).
- ///
- ///
- /// The container.
- ///
- public string Container { get; private set; }
-
- public StatType StatType { get; private set; }
-
- ///
- /// Action used to update this stat when the value is requested if it's a pull type.
- ///
- public Action PullAction { get; private set; }
-
- public StatVerbosity Verbosity { get; private set; }
- public string ShortName { get; private set; }
- public string Name { get; private set; }
- public string Description { get; private set; }
- public virtual string UnitName { get; private set; }
-
- public virtual double Value
- {
- get
- {
- // Asking for an update here means that the updater cannot access this value without infinite recursion.
- // XXX: A slightly messy but simple solution may be to flick a flag so we can tell if this is being
- // called by the pull action and just return the value.
- if (StatType == StatType.Pull)
- PullAction(this);
-
- return m_value;
- }
-
- set
- {
- m_value = value;
- }
- }
-
- private double m_value;
-
- ///
- /// Constructor
- ///
- /// Short name for the stat. Must not contain spaces. e.g. "LongFrames"
- /// Human readable name for the stat. e.g. "Long frames"
- /// Description of stat
- ///
- /// Unit name for the stat. Should be preceeded by a space if the unit name isn't normally appeneded immediately to the value.
- /// e.g. " frames"
- ///
- /// Category under which this stat should appear, e.g. "scene". Do not capitalize.
- /// Entity to which this stat relates. e.g. scene name if this is a per scene stat.
- /// Push or pull
- /// Pull stats need an action to update the stat on request. Push stats should set null here.
- /// Verbosity of stat. Controls whether it will appear in short stat display or only full display.
- public Stat(
- string shortName,
- string name,
- string description,
- string unitName,
- string category,
- string container,
- StatType type,
- Action pullAction,
- StatVerbosity verbosity)
- {
- if (StatsManager.SubCommands.Contains(category))
- throw new Exception(
- string.Format("Stat cannot be in category '{0}' since this is reserved for a subcommand", category));
-
- ShortName = shortName;
- Name = name;
- Description = description;
- UnitName = unitName;
- Category = category;
- Container = container;
- StatType = type;
-
- if (StatType == StatType.Push && pullAction != null)
- throw new Exception("A push stat cannot have a pull action");
- else
- PullAction = pullAction;
-
- Verbosity = verbosity;
- }
-
- public virtual string ToConsoleString()
- {
- return string.Format(
- "{0}.{1}.{2} : {3}{4}", Category, Container, ShortName, Value, UnitName);
- }
- }
-
- public class PercentageStat : Stat
- {
- public int Antecedent { get; set; }
- public int Consequent { get; set; }
-
- public override double Value
- {
- get
- {
- int c = Consequent;
-
- // Avoid any chance of a multi-threaded divide-by-zero
- if (c == 0)
- return 0;
-
- return (double)Antecedent / c * 100;
- }
-
- set
- {
- throw new Exception("Cannot set value on a PercentageStat");
- }
- }
-
- public PercentageStat(
- string shortName,
- string name,
- string description,
- string category,
- string container,
- StatType type,
- Action pullAction,
- StatVerbosity verbosity)
- : base(shortName, name, description, "%", category, container, type, pullAction, verbosity) {}
-
- public override string ToConsoleString()
- {
- return string.Format(
- "{0}.{1}.{2} : {3:0.##}{4} ({5}/{6})",
- Category, Container, ShortName, Value, UnitName, Antecedent, Consequent);
- }
}
}
\ No newline at end of file
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index 28d6d5cce5..b709baa3c7 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -89,17 +89,6 @@ namespace OpenSim.Framework.Monitoring
FirstTick = Environment.TickCount & Int32.MaxValue;
LastTick = FirstTick;
}
-
- public ThreadWatchdogInfo(ThreadWatchdogInfo previousTwi)
- {
- Thread = previousTwi.Thread;
- FirstTick = previousTwi.FirstTick;
- LastTick = previousTwi.LastTick;
- Timeout = previousTwi.Timeout;
- IsTimedOut = previousTwi.IsTimedOut;
- AlarmIfTimeout = previousTwi.AlarmIfTimeout;
- AlarmMethod = previousTwi.AlarmMethod;
- }
}
///
@@ -231,25 +220,7 @@ namespace OpenSim.Framework.Monitoring
private static bool RemoveThread(int threadID)
{
lock (m_threads)
- {
- ThreadWatchdogInfo twi;
- if (m_threads.TryGetValue(threadID, out twi))
- {
- m_log.DebugFormat(
- "[WATCHDOG]: Removing thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
-
- m_threads.Remove(threadID);
-
- return true;
- }
- else
- {
- m_log.WarnFormat(
- "[WATCHDOG]: Requested to remove thread with ID {0} but this is not being monitored", threadID);
-
- return false;
- }
- }
+ return m_threads.Remove(threadID);
}
public static bool AbortThread(int threadID)
@@ -364,9 +335,7 @@ namespace OpenSim.Framework.Monitoring
if (callbackInfos == null)
callbackInfos = new List();
- // Send a copy of the watchdog info to prevent race conditions where the watchdog
- // thread updates the monitoring info after an alarm has been sent out.
- callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
+ callbackInfos.Add(threadInfo);
}
}
}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs b/OpenSim/Framework/PacketPool.cs
similarity index 71%
rename from OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
rename to OpenSim/Framework/PacketPool.cs
index 9f22fb48ec..41d17c54f2 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/PacketPool.cs
+++ b/OpenSim/Framework/PacketPool.cs
@@ -31,10 +31,10 @@ using System.Reflection;
using OpenMetaverse;
using OpenMetaverse.Packets;
using log4net;
-using OpenSim.Framework.Monitoring;
-namespace OpenSim.Region.ClientStack.LindenUDP
+namespace OpenSim.Framework
{
+
public sealed class PacketPool
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -44,32 +44,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
private bool packetPoolEnabled = true;
private bool dataBlockPoolEnabled = true;
- private PercentageStat m_packetsReusedStat = new PercentageStat(
- "PacketsReused",
- "Packets reused",
- "Number of packets reused out of all requests to the packet pool",
- "clientstack",
- "packetpool",
- StatType.Push,
- null,
- StatVerbosity.Debug);
-
- private PercentageStat m_blocksReusedStat = new PercentageStat(
- "PacketDataBlocksReused",
- "Packet data blocks reused",
- "Number of data blocks reused out of all requests to the packet pool",
- "clientstack",
- "packetpool",
- StatType.Push,
- null,
- StatVerbosity.Debug);
-
- ///
- /// Pool of packets available for reuse.
- ///
private readonly Dictionary> pool = new Dictionary>();
- private static Dictionary> DataBlocks = new Dictionary>();
+ private static Dictionary> DataBlocks =
+ new Dictionary>();
+
+ static PacketPool()
+ {
+ }
public static PacketPool Instance
{
@@ -88,45 +70,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return dataBlockPoolEnabled; }
}
- private PacketPool()
- {
- StatsManager.RegisterStat(m_packetsReusedStat);
- StatsManager.RegisterStat(m_blocksReusedStat);
-
- StatsManager.RegisterStat(
- new Stat(
- "PacketsPoolCount",
- "Objects within the packet pool",
- "The number of objects currently stored within the packet pool",
- "",
- "clientstack",
- "packetpool",
- StatType.Pull,
- stat => { lock (pool) { stat.Value = pool.Count; } },
- StatVerbosity.Debug));
-
- StatsManager.RegisterStat(
- new Stat(
- "PacketDataBlocksPoolCount",
- "Objects within the packet data block pool",
- "The number of objects currently stored within the packet data block pool",
- "",
- "clientstack",
- "packetpool",
- StatType.Pull,
- stat => { lock (DataBlocks) { stat.Value = DataBlocks.Count; } },
- StatVerbosity.Debug));
- }
-
- ///
- /// Gets a packet of the given type.
- ///
- ///
- /// Guaranteed to always return a packet, whether from the pool or newly constructed.
public Packet GetPacket(PacketType type)
{
- m_packetsReusedStat.Consequent++;
-
Packet packet;
if (!packetPoolEnabled)
@@ -136,19 +81,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
if (!pool.ContainsKey(type) || pool[type] == null || (pool[type]).Count == 0)
{
-// m_log.DebugFormat("[PACKETPOOL]: Building {0} packet", type);
-
// Creating a new packet if we cannot reuse an old package
packet = Packet.BuildPacket(type);
}
else
{
-// m_log.DebugFormat("[PACKETPOOL]: Pulling {0} packet", type);
-
// Recycle old packages
- m_packetsReusedStat.Antecedent++;
-
- packet = pool[type].Pop();
+ packet = (pool[type]).Pop();
}
}
@@ -197,7 +136,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
{
PacketType type = GetType(bytes);
-// Array.Clear(zeroBuffer, 0, zeroBuffer.Length);
+ Array.Clear(zeroBuffer, 0, zeroBuffer.Length);
int i = 0;
Packet packet = GetPacket(type);
@@ -244,7 +183,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
switch (packet.Type)
{
// List pooling packets here
- case PacketType.AgentUpdate:
case PacketType.PacketAck:
case PacketType.ObjectUpdate:
case PacketType.ImprovedTerseObjectUpdate:
@@ -259,9 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if ((pool[type]).Count < 50)
{
-// m_log.DebugFormat("[PACKETPOOL]: Pushing {0} packet", type);
-
- pool[type].Push(packet);
+ (pool[type]).Push(packet);
}
}
break;
@@ -273,21 +209,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
- public T GetDataBlock() where T: new()
+ public static T GetDataBlock() where T: new()
{
lock (DataBlocks)
{
- m_blocksReusedStat.Consequent++;
-
Stack