Formatting cleanup.

0.6.0-stable
Jeff Ames 2008-05-16 01:22:11 +00:00
parent e25818d832
commit 65c5efe43b
261 changed files with 3718 additions and 3831 deletions

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]

View File

@ -58,7 +58,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
try
{
if (openSim.ConfigSource.Configs["RemoteAdmin"] != null &&
if (openSim.ConfigSource.Configs["RemoteAdmin"] != null &&
openSim.ConfigSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
{
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
@ -96,7 +96,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requiredPassword != String.Empty &&
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
throw new Exception("wrong password");
LLUUID regionID = new LLUUID((string) requestData["regionID"]);
responseData["accepted"] = "true";
@ -106,10 +106,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene))
throw new Exception("region not found");
responseData["rebooting"] = "true";
rebootedScene.Restart(30);
}
}
catch(Exception e)
{
m_log.ErrorFormat("[RADMIN]: Restart region: failed: {0}", e.Message);
@ -136,7 +136,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
if (requiredPassword != String.Empty &&
(!requestData.Contains("password") || (string) requestData["password"] != requiredPassword))
throw new Exception("wrong password");
string message = (string) requestData["message"];
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
@ -167,7 +167,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}", request.ToString());
foreach (string k in requestData.Keys)
{
m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}",
m_log.DebugFormat("[RADMIN]: Load Terrain: XmlRpc {0}: >{1}< {2}",
k, (string)requestData[k], ((string)requestData[k]).Length);
}
@ -198,7 +198,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
response.Value = responseData;
}
catch (Exception e)
catch (Exception e)
{
m_log.ErrorFormat("[RADMIN] Terrain Loading: failed: {0}", e.Message);
m_log.DebugFormat("[RADMIN] Terrain Loading: failed: {0}", e.ToString());
@ -227,14 +227,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController
int timeout = 2000;
if (requestData.ContainsKey("shutdown") &&
if (requestData.ContainsKey("shutdown") &&
((string) requestData["shutdown"] == "delayed") &&
requestData.ContainsKey("milliseconds"))
{
timeout = (Int32) requestData["milliseconds"];
m_app.SceneManager.SendGeneralMessage("Region is going down in " + ((int) (timeout/1000)).ToString() +
" second(s). Please save what you are doing and log out.");
}
}
else
{
m_app.SceneManager.SendGeneralMessage("Region is going down now.");
@ -248,7 +248,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["success"] = "true";
}
catch (Exception e)
catch (Exception e)
{
m_log.ErrorFormat("[RADMIN] Shutdown: failed: {0}", e.Message);
m_log.DebugFormat("[RADMIN] Shutdown: failed: {0}", e.ToString());
@ -272,7 +272,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable requestData = (Hashtable) request.Params[0];
foreach (string p in param)
{
if (!requestData.Contains(p))
if (!requestData.Contains(p))
throw new Exception(String.Format("missing string parameter {0}", p));
if (String.IsNullOrEmpty((string)requestData[p]))
throw new Exception(String.Format("parameter {0} is empty", p));
@ -284,7 +284,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable requestData = (Hashtable) request.Params[0];
foreach (string p in param)
{
if (!requestData.Contains(p))
if (!requestData.Contains(p))
throw new Exception(String.Format("missing integer parameter {0}", p));
}
}
@ -324,7 +324,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// <description>if true, persist the region info
/// ('true' or 'false')</description></item>
/// </list>
///
///
/// XmlRpcCreateRegionMethod returns
/// <list type="table">
/// <listheader><term>name</term><description>description</description></listheader>
@ -346,9 +346,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable responseData = new Hashtable();
try {
checkStringParameters(request, new string[] { "password",
"region_name",
"region_master_first", "region_master_last",
checkStringParameters(request, new string[] { "password",
"region_name",
"region_master_first", "region_master_last",
"region_master_password",
"listen_ip", "external_address"});
checkIntegerParams(request, new string[] { "region_x", "region_y", "listen_port"});
@ -360,16 +360,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// extract or generate region ID now
Scene scene = null;
LLUUID regionID = LLUUID.Zero;
if (requestData.ContainsKey("region_id") &&
!String.IsNullOrEmpty((string)requestData["region_id"]))
if (requestData.ContainsKey("region_id") &&
!String.IsNullOrEmpty((string)requestData["region_id"]))
{
regionID = (string) requestData["region_id"];
if (m_app.SceneManager.TryGetScene(regionID, out scene))
if (m_app.SceneManager.TryGetScene(regionID, out scene))
throw new Exception(String.Format("region UUID already in use by region {0}, UUID {1}, <{2},{3}>",
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
}
else
}
else
{
regionID = LLUUID.Random();
m_log.DebugFormat("[RADMIN] CreateRegion: new region UUID {0}", regionID);
@ -385,7 +385,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// check for collisions: region name, region UUID,
// region location
if (m_app.SceneManager.TryGetScene(region.RegionName, out scene))
if (m_app.SceneManager.TryGetScene(region.RegionName, out scene))
throw new Exception(String.Format("region name already in use by region {0}, UUID {1}, <{2},{3}>",
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
@ -395,43 +395,43 @@ namespace OpenSim.ApplicationPlugins.RemoteController
region.RegionLocX, region.RegionLocY,
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
// Security risk [and apparently not used]
// if (requestData.ContainsKey("datastore"))
// region.DataStore = (string) requestData["datastore"];
region.InternalEndPoint =
region.InternalEndPoint =
new IPEndPoint(IPAddress.Parse((string) requestData["listen_ip"]), 0);
region.InternalEndPoint.Port = (Int32) requestData["listen_port"];
if (0 == region.InternalEndPoint.Port) throw new Exception("listen_port is 0");
if (m_app.SceneManager.TryGetScene(region.InternalEndPoint, out scene))
throw new Exception(String.Format("region internal IP {0} and port {1} already in use by region {2}, UUID {3}, <{4},{5}>",
region.InternalEndPoint.Address,
region.InternalEndPoint.Address,
region.InternalEndPoint.Port,
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
region.ExternalHostName = (string) requestData["external_address"];
region.MasterAvatarFirstName = (string) requestData["region_master_first"];
region.MasterAvatarLastName = (string) requestData["region_master_last"];
region.MasterAvatarSandboxPassword = (string) requestData["region_master_password"];
bool persist = Convert.ToBoolean((string)requestData["persist"]);
if (persist)
if (persist)
{
string regionConfigPath = Path.Combine(Path.Combine(Util.configDir(), "Regions"),
String.Format("{0}x{1}-{2}.xml",
region.RegionLocX.ToString(),
region.RegionLocY.ToString(),
regionID.ToString()));
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
region.RegionID, regionConfigPath);
region.SaveRegionToFile("dynamic region", regionConfigPath);
}
m_app.CreateRegion(region);
responseData["success"] = "true";
@ -476,7 +476,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// <item><term>start_region_y</term>
/// <description>avatar's start region coordinates, Y value</description></item>
/// </list>
///
///
/// XmlRpcCreateUserMethod returns
/// <list type="table">
/// <listheader><term>name</term><description>description</description></listheader>
@ -497,10 +497,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable();
try
try
{
// check completeness
checkStringParameters(request, new string[] { "password", "user_firstname",
checkStringParameters(request, new string[] { "password", "user_firstname",
"user_lastname", "user_password" });
checkIntegerParams(request, new string[] { "start_region_x", "start_region_y" });
@ -514,16 +514,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
string passwd = (string) requestData["user_password"];
uint regX = Convert.ToUInt32((Int32)requestData["start_region_x"]);
uint regY = Convert.ToUInt32((Int32)requestData["start_region_y"]);
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname);
if (null != userProfile)
if (null != userProfile)
throw new Exception(String.Format("avatar {0} {1} already exists", firstname, lastname));
LLUUID userID = m_app.CreateUser(firstname, lastname, passwd, regX, regY);
if (userID == LLUUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}",
firstname, lastname));
responseData["success"] = "true";
responseData["avatar_uuid"] = userID.ToString();
@ -531,7 +531,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstname, lastname, userID);
}
catch (Exception e)
catch (Exception e)
{
m_log.ErrorFormat("[RADMIN] CreateUser: failed: {0}", e.Message);
m_log.DebugFormat("[RADMIN] CreateUser: failed: {0}", e.ToString());
@ -553,33 +553,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController
Hashtable requestData = (Hashtable) request.Params[0];
Hashtable responseData = new Hashtable();
try
try
{
// check completeness
foreach (string p in new string[] { "password", "filename" })
{
if (!requestData.Contains(p))
if (!requestData.Contains(p))
throw new Exception(String.Format("missing parameter {0}", p));
if (String.IsNullOrEmpty((string)requestData[p]))
throw new Exception(String.Format("parameter {0} is empty"));
}
// check password
if (!String.IsNullOrEmpty(requiredPassword) &&
(string)requestData["password"] != requiredPassword) throw new Exception("wrong password");
string filename = (string)requestData["filename"];
if (requestData.Contains("region_uuid"))
{
LLUUID region_uuid = (string)requestData["region_uuid"];
if (!m_app.SceneManager.TrySetCurrentScene(region_uuid))
if (!m_app.SceneManager.TrySetCurrentScene(region_uuid))
throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString()));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString());
}
else if (requestData.Contains("region_name"))
{
string region_name = (string)requestData["region_name"];
if (!m_app.SceneManager.TrySetCurrentScene(region_name))
if (!m_app.SceneManager.TrySetCurrentScene(region_name))
throw new Exception(String.Format("failed to switch to region {0}", region_name));
m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name);
}
@ -589,7 +589,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new LLVector3(0, 0, 0));
responseData["loaded"] = "true";
response.Value = responseData;
}
catch (Exception e)
@ -600,10 +600,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController
responseData["loaded"] = "false";
responseData["switched"] = "false";
responseData["error"] = e.Message;
response.Value = responseData;
}
return response;
}

View File

@ -23,7 +23,7 @@
* 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 libsecondlife;
@ -65,7 +65,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
region_external_hostname = regInfo.ExternalHostName;
if (!String.IsNullOrEmpty(regInfo.MasterAvatarFirstName))
region_owner = String.Format("{0} {1}", regInfo.MasterAvatarFirstName,
region_owner = String.Format("{0} {1}", regInfo.MasterAvatarFirstName,
regInfo.MasterAvatarLastName);
}
}

View File

@ -23,7 +23,7 @@
* 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;
@ -57,12 +57,12 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
[Extension("/OpenSim/Startup")]
public class RestRegionPlugin : RestPlugin
{
private static readonly log4net.ILog _log =
private static readonly log4net.ILog _log =
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
#region overriding properties
public override string Name
{
public override string Name
{
get { return "REGION"; }
}
@ -86,7 +86,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
try
{
base.Initialise(openSim);
if (IsEnabled)
if (IsEnabled)
m_log.InfoFormat("{0} Rest Plugins Enabled", MsgID);
else
m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID);
@ -122,7 +122,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
xw.Formatting = Formatting.Indented;
xw.WriteStartElement(String.Empty, "regions", String.Empty);
foreach (Scene s in App.SceneManager.Scenes)
{
@ -132,7 +132,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
}
xw.WriteEndElement();
xw.Close();
return sw.ToString();
}
@ -154,7 +154,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
xs.Serialize(xw, new RegionDetails(scene.RegionInfo));
xw.Close();
return sw.ToString();
}
#endregion methods

View File

@ -23,7 +23,7 @@
* 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;
@ -54,7 +54,7 @@ namespace OpenSim.ApplicationPlugins.Rest
{
#region properties
protected static readonly log4net.ILog m_log =
protected static readonly log4net.ILog m_log =
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IConfig _config; // Configuration source: Rest Plugins
@ -100,8 +100,8 @@ namespace OpenSim.ApplicationPlugins.Rest
/// </summary>
public bool IsEnabled
{
get
{
get
{
return (null != _pluginConfig) && _pluginConfig.GetBoolean("enabled", false);
}
}
@ -109,7 +109,7 @@ namespace OpenSim.ApplicationPlugins.Rest
/// <summary>
/// OpenSimMain application
/// </summary>
public OpenSimMain App
public OpenSimMain App
{
get { return _app; }
}
@ -117,7 +117,7 @@ namespace OpenSim.ApplicationPlugins.Rest
/// <summary>
/// RPC server
/// </summary>
public BaseHttpServer HttpServer
public BaseHttpServer HttpServer
{
get { return _httpd; }
}
@ -171,7 +171,7 @@ namespace OpenSim.ApplicationPlugins.Rest
return;
}
if (!_config.GetBoolean("enabled", false))
if (!_config.GetBoolean("enabled", false))
{
m_log.WarnFormat("{0} Rest Plugins are disabled", MsgID);
return;
@ -184,10 +184,10 @@ namespace OpenSim.ApplicationPlugins.Rest
_godkey = _config.GetString("god_key", String.Empty);
// Retrive prefix if any.
_prefix = _config.GetString("prefix", "/admin");
// Get plugin specific config
_pluginConfig = openSim.ConfigSource.Configs[ConfigName];
m_log.InfoFormat("{0} Rest Plugins Enabled", MsgID);
}
catch (Exception e)
@ -200,7 +200,7 @@ namespace OpenSim.ApplicationPlugins.Rest
// not possible for the openSim pointer to be null. However
// were the implementation to be changed, this could
// result in a silent initialization failure. Harmless
// except for lack of function and lack of any
// except for lack of function and lack of any
// diagnostic indication as to why. The same is true if
// the HTTP server reference is bad.
// We should at least issue a message...
@ -214,7 +214,7 @@ namespace OpenSim.ApplicationPlugins.Rest
public void AddRestStreamHandler(string httpMethod, string path, RestMethod method)
{
if (!path.StartsWith(_prefix))
if (!path.StartsWith(_prefix))
{
path = String.Format("{0}{1}", _prefix, path);
}
@ -226,7 +226,7 @@ namespace OpenSim.ApplicationPlugins.Rest
m_log.DebugFormat("{0} Added REST handler {1} {2}", MsgID, httpMethod, path);
}
public bool VerifyGod(string key)
{
if (String.IsNullOrEmpty(key)) return false;

View File

@ -126,7 +126,7 @@ namespace OpenSim.Data.Base
{
int ordinal = m_source.GetOrdinal(name);
int int32 = m_source.GetInt32(ordinal);
return int32;
return int32;
}
public Int64 GetInt64(string name)

View File

@ -30,7 +30,7 @@ using System.Collections.Generic;
using System.Data.Common;
namespace OpenSim.Data.Base
{
{
public delegate TField ObjectGetAccessor<TObj, TField>(TObj obj);
public delegate void ObjectSetAccessor<TObj, TField>(TObj obj, TField value);

View File

@ -29,7 +29,7 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -42,8 +42,8 @@ using System.Security;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -55,11 +55,11 @@ using System.Security;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -28,7 +28,7 @@
using libsecondlife;
namespace OpenSim.Data
{
{
public enum DataResponse
{
RESPONSE_OK,
@ -74,7 +74,7 @@ namespace OpenSim.Data
RegionProfileData[] GetProfilesInRange(uint Xmin, uint Ymin, uint Xmax, uint Ymax);
/// <summary>
/// Authenticates a sim by use of its recv key.
/// Authenticates a sim by use of its recv key.
/// WARNING: Insecure
/// </summary>
/// <param name="UUID">The UUID sent by the sim</param>

View File

@ -28,7 +28,7 @@
using System.IO;
using System.Text.RegularExpressions;
/*
/*
Taken from public code listing at by Alex Pinsker
http://alexpinsker.blogspot.com/2005/12/reading-ini-file-from-c_113432097333021549.html
*/

View File

@ -216,7 +216,7 @@ namespace OpenSim.Data.MSSQL
override public string Version
{
// get { return database.getVersion(); }
// get { return database.getVersion(); }
get { return database.getVersion(); }
}

View File

@ -140,7 +140,7 @@ namespace OpenSim.Data.MSSQL
m_landAccessListTable = createLandAccessListTable();
m_dataSet.Tables.Add(m_landAccessListTable);
setupLandAccessCommands(m_landAccessListDataAdapter, m_connection);
m_landAccessListDataAdapter.Fill(m_landAccessListTable);
m_landAccessListDataAdapter.Fill(m_landAccessListTable);
}
}
@ -172,7 +172,7 @@ namespace OpenSim.Data.MSSQL
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
// Instance.RemoveObject(obj, regionUUID);
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
DataTable prims = m_primTable;
@ -222,7 +222,7 @@ namespace OpenSim.Data.MSSQL
/// <summary>
/// Load persisted objects from region storage.
/// </summary>
/// </summary>
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{
// return Instance.LoadObjects(regionUUID);
@ -328,12 +328,12 @@ namespace OpenSim.Data.MSSQL
TaskInventoryItem item = buildItem(row);
inventory.Add(item);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
}
prim.RestoreInventoryItems(inventory);
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// every item). This data should really be stored in the prim table itself.
if (dbItemRows.Length > 0)
{
@ -527,7 +527,7 @@ namespace OpenSim.Data.MSSQL
/***********************************************************************
*
* Database Definition Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -742,7 +742,7 @@ namespace OpenSim.Data.MSSQL
}
/***********************************************************************
*
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant
@ -1198,7 +1198,7 @@ namespace OpenSim.Data.MSSQL
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
// For now, we're just going to crudely remove all the previous inventory items
// For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set.
lock (m_dataSet)
{
@ -1209,7 +1209,7 @@ namespace OpenSim.Data.MSSQL
{
// m_log.InfoFormat(
// "[REGION DB]: " +
// "Adding item {0}, {1} to prim ID {2}",
// "Adding item {0}, {1} to prim ID {2}",
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
DataRow newItemRow = m_itemsTable.NewRow();
@ -1282,7 +1282,7 @@ namespace OpenSim.Data.MSSQL
sql += subsql;
sql += " where " + pk;
SqlCommand cmd = new SqlCommand(sql);
// this provides the binding for all our parameters, so
// much less code than it used to be
@ -1329,7 +1329,7 @@ namespace OpenSim.Data.MSSQL
/// This is a convenience function that collapses 5 repetitive
/// lines for defining SqlParameters to 2 parameters:
/// column name and database type.
///
///
/// It assumes certain conventions like :param as the param
/// name to replace in parametrized queries, and that source
/// version is always current version, both of which are fine
@ -1424,7 +1424,7 @@ namespace OpenSim.Data.MSSQL
SqlCommand tcmd = new SqlCommand(createTerrain, conn);
SqlCommand lcmd = new SqlCommand(createLand, conn);
SqlCommand lalcmd = new SqlCommand(createLandAccessList, conn);
conn.Open();
try
{
@ -1604,6 +1604,6 @@ namespace OpenSim.Data.MSSQL
{
return DbType.String;
}
}
}
}
}

View File

@ -79,7 +79,7 @@ namespace OpenSim.Data.MSSQL
private void TestTables()
{
IDbCommand cmd = database.Query("SELECT TOP 1 * FROM "+m_regionsTableName, new Dictionary<string, string>());
try
{
cmd.ExecuteNonQuery();
@ -88,7 +88,7 @@ namespace OpenSim.Data.MSSQL
catch (Exception)
{
m_log.Info("[GRID DB]: MSSQL Database doesn't exist... creating");
database.ExecuteResourceSql("Mssql-regions.sql");
database.ExecuteResourceSql("Mssql-regions.sql");
}
}
@ -161,7 +161,7 @@ namespace OpenSim.Data.MSSQL
}
return null;
}
/// <summary>
/// Returns a sim profile from its UUID
/// </summary>
@ -255,17 +255,17 @@ namespace OpenSim.Data.MSSQL
{
//Insert new region
string sql =
"UPDATE " + m_regionsTableName + @" SET
[regionHandle]=@regionHandle, [regionName]=@regionName,
"UPDATE " + m_regionsTableName + @" SET
[regionHandle]=@regionHandle, [regionName]=@regionName,
[regionRecvKey]=@regionRecvKey, [regionSecret]=@regionSecret, [regionSendKey]=@regionSendKey,
[regionDataURI]=@regionDataURI, [serverIP]=@serverIP, [serverPort]=@serverPort, [serverURI]=@serverURI,
[locX]=@locX, [locY]=@locY, [locZ]=@locZ, [eastOverrideHandle]=@eastOverrideHandle,
[westOverrideHandle]=@westOverrideHandle, [southOverrideHandle]=@southOverrideHandle,
[northOverrideHandle]=@northOverrideHandle, [regionAssetURI]=@regionAssetURI,
[locX]=@locX, [locY]=@locY, [locZ]=@locZ, [eastOverrideHandle]=@eastOverrideHandle,
[westOverrideHandle]=@westOverrideHandle, [southOverrideHandle]=@southOverrideHandle,
[northOverrideHandle]=@northOverrideHandle, [regionAssetURI]=@regionAssetURI,
[regionAssetRecvKey]=@regionAssetRecvKey, [regionAssetSendKey]=@regionAssetSendKey,
[regionUserURI]=@regionUserURI, [regionUserRecvKey]=@regionUserRecvKey, [regionUserSendKey]=@regionUserSendKey,
[regionMapTexture]=@regionMapTexture, [serverHttpPort]=@serverHttpPort,
[serverRemotingPort]=@serverRemotingPort, [owner_uuid]=@owner_uuid
[serverRemotingPort]=@serverRemotingPort, [owner_uuid]=@owner_uuid
where [uuid]=@uuid";
Dictionary<string, string> parameters = new Dictionary<string, string>();

View File

@ -80,7 +80,7 @@ namespace OpenSim.Data.MSSQL
if (tableName == null)
{
database.ExecuteResourceSql("CreateFoldersTable.sql");
//database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql");
//database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql");
return;
}
}
@ -236,9 +236,9 @@ namespace OpenSim.Data.MSSQL
// There should only ever be one root folder for a user. However, if there's more
// than one we'll simply use the first one rather than failing. It would be even
// nicer to print some message to this effect, but this feels like it's too low a
// nicer to print some message to this effect, but this feels like it's too low a
// to put such a message out, and it's too minor right now to spare the time to
// suitably refactor.
// suitably refactor.
if (items.Count > 0)
{
rootFolder = items[0];
@ -326,7 +326,7 @@ namespace OpenSim.Data.MSSQL
item.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
item.Flags = (uint) reader["flags"];
return item;
}
catch (SqlException e)
@ -455,7 +455,7 @@ namespace OpenSim.Data.MSSQL
+ ", @inventoryNextPermissions, @inventoryCurrentPermissions, @invType, @creatorID"
+ ", @inventoryBasePermissions, @inventoryEveryOnePermissions, @salePrice, @saleType"
+ ", @creationDate, @groupID, @groupOwned, @flags);";
try
{
Dictionary<string, string> param = new Dictionary<string, string>();
@ -472,7 +472,7 @@ namespace OpenSim.Data.MSSQL
param["creatorID"] = item.Creator.ToString();
param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions);
param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions);
param["salePrice"] = Convert.ToString(item.SalePrice);
param["saleType"] = Convert.ToString(item.SaleType);
param["creationDate"] = Convert.ToString(item.CreationDate);
@ -550,7 +550,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
///
///
/// </summary>
/// <param name="item"></param>
public void deleteInventoryItem(LLUUID itemID)
@ -667,7 +667,7 @@ namespace OpenSim.Data.MSSQL
}
/// <summary>
/// Append a list of all the child folders of a parent folder
/// Append a list of all the child folders of a parent folder
/// </summary>
/// <param name="folders">list where folders will be appended</param>
/// <param name="parentID">ID of parent</param>

View File

@ -442,7 +442,7 @@ namespace OpenSim.Data.MSSQL
return returnval;
}
/// <summary>
/// Execute a SQL statement stored in a resource, as a string
/// </summary>
@ -509,7 +509,7 @@ namespace OpenSim.Data.MSSQL
throw new Exception(string.Format("Resource '{0}' was not found", name));
}
/// <summary>
/// <summary>
/// Returns the version of this DB provider
/// </summary>
/// <returns>A string containing the DB provider</returns>

View File

@ -105,7 +105,7 @@ namespace OpenSim.Data.MSSQL
{
database.ExecuteResourceSql("Mssql-users.sql");
}
cmd = database.Query("select top 1 * from " + m_agentsTableName, new Dictionary<string, string>());
try
{
@ -747,7 +747,7 @@ namespace OpenSim.Data.MSSQL
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
@ -761,12 +761,12 @@ namespace OpenSim.Data.MSSQL
{
return;
}
override public void RemoveAttachment(LLUUID user, LLUUID item)
{
return;
}
override public List<LLUUID> GetAttachments(LLUUID user)
{
return new List<LLUUID>();

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -49,7 +49,7 @@ namespace OpenSim.Data.MapperFactory
return new MSSQLDatabaseMapper(connectionString);
default:
throw new ArgumentException("Unknown Database Mapper type [" + type + "].");
}
}
}
}
}

View File

@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL
_dbConnection.Connection);
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
p.Value = assetID.GetBytes();
try
{
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL
}
override public void CreateAsset(AssetBase asset)
{
{
lock (_dbConnection)
{
MySqlCommand cmd =
@ -119,10 +119,10 @@ namespace OpenSim.Data.MySQL
"REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" +
"VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)",
_dbConnection.Connection);
// need to ensure we dispose
try
{
{
using (cmd)
{
MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16);
@ -145,7 +145,7 @@ namespace OpenSim.Data.MySQL
"MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString()
+ Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
_dbConnection.Reconnect();
}
}
}
}

View File

@ -50,12 +50,12 @@ namespace OpenSim.Data.MySQL
private const string m_terrainSelect = "select * from terrain limit 1";
private const string m_landSelect = "select * from land";
private const string m_landAccessListSelect = "select * from landaccesslist";
/// <summary>
/// We're only using this to version the table!
/// </summary>
private DataSet m_dataSet;
private MySqlDataAdapter m_primDataAdapter;
@ -65,16 +65,16 @@ namespace OpenSim.Data.MySQL
private MySqlDataAdapter m_terrainDataAdapter;
private MySqlDataAdapter m_landDataAdapter;
private MySqlDataAdapter m_landAccessListDataAdapter;
private DataTable m_primTable;
private DataTable m_shapeTable;
private DataTable m_itemsTable;
private DataTable m_terrainTable;
private DataTable m_landTable;
private DataTable m_landAccessListTable;
// Temporary attribute while this is experimental
private bool persistPrimInventories;
private bool persistPrimInventories;
/***********************************************************************
*
@ -98,9 +98,9 @@ namespace OpenSim.Data.MySQL
MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, m_connection);
m_shapeDataAdapter = new MySqlDataAdapter(shapeSelectCmd);
MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, m_connection);
m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd);
m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd);
MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, m_connection);
m_terrainDataAdapter = new MySqlDataAdapter(terrainSelectCmd);
@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL
MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection);
m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd);
TestTables(m_connection);
lock (m_dataSet)
@ -125,13 +125,13 @@ namespace OpenSim.Data.MySQL
m_dataSet.Tables.Add(m_shapeTable);
SetupShapeCommands(m_shapeDataAdapter, m_connection);
m_shapeDataAdapter.Fill(m_shapeTable);
if (persistPrimInventories)
{
m_itemsTable = createItemsTable();
m_dataSet.Tables.Add(m_itemsTable);
SetupItemsCommands(m_itemsDataAdapter, m_connection);
m_itemsDataAdapter.Fill(m_itemsTable);
m_itemsDataAdapter.Fill(m_itemsTable);
}
m_terrainTable = createTerrainTable();
@ -195,7 +195,7 @@ namespace OpenSim.Data.MySQL
UpgradeLandTable(tableList["land"], dbconn);
//database.Close();
}
/// <summary>
@ -290,12 +290,12 @@ namespace OpenSim.Data.MySQL
{
shapeRow.Delete();
}
if (persistPrimInventories)
{
{
RemoveItems(uuid);
}
// Remove prim row
row.Delete();
}
@ -309,18 +309,18 @@ namespace OpenSim.Data.MySQL
/// </summary>
private void RemoveItems(LLUUID uuid)
{
String sql = String.Format("primID = '{0}'", uuid);
String sql = String.Format("primID = '{0}'", uuid);
DataRow[] itemRows = m_itemsTable.Select(sql);
foreach (DataRow itemRow in itemRows)
{
itemRow.Delete();
}
}
/// <summary>
/// Load persisted objects from region storage.
/// </summary>
/// </summary>
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{
Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>();
@ -341,17 +341,17 @@ namespace OpenSim.Data.MySQL
foreach (DataRow primRow in primsForRegion)
{
try
try
{
string uuid = (string) primRow["UUID"];
string objID = (string) primRow["SceneGroupID"];
SceneObjectPart prim = buildPrim(primRow);
if (uuid == objID) //is new SceneObjectGroup ?
{
SceneObjectGroup group = new SceneObjectGroup();
DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID));
if (shapeRow != null)
{
@ -384,11 +384,11 @@ namespace OpenSim.Data.MySQL
}
createdObjects[new LLUUID(objID)].AddPart(prim);
}
if (persistPrimInventories)
{
LoadItems(prim);
}
}
}
catch (Exception e)
{
@ -403,7 +403,7 @@ namespace OpenSim.Data.MySQL
}
return retvals;
}
/// <summary>
/// Load in a prim's persisted inventory.
/// </summary>
@ -411,31 +411,31 @@ namespace OpenSim.Data.MySQL
private void LoadItems(SceneObjectPart prim)
{
//m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
DataTable dbItems = m_itemsTable;
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
DataRow[] dbItemRows = dbItems.Select(sql);
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
foreach (DataRow row in dbItemRows)
{
TaskInventoryItem item = buildItem(row);
inventory.Add(item);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
}
prim.RestoreInventoryItems(inventory);
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// every item). This data should really be stored in the prim table itself.
if (dbItemRows.Length > 0)
{
prim.FolderID = inventory[0].ParentID;
}
}
}
public void StoreTerrain(double[,] ter, LLUUID regionID)
{
@ -474,8 +474,8 @@ namespace OpenSim.Data.MySQL
{
m_connection.Open();
}
lock (m_dataSet)
lock (m_dataSet)
{
using (MySqlDataReader row = cmd.ExecuteReader())
{
@ -498,7 +498,7 @@ namespace OpenSim.Data.MySQL
m_log.Info("[REGION DB]: No terrain found for region");
return null;
}
m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString());
}
}
@ -558,7 +558,7 @@ namespace OpenSim.Data.MySQL
fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID);
landaccesslist.Rows.Add(newAccessRow);
}
Commit();
}
}
@ -624,7 +624,7 @@ namespace OpenSim.Data.MySQL
/***********************************************************************
*
* Database Definition Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -803,7 +803,7 @@ namespace OpenSim.Data.MySQL
return shapes;
}
private static DataTable createItemsTable()
{
DataTable items = new DataTable("primitems");
@ -812,8 +812,8 @@ namespace OpenSim.Data.MySQL
createCol(items, "primID", typeof (String));
createCol(items, "assetID", typeof (String));
createCol(items, "parentFolderID", typeof (String));
createCol(items, "invType", typeof (Int32));
createCol(items, "invType", typeof (Int32));
createCol(items, "assetType", typeof (Int32));
createCol(items, "name", typeof (String));
@ -834,10 +834,10 @@ namespace OpenSim.Data.MySQL
items.PrimaryKey = new DataColumn[] {items.Columns["itemID"]};
return items;
}
}
/***********************************************************************
*
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant
@ -932,8 +932,8 @@ namespace OpenSim.Data.MySQL
}
return prim;
}
/// <summary>
/// Build a prim inventory item from the persisted data.
/// </summary>
@ -942,15 +942,15 @@ namespace OpenSim.Data.MySQL
private static TaskInventoryItem buildItem(DataRow row)
{
TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ItemID = new LLUUID((String)row["itemID"]);
taskItem.ItemID = new LLUUID((String)row["itemID"]);
taskItem.ParentPartID = new LLUUID((String)row["primID"]);
taskItem.AssetID = new LLUUID((String)row["assetID"]);
taskItem.ParentID = new LLUUID((String)row["parentFolderID"]);
taskItem.InvType = Convert.ToInt32(row["invType"]);
taskItem.Type = Convert.ToInt32(row["assetType"]);
taskItem.Name = (String)row["name"];
taskItem.Description = (String)row["description"];
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
@ -958,15 +958,15 @@ namespace OpenSim.Data.MySQL
taskItem.OwnerID = new LLUUID((String)row["ownerID"]);
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
taskItem.GroupID = new LLUUID((String)row["groupID"]);
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]);
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]);
return taskItem;
}
}
private static LandData buildLandData(DataRow row)
{
@ -1117,17 +1117,17 @@ namespace OpenSim.Data.MySQL
}
}
}
private static void fillItemRow(DataRow row, TaskInventoryItem taskItem)
{
row["itemID"] = taskItem.ItemID;
row["primID"] = taskItem.ParentPartID;
row["assetID"] = taskItem.AssetID;
row["parentFolderID"] = taskItem.ParentID;
row["invType"] = taskItem.InvType;
row["assetType"] = taskItem.Type;
row["name"] = taskItem.Name;
row["description"] = taskItem.Description;
row["creationDate"] = taskItem.CreationDate;
@ -1140,7 +1140,7 @@ namespace OpenSim.Data.MySQL
row["basePermissions"] = taskItem.BaseMask;
row["everyonePermissions"] = taskItem.EveryoneMask;
row["groupPermissions"] = taskItem.GroupMask;
}
}
private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID)
{
@ -1322,39 +1322,39 @@ namespace OpenSim.Data.MySQL
else
{
fillShapeRow(shapeRow, prim);
}
}
}
// see IRegionDatastore
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
{
if (!persistPrimInventories)
return;
m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID);
// For now, we're just going to crudely remove all the previous inventory items
// For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set.
lock (m_dataSet)
{
RemoveItems(primID);
{
RemoveItems(primID);
// repalce with current inventory details
foreach (TaskInventoryItem newItem in items)
{
// m_log.InfoFormat(
// "[REGION DB]: " +
// "Adding item {0}, {1} to prim ID {2}",
// "Adding item {0}, {1} to prim ID {2}",
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
DataRow newItemRow = m_itemsTable.NewRow();
fillItemRow(newItemRow, newItem);
m_itemsTable.Rows.Add(newItemRow);
m_itemsTable.Rows.Add(newItemRow);
}
}
Commit();
}
}
/***********************************************************************
*
@ -1447,9 +1447,9 @@ namespace OpenSim.Data.MySQL
}
sql += subsql;
sql += ")";
//m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql);
return sql;
}
@ -1466,7 +1466,7 @@ namespace OpenSim.Data.MySQL
/// This is a convenience function that collapses 5 repetitive
/// lines for defining MySqlParameters to 2 parameters:
/// column name and database type.
///
///
/// It assumes certain conventions like ?param as the param
/// name to replace in parametrized queries, and that source
/// version is always current version, both of which are fine
@ -1498,7 +1498,7 @@ namespace OpenSim.Data.MySQL
delete.Connection = conn;
da.DeleteCommand = delete;
}
private void SetupItemsCommands(MySqlDataAdapter da, MySqlConnection conn)
{
da.InsertCommand = createInsertCommand("primitems", m_itemsTable);
@ -1511,7 +1511,7 @@ namespace OpenSim.Data.MySQL
delete.Parameters.Add(createMySqlParameter("itemID", typeof (String)));
delete.Connection = conn;
da.DeleteCommand = delete;
}
}
private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn)
{
@ -1597,7 +1597,7 @@ namespace OpenSim.Data.MySQL
{
m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e);
}
try
{
icmd.ExecuteNonQuery();
@ -1605,7 +1605,7 @@ namespace OpenSim.Data.MySQL
catch (MySqlException e)
{
m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e);
}
}
try
{
@ -1643,7 +1643,7 @@ namespace OpenSim.Data.MySQL
MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, conn);
MySqlDataAdapter sDa = new MySqlDataAdapter(shapeSelectCmd);
MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, conn);
MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd);
MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd);
MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, conn);
MySqlDataAdapter tDa = new MySqlDataAdapter(terrainSelectCmd);
MySqlCommand landSelectCmd = new MySqlCommand(m_landSelect, conn);
@ -1656,10 +1656,10 @@ namespace OpenSim.Data.MySQL
{
pDa.Fill(tmpDS, "prims");
sDa.Fill(tmpDS, "primshapes");
if (persistPrimInventories)
iDa.Fill(tmpDS, "primitems");
tDa.Fill(tmpDS, "terrain");
lDa.Fill(tmpDS, "land");
lalDa.Fill(tmpDS, "landaccesslist");
@ -1672,10 +1672,10 @@ namespace OpenSim.Data.MySQL
pDa.Fill(tmpDS, "prims");
sDa.Fill(tmpDS, "primshapes");
if (persistPrimInventories)
iDa.Fill(tmpDS, "primitems");
tDa.Fill(tmpDS, "terrain");
lDa.Fill(tmpDS, "land");
lalDa.Fill(tmpDS, "landaccesslist");
@ -1688,7 +1688,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
foreach (DataColumn col in createShapeTable().Columns)
{
if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
@ -1697,9 +1697,9 @@ namespace OpenSim.Data.MySQL
return false;
}
}
// XXX primitems should probably go here eventually
foreach (DataColumn col in createTerrainTable().Columns)
{
if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
@ -1708,7 +1708,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
foreach (DataColumn col in createLandTable().Columns)
{
if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName))
@ -1717,7 +1717,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
foreach (DataColumn col in createLandAccessListTable().Columns)
{
if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName))
@ -1726,7 +1726,7 @@ namespace OpenSim.Data.MySQL
return false;
}
}
return true;
}
@ -1783,7 +1783,7 @@ namespace OpenSim.Data.MySQL
else if (type == typeof (Int64))
{
return "bigint";
}
}
else if (type == typeof (Double))
{
return "float";

View File

@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL
/// </summary>
public class MySQLInventoryData : IInventoryData
{
private static readonly ILog m_log
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
@ -249,7 +249,7 @@ namespace OpenSim.Data.MySQL
// There should only ever be one root folder for a user. However, if there's more
// than one we'll simply use the first one rather than failing. It would be even
// nicer to print some message to this effect, but this feels like it's too low a
// nicer to print some message to this effect, but this feels like it's too low a
// to put such a message out, and it's too minor right now to spare the time to
// suitably refactor.
if (items.Count > 0)
@ -332,13 +332,13 @@ namespace OpenSim.Data.MySQL
item.InvType = (int) reader["invType"];
item.Creator = new LLUUID((string) reader["creatorID"]);
item.BasePermissions = (uint) reader["inventoryBasePermissions"];
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"];
item.SalePrice = (int) reader["salePrice"];
item.SaleType = Convert.ToByte(reader["saleType"]);
item.CreationDate = (int) reader["creationDate"];
item.GroupID = new LLUUID(reader["groupID"].ToString());
item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
item.Flags = (uint) reader["flags"];
item.Flags = (uint) reader["flags"];
return item;
}
@ -483,12 +483,12 @@ namespace OpenSim.Data.MySQL
result.Parameters.AddWithValue("?groupID", item.GroupID);
result.Parameters.AddWithValue("?groupOwned", item.GroupOwned);
result.Parameters.AddWithValue("?flags", item.Flags);
lock (database)
{
result.ExecuteNonQuery();
}
result.Dispose();
}
catch (MySqlException e)
@ -507,7 +507,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
///
///
/// </summary>
/// <param name="item"></param>
public void deleteInventoryItem(LLUUID itemID)
@ -517,7 +517,7 @@ namespace OpenSim.Data.MySQL
MySqlCommand cmd =
new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection);
cmd.Parameters.AddWithValue("?uuid", itemID.ToString());
lock (database)
{
cmd.ExecuteNonQuery();
@ -596,7 +596,7 @@ namespace OpenSim.Data.MySQL
}
/// <summary>
/// Append a list of all the child folders of a parent folder
/// Append a list of all the child folders of a parent folder
/// </summary>
/// <param name="folders">list where folders will be appended</param>
/// <param name="parentID">ID of parent</param>
@ -623,11 +623,11 @@ namespace OpenSim.Data.MySQL
protected void deleteOneFolder(LLUUID folderID)
{
try
{
{
MySqlCommand cmd =
new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", database.Connection);
cmd.Parameters.AddWithValue("?uuid", folderID.ToString());
lock (database)
{
cmd.ExecuteNonQuery();
@ -647,7 +647,7 @@ namespace OpenSim.Data.MySQL
MySqlCommand cmd =
new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", database.Connection);
cmd.Parameters.AddWithValue("?uuid", folderID.ToString());
lock (database)
{
cmd.ExecuteNonQuery();

View File

@ -302,7 +302,7 @@ namespace OpenSim.Data.MySQL
// Region Main gotta-have-or-we-return-null parts
UInt64 tmp64;
if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64))
{
{
return null;
}
else
@ -310,7 +310,7 @@ namespace OpenSim.Data.MySQL
retval.regionHandle = tmp64;
}
LLUUID tmp_uuid;
if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid))
if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid))
{
return null;
}
@ -321,7 +321,7 @@ namespace OpenSim.Data.MySQL
// non-critical parts
retval.regionName = (string)reader["regionName"];
retval.originUUID = new LLUUID((string) reader["originUUID"]);
retval.originUUID = new LLUUID((string) reader["originUUID"]);
// Secrets
retval.regionRecvKey = (string) reader["regionRecvKey"];
@ -360,8 +360,8 @@ namespace OpenSim.Data.MySQL
// World Map Addition
LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID);
LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid);
}
LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid);
}
else
{
return null;
@ -418,7 +418,7 @@ namespace OpenSim.Data.MySQL
LLUUID.TryParse((string) reader["sessionID"], out tmp);
retval.SessionID = tmp;
LLUUID.TryParse((string)reader["secureSessionID"], out tmp);
retval.SecureSessionID = tmp;
@ -488,7 +488,7 @@ namespace OpenSim.Data.MySQL
if (reader.IsDBNull(reader.GetOrdinal("profileAboutText")))
retval.AboutText = "";
else
else
retval.AboutText = (string) reader["profileAboutText"];
if (reader.IsDBNull(reader.GetOrdinal("profileFirstText")))
@ -511,7 +511,7 @@ namespace OpenSim.Data.MySQL
LLUUID.TryParse((string)reader["profileFirstImage"], out tmp);
retval.FirstLifeImage = tmp;
}
if (reader.IsDBNull(reader.GetOrdinal("webLoginKey")))
{
retval.WebLoginKey = LLUUID.Zero;

View File

@ -59,7 +59,7 @@ namespace OpenSim.Data.MySQL
{
// TODO: actually do something with our connect string
// instead of loading the second config
IniFile iniFile = new IniFile("mysql_connection.ini");
string settingHostname = iniFile.ParseFileReadValue("hostname");
string settingDatabase = iniFile.ParseFileReadValue("database");
@ -67,7 +67,7 @@ namespace OpenSim.Data.MySQL
string settingPassword = iniFile.ParseFileReadValue("password");
string settingPooling = iniFile.ParseFileReadValue("pooling");
string settingPort = iniFile.ParseFileReadValue("port");
m_usersTableName = iniFile.ParseFileReadValue("userstablename");
if (m_usersTableName == null)
{
@ -206,15 +206,15 @@ namespace OpenSim.Data.MySQL
param["?friendID"] = friend.UUID.ToString();
param["?friendPerms"] = perms.ToString();
param["?datetimestamp"] = dtvalue.ToString();
try
try
{
lock (database)
{
IDbCommand adder =
database.Query(
"INSERT INTO `" + m_userFriendsTableName + "` " +
"(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " +
"(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " +
"VALUES " +
"(?ownerID,?friendID,?friendPerms,?datetimestamp)",
param);
@ -325,7 +325,7 @@ namespace OpenSim.Data.MySQL
// This is not a real column in the database table, it's a joined column from the opposite record
fli.FriendListOwnerPerms = (uint)Convert.ToInt32(reader["ownerperms"]);
Lfli.Add(fli);
}
reader.Close();
@ -599,7 +599,7 @@ namespace OpenSim.Data.MySQL
user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText,
user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey);
}
return true;
}
@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
@ -644,12 +644,12 @@ namespace OpenSim.Data.MySQL
{
return;
}
override public void RemoveAttachment(LLUUID user, LLUUID item)
{
return;
}
override public List<LLUUID> GetAttachments(LLUUID user)
{
return new List<LLUUID>();

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -35,7 +35,7 @@ using NHibernate.UserTypes;
namespace OpenSim.Data.NHibernate
{
[Serializable]
public class LLUUIDUserType: IUserType
public class LLUUIDUserType: IUserType
{
public object Assemble(object cached, object owner)
{
@ -69,7 +69,7 @@ namespace OpenSim.Data.NHibernate
public object NullSafeGet(IDataReader rs, string[] names, object owner)
{
object uuid = null;
object uuid = null;
int ord = rs.GetOrdinal(names[0]);
if (!rs.IsDBNull(ord))

View File

@ -65,20 +65,20 @@ namespace OpenSim.Data.NHibernate
// TODO: make this a real exception type
throw new Exception("Malformed Inventory connection string '" + connect + "'");
}
// NHibernate setup
cfg = new Configuration();
cfg.SetProperty(Environment.ConnectionProvider,
cfg.SetProperty(Environment.ConnectionProvider,
"NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty(Environment.Dialect,
cfg.SetProperty(Environment.Dialect,
"NHibernate.Dialect." + parts[0]);
cfg.SetProperty(Environment.ConnectionDriver,
cfg.SetProperty(Environment.ConnectionDriver,
"NHibernate.Driver." + parts[1]);
cfg.SetProperty(Environment.ConnectionString, parts[2]);
cfg.AddAssembly("OpenSim.Data.NHibernate");
HbmSerializer.Default.Validate = true;
using ( MemoryStream stream =
using ( MemoryStream stream =
HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
cfg.AddInputStream(stream);

View File

@ -62,23 +62,23 @@ namespace OpenSim.Data.NHibernate
// TODO: make this a real exception type
throw new Exception("Malformed Inventory connection string '" + connect + "'");
}
// Establish NHibernate Connection
cfg = new Configuration();
cfg.SetProperty(Environment.ConnectionProvider,
cfg.SetProperty(Environment.ConnectionProvider,
"NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty(Environment.Dialect,
cfg.SetProperty(Environment.Dialect,
"NHibernate.Dialect." + parts[0]);
cfg.SetProperty(Environment.ConnectionDriver,
cfg.SetProperty(Environment.ConnectionDriver,
"NHibernate.Driver." + parts[1]);
cfg.SetProperty(Environment.ConnectionString, parts[2]);
cfg.AddAssembly("OpenSim.Data.NHibernate");
HbmSerializer.Default.Validate = true;
using ( MemoryStream stream =
using ( MemoryStream stream =
HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
cfg.AddInputStream(stream);
// If uncommented this will auto create tables, but it
// does drops of the old tables, so we need a smarter way
// to acturally manage this.
@ -120,8 +120,8 @@ namespace OpenSim.Data.NHibernate
/*****************************************************************
*
* Basic CRUD operations on Data
*
* Basic CRUD operations on Data
*
****************************************************************/
// READ
@ -195,7 +195,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="item"></param>
public void deleteInventoryItem(LLUUID itemID)
@ -279,7 +279,7 @@ namespace OpenSim.Data.NHibernate
}
/// <summary>
///
///
/// </summary>
/// <param name="folder"></param>
public void deleteInventoryFolder(LLUUID folderID)
@ -353,7 +353,7 @@ namespace OpenSim.Data.NHibernate
{
updateInventoryItem(item);
}
/// <summary>
@ -403,9 +403,9 @@ namespace OpenSim.Data.NHibernate
return null;
}
}
/// <summary>
/// Append a list of all the child folders of a parent folder
/// Append a list of all the child folders of a parent folder
/// </summary>
/// <param name="folders">list where folders will be appended</param>
/// <param name="parentID">ID of parent</param>
@ -413,7 +413,7 @@ namespace OpenSim.Data.NHibernate
{
using (ISession session = factory.OpenSession())
{
ICriteria criteria = session.CreateCriteria(typeof(InventoryFolderBase));
criteria.Add(Expression.Eq("ParentID", parentID));
foreach (InventoryFolderBase item in criteria.List())
@ -443,7 +443,7 @@ namespace OpenSim.Data.NHibernate
for (int i = 0; i < folders.Count; i++)
getInventoryFolders(ref folders, folders[i].ID);
return folders;
}
}

View File

@ -64,20 +64,20 @@ namespace OpenSim.Data.NHibernate
// This is stubbing for now, it will become dynamic later and support different db backends
cfg = new Configuration();
cfg.SetProperty(Environment.ConnectionProvider,
cfg.SetProperty(Environment.ConnectionProvider,
"NHibernate.Connection.DriverConnectionProvider");
cfg.SetProperty(Environment.Dialect,
cfg.SetProperty(Environment.Dialect,
"NHibernate.Dialect." + parts[0]);
cfg.SetProperty(Environment.ConnectionDriver,
cfg.SetProperty(Environment.ConnectionDriver,
"NHibernate.Driver." + parts[1]);
cfg.SetProperty(Environment.ConnectionString, parts[2]);
cfg.AddAssembly("OpenSim.Data.NHibernate");
HbmSerializer.Default.Validate = true;
using ( MemoryStream stream =
using ( MemoryStream stream =
HbmSerializer.Default.Serialize(Assembly.GetExecutingAssembly()))
cfg.AddInputStream(stream);
// new SchemaExport(cfg).Create(true, true);
factory = cfg.BuildSessionFactory();
@ -122,7 +122,7 @@ namespace OpenSim.Data.NHibernate
// BUG: CATCHALL IS BAD.
}
catch (Exception) {}
return (user != null);
}
@ -151,7 +151,7 @@ namespace OpenSim.Data.NHibernate
// TODO: save agent
transaction.Commit();
}
}
}
}
else
{
@ -162,7 +162,7 @@ namespace OpenSim.Data.NHibernate
private static void SetAgentData(LLUUID uuid, UserAgentData agent, ISession session)
{
if (agent == null)
if (agent == null)
{
// TODO: got to figure out how to do a delete right
}
@ -178,7 +178,7 @@ namespace OpenSim.Data.NHibernate
session.Update(agent);
}
}
}
override public bool UpdateUserProfile(UserProfileData profile)
{
@ -193,7 +193,7 @@ namespace OpenSim.Data.NHibernate
transaction.Commit();
return true;
}
}
}
}
else
{
@ -202,7 +202,7 @@ namespace OpenSim.Data.NHibernate
return true;
}
}
override public void AddNewUserAgent(UserAgentData agent)
{
using (ISession session = factory.OpenSession())
@ -212,9 +212,9 @@ namespace OpenSim.Data.NHibernate
session.Save(agent);
transaction.Commit();
}
}
}
}
public void UpdateUserAgent(UserAgentData agent)
{
using (ISession session = factory.OpenSession())
@ -224,7 +224,7 @@ namespace OpenSim.Data.NHibernate
session.Update(agent);
transaction.Commit();
}
}
}
}
override public UserAgentData GetAgentByUUID(LLUUID uuid)
@ -262,7 +262,7 @@ namespace OpenSim.Data.NHibernate
{
return GetUserByName(fname, lname).CurrentAgent;
}
override public UserAgentData GetAgentByName(string name)
{
return GetAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
@ -273,7 +273,7 @@ namespace OpenSim.Data.NHibernate
List<AvatarPickerAvatar> results = new List<AvatarPickerAvatar>();
string[] querysplit;
querysplit = query.Split(' ');
if (querysplit.Length == 2)
{
using (ISession session = factory.OpenSession())
@ -293,7 +293,7 @@ namespace OpenSim.Data.NHibernate
}
return results;
}
// TODO: actually implement these
public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid) {return;}
public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;}
@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
public AvatarAppearance GetUserAppearance(LLUUID user)
public AvatarAppearance GetUserAppearance(LLUUID user)
{
AvatarAppearance appearance;
// TODO: I'm sure I'll have to do something silly here
@ -345,19 +345,19 @@ namespace OpenSim.Data.NHibernate
}
transaction.Commit();
}
}
}
}
override public void AddAttachment(LLUUID user, LLUUID item)
{
return;
}
override public void RemoveAttachment(LLUUID user, LLUUID item)
{
return;
}
override public List<LLUUID> GetAttachments(LLUUID user)
{
return new List<LLUUID>();

View File

@ -47,11 +47,11 @@ namespace OpenSim.Data.Null
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
}
// see IRegionDatastore
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
{
}
}
public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID)
{

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -95,6 +95,6 @@ namespace OpenSim.Data
}
return value;
}
}
}
}

View File

@ -135,7 +135,7 @@ namespace OpenSim.Data
rowMapperSchema.AddMapping<byte[]>("ExtraParams",
delegate(PrimitiveBaseShapeRowMapper shape) { return shape.Object.ExtraParams; },
delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; });
delegate(PrimitiveBaseShapeRowMapper shape, byte[] value) { shape.Object.ExtraParams = value; });
}
public override PrimitiveBaseShapeRowMapper FromReader(BaseDataReader reader)

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -120,7 +120,7 @@ namespace OpenSim.Data
public LLUUID regionMapTextureID = new LLUUID("00000000-0000-1111-9999-000000000006");
/// <summary>
/// this particular mod to the file provides support within the spec for RegionProfileData for the
/// this particular mod to the file provides support within the spec for RegionProfileData for the
/// owner_uuid for the region
/// </summary>
public LLUUID owner_uuid = LLUUID.Zero;
@ -128,7 +128,7 @@ namespace OpenSim.Data
/// <summary>
/// OGS/OpenSim Specific original ID for a region after move/split
/// </summary>
public LLUUID originUUID;
public LLUUID originUUID;
/// <summary>
/// Get Sim profile data from grid server when in grid mode
@ -163,7 +163,7 @@ namespace OpenSim.Data
simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]);
simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
simData.serverURI = (string)responseData["server_uri"];
simData.serverURI = (string)responseData["server_uri"];
simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/";
simData.UUID = new LLUUID((string) responseData["region_UUID"]);
simData.regionName = (string) responseData["region_name"];
@ -206,7 +206,7 @@ namespace OpenSim.Data
simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]);
simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]);
simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/";
simData.serverURI = (string)responseData["server_uri"];
simData.serverURI = (string)responseData["server_uri"];
simData.UUID = new LLUUID((string) responseData["region_UUID"]);
simData.regionName = (string) responseData["region_name"];

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -51,7 +51,7 @@ namespace OpenSim.Data.SQLite
private const string SelectAssetSQL = "select * from assets where UUID=:UUID";
private const string DeleteAssetSQL = "delete from assets where UUID=:UUID";
private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, InvType, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :InvType, :Local, :Temporary, :Data)";
private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, InvType=:InvType, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID";
private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, InvType=:InvType, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID";
private const string assetSelect = "select * from assets";
private SqliteConnection m_conn;
@ -70,11 +70,11 @@ namespace OpenSim.Data.SQLite
override public AssetBase FetchAsset(LLUUID uuid)
{
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
using (IDataReader reader = cmd.ExecuteReader())
using (IDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
@ -98,7 +98,7 @@ namespace OpenSim.Data.SQLite
{
m_log.Info("[ASSET DB]: Asset exists already, ignoring.");
}
else
else
{
using (SqliteCommand cmd = new SqliteCommand(InsertAssetSQL, m_conn))
{
@ -110,7 +110,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
}
}
@ -119,7 +119,7 @@ namespace OpenSim.Data.SQLite
override public void UpdateAsset(AssetBase asset)
{
LogAssetLoad(asset);
using (SqliteCommand cmd = new SqliteCommand(UpdateAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(asset.FullID)));
@ -130,7 +130,7 @@ namespace OpenSim.Data.SQLite
cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local));
cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary));
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
cmd.ExecuteNonQuery();
}
@ -154,14 +154,14 @@ namespace OpenSim.Data.SQLite
using (SqliteCommand cmd = new SqliteCommand(SelectAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
using (IDataReader reader = cmd.ExecuteReader())
using (IDataReader reader = cmd.ExecuteReader())
{
if (reader.Read())
{
reader.Close();
return true;
}
else
else
{
reader.Close();
return false;
@ -175,7 +175,7 @@ namespace OpenSim.Data.SQLite
using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn))
{
cmd.Parameters.Add(new SqliteParameter(":UUID", Util.ToRawUuidString(uuid)));
cmd.ExecuteNonQuery();
}
}
@ -193,7 +193,7 @@ namespace OpenSim.Data.SQLite
/***********************************************************************
*
* Database Definition Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -216,7 +216,7 @@ namespace OpenSim.Data.SQLite
}
/***********************************************************************
*
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant

View File

@ -106,22 +106,22 @@ namespace OpenSim.Data.SQLite
// new fields
if (!Convert.IsDBNull(row["salePrice"]))
item.SalePrice = Convert.ToInt32(row["salePrice"]);
if (!Convert.IsDBNull(row["saleType"]))
item.SaleType = Convert.ToByte(row["saleType"]);
if (!Convert.IsDBNull(row["creationDate"]))
item.CreationDate = Convert.ToInt32(row["creationDate"]);
if (!Convert.IsDBNull(row["groupID"]))
item.GroupID = new LLUUID((string)row["groupID"]);
if (!Convert.IsDBNull(row["groupOwned"]))
item.GroupOwned = Convert.ToBoolean(row["groupOwned"]);
if (!Convert.IsDBNull(row["Flags"]))
item.Flags = Convert.ToUInt32(row["Flags"]);
return item;
}
@ -221,7 +221,7 @@ namespace OpenSim.Data.SQLite
{
if (add)
m_log.ErrorFormat("[INVENTORY DB]: Interface Misuse: Attempting to Add inventory item that already exists: {0}", item.ID);
fillItemRow(inventoryRow, item);
}
invItemsDa.Update(ds, "inventoryitems");
@ -314,9 +314,9 @@ namespace OpenSim.Data.SQLite
// There should only ever be one root folder for a user. However, if there's more
// than one we'll simply use the first one rather than failing. It would be even
// nicer to print some message to this effect, but this feels like it's too low a
// nicer to print some message to this effect, but this feels like it's too low a
// to put such a message out, and it's too minor right now to spare the time to
// suitably refactor.
// suitably refactor.
if (folders.Count > 0)
{
return folders[0];
@ -327,7 +327,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
/// Append a list of all the child folders of a parent folder
/// Append a list of all the child folders of a parent folder
/// </summary>
/// <param name="folders">list where folders will be appended</param>
/// <param name="parentID">ID of parent</param>
@ -435,7 +435,7 @@ namespace OpenSim.Data.SQLite
}
/// <summary>
///
///
/// </summary>
/// <param name="item"></param>
public void deleteInventoryItem(LLUUID itemID)
@ -664,7 +664,7 @@ namespace OpenSim.Data.SQLite
{
string createInventoryItems = defineTable(createInventoryItemsTable());
string createInventoryFolders = defineTable(createInventoryFoldersTable());
SqliteCommand pcmd = new SqliteCommand(createInventoryItems, conn);
SqliteCommand scmd = new SqliteCommand(createInventoryFolders, conn);
@ -697,7 +697,7 @@ namespace OpenSim.Data.SQLite
// Very clumsy way of checking whether we need to upgrade the database table version and then updating. Only
// putting up with this because this code should be blown away soon by nhibernate...
conn.Open();
SqliteCommand cmd;
try
{
@ -707,7 +707,7 @@ namespace OpenSim.Data.SQLite
catch (SqliteSyntaxException)
{
m_log.Info("[INVENTORY DB]: Upgrading sqlite inventory database to version 2");
cmd = new SqliteCommand("alter table inventoryitems add column salePrice integer default 99;", conn);
cmd.ExecuteNonQuery();
cmd = new SqliteCommand("alter table inventoryitems add column saleType integer default 0;", conn);
@ -719,15 +719,15 @@ namespace OpenSim.Data.SQLite
cmd = new SqliteCommand("alter table inventoryitems add column groupOwned integer default 0;", conn);
cmd.ExecuteNonQuery();
cmd = new SqliteCommand("alter table inventoryitems add column flags integer default 0;", conn);
cmd.ExecuteNonQuery();
cmd.ExecuteNonQuery();
pDa.Fill(tmpDS, "inventoryitems");
}
finally
{
conn.Close();
}
foreach (DataColumn col in createInventoryItemsTable().Columns)
{
if (! tmpDS.Tables["inventoryitems"].Columns.Contains(col.ColumnName))

View File

@ -90,11 +90,11 @@ namespace OpenSim.Data.SQLite
SqliteCommand shapeSelectCmd = new SqliteCommand(shapeSelect, m_conn);
shapeDa = new SqliteDataAdapter(shapeSelectCmd);
// SqliteCommandBuilder shapeCb = new SqliteCommandBuilder(shapeDa);
// SqliteCommandBuilder shapeCb = new SqliteCommandBuilder(shapeDa);
SqliteCommand itemsSelectCmd = new SqliteCommand(itemsSelect, m_conn);
itemsDa = new SqliteDataAdapter(itemsSelectCmd);
SqliteCommand terrainSelectCmd = new SqliteCommand(terrainSelect, m_conn);
terrainDa = new SqliteDataAdapter(terrainSelectCmd);
@ -117,7 +117,7 @@ namespace OpenSim.Data.SQLite
ds.Tables.Add(createShapeTable());
setupShapeCommands(shapeDa, m_conn);
if (persistPrimInventories)
{
ds.Tables.Add(createItemsTable());
@ -183,8 +183,8 @@ namespace OpenSim.Data.SQLite
{
foreach (SceneObjectPart prim in obj.Children.Values)
{
if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0
if ((prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Physics) == 0
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.Temporary) == 0
&& (prim.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.TemporaryOnRez) == 0)
{
m_log.Info("[REGION DB]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
@ -210,7 +210,7 @@ namespace OpenSim.Data.SQLite
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
m_log.InfoFormat("[REGION DB]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["primshapes"];
@ -234,7 +234,7 @@ namespace OpenSim.Data.SQLite
}
// Remove prim row
row.Delete();
row.Delete();
}
}
@ -247,11 +247,11 @@ namespace OpenSim.Data.SQLite
/// </summary>
private void RemoveItems(LLUUID uuid)
{
DataTable items = ds.Tables["primitems"];
DataTable items = ds.Tables["primitems"];
String sql = String.Format("primID = '{0}'", uuid);
String sql = String.Format("primID = '{0}'", uuid);
DataRow[] itemRows = items.Select(sql);
foreach (DataRow itemRow in itemRows)
{
itemRow.Delete();
@ -286,7 +286,7 @@ namespace OpenSim.Data.SQLite
try
{
SceneObjectPart prim = null;
string uuid = (string) primRow["UUID"];
string objID = (string) primRow["SceneGroupID"];
if (uuid == objID) //is new SceneObjectGroup ?
@ -353,25 +353,25 @@ namespace OpenSim.Data.SQLite
private void LoadItems(SceneObjectPart prim)
{
//m_log.DebugFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID);
DataTable dbItems = ds.Tables["primitems"];
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
DataRow[] dbItemRows = dbItems.Select(sql);
IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
foreach (DataRow row in dbItemRows)
{
TaskInventoryItem item = buildItem(row);
inventory.Add(item);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
//m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID);
}
prim.RestoreInventoryItems(inventory);
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// XXX A nasty little hack to recover the folder id for the prim (which is currently stored in
// every item). This data should really be stored in the prim table itself.
if (dbItemRows.Length > 0)
{
@ -548,12 +548,12 @@ namespace OpenSim.Data.SQLite
{
primDa.Update(ds, "prims");
shapeDa.Update(ds, "primshapes");
if (persistPrimInventories)
{
itemsDa.Update(ds, "primitems");
}
terrainDa.Update(ds, "terrain");
landDa.Update(ds, "land");
landAccessListDa.Update(ds, "landaccesslist");
@ -569,7 +569,7 @@ namespace OpenSim.Data.SQLite
/***********************************************************************
*
* Database Definition Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -705,8 +705,8 @@ namespace OpenSim.Data.SQLite
createCol(items, "primID", typeof (String));
createCol(items, "assetID", typeof (String));
createCol(items, "parentFolderID", typeof (String));
createCol(items, "invType", typeof (Int32));
createCol(items, "invType", typeof (Int32));
createCol(items, "assetType", typeof (Int32));
createCol(items, "name", typeof (String));
@ -784,7 +784,7 @@ namespace OpenSim.Data.SQLite
}
/***********************************************************************
*
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant
@ -897,7 +897,7 @@ namespace OpenSim.Data.SQLite
return prim;
}
/// <summary>
/// Build a prim inventory item from the persisted data.
/// </summary>
@ -906,15 +906,15 @@ namespace OpenSim.Data.SQLite
private static TaskInventoryItem buildItem(DataRow row)
{
TaskInventoryItem taskItem = new TaskInventoryItem();
taskItem.ItemID = new LLUUID((String)row["itemID"]);
taskItem.ItemID = new LLUUID((String)row["itemID"]);
taskItem.ParentPartID = new LLUUID((String)row["primID"]);
taskItem.AssetID = new LLUUID((String)row["assetID"]);
taskItem.ParentID = new LLUUID((String)row["parentFolderID"]);
taskItem.InvType = Convert.ToInt32(row["invType"]);
taskItem.Type = Convert.ToInt32(row["assetType"]);
taskItem.Name = (String)row["name"];
taskItem.Description = (String)row["description"];
taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]);
@ -922,13 +922,13 @@ namespace OpenSim.Data.SQLite
taskItem.OwnerID = new LLUUID((String)row["ownerID"]);
taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]);
taskItem.GroupID = new LLUUID((String)row["groupID"]);
taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]);
taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]);
taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]);
taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]);
taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]);
return taskItem;
}
@ -990,14 +990,14 @@ namespace OpenSim.Data.SQLite
cmd.ExecuteNonQuery();
m_conn.Close();
m_conn.Dispose();
m_log.Error("[REGION DB]: The land table was recently updated. You need to restart the simulator. Exiting now.");
Thread.Sleep(10000);
// ICK! but it's better then A thousand red SQLITE error messages!
Environment.Exit(0);
}
catch (Exception)
{
@ -1006,7 +1006,7 @@ namespace OpenSim.Data.SQLite
Environment.Exit(0);
}
}
return newData;
}
@ -1107,17 +1107,17 @@ namespace OpenSim.Data.SQLite
row["SitTargetOrientY"] = sitTargetOrient.Y;
row["SitTargetOrientZ"] = sitTargetOrient.Z;
}
private static void fillItemRow(DataRow row, TaskInventoryItem taskItem)
{
row["itemID"] = taskItem.ItemID;
row["primID"] = taskItem.ParentPartID;
row["assetID"] = taskItem.AssetID;
row["parentFolderID"] = taskItem.ParentID;
row["invType"] = taskItem.InvType;
row["assetType"] = taskItem.Type;
row["name"] = taskItem.Name;
row["description"] = taskItem.Description;
row["creationDate"] = taskItem.CreationDate;
@ -1294,37 +1294,37 @@ namespace OpenSim.Data.SQLite
fillShapeRow(shapeRow, prim);
}
}
// see IRegionDatastore
public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items)
{
if (!persistPrimInventories)
return;
m_log.InfoFormat("[REGION DB]: Entered StorePrimInventory with prim ID {0}", primID);
DataTable dbItems = ds.Tables["primitems"];
// For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set.
DataTable dbItems = ds.Tables["primitems"];
// For now, we're just going to crudely remove all the previous inventory items
// no matter whether they have changed or not, and replace them with the current set.
lock (ds)
{
RemoveItems(primID);
// repalce with current inventory details
foreach (TaskInventoryItem newItem in items)
{
// m_log.InfoFormat(
// "[DATASTORE]: ",
// "Adding item {0}, {1} to prim ID {2}",
// "[DATASTORE]: ",
// "Adding item {0}, {1} to prim ID {2}",
// newItem.Name, newItem.ItemID, newItem.ParentPartID);
DataRow newItemRow = dbItems.NewRow();
fillItemRow(newItemRow, newItem);
dbItems.Rows.Add(newItemRow);
dbItems.Rows.Add(newItemRow);
}
}
Commit();
}
@ -1436,7 +1436,7 @@ namespace OpenSim.Data.SQLite
/// This is a convenience function that collapses 5 repetitive
/// lines for defining SqliteParameters to 2 parameters:
/// column name and database type.
///
///
/// It assumes certain conventions like :param as the param
/// name to replace in parametrized queries, and that source
/// version is always current version, both of which are fine
@ -1451,7 +1451,7 @@ namespace OpenSim.Data.SQLite
param.SourceColumn = name;
param.SourceVersion = DataRowVersion.Current;
return param;
}
}
private void setupPrimCommands(SqliteDataAdapter da, SqliteConnection conn)
{
@ -1466,7 +1466,7 @@ namespace OpenSim.Data.SQLite
delete.Connection = conn;
da.DeleteCommand = delete;
}
private void setupItemsCommands(SqliteDataAdapter da, SqliteConnection conn)
{
da.InsertCommand = createInsertCommand("primitems", ds.Tables["primitems"]);
@ -1479,7 +1479,7 @@ namespace OpenSim.Data.SQLite
delete.Parameters.Add(createSqliteParameter("itemID", typeof (String)));
delete.Connection = conn;
da.DeleteCommand = delete;
}
}
private void setupTerrainCommands(SqliteDataAdapter da, SqliteConnection conn)
{
@ -1660,7 +1660,7 @@ namespace OpenSim.Data.SQLite
return false;
}
}
// XXX primitems should probably go here eventually
foreach (DataColumn col in createTerrainTable().Columns)

View File

@ -58,7 +58,7 @@ namespace OpenSim.Data.SQLite
private const string AvatarPickerAndSQL = "select * from users where username like :username and surname like :surname";
private const string AvatarPickerOrSQL = "select * from users where username like :username or surname like :surname";
private DataSet ds;
private SqliteDataAdapter da;
private SqliteDataAdapter daf;
@ -67,16 +67,16 @@ namespace OpenSim.Data.SQLite
override public void Initialise(string connect)
{
// default to something sensible
if (connect == "")
if (connect == "")
connect = "URI=file:userprofiles.db,version=3";
SqliteConnection conn = new SqliteConnection(connect);
TestTables(conn);
// This sucks, but It doesn't seem to work with the dataset Syncing :P
g_conn = conn;
g_conn.Open();
ds = new DataSet();
da = new SqliteDataAdapter(new SqliteCommand(userSelect, conn));
daf = new SqliteDataAdapter(new SqliteCommand(userFriendsSelect, conn));
@ -159,7 +159,7 @@ namespace OpenSim.Data.SQLite
override public void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms)
{
string InsertFriends = "insert into userfriends(ownerID, friendID, friendPerms) values(:ownerID, :friendID, :perms)";
using (SqliteCommand cmd = new SqliteCommand(InsertFriends, g_conn))
{
cmd.Parameters.Add(new SqliteParameter(":ownerID", friendlistowner.UUID.ToString()));
@ -228,11 +228,11 @@ namespace OpenSim.Data.SQLite
m_log.Error("[USER DB]: Exception getting friends list for user: " + ex.ToString());
}
}
return returnlist;
}
#endregion
@ -380,9 +380,9 @@ namespace OpenSim.Data.SQLite
else
{
fillUserRow(row, user);
}
// This is why we're getting the 'logins never log-off'.. because It isn't clearing the
// This is why we're getting the 'logins never log-off'.. because It isn't clearing the
// useragents table once the useragent is null
//
// A database guy should look at this and figure out the best way to clear the useragents table.
@ -403,7 +403,7 @@ namespace OpenSim.Data.SQLite
}
else
{
// I just added this to help the standalone login situation.
// I just added this to help the standalone login situation.
//It still needs to be looked at by a Database guy
DataTable ua = ds.Tables["useragents"];
row = ua.Rows.Find(Util.ToRawUuidString(user.ID));
@ -480,7 +480,7 @@ namespace OpenSim.Data.SQLite
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// override public AvatarAppearance GetUserAppearance(LLUUID user)
// {
// return new AvatarAppearance();
// }
@ -494,17 +494,17 @@ namespace OpenSim.Data.SQLite
{
return;
}
override public void RemoveAttachment(LLUUID user, LLUUID item)
{
return;
}
override public List<LLUUID> GetAttachments(LLUUID user)
{
return new List<LLUUID>();
}
/// <summary>
/// Returns the name of the storage provider
/// </summary>
@ -525,13 +525,13 @@ namespace OpenSim.Data.SQLite
/***********************************************************************
*
* DataTable creation
* DataTable creation
*
**********************************************************************/
/***********************************************************************
*
* Database Definition Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -610,7 +610,7 @@ namespace OpenSim.Data.SQLite
}
/***********************************************************************
*
*
* Convert between ADO.NET <=> OpenSim Objects
*
* These should be database independant

View File

@ -39,7 +39,7 @@ namespace OpenSim.Data.SQLite
/***********************************************************************
*
* Database Definition Helper Functions
*
*
* This should be db agnostic as we define them in ADO.NET terms
*
**********************************************************************/
@ -161,7 +161,7 @@ namespace OpenSim.Data.SQLite
/// This is a convenience function that collapses 5 repetitive
/// lines for defining SqliteParameters to 2 parameters:
/// column name and database type.
///
///
/// It assumes certain conventions like :param as the param
/// name to replace in parametrized queries, and that source
/// version is always current version, both of which are fine

View File

@ -36,11 +36,11 @@ namespace OpenSim.Data
public abstract class UserDataBase : IUserData
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<LLUUID, AvatarAppearance> aplist = new Dictionary<LLUUID, AvatarAppearance>();
public abstract UserProfileData GetUserByUUID(LLUUID user);
public abstract UserProfileData GetUserByName(string fname, string lname);
public abstract UserProfileData GetUserByName(string fname, string lname);
public abstract UserAgentData GetAgentByUUID(LLUUID user);
public abstract UserAgentData GetAgentByName(string name);
public abstract UserAgentData GetAgentByName(string fname, string lname);

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,7 +54,7 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//

View File

@ -38,7 +38,7 @@ using Nini.Config;
/// Loads assets from the filesystem location. Not yet a plugin, though it should be.
/// </summary>
namespace OpenSim.Framework.AssetLoader.Filesystem
{
{
public class AssetLoaderFileSystem : IAssetLoader
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -63,7 +63,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
return asset;
}
protected static void LoadAsset(AssetBase info, bool image, string path)
{
FileInfo fInfo = new FileInfo(path);
@ -77,7 +77,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
info.Data = idata;
//info.loaded=true;
}
public void ForEachDefaultXmlAsset(Action<AssetBase> action)
{
string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml");
@ -91,28 +91,28 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
if (File.Exists(assetSetFilename))
{
string assetSetPath = "ERROR";
try
{
XmlConfigSource source = new XmlConfigSource(assetSetFilename);
for (int i = 0; i < source.Configs.Count; i++)
{
assetSetPath = source.Configs[i].GetString("file", String.Empty);
LoadXmlAssetSet(Path.Combine(Util.assetsDir(), assetSetPath), assets);
}
}
catch (XmlException e)
{
m_log.ErrorFormat("[ASSETS]: Error loading {0} : {1}", assetSetPath, e);
}
}
}
else
{
m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded.");
}
assets.ForEach(action);
}
@ -124,7 +124,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
protected static void LoadXmlAssetSet(string assetSetPath, List<AssetBase> assets)
{
m_log.InfoFormat("[ASSETS]: Loading asset set {0}", assetSetPath);
if (File.Exists(assetSetPath))
{
try
@ -156,6 +156,6 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
{
m_log.ErrorFormat("[ASSETS]: Asset set file {0} does not exist!", assetSetPath);
}
}
}
}
}

View File

@ -56,7 +56,7 @@ namespace OpenSim.Framework
public readonly static int SKIRT = 12;
private readonly static int MAX_WEARABLES = 13;
private static LLUUID BODY_ASSET = new LLUUID("66c41e39-38f9-f75a-024e-585989bfab73");
private static LLUUID BODY_ITEM = new LLUUID("66c41e39-38f9-f75a-024e-585989bfaba9");
private static LLUUID SKIN_ASSET = new LLUUID("77c41e39-38f9-f75a-024e-585989bbabbb");
@ -204,7 +204,7 @@ namespace OpenSim.Framework
set { m_wearables[SKIRT].AssetID = value; }
}
public void SetDefaultWearables()
public void SetDefaultWearables()
{
m_wearables[BODY].AssetID = BODY_ASSET;
m_wearables[BODY].ItemID = BODY_ITEM;
@ -257,7 +257,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
/// <param name="texture"></param>
/// <param name="visualParam"></param>

View File

@ -72,7 +72,7 @@ namespace OpenSim.Framework
public void Remove(uint id)
{
//m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count);
//m_log.InfoFormat("[CLIENT]: Removing client with code {0}, current count {1}", id, m_clients.Count);
lock (m_clients)
{
m_clients.Remove(id);

View File

@ -40,12 +40,12 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary>
/// Manages local cache of assets and their sending to viewers.
///
///
/// This class actually encapsulates two largely separate mechanisms. One mechanism fetches assets either
/// synchronously or async and passes the data back to the requester. The second mechanism fetches assets and
/// sends packetised data directly back to the client. The only point where they meet is AssetReceived() and
/// AssetNotFound(), which means they do share the same asset and texture caches.
///
///
/// TODO Assets in this cache are effectively immortal (they are never disposed off through old age).
/// This is not a huge problem at the moment since other memory use usually dwarfs that used by assets
/// but it's something to bear in mind.
@ -281,8 +281,8 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary>
/// Synchronously retreive an asset. If the asset isn't in the cache, a request will be made to the persistent store to
/// load it into the cache.
///
/// load it into the cache.
///
/// XXX We'll keep polling the cache until we get the asset or we exceed
/// the allowed number of polls. This isn't a very good way of doing things since a single thread
/// is processing inbound packets, so if the asset server is slow, we could block this for up to
@ -431,11 +431,11 @@ namespace OpenSim.Framework.Communications.Cache
//making a copy of the list is not ideal
//but the old method of locking around this whole block of code was causing a multi-thread lock
//between this and the TextureDownloadModule
//while the localAsset thread running this and trying to send a texture to the callback in the
//while the localAsset thread running this and trying to send a texture to the callback in the
//texturedownloadmodule , and hitting a lock in there. While the texturedownload thread (which was holding
// the lock in the texturedownload module) was trying to
// the lock in the texturedownload module) was trying to
//request a new asset and hitting a lock in here on the RequestLists.
List<NewAssetRequest> theseRequests = new List<NewAssetRequest>(reqList.Requests);
reqList.Requests.Clear();
@ -460,7 +460,7 @@ namespace OpenSim.Framework.Communications.Cache
{
// m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
// Notify requesters for this asset
// Notify requesters for this asset
AssetRequestsList reqList = null;
lock (RequestLists)
{
@ -552,7 +552,7 @@ namespace OpenSim.Framework.Communications.Cache
}
return;
}
//it is in our cache
//it is in our cache
AssetInfo asset = Assets[requestID];
// add to the AssetRequests list
@ -679,14 +679,14 @@ namespace OpenSim.Framework.Communications.Cache
public byte AssetRequestSource = 2;
public byte[] Params = null;
//public bool AssetInCache;
//public int TimeRequested;
//public int TimeRequested;
public int DiscardLevel = -1;
public AssetRequest()
{
}
}
public class AssetInfo : AssetBase
{
public AssetInfo()

View File

@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache
{
public abstract class AssetServerBase : IAssetServer
{
private static readonly ILog m_log
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected IAssetReceiver m_receiver;
@ -47,12 +47,12 @@ namespace OpenSim.Framework.Communications.Cache
// Temporarily hardcoded - should be a plugin
protected IAssetLoader assetLoader = new AssetLoaderFileSystem();
protected abstract void StoreAsset(AssetBase asset);
protected abstract void CommitAssets();
/// <summary>
/// This method must be implemented by a subclass to retrieve the asset named in the
/// This method must be implemented by a subclass to retrieve the asset named in the
/// AssetRequest. If the asset is not found, null should be returned.
/// </summary>
/// <param name="req"></param>
@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache
protected abstract AssetBase GetAsset(AssetRequest req);
/// <summary>
/// Process an asset request. This method will call GetAsset(AssetRequest req)
/// Process an asset request. This method will call GetAsset(AssetRequest req)
/// on the subclass.
/// </summary>
/// <param name="req"></param>

View File

@ -36,55 +36,55 @@ using log4net;
namespace OpenSim.Framework.Communications.Cache
{
internal delegate void AddItemDelegate(InventoryItemBase itemInfo);
internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
internal delegate void UpdateItemDelegate(InventoryItemBase itemInfo);
internal delegate void DeleteItemDelegate(LLUUID itemID);
internal delegate void CreateFolderDelegate(string folderName, LLUUID folderID, ushort folderType, LLUUID parentID);
internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID);
internal delegate void MoveFolderDelegate(LLUUID folderID, LLUUID parentID);
internal delegate void PurgeFolderDelegate(LLUUID folderID);
internal delegate void UpdateFolderDelegate(string name, LLUUID folderID, ushort type, LLUUID parentID);
internal delegate void SendInventoryDescendentsDelegate(
IClientAPI client, LLUUID folderID, bool fetchFolders, bool fetchItems);
/// <summary>
/// Stores user profile and inventory data received from backend services for a particular user.
/// </summary>
public class CachedUserInfo
{
private static readonly ILog m_log
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// The comms manager holds references to services (user, grid, inventory, etc.)
/// </summary>
/// </summary>
private readonly CommunicationsManager m_commsManager;
public UserProfileData UserProfile { get { return m_userProfile; } }
private readonly UserProfileData m_userProfile;
private readonly UserProfileData m_userProfile;
/// <summary>
/// Has we received the user's inventory from the inventory service?
/// </summary>
private bool m_hasInventory;
/// <summary>
/// Inventory requests waiting for receipt of this user's inventory from the inventory service.
/// </summary>
private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>();
private readonly IList<IInventoryRequest> m_pendingRequests = new List<IInventoryRequest>();
/// <summary>
/// Has this user info object yet received its inventory information from the invetnroy service?
/// </summary>
public bool HasInventory { get { return m_hasInventory; } }
private InventoryFolderImpl m_rootFolder;
public InventoryFolderImpl RootFolder { get { return m_rootFolder; } }
public InventoryFolderImpl RootFolder { get { return m_rootFolder; } }
/// <summary>
/// FIXME: This could be contained within a local variable - it doesn't need to be a field
/// </summary>
private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders
private IDictionary<LLUUID, IList<InventoryFolderImpl>> pendingCategorizationFolders
= new Dictionary<LLUUID, IList<InventoryFolderImpl>>();
/// <summary>
@ -97,7 +97,7 @@ namespace OpenSim.Framework.Communications.Cache
m_commsManager = commsManager;
m_userProfile = userProfile;
}
/// <summary>
/// This allows a request to be added to be processed once we receive a user's inventory
/// from the inventory service. If we already have the inventory, the request
@ -118,7 +118,7 @@ namespace OpenSim.Framework.Communications.Cache
}
}
}
/// <summary>
/// Store a folder pending arrival of its parent
/// </summary>
@ -126,7 +126,7 @@ namespace OpenSim.Framework.Communications.Cache
private void AddPendingFolder(InventoryFolderImpl folder)
{
LLUUID parentFolderId = folder.ParentID;
if (pendingCategorizationFolders.ContainsKey(parentFolderId))
{
pendingCategorizationFolders[parentFolderId].Add(folder);
@ -135,11 +135,11 @@ namespace OpenSim.Framework.Communications.Cache
{
IList<InventoryFolderImpl> folders = new List<InventoryFolderImpl>();
folders.Add(folder);
pendingCategorizationFolders[parentFolderId] = folders;
}
}
/// <summary>
/// Add any pending folders which were received before the given folder
/// </summary>
@ -155,18 +155,18 @@ namespace OpenSim.Framework.Communications.Cache
// m_log.DebugFormat(
// "[INVENTORY CACHE]: Resolving pending received folder {0} {1} into {2} {3}",
// folder.name, folder.folderID, parent.name, parent.folderID);
lock (newFolder.SubFolders)
{
if (!newFolder.SubFolders.ContainsKey(folder.ID))
{
newFolder.SubFolders.Add(folder.ID, folder);
}
}
}
}
}
}
/// <summary>
/// Callback invoked when the inventory is received from an async request to the inventory service
/// </summary>
@ -177,12 +177,12 @@ namespace OpenSim.Framework.Communications.Cache
// FIXME: Exceptions thrown upwards never appear on the console. Could fix further up if these
// are simply being swallowed
try
{
{
foreach (InventoryFolderImpl folder in folders)
{
FolderReceive(folder);
}
foreach (InventoryItemBase item in items)
{
ItemReceive(item);
@ -191,15 +191,15 @@ namespace OpenSim.Framework.Communications.Cache
catch (Exception e)
{
m_log.ErrorFormat("[INVENTORY CACHE]: Error processing inventory received from inventory service, {0}", e);
}
}
// Deal with pending requests
lock (m_pendingRequests)
{
// We're going to change inventory status within the lock to avoid a race condition
// where requests are processed after the AddRequest() method has been called.
m_hasInventory = true;
foreach (IInventoryRequest request in m_pendingRequests)
{
request.Execute();
@ -215,7 +215,7 @@ namespace OpenSim.Framework.Communications.Cache
private void FolderReceive(InventoryFolderImpl newFolder)
{
// m_log.DebugFormat(
// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}",
// "[INVENTORY CACHE]: Received folder {0} {1} for user {2}",
// folderInfo.Name, folderInfo.ID, userID);
if (RootFolder == null)
@ -232,7 +232,7 @@ namespace OpenSim.Framework.Communications.Cache
else
{
InventoryFolderImpl parentFolder = RootFolder.FindFolder(newFolder.ParentID);
if (parentFolder != null)
{
lock (parentFolder.SubFolders)
@ -252,44 +252,44 @@ namespace OpenSim.Framework.Communications.Cache
else
{
AddPendingFolder(newFolder);
}
}
}
ResolvePendingFolders(newFolder);
}
/// <summary>
/// Callback invoked when an item is received from an async request to the inventory service.
///
///
/// We're assuming here that items are always received after all the folders
/// received.
/// </summary>
/// <param name="folderInfo"></param>
/// <param name="folderInfo"></param>
private void ItemReceive(InventoryItemBase itemInfo)
{
// m_log.DebugFormat(
// "[INVENTORY CACHE]: Received item {0} {1} for user {2}",
// "[INVENTORY CACHE]: Received item {0} {1} for user {2}",
// itemInfo.Name, itemInfo.ID, userID);
InventoryFolderImpl folder = RootFolder.FindFolder(itemInfo.Folder);
if (null == folder)
{
m_log.WarnFormat(
"Received item {0} {1} but its folder {2} does not exist",
"Received item {0} {1} but its folder {2} does not exist",
itemInfo.Name, itemInfo.ID, itemInfo.Folder);
return;
}
lock (folder.Items)
{
folder.Items[itemInfo.ID] = itemInfo;
}
}
/// <summary>
/// Create a folder in this agent's inventory.
///
/// Create a folder in this agent's inventory.
///
/// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued.
/// </summary>
@ -299,20 +299,20 @@ namespace OpenSim.Framework.Communications.Cache
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Creating inventory folder {0} {1} for {2} {3}", folderID, folderName, remoteClient.Name, remoteClient.AgentId);
if (HasInventory)
{
InventoryFolderImpl parentFolder = RootFolder.FindFolder(parentID);
if (null == parentFolder)
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Tried to create folder {0} {1} but the parent {2} does not exist",
folderName, folderID, parentID);
return false;
}
InventoryFolderImpl createdFolder = parentFolder.CreateChildFolder(folderID, folderName, folderType);
if (createdFolder != null)
@ -324,17 +324,17 @@ namespace OpenSim.Framework.Communications.Cache
createdBaseFolder.ParentID = createdFolder.ParentID;
createdBaseFolder.Type = createdFolder.Type;
createdBaseFolder.Version = createdFolder.Version;
m_commsManager.InventoryService.AddFolder(createdBaseFolder);
return true;
}
else
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists",
"[AGENT INVENTORY]: Tried to create folder {0} {1} but the folder already exists",
folderName, folderID);
return false;
}
}
@ -344,22 +344,22 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(CreateFolderDelegate), this, "CreateFolder"),
new object[] { folderName, folderID, folderType, parentID }));
return true;
}
}
}
/// <summary>
/// Handle a client request to update the inventory folder
///
///
/// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued.
///
///
/// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
/// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
/// and needs to be changed.
/// </summary>
///
///
/// <param name="folderID"></param>
/// <param name="type"></param>
/// <param name="name"></param>
@ -367,7 +367,7 @@ namespace OpenSim.Framework.Communications.Cache
public bool UpdateFolder(string name, LLUUID folderID, ushort type, LLUUID parentID)
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
if (HasInventory)
{
@ -378,7 +378,7 @@ namespace OpenSim.Framework.Communications.Cache
baseFolder.ParentID = parentID;
baseFolder.Type = (short) type;
baseFolder.Version = RootFolder.Version;
m_commsManager.InventoryService.AddFolder(baseFolder);
}
else
@ -387,18 +387,18 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(UpdateFolderDelegate), this, "UpdateFolder"),
new object[] { name, folderID, type, parentID }));
}
}
return true;
}
}
/// <summary>
/// Handle an inventory folder move request from the client.
///
///
/// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued.
/// </summary>
///
///
/// <param name="folderID"></param>
/// <param name="parentID"></param>
public bool MoveFolder(LLUUID folderID, LLUUID parentID)
@ -413,9 +413,9 @@ namespace OpenSim.Framework.Communications.Cache
baseFolder.Owner = m_userProfile.ID;
baseFolder.ID = folderID;
baseFolder.ParentID = parentID;
m_commsManager.InventoryService.MoveFolder(baseFolder);
return true;
}
else
@ -424,30 +424,30 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(MoveFolderDelegate), this, "MoveFolder"),
new object[] { folderID, parentID }));
return true;
}
}
}
}
/// <summary>
/// This method will delete all the items and folders in the given folder.
///
///
/// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued.
/// </summary>
///
///
/// <param name="folderID"></param>
public bool PurgeFolder(LLUUID folderID)
{
// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
// m_log.InfoFormat("[AGENT INVENTORY]: Purging folder {0} for {1} uuid {2}",
// folderID, remoteClient.Name, remoteClient.AgentId);
if (HasInventory)
{
InventoryFolderImpl purgedFolder = RootFolder.FindFolder(folderID);
if (purgedFolder != null)
{
{
// XXX Nasty - have to create a new object to hold details we already have
InventoryFolderBase purgedBaseFolder = new InventoryFolderBase();
purgedBaseFolder.Owner = purgedFolder.Owner;
@ -455,12 +455,12 @@ namespace OpenSim.Framework.Communications.Cache
purgedBaseFolder.Name = purgedFolder.Name;
purgedBaseFolder.ParentID = purgedFolder.ParentID;
purgedBaseFolder.Type = purgedFolder.Type;
purgedBaseFolder.Version = purgedFolder.Version;
m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
purgedBaseFolder.Version = purgedFolder.Version;
m_commsManager.InventoryService.PurgeFolder(purgedBaseFolder);
purgedFolder.Purge();
return true;
}
}
@ -470,12 +470,12 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(PurgeFolderDelegate), this, "PurgeFolder"),
new object[] { folderID }));
return true;
}
}
return false;
}
}
/// <summary>
/// Add an item to the user's inventory
@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(AddItemDelegate), this, "AddItem"),
new object[] { item }));
}
}
}
/// <summary>
@ -514,18 +514,18 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(UpdateItemDelegate), this, "UpdateItem"),
new object[] { item }));
}
}
}
/// <summary>
/// Delete an item from the user's inventory
///
///
/// If the inventory service has not yet delievered the inventory
/// for this user then the request will be queued.
/// </summary>
/// <param name="itemID"></param>
/// <returns>
/// true on a successful delete or a if the request is queued.
/// true on a successful delete or a if the request is queued.
/// Returns false on an immediate failure
/// </returns>
public bool DeleteItem(LLUUID itemID)
@ -535,14 +535,14 @@ namespace OpenSim.Framework.Communications.Cache
// XXX For historical reasons (grid comms), we need to retrieve the whole item in order to delete, even though
// really only the item id is required.
InventoryItemBase item = RootFolder.FindItem(itemID);
if (null == item)
{
m_log.WarnFormat("[AGENT INVENTORY]: Tried to delete item {0} which does not exist", itemID);
return false;
}
if (RootFolder.DeleteItem(item.ID))
{
return m_commsManager.InventoryService.DeleteItem(item);
@ -554,13 +554,13 @@ namespace OpenSim.Framework.Communications.Cache
new InventoryRequest(
Delegate.CreateDelegate(typeof(DeleteItemDelegate), this, "DeleteItem"),
new object[] { itemID }));
return true;
}
}
return false;
}
/// <summary>
/// Send details of the inventory items and/or folders in a given folder to the client.
/// </summary>
@ -574,13 +574,13 @@ namespace OpenSim.Framework.Communications.Cache
if (HasInventory)
{
InventoryFolderImpl folder;
if ((folder = RootFolder.FindFolder(folderID)) != null)
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Found folder {0} for client {1}",
// "[AGENT INVENTORY]: Found folder {0} for client {1}",
// folderID, remoteClient.AgentId);
client.SendInventoryFolderDetails(
client.AgentId, folderID, folder.RequestListOfItems(),
folder.RequestListOfFolders(), fetchFolders, fetchItems);
@ -592,7 +592,7 @@ namespace OpenSim.Framework.Communications.Cache
m_log.WarnFormat(
"[AGENT INVENTORY]: Could not find folder {0} requested by user {1} {2}",
folderID, client.Name, client.AgentId);
return false;
}
}
@ -604,13 +604,13 @@ namespace OpenSim.Framework.Communications.Cache
new object[] { client, folderID, fetchFolders, fetchItems }));
return true;
}
}
}
}
/// <summary>
/// Should be implemented by callers which require a callback when the user's inventory is received
/// </summary>
/// </summary>
public interface IInventoryRequest
{
/// <summary>
@ -618,7 +618,7 @@ namespace OpenSim.Framework.Communications.Cache
/// </summary>
void Execute();
}
/// <summary>
/// Generic inventory request
/// </summary>
@ -626,16 +626,16 @@ namespace OpenSim.Framework.Communications.Cache
{
private Delegate m_delegate;
private Object[] m_args;
internal InventoryRequest(Delegate delegat, Object[] args)
{
m_delegate = delegat;
m_delegate = delegat;
m_args = args;
}
public void Execute()
{
m_delegate.DynamicInvoke(m_args);
}
}
}
}

View File

@ -95,9 +95,9 @@ namespace OpenSim.Framework.Communications.Cache
// XmlSerializer xs = new XmlSerializer(typeof(AssetBase));
// xs.Serialize(s, asset);
// RestClient rc = new RestClient(_assetServerUrl);
string assetUrl = _assetServerUrl + "/assets/";
string assetUrl = _assetServerUrl + "/assets/";
//rc.AddResourcePath("assets");
// rc.RequestMethod = "POST";
@ -105,7 +105,7 @@ namespace OpenSim.Framework.Communications.Cache
//m_log.InfoFormat("[ASSET]: Stored {0}", rc);
m_log.InfoFormat("[GRID ASSET CLIENT]: Sending store request for asset {0}", asset.FullID);
RestObjectPoster.BeginPostObject<AssetBase>(assetUrl, asset);
}
catch (Exception e)

View File

@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications.Cache
public class InventoryFolderImpl : InventoryFolderBase
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// Fields
public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>();
public Dictionary<LLUUID, InventoryFolderImpl> SubFolders = new Dictionary<LLUUID, InventoryFolderImpl>();
@ -82,14 +82,14 @@ namespace OpenSim.Framework.Communications.Cache
subFold.ParentID = this.ID;
subFold.Owner = Owner;
SubFolders.Add(subFold.ID, subFold);
return subFold;
}
}
return null;
}
/// <summary>
/// Delete all the folders and items in this folder.
/// </summary>
@ -97,9 +97,9 @@ namespace OpenSim.Framework.Communications.Cache
{
foreach (InventoryFolderImpl folder in SubFolders.Values)
{
folder.Purge();
folder.Purge();
}
SubFolders.Clear();
Items.Clear();
}
@ -118,20 +118,20 @@ namespace OpenSim.Framework.Communications.Cache
return Items[itemID];
}
}
lock (SubFolders)
{
foreach (InventoryFolderImpl folder in SubFolders.Values)
{
InventoryItemBase item = folder.FindItem(itemID);
if (item != null)
{
return item;
}
}
}
return null;
}
@ -143,7 +143,7 @@ namespace OpenSim.Framework.Communications.Cache
public bool DeleteItem(LLUUID itemID)
{
bool found = false;
lock (Items)
{
if (Items.ContainsKey(itemID))
@ -152,20 +152,20 @@ namespace OpenSim.Framework.Communications.Cache
return true;
}
}
lock (SubFolders)
{
foreach (InventoryFolderImpl folder in SubFolders.Values)
{
found = folder.DeleteItem(itemID);
if (found == true)
{
break;
}
}
}
return found;
}
@ -175,25 +175,25 @@ namespace OpenSim.Framework.Communications.Cache
/// </summary>
/// <returns>The requested folder if it exists, null if it does not.</returns>
public InventoryFolderImpl FindFolder(LLUUID folderID)
{
{
if (folderID == ID)
{
return this;
}
lock (SubFolders)
{
foreach (InventoryFolderImpl folder in SubFolders.Values)
{
InventoryFolderImpl returnFolder = folder.FindFolder(folderID);
if (returnFolder != null)
{
return returnFolder;
}
}
}
return null;
}
@ -203,7 +203,7 @@ namespace OpenSim.Framework.Communications.Cache
public List<InventoryItemBase> RequestListOfItems()
{
List<InventoryItemBase> itemList = new List<InventoryItemBase>();
lock (Items)
{
foreach (InventoryItemBase item in Items.Values)
@ -211,9 +211,9 @@ namespace OpenSim.Framework.Communications.Cache
itemList.Add(item);
}
}
//m_log.DebugFormat("[INVENTORY FOLDER IMPL]: Found {0} items", itemList.Count);
return itemList;
}
@ -221,9 +221,9 @@ namespace OpenSim.Framework.Communications.Cache
/// Return the list of immediate child folders in this folder.
/// </summary>
public List<InventoryFolderBase> RequestListOfFolders()
{
{
List<InventoryFolderBase> folderList = new List<InventoryFolderBase>();
lock (SubFolders)
{
foreach (InventoryFolderBase folder in SubFolders.Values)
@ -231,7 +231,7 @@ namespace OpenSim.Framework.Communications.Cache
folderList.Add(folder);
}
}
return folderList;
}
}

View File

@ -45,34 +45,34 @@ namespace OpenSim.Framework.Communications.Cache
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private LLUUID libOwner = new LLUUID("11111111-1111-0000-0000-000100bba000");
/// <summary>
/// Holds the root library folder and all its descendents. This is really only used during inventory
/// setup so that we don't have to repeatedly search the tree of library folders.
/// </summary>
protected Dictionary<LLUUID, InventoryFolderImpl> libraryFolders
protected Dictionary<LLUUID, InventoryFolderImpl> libraryFolders
= new Dictionary<LLUUID, InventoryFolderImpl>();
public LibraryRootFolder()
{
m_log.Info("[LIBRARY INVENTORY]: Loading library inventory");
Owner = libOwner;
ID = new LLUUID("00000112-000f-0000-0000-000100bba000");
Name = "OpenSim Library";
ParentID = LLUUID.Zero;
Type = (short) 8;
Version = (ushort) 1;
libraryFolders.Add(ID, this);
LoadLibraries(Path.Combine(Util.inventoryDir(), "Libraries.xml"));
// CreateLibraryItems();
}
/// <summary>
/// Hardcoded item creation. Please don't add any more items here - future items should be created
/// Hardcoded item creation. Please don't add any more items here - future items should be created
/// in the xml in the bin/inventory folder.
/// </summary>
///
@ -132,7 +132,7 @@ namespace OpenSim.Framework.Communications.Cache
item.NextPermissions = 0x7FFFFFFF;
return item;
}
/// <summary>
/// Use the asset set information at path to load assets
/// </summary>
@ -142,49 +142,49 @@ namespace OpenSim.Framework.Communications.Cache
{
m_log.InfoFormat(
"[LIBRARY INVENTORY]: Loading libraries control file {0}", librariesControlPath);
LoadFromFile(librariesControlPath, "Libraries control", ReadLibraryFromConfig);
}
/// <summary>
/// Read a library set from config
/// </summary>
/// <param name="config"></param>
protected void ReadLibraryFromConfig(IConfig config)
{
string foldersPath
string foldersPath
= Path.Combine(
Util.inventoryDir(), config.GetString("foldersFile", String.Empty));
LoadFromFile(foldersPath, "Library folders", ReadFolderFromConfig);
string itemsPath
string itemsPath
= Path.Combine(
Util.inventoryDir(), config.GetString("itemsFile", String.Empty));
LoadFromFile(itemsPath, "Library items", ReadItemFromConfig);
}
/// <summary>
/// Read a library inventory folder from a loaded configuration
/// </summary>
/// <param name="source"></param>
private void ReadFolderFromConfig(IConfig config)
{
{
InventoryFolderImpl folderInfo = new InventoryFolderImpl();
folderInfo.ID = new LLUUID(config.GetString("folderID", ID.ToString()));
folderInfo.Name = config.GetString("name", "unknown");
folderInfo.Name = config.GetString("name", "unknown");
folderInfo.ParentID = new LLUUID(config.GetString("parentFolderID", ID.ToString()));
folderInfo.Type = (short)config.GetInt("type", 8);
folderInfo.Owner = libOwner;
folderInfo.Version = 1;
folderInfo.Owner = libOwner;
folderInfo.Version = 1;
if (libraryFolders.ContainsKey(folderInfo.ParentID))
{
{
InventoryFolderImpl parentFolder = libraryFolders[folderInfo.ParentID];
libraryFolders.Add(folderInfo.ID, folderInfo);
parentFolder.SubFolders.Add(folderInfo.ID, folderInfo);
@ -201,7 +201,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <summary>
/// Read a library inventory item metadata from a loaded configuration
/// </summary>
/// <param name="source"></param>
/// <param name="source"></param>
private void ReadItemFromConfig(IConfig config)
{
InventoryItemBase item = new InventoryItemBase();
@ -218,11 +218,11 @@ namespace OpenSim.Framework.Communications.Cache
item.NextPermissions = (uint)config.GetLong("nextPermissions", 0x7FFFFFFF);
item.EveryOnePermissions = (uint)config.GetLong("everyonePermissions", 0x7FFFFFFF);
item.BasePermissions = (uint)config.GetLong("basePermissions", 0x7FFFFFFF);
if (libraryFolders.ContainsKey(item.Folder))
{
InventoryFolderImpl parentFolder = libraryFolders[item.Folder];
parentFolder.Items.Add(item.ID, item);
}
else
@ -230,11 +230,11 @@ namespace OpenSim.Framework.Communications.Cache
m_log.WarnFormat(
"[LIBRARY INVENTORY]: Couldn't add item {0} ({1}) since parent folder with ID {2} does not exist!",
item.Name, item.ID, item.Folder);
}
}
}
private delegate void ConfigAction(IConfig config);
private delegate void ConfigAction(IConfig config);
/// <summary>
/// Load the given configuration at a path and perform an action on each Config contained within it
/// </summary>
@ -242,7 +242,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="fileDescription"></param>
/// <param name="action"></param>
private static void LoadFromFile(string path, string fileDescription, ConfigAction action)
{
{
if (File.Exists(path))
{
try
@ -250,21 +250,21 @@ namespace OpenSim.Framework.Communications.Cache
XmlConfigSource source = new XmlConfigSource(path);
for (int i = 0; i < source.Configs.Count; i++)
{
{
action(source.Configs[i]);
}
}
catch (XmlException e)
{
m_log.ErrorFormat("[LIBRARY INVENTORY]: Error loading {0} : {1}", path, e);
}
}
}
else
{
m_log.ErrorFormat("[LIBRARY INVENTORY]: {0} file {1} does not exist!", fileDescription, path);
}
}
}
/// <summary>
/// Looks like a simple getter, but is written like this for some consistency with the other Request
/// methods in the superclass

View File

@ -33,7 +33,7 @@ using libsecondlife;
using log4net;
namespace OpenSim.Framework.Communications.Cache
{
{
/// <summary>
/// Holds user profile information and retrieves it from backend services.
/// </summary>
@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications.Cache
/// The comms manager holds references to services (user, grid, inventory, etc.)
/// </summary>
private readonly CommunicationsManager m_commsManager;
/// <summary>
/// Each user has a cached profile.
/// </summary>
@ -84,8 +84,8 @@ namespace OpenSim.Framework.Communications.Cache
}
}
}
}
}
/// <summary>
/// Remove this user's profile cache.
/// </summary>
@ -103,9 +103,9 @@ namespace OpenSim.Framework.Communications.Cache
else
{
m_log.ErrorFormat("[USER CACHE]: Tried to remove the profile of user {0}, but this was not in the scene", userID);
}
}
}
return false;
}
@ -118,14 +118,14 @@ namespace OpenSim.Framework.Communications.Cache
{
CachedUserInfo userInfo = GetUserDetails(userID);
if (userInfo != null)
{
{
m_commsManager.InventoryService.RequestInventoryForUser(userID, userInfo.InventoryReceive);
}
else
{
m_log.ErrorFormat("[USER CACHE]: RequestInventoryForUser() - user profile for user {0} not found", userID);
}
}
}
/// <summary>
/// Get the details of the given user. A caller should try this method first if it isn't sure that
@ -151,7 +151,7 @@ namespace OpenSim.Framework.Communications.Cache
/// <param name="parentID"></param>
public void HandleCreateInventoryFolder(IClientAPI remoteClient, LLUUID folderID, ushort folderType,
string folderName, LLUUID parentID)
{
{
CachedUserInfo userProfile;
if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@ -159,21 +159,21 @@ namespace OpenSim.Framework.Communications.Cache
if (!userProfile.CreateFolder(folderName, folderID, folderType, parentID))
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
"[AGENT INVENTORY]: Failed to create folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
/// <summary>
/// Handle a client request to update the inventory folder
///
///
/// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE
/// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing,
/// and needs to be changed.
@ -188,7 +188,7 @@ namespace OpenSim.Framework.Communications.Cache
{
// m_log.DebugFormat(
// "[AGENT INVENTORY]: Updating inventory folder {0} {1} for {2} {3}", folderID, name, remoteClient.Name, remoteClient.AgentId);
CachedUserInfo userProfile;
if (m_userProfiles.TryGetValue(remoteClient.AgentId, out userProfile))
@ -196,16 +196,16 @@ namespace OpenSim.Framework.Communications.Cache
if (!userProfile.UpdateFolder(name, folderID, type, parentID))
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
"[AGENT INVENTORY]: Failed to update folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
}
/// <summary>
@ -223,16 +223,16 @@ namespace OpenSim.Framework.Communications.Cache
if (!userProfile.MoveFolder(folderID, parentID))
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Failed to move folder for user {0} {1}",
"[AGENT INVENTORY]: Failed to move folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
}
/// <summary>
@ -267,14 +267,14 @@ namespace OpenSim.Framework.Communications.Cache
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
}
/// <summary>
/// Handle the caps inventory descendents fetch.
///
///
/// Since the folder structure is sent to the client on login, I believe we only need to handle items.
/// </summary>
/// <param name="agentID"></param>
@ -288,20 +288,20 @@ namespace OpenSim.Framework.Communications.Cache
bool fetchFolders, bool fetchItems, int sortOrder)
{
// m_log.DebugFormat(
// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
// "[INVENTORY CACHE]: Fetching folders ({0}), items ({1}) from {2} for agent {3}",
// fetchFolders, fetchItems, folderID, agentID);
// FIXME MAYBE: We're not handling sortOrder!
InventoryFolderImpl fold;
if ((fold = libraryRoot.FindFolder(folderID)) != null)
{
return fold.RequestListOfItems();
}
}
CachedUserInfo userProfile;
if (m_userProfiles.TryGetValue(agentID, out userProfile))
{
{
// XXX: When a client crosses into a scene, their entire inventory is fetched
// asynchronously. If the client makes a request before the inventory is received, we need
// to give the inventory a chance to come in.
@ -315,18 +315,18 @@ namespace OpenSim.Framework.Communications.Cache
while (attempts++ < 30)
{
m_log.DebugFormat(
"[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}",
"[INVENTORY CACHE]: Poll number {0} for inventory items in folder {1} for user {2}",
attempts, folderID, agentID);
Thread.Sleep(2000);
if (userProfile.HasInventory)
{
break;
}
}
}
}
if (userProfile.HasInventory)
{
if ((fold = userProfile.RootFolder.FindFolder(folderID)) != null)
@ -338,9 +338,9 @@ namespace OpenSim.Framework.Communications.Cache
m_log.WarnFormat(
"[AGENT INVENTORY]: Could not find folder {0} requested by user {1}",
folderID, agentID);
return null;
}
}
}
else
{
@ -352,7 +352,7 @@ namespace OpenSim.Framework.Communications.Cache
else
{
m_log.ErrorFormat("[AGENT INVENTORY]: Could not find user profile for {0}", agentID);
return null;
}
}
@ -371,16 +371,16 @@ namespace OpenSim.Framework.Communications.Cache
if (!userProfile.PurgeFolder(folderID))
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Failed to purge folder for user {0} {1}",
"[AGENT INVENTORY]: Failed to purge folder for user {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
}
public void HandleFetchInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID ownerID)
@ -407,9 +407,9 @@ namespace OpenSim.Framework.Communications.Cache
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
"[AGENT INVENTORY]: Could not find user profile for {0} {1}",
remoteClient.Name, remoteClient.AgentId);
}
}
}
}
}

View File

@ -64,16 +64,16 @@ namespace OpenSim.Framework.Communications.Capabilities
public class Caps
{
private static readonly ILog m_log =
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_httpListenerHostName;
private uint m_httpListenPort;
/// <summary>
/// This is the uuid portion of every CAPS path. It is used to make capability urls private to the requester.
/// </summary>
private string m_capsObjectPath;
private string m_capsObjectPath;
public string CapsObjectPath { get { return m_capsObjectPath; } }
private CapsHandlers m_capsHandlers;
@ -88,7 +88,7 @@ namespace OpenSim.Framework.Communications.Capabilities
// The following two entries are in a module, however, there also here so that we don't re-assign
// the path to another cap by mistake.
private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module.
private static readonly string m_parcelVoiceInfoRequestPath = "0007/"; // This is in a module.
private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
//private string eventQueue = "0100/";
@ -100,7 +100,7 @@ namespace OpenSim.Framework.Communications.Capabilities
private bool m_dumpAssetsToFile;
private string m_regionName;
// These are callbacks which will be setup by the scene so that we can update scene data when we
// These are callbacks which will be setup by the scene so that we can update scene data when we
// receive capability calls
public NewInventoryItem AddNewInventoryItem = null;
public ItemUpdatedCallback ItemUpdatedCall = null;
@ -128,46 +128,46 @@ namespace OpenSim.Framework.Communications.Capabilities
public void RegisterHandlers()
{
DeregisterHandlers();
string capsBase = "/CAPS/" + m_capsObjectPath;
string capsBase = "/CAPS/" + m_capsObjectPath;
try
{
// the root of all evil
m_capsHandlers["SEED"] = new RestStreamHandler("POST", capsBase + m_requestPath, CapsRequest);
m_capsHandlers["MapLayer"] =
new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST",
capsBase + m_mapLayerPath,
m_capsHandlers["MapLayer"] =
new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST",
capsBase + m_mapLayerPath,
GetMapLayer);
m_capsHandlers["NewFileAgentInventory"] =
m_capsHandlers["NewFileAgentInventory"] =
new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST",
capsBase + m_newInventory,
NewAgentInventoryRequest);
m_capsHandlers["UpdateNotecardAgentInventory"] =
m_capsHandlers["UpdateNotecardAgentInventory"] =
new RestStreamHandler("POST", capsBase + m_notecardUpdatePath, NoteCardAgentInventory);
m_capsHandlers["UpdateScriptAgentInventory"] = m_capsHandlers["UpdateNotecardAgentInventory"];
m_capsHandlers["UpdateScriptTaskInventory"] =
m_capsHandlers["UpdateScriptTaskInventory"] =
new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
// justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and
// subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires
// enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service,
// but when I went on the Linden grid, the
// justincc: I've disabled the CAPS service for now to fix problems with selecting textures, and
// subsequent inventory breakage, in the edit object pane (such as mantis 1085). This requires
// enhancements (probably filling out the folder part of the LLSD reply) to our CAPS service,
// but when I went on the Linden grid, the
// simulators I visited (version 1.21) were, surprisingly, no longer supplying this capability. Instead,
// the 1.19.1.4 client appeared to be happily flowing inventory data over UDP
//
// This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid
// we will be
// This is very probably just a temporary measure - once the CAPS service appears again on the Linden grid
// we will be
// able to get the data we need to implement the necessary part of the protocol to fix the issue above.
// m_capsHandlers["FetchInventoryDescendents"] =
// m_capsHandlers["FetchInventoryDescendents"] =
// new RestStreamHandler("POST", capsBase + m_fetchInventoryPath, FetchInventoryRequest);
// m_capsHandlers["FetchInventoryDescendents"] =
// m_capsHandlers["FetchInventoryDescendents"] =
// new LLSDStreamhandler<LLSDFetchInventoryDescendents, LLSDInventoryDescendents>("POST",
// capsBase + m_fetchInventory,
// FetchInventory));
// m_capsHandlers["RequestTextureDownload"] = new RestStreamHandler("POST",
// capsBase + m_requestTexture,
// capsBase + m_requestTexture,
// RequestTexture);
}
catch (Exception e)
@ -181,7 +181,7 @@ namespace OpenSim.Framework.Communications.Capabilities
/// </summary>
/// <param name="capName"></param>
/// <param name="handler"></param>
public void RegisterHandler(string capName, IRequestHandler handler)
public void RegisterHandler(string capName, IRequestHandler handler)
{
m_capsHandlers[capName] = handler;
m_log.DebugFormat("[CAPS]: Registering handler for \"{0}\": path {1}", capName, handler.Path);
@ -189,14 +189,14 @@ namespace OpenSim.Framework.Communications.Capabilities
/// <summary>
/// Remove all CAPS service handlers.
///
///
/// </summary>
/// <param name="httpListener"></param>
/// <param name="path"></param>
/// <param name="restMethod"></param>
public void DeregisterHandlers()
{
foreach (string capsName in m_capsHandlers.Caps)
foreach (string capsName in m_capsHandlers.Caps)
{
m_capsHandlers.Remove(capsName);
}
@ -220,7 +220,7 @@ namespace OpenSim.Framework.Communications.Capabilities
// FIXME: these all should probably go into the respective region
// modules
/// <summary>
/// Processes a fetch inventory request and sends the reply
@ -229,7 +229,7 @@ namespace OpenSim.Framework.Communications.Capabilities
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
// Request is like:
// Request is like:
//<llsd>
// <map><key>folders</key>
// <array>
@ -240,14 +240,14 @@ namespace OpenSim.Framework.Communications.Capabilities
// </map>
//</llsd>
//
// multiple fetch-folder maps are allowed within the larger folders map.
// multiple fetch-folder maps are allowed within the larger folders map.
public string FetchInventoryRequest(string request, string path, string param)
{
string unmodifiedRequest = request.ToString();
//m_log.DebugFormat("[AGENT INVENTORY]: Received CAPS fetch inventory request {0}", unmodifiedRequest);
m_log.Debug("[CAPS]: Inventory Request in region: " + m_regionName);
Hashtable hash = new Hashtable();
try
{
@ -258,7 +258,7 @@ namespace OpenSim.Framework.Communications.Capabilities
m_log.Error("[AGENT INVENTORY]: Fetch error: " + pe.Message);
m_log.Error("Request: " + request.ToString());
}
ArrayList foldersrequested = (ArrayList)hash["folders"];
string response = "";
@ -275,15 +275,15 @@ namespace OpenSim.Framework.Communications.Capabilities
inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(reply);
inventoryitemstr = inventoryitemstr.Replace("<llsd><map><key>folders</key><array>", "");
inventoryitemstr = inventoryitemstr.Replace("</array></map></llsd>", "");
response += inventoryitemstr;
}
if (response.Length == 0)
{
// Ter-guess: If requests fail a lot, the client seems to stop requesting descendants.
// Therefore, I'm concluding that the client only has so many threads available to do requests
// and when a thread stalls.. is stays stalled.
// and when a thread stalls.. is stays stalled.
// Therefore we need to return something valid
response = "<llsd><map><key>folders</key><array /></map></llsd>";
}
@ -291,7 +291,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
response = "<llsd><map><key>folders</key><array>" + response + "</array></map></llsd>";
}
//m_log.DebugFormat("[AGENT INVENTORY]: Replying to CAPS fetch inventory request with following xml");
//m_log.Debug(Util.GetFormattedXml(response));
@ -310,7 +310,7 @@ namespace OpenSim.Framework.Communications.Capabilities
contents.agent___id = m_agentID;
contents.owner___id = invFetch.owner_id;
contents.folder___id = invFetch.folder_id;
// The version number being sent back was originally 1.
// Unfortunately, on 1.19.1.4, this means that we see a problem where on subsequent logins
// without clearing client cache, objects in the root folder disappear until the cache is cleared,
@ -318,8 +318,8 @@ namespace OpenSim.Framework.Communications.Capabilities
//
// Seeing the version to something other than 0 may be the right thing to do, but there is
// a greater subtlety of the second life protocol that needs to be understood first.
contents.version = 0;
contents.version = 0;
contents.descendents = 0;
reply.folders.Array.Add(contents);
List<InventoryItemBase> itemList = null;
@ -327,7 +327,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
itemList = CAPSFetchInventoryDescendents(m_agentID, invFetch.folder_id, invFetch.owner_id, invFetch.fetch_folders, invFetch.fetch_items, invFetch.sort_order);
}
if (itemList != null)
{
foreach (InventoryItemBase invItem in itemList)
@ -336,12 +336,12 @@ namespace OpenSim.Framework.Communications.Capabilities
}
}
else
{
{
IClientAPI client = GetClient(m_agentID);
// We're going to both notify the client of inventory service failure and send back a 'no folder contents' response.
// We're going to both notify the client of inventory service failure and send back a 'no folder contents' response.
// If we don't send back the response,
// the client becomes unhappy (see Teravus' comment in FetchInventoryRequest())
// the client becomes unhappy (see Teravus' comment in FetchInventoryRequest())
if (client != null)
{
client.SendAgentAlertMessage(
@ -351,11 +351,11 @@ namespace OpenSim.Framework.Communications.Capabilities
else
{
m_log.ErrorFormat(
"[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure",
"[AGENT INVENTORY]: Could not lookup controlling client for {0} in order to notify them of the inventory service failure",
m_agentID);
}
}
contents.descendents = contents.items.Array.Count;
return reply;
}
@ -375,7 +375,7 @@ namespace OpenSim.Framework.Communications.Capabilities
llsdItem.item_id = invItem.ID;
llsdItem.name = invItem.Name;
llsdItem.parent_id = invItem.Folder;
llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower();
llsdItem.permissions = new LLSDPermissions();
llsdItem.permissions.creator_id = invItem.Creator;
@ -395,7 +395,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="mapReq"></param>
/// <returns></returns>
@ -408,7 +408,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <returns></returns>
protected static LLSDMapLayer GetLLSDMapLayerResponse()
@ -421,7 +421,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
@ -437,7 +437,7 @@ namespace OpenSim.Framework.Communications.Capabilities
#region EventQueue (Currently not enabled)
/// <summary>
///
///
/// </summary>
/// <param name="request"></param>
/// <param name="path"></param>
@ -463,7 +463,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="caps"></param>
/// <param name="ipAddressPort"></param>
@ -482,7 +482,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <returns></returns>
public string CreateEmptyEventResponse()
@ -590,7 +590,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="llsdRequest"></param>
/// <returns></returns>
@ -622,7 +622,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="assetID"></param>
/// <param name="inventoryItem"></param>
@ -708,7 +708,7 @@ namespace OpenSim.Framework.Communications.Capabilities
/// <param name="itemID">Item to update</param>
/// <param name="primID">Prim containing item to update</param>
/// <param name="isScriptRunning">Signals whether the script to update is currently running</param>
/// <param name="data">New asset data</param>
/// <param name="data">New asset data</param>
public void TaskScriptUpdated(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data)
{
if (TaskScriptUpdatedCall != null)
@ -751,7 +751,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
@ -807,7 +807,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
/// This class is a callback invoked when a client sends asset data to
/// This class is a callback invoked when a client sends asset data to
/// an agent inventory notecard update url
/// </summary>
public class ItemUpdater
@ -831,7 +831,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
@ -889,7 +889,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
/// This class is a callback invoked when a client sends asset data to
/// This class is a callback invoked when a client sends asset data to
/// a task inventory script update url
/// </summary>
public class TaskInventoryScriptUpdater
@ -921,7 +921,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
@ -931,7 +931,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
try
{
// m_log.InfoFormat("[CAPS]: " +
// m_log.InfoFormat("[CAPS]: " +
// "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}",
// data, path, param));

View File

@ -64,14 +64,14 @@ namespace OpenSim.Framework.Communications.Capabilities
/// </summary>
/// <param name="capsName">name of the capability of the cap
/// handler to be removed</param>
public void Remove(string capsName)
public void Remove(string capsName)
{
// This line must be here, or caps will break!
m_httpListener.RemoveStreamHandler("POST", m_capsHandlers[capsName].Path);
m_capsHandlers.Remove(capsName);
}
public bool ContainsCap(string cap)
public bool ContainsCap(string cap)
{
return m_capsHandlers.ContainsKey(cap);
}
@ -85,14 +85,14 @@ namespace OpenSim.Framework.Communications.Capabilities
/// retrieve a cap handler for a cap that is not contained in
/// CapsHandlers.
/// </Remarks>
public IRequestHandler this[string idx]
public IRequestHandler this[string idx]
{
get
get
{
return m_capsHandlers[idx];
}
set
set
{
if (m_capsHandlers.ContainsKey(idx))
{
@ -111,9 +111,9 @@ namespace OpenSim.Framework.Communications.Capabilities
/// Return the list of cap names for which this CapsHandlers
/// object contains cap handlers.
/// </summary>
public string[] Caps
public string[] Caps
{
get
get
{
string[] __keys = new string[m_capsHandlers.Keys.Count];
m_capsHandlers.Keys.CopyTo(__keys, 0);
@ -125,7 +125,7 @@ namespace OpenSim.Framework.Communications.Capabilities
/// Return an LLSD-serializable Hashtable describing the
/// capabilities and their handler details.
/// </summary>
public Hashtable CapsDetails
public Hashtable CapsDetails
{
get
{

View File

@ -37,12 +37,12 @@ using libsecondlife;
namespace OpenSim.Framework.Communications.Capabilities
{
/// <summary>
/// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code.
/// Borrowed from (a older version of) libsl for now, as their new llsd code doesn't work we our decoding code.
/// </summary>
public static class LLSD
{
/// <summary>
///
///
/// </summary>
public class LLSDParseException : Exception
{
@ -52,7 +52,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
public class LLSDSerializeException : Exception
{
@ -62,7 +62,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="b"></param>
/// <returns></returns>
@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="st"></param>
/// <returns></returns>
@ -96,7 +96,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="obj"></param>
/// <returns></returns>
@ -116,7 +116,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="writer"></param>
/// <param name="obj"></param>
@ -217,7 +217,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
@ -360,7 +360,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
@ -405,7 +405,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
@ -441,7 +441,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="count"></param>
/// <returns></returns>
@ -453,7 +453,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="obj"></param>
/// <param name="indent"></param>
@ -661,7 +661,7 @@ namespace OpenSim.Framework.Communications.Capabilities
}
/// <summary>
///
///
/// </summary>
/// <param name="reader"></param>
private static void SkipWS(XmlTextReader reader)

View File

@ -35,9 +35,9 @@ namespace OpenSim.Framework.Communications.Capabilities
{
public class LLSDHelpers
{
// private static readonly log4net.ILog m_log
// private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public static string SerialiseLLSDReply(object obj)
{
StringWriter sw = new StringWriter();
@ -47,9 +47,9 @@ namespace OpenSim.Framework.Communications.Capabilities
SerializeLLSDType(writer, obj);
writer.WriteEndElement();
writer.Close();
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
return sw.ToString();
}
@ -146,7 +146,7 @@ namespace OpenSim.Framework.Communications.Capabilities
fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value);
//TODO
// the LLSD map/array types in the array need to be deserialised
// but first we need to know the right class to deserialise them into.
// but first we need to know the right class to deserialise them into.
}
else
{

View File

@ -91,7 +91,7 @@ namespace OpenSim.Framework.Communications.Capabilities
public int descendents;
public LLUUID folder___id; //as LL can't decide if they are going to use "_" or "-" to separate words in the field names
public LLSDArray items = new LLSDArray();
public LLUUID owner___id; // and of course we can't have field names with "-" in
public LLUUID owner___id; // and of course we can't have field names with "-" in
public int version;
}
}

View File

@ -23,7 +23,7 @@
* 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.Collections;
@ -41,7 +41,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
}
public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds)
public LLSDParcelVoiceInfoResponse(string region, int localID, Hashtable creds)
{
region_name = region;
parcel_local_id = localID;

View File

@ -51,7 +51,7 @@ namespace OpenSim.Framework.Communications.Capabilities
//string requestBody = streamReader.ReadToEnd();
//streamReader.Close();
// libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)
// libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)
// libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request));
Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request);

View File

@ -34,7 +34,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
/// <summary>
/// The task inventory item that was updated
/// </summary>
/// </summary>
public LLUUID item_id;
/// <summary>

View File

@ -34,17 +34,17 @@ namespace OpenSim.Framework.Communications.Capabilities
{
/// <summary>
/// The item containing the script to update
/// </summary>
/// </summary>
public LLUUID item_id;
/// <summary>
/// The task containing the script
/// </summary>
/// </summary>
public LLUUID task_id;
/// <summary>
/// Signals whether the script is currently active
/// </summary>
/// </summary>
public int is_script_running;
}
}

View File

@ -23,7 +23,7 @@
* 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.
*
*
*/
namespace OpenSim.Framework.Communications.Capabilities
@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications.Capabilities
{
}
public LLSDVoiceAccountResponse(string user, string pass)
public LLSDVoiceAccountResponse(string user, string pass)
{
username = user;
password = pass;

View File

@ -236,7 +236,7 @@ namespace OpenSim.Framework.Communications
public void UpdateAvatarPropertiesRequest(IClientAPI remote_client, UserProfileData UserProfile)
{
m_userService.UpdateUserProfileProperties(UserProfile);
m_userService.UpdateUserProfileProperties(UserProfile);
return;
}

View File

@ -112,7 +112,7 @@ namespace OpenSim.Framework.Communications
public void EndInvoke()
{
// This method assumes that only 1 thread calls EndInvoke
// This method assumes that only 1 thread calls EndInvoke
if (!IsCompleted)
{
// If the operation isn't done, wait for it
@ -142,7 +142,7 @@ namespace OpenSim.Framework.Communications
// Save the asynchronous operation's result
m_result = result;
// Tell the base class that the operation completed
// Tell the base class that the operation completed
// sucessfully (no exception)
base.SetAsCompleted(completedSynchronously);
}

View File

@ -43,62 +43,62 @@ namespace OpenSim.Framework.Communications
public interface IInventoryServices
{
/// <summary>
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// Request the inventory for a user. This is an asynchronous operation that will call the callback when the
/// inventory has been received
/// </summary>
/// <param name="userID"></param>
/// <param name="callback"></param>
void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback);
/// <summary>
/// Add a new folder to the user's inventory
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully added</returns>
bool AddFolder(InventoryFolderBase folder);
/// <summary>
/// Move an inventory folder to a new location
/// </summary>
/// <param name="folder">A folder containing the details of the new location</param>
/// <returns>true if the folder was successfully moved</returns>
bool MoveFolder(InventoryFolderBase folder);
/// <summary>
/// Purge an inventory folder of all its items and subfolders.
/// </summary>
/// <param name="folder"></param>
/// <returns>true if the folder was successfully purged</returns>
bool PurgeFolder(InventoryFolderBase folder);
/// <summary>
/// Add a new item to the user's inventory
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully added</returns>
bool AddItem(InventoryItemBase item);
/// <summary>
/// Update an item in the user's inventory
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully updated</returns>
bool UpdateItem(InventoryItemBase item);
/// <summary>
/// Delete an item from the user's inventory
/// </summary>
/// <param name="item"></param>
/// <returns>true if the item was successfully deleted</returns>
bool DeleteItem(InventoryItemBase item);
/// <summary>
/// Create a new inventory for the given user.
/// </summary>
/// <param name="user"></param>
/// <returns>true if the inventory was successfully created, false otherwise</returns>
bool CreateNewUserInventory(LLUUID user);
bool HasInventoryForUser(LLUUID userID);
/// <summary>
@ -107,12 +107,12 @@ namespace OpenSim.Framework.Communications
/// <param name="userID"></param>
/// <returns>null if no root folder was found</returns>
InventoryFolderBase RequestRootFolder(LLUUID userID);
/// <summary>
/// Returns a list of all the folders in a given user's inventory.
/// </summary>
/// <param name="userId"></param>
/// <returns>A flat list of the user's inventory folder tree,
/// <returns>A flat list of the user's inventory folder tree,
/// null if there is no inventory for this user</returns>
List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId);
}

View File

@ -37,7 +37,7 @@ namespace OpenSim.Framework.Communications
/// </summary>
/// <param name="fname">First name</param>
/// <param name="lname">Last name</param>
/// <returns>A user profile. Returns null if no profile is found</returns>
/// <returns>A user profile. Returns null if no profile is found</returns>
UserProfileData GetUserProfile(string firstName, string lastName);
//UserProfileData GetUserProfile(string name);
@ -46,7 +46,7 @@ namespace OpenSim.Framework.Communications
/// Loads a user profile from a database by UUID
/// </summary>
/// <param name="uuid">The target UUID</param>
/// <returns>A user profile. Returns null if no user profile is found.</returns>
/// <returns>A user profile. Returns null if no user profile is found.</returns>
UserProfileData GetUserProfile(LLUUID userId);
void clearUserAgent(LLUUID avatarID);
@ -57,7 +57,7 @@ namespace OpenSim.Framework.Communications
UserProfileData SetupMasterUser(LLUUID userId);
/// <summary>
///
///
/// </summary>
/// <param name="user"></param>
LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY);
@ -110,7 +110,7 @@ namespace OpenSim.Framework.Communications
List<FriendListItem> GetUserFriendList(LLUUID friendlistowner);
/// <summary>
/// Get's the User Appearance
/// Get's the User Appearance
AvatarAppearance GetUserAppearance(LLUUID user);
void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);

View File

@ -40,13 +40,13 @@ namespace OpenSim.Framework.Communications
/// </summary>
public abstract class InventoryServiceBase : IInventoryServices
{
private static readonly ILog m_log
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>();
#region Plugin methods
/// <summary>
/// Adds a new user server plugin - plugins will be requested in the order they were loaded.
/// </summary>
@ -76,42 +76,42 @@ namespace OpenSim.Framework.Communications
}
}
}
#endregion
#region IInventoryServices methods
#region IInventoryServices methods
// See IInventoryServices
public List<InventoryFolderBase> GetInventorySkeleton(LLUUID userId)
{
// m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId);
InventoryFolderBase rootFolder = RequestRootFolder(userId);
// Agent has no inventory structure yet.
if (null == rootFolder)
{
return null;
}
List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
return null;
}
List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>();
userFolders.Add(rootFolder);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
IList<InventoryFolderBase> folders = plugin.Value.getFolderHierarchy(rootFolder.ID);
userFolders.AddRange(folders);
}
}
// foreach (InventoryFolderBase folder in userFolders)
// {
// m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID);
// }
return userFolders;
}
// See IInventoryServices
public virtual bool HasInventoryForUser(LLUUID userID)
{
@ -133,31 +133,31 @@ namespace OpenSim.Framework.Communications
public bool CreateNewUserInventory(LLUUID user)
{
InventoryFolderBase existingRootFolder = RequestRootFolder(user);
if (null != existingRootFolder)
{
m_log.WarnFormat(
"[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have "
+ "a root inventory folder with id {1}",
+ "a root inventory folder with id {1}",
user, existingRootFolder.ID);
}
else
{
{
UsersInventory inven = new UsersInventory();
inven.CreateNewInventorySet(user);
AddNewInventorySet(inven);
return true;
}
return false;
}
}
// See IInventoryServices
public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback);
public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback);
#endregion
#region Methods used by GridInventoryService
public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID)
@ -180,21 +180,21 @@ namespace OpenSim.Framework.Communications
}
return itemsList;
}
#endregion
// See IInventoryServices
public bool AddFolder(InventoryFolderBase folder)
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
"[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.addInventoryFolder(folder);
}
// FIXME: Should return false on failure
// FIXME: Should return false on failure
return true;
}
@ -203,14 +203,14 @@ namespace OpenSim.Framework.Communications
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.moveInventoryFolder(folder);
}
// FIXME: Should return false on failure
return true;
// FIXME: Should return false on failure
return true;
}
// See IInventoryServices
@ -218,14 +218,14 @@ namespace OpenSim.Framework.Communications
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.addInventoryItem(item);
}
// FIXME: Should return false on failure
return true;
// FIXME: Should return false on failure
return true;
}
// See IInventoryServices
@ -233,14 +233,14 @@ namespace OpenSim.Framework.Communications
{
m_log.InfoFormat(
"[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.updateInventoryItem(item);
}
// FIXME: Should return false on failure
return true;
// FIXME: Should return false on failure
return true;
}
// See IInventoryServices
@ -248,19 +248,19 @@ namespace OpenSim.Framework.Communications
{
m_log.InfoFormat(
"[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.deleteInventoryItem(item.ID);
}
// FIXME: Should return false on failure
return true;
// FIXME: Should return false on failure
return true;
}
/// <summary>
/// Purge a folder of all items items and subfolders.
///
///
/// FIXME: Really nasty in a sense, because we have to query the database to get information we may
/// already know... Needs heavy refactoring.
/// </summary>
@ -269,13 +269,13 @@ namespace OpenSim.Framework.Communications
{
m_log.DebugFormat(
"[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID);
List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID);
foreach (InventoryFolderBase subFolder in subFolders)
{
// m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID);
foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins)
{
plugin.Value.deleteInventoryFolder(subFolder.ID);
@ -288,17 +288,17 @@ namespace OpenSim.Framework.Communications
{
DeleteItem(item);
}
// FIXME: Should return false on failure
return true;
// FIXME: Should return false on failure
return true;
}
private void AddNewInventorySet(UsersInventory inventory)
{
foreach (InventoryFolderBase folder in inventory.Folders.Values)
{
AddFolder(folder);
}
}
}
/// <summary>
@ -340,7 +340,7 @@ namespace OpenSim.Framework.Communications
folder.Type = (short)AssetType.Bodypart;
folder.Version = 1;
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.ParentID = rootFolder;
folder.Owner = user;
@ -348,7 +348,7 @@ namespace OpenSim.Framework.Communications
folder.Name = "Calling Cards";
folder.Type = (short)AssetType.CallingCard;
folder.Version = 1;
Folders.Add(folder.ID, folder);
Folders.Add(folder.ID, folder);
folder = new InventoryFolderBase();
folder.ParentID = rootFolder;

View File

@ -31,9 +31,9 @@ namespace OpenSim.Framework.Communications.Limit
/// Interface for strategies that can limit requests from the client. Currently only used in the
/// texture modules to deal with repeated requests for certain textures. However, limiting strategies
/// could be used with other requests.
/// </summary>
/// </summary>
public interface IRequestLimitStrategy<TId>
{
{
/// <summary>
/// Should the request be allowed? If the id is not monitored, then the request is always allowed.
/// Otherwise, the strategy criteria will be applied.
@ -41,21 +41,21 @@ namespace OpenSim.Framework.Communications.Limit
/// <param name="id"></param>
/// <returns></returns>
bool AllowRequest(TId id);
/// <summary>
/// Has the request been refused just once?
/// </summary>
/// <returns>False if the request has not yet been refused, or if the request has been refused more
/// than once.</returns>
bool IsFirstRefusal(TId id);
/// <summary>
/// Start monitoring for future AllowRequest calls. If the id is already monitored, then monitoring
/// continues.
/// </summary>
/// <param name="id"></param>
void MonitorRequests(TId id);
/// <summary>
/// Is the id being monitored?
/// </summary>

View File

@ -26,15 +26,15 @@
*/
namespace OpenSim.Framework.Communications.Limit
{
{
/// <summary>
/// Strategy which polices no limits
/// </summary>
public class NullLimitStrategy<TId> : IRequestLimitStrategy<TId>
{
{
public bool AllowRequest(TId id) { return true; }
public bool IsFirstRefusal(TId id) { return false; }
public void MonitorRequests(TId id) { /* intentionally blank */ }
public bool IsMonitoringRequests(TId id) { return false; }
public bool IsMonitoringRequests(TId id) { return false; }
}
}

View File

@ -31,14 +31,14 @@ namespace OpenSim.Framework.Communications.Limit
{
/// <summary>
/// Limit requests by discarding them after they've been repeated a certain number of times.
/// </summary>
/// </summary>
public class RepeatLimitStrategy<TId> : IRequestLimitStrategy<TId>
{
/// <summary>
/// Record each asset request that we're notified about.
/// </summary>
private readonly Dictionary<TId, int> requestCounts = new Dictionary<TId, int>();
/// <summary>
/// The maximum number of requests that can be made before we drop subsequent requests.
/// </summary>
@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Limit
{
get { return m_maxRequests; }
}
/// <summary></summary>
/// <param name="maxRequests">The maximum number of requests that may be served before all further
/// requests are dropped.</param>
@ -55,52 +55,52 @@ namespace OpenSim.Framework.Communications.Limit
{
m_maxRequests = maxRequests;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
public bool AllowRequest(TId id)
{
{
if (requestCounts.ContainsKey(id))
{
requestCounts[id] += 1;
if (requestCounts[id] > m_maxRequests)
{
{
return false;
}
}
}
return true;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public bool IsFirstRefusal(TId id)
{
if (requestCounts.ContainsKey(id) && m_maxRequests + 1 == requestCounts[id])
{
return true;
}
}
return false;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public void MonitorRequests(TId id)
{
if (!IsMonitoringRequests(id))
{
requestCounts.Add(id, 1);
}
}
}
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public bool IsMonitoringRequests(TId id)
{
return requestCounts.ContainsKey(id);

View File

@ -32,17 +32,17 @@ namespace OpenSim.Framework.Communications.Limit
{
/// <summary>
/// Limit requests by discarding repeat attempts that occur within a given time period
///
///
/// XXX Don't use this for limiting texture downloading, at least not until we better handle multiple requests
/// for the same texture at different resolutions.
/// </summary>
/// </summary>
public class TimeLimitStrategy<TId> : IRequestLimitStrategy<TId>
{
/// <summary>
/// Record the time at which an asset request occurs.
/// </summary>
private readonly Dictionary<TId, Request> requests = new Dictionary<TId, Request>();
private readonly Dictionary<TId, Request> requests = new Dictionary<TId, Request>();
/// <summary>
/// The minimum time period between which requests for the same data will be serviced.
/// </summary>
@ -53,37 +53,37 @@ namespace OpenSim.Framework.Communications.Limit
}
/// <summary></summary>
/// <param name="repeatPeriod"></param>
/// <param name="repeatPeriod"></param>
public TimeLimitStrategy(TimeSpan repeatPeriod)
{
m_repeatPeriod = repeatPeriod;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
public bool AllowRequest(TId id)
{
{
if (IsMonitoringRequests(id))
{
DateTime now = DateTime.Now;
TimeSpan elapsed = now - requests[id].Time;
if (elapsed < RepeatPeriod)
{
requests[id].Refusals += 1;
return false;
}
requests[id].Time = now;
requests[id].Time = now;
}
return true;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public bool IsFirstRefusal(TId id)
{
if (IsMonitoringRequests(id))
@ -92,31 +92,31 @@ namespace OpenSim.Framework.Communications.Limit
{
return true;
}
}
}
return false;
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public void MonitorRequests(TId id)
{
if (!IsMonitoringRequests(id))
{
requests.Add(id, new Request(DateTime.Now));
}
}
}
}
/// <summary>
/// <see cref="IRequestLimitStrategy"/>
/// </summary>
/// </summary>
public bool IsMonitoringRequests(TId id)
{
return requests.ContainsKey(id);
}
}
}
/// <summary>
/// Private request details.
/// </summary>
@ -126,12 +126,12 @@ namespace OpenSim.Framework.Communications.Limit
/// Time of last request
/// </summary>
public DateTime Time;
/// <summary>
/// Number of refusals associated with this request
/// </summary>
public int Refusals;
public Request(DateTime time)
{
Time = time;

View File

@ -239,7 +239,7 @@ namespace OpenSim.Framework.Communications
"Could not authenticate your avatar. Please check your username and password, and check the grid if problems persist.",
"false");
}
/// <summary>
/// Response to indicate that login failed because the agent's inventory was not available.
/// </summary>
@ -249,7 +249,7 @@ namespace OpenSim.Framework.Communications
return GenerateFailureResponse(
"key",
"The avatar inventory service is not responding. Please notify your login region operator.",
"false");
"false");
}
public XmlRpcResponse CreateAlreadyLoggedInResponse()

View File

@ -48,8 +48,8 @@ namespace OpenSim.Framework.Communications
protected string m_welcomeMessage = "Welcome to OpenSim";
protected UserManagerBase m_userManager = null;
protected Mutex m_loginMutex = new Mutex(false);
protected Mutex m_loginMutex = new Mutex(false);
/// <summary>
/// Used during login to send the skeleton of the OpenSim Library to the client.
/// </summary>
@ -61,12 +61,12 @@ namespace OpenSim.Framework.Communications
/// <param name="userManager"></param>
/// <param name="libraryRootFolder"></param>
/// <param name="welcomeMess"></param>
public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder,
public LoginService(UserManagerBase userManager, LibraryRootFolder libraryRootFolder,
string welcomeMess)
{
m_userManager = userManager;
m_libraryRootFolder = libraryRootFolder;
if (welcomeMess != String.Empty)
{
m_welcomeMessage = welcomeMess;
@ -79,15 +79,15 @@ namespace OpenSim.Framework.Communications
/// <param name="response">The existing response</param>
/// <param name="theUser">The user profile</param>
public abstract void CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest);
/// <summary>
/// Get the initial login inventory skeleton (in other words, the folder structure) for the given user.
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
/// <exception cref='System.Exception'>This will be thrown if there is a problem with the inventory service</exception>
protected abstract InventoryData GetInventorySkeleton(LLUUID userID);
protected abstract InventoryData GetInventorySkeleton(LLUUID userID);
/// <summary>
/// Called when we receive the client's initial XMLRPC login_to_simulator request message
/// </summary>
@ -112,7 +112,7 @@ namespace OpenSim.Framework.Communications
UserProfileData userProfile;
LoginResponse logResponse = new LoginResponse();
string firstname = String.Empty;
string lastname = String.Empty;
@ -120,23 +120,23 @@ namespace OpenSim.Framework.Communications
{
firstname = (string) requestData["first"];
lastname = (string) requestData["last"];
m_log.InfoFormat(
"[LOGIN BEGIN]: Received login request message from user {0} {1}",
"[LOGIN BEGIN]: Received login request message from user {0} {1}",
firstname, lastname);
string clientVersion = "Unknown";
if (requestData.Contains("version"))
{
clientVersion = (string)requestData["version"];
clientVersion = (string)requestData["version"];
}
if (requestData.Contains("start"))
{
startLocationRequest = (string)requestData["start"];
}
}
m_log.DebugFormat(
"[LOGIN]: Client is {0}, start location is {1}", clientVersion, startLocationRequest);
@ -163,9 +163,9 @@ namespace OpenSim.Framework.Communications
catch (Exception e)
{
m_log.InfoFormat(
"[LOGIN END]: Bad web_login_key: {0} for user {1} {2}, exception {3}",
"[LOGIN END]: Bad web_login_key: {0} for user {1} {2}, exception {3}",
requestData["web_login_key"], firstname, lastname, e);
return logResponse.CreateFailedResponse();
}
GoodLogin = AuthenticateUser(userProfile, webloginkey);
@ -176,14 +176,14 @@ namespace OpenSim.Framework.Communications
{
m_log.Info(
"[LOGIN END]: login_to_simulator login message did not contain all the required data");
return logResponse.CreateGridErrorResponse();
}
if (!GoodLogin)
{
m_log.InfoFormat("[LOGIN END]: User {0} {1} failed authentication", firstname, lastname);
return logResponse.CreateLoginFailedResponse();
}
else
@ -199,11 +199,11 @@ namespace OpenSim.Framework.Communications
m_userManager.CommitAgent(ref userProfile);
// Reject the login
m_log.InfoFormat(
"[LOGIN END]: Notifying user {0} {1} that they are already logged in",
"[LOGIN END]: Notifying user {0} {1} that they are already logged in",
firstname, lastname);
return logResponse.CreateAlreadyLoggedInResponse();
}
// Otherwise...
@ -214,9 +214,9 @@ namespace OpenSim.Framework.Communications
{
LLUUID agentID = userProfile.ID;
InventoryData inventData = null;
try
{
{
inventData = GetInventorySkeleton(agentID);
}
catch (Exception e)
@ -224,10 +224,10 @@ namespace OpenSim.Framework.Communications
m_log.ErrorFormat(
"[LOGIN END]: Error retrieving inventory skeleton of agent {0}, {1} - {2}",
agentID, e.GetType(), e.Message);
return logResponse.CreateLoginInventoryFailedResponse();
}
return logResponse.CreateLoginInventoryFailedResponse();
}
ArrayList AgentInventoryArray = inventData.InventoryArray;
Hashtable InventoryRootHash = new Hashtable();
@ -235,7 +235,7 @@ namespace OpenSim.Framework.Communications
ArrayList InventoryRoot = new ArrayList();
InventoryRoot.Add(InventoryRootHash);
userProfile.RootInventoryFolderID = inventData.RootFolderID;
// Inventory Library Section
Hashtable InventoryLibRootHash = new Hashtable();
InventoryLibRootHash["folder_id"] = "00000112-000f-0000-0000-000100bba000";
@ -244,10 +244,10 @@ namespace OpenSim.Framework.Communications
logResponse.InventoryLibRoot = InventoryLibRoot;
logResponse.InventoryLibraryOwner = GetLibraryOwner();
logResponse.InventoryRoot = InventoryRoot;
logResponse.InventorySkeleton = AgentInventoryArray;
logResponse.InventoryLibrary = GetInventoryLibrary();
logResponse.InventoryLibrary = GetInventoryLibrary();
// Circuit Code
uint circode = (uint) (Util.RandomClass.Next());
@ -280,15 +280,15 @@ namespace OpenSim.Framework.Communications
//return logResponse.ToXmlRpcResponse();
}
CommitAgent(ref userProfile);
// If we reach this point, then the login has successfully logged onto the grid
if (StatsManager.UserStats != null)
StatsManager.UserStats.AddSuccessfulLogin();
m_log.DebugFormat(
"[LOGIN END]: Authentication of user {0} {1} successful. Sending response to client.",
firstname, lastname);
return logResponse.ToXmlRpcResponse();
}
catch (Exception e)
@ -422,10 +422,10 @@ namespace OpenSim.Framework.Communications
}
CommitAgent(ref userProfile);
// If we reach this point, then the login has successfully logged onto the grid
if (StatsManager.UserStats != null)
StatsManager.UserStats.AddSuccessfulLogin();
StatsManager.UserStats.AddSuccessfulLogin();
return logResponse.ToLLSDResponse();
}
@ -449,7 +449,7 @@ namespace OpenSim.Framework.Communications
// period, space, parens, and dash.
Regex wfcut = new Regex("[^a-zA-Z0-9_\\.\\$ \\(\\)\\-]");
Hashtable returnactions = new Hashtable();
int statuscode = 200;
@ -467,7 +467,7 @@ namespace OpenSim.Framework.Communications
// the client requires the HTML form field be named 'username'
// however, the data it sends when it loads the first time is 'firstname'
// another one of those little nuances.
if (keysvals.Contains("firstname"))
firstname = wfcut.Replace((string)keysvals["firstname"], String.Empty, 99999);
@ -494,7 +494,7 @@ namespace OpenSim.Framework.Communications
if (keysvals.Contains("lang"))
lang = wfcut.Replace((string)keysvals["lang"], String.Empty, 99999);
if (keysvals.Contains("password"))
password = wfcut.Replace((string)keysvals["password"], String.Empty, 99999);
@ -541,8 +541,8 @@ namespace OpenSim.Framework.Communications
return returnactions;
}
public string GetLoginForm(string firstname, string lastname, string location, string region,
string grid, string channel, string version, string lang,
public string GetLoginForm(string firstname, string lastname, string location, string region,
string grid, string channel, string version, string lang,
string password, string errormessages)
{
// inject our values in the form at the markers
@ -559,7 +559,7 @@ namespace OpenSim.Framework.Communications
loginform = sr.ReadToEnd();
sr.Close();
}
loginform = loginform.Replace("[$firstname]", firstname);
loginform = loginform.Replace("[$lastname]", lastname);
loginform = loginform.Replace("[$location]", location);
@ -586,7 +586,7 @@ namespace OpenSim.Framework.Communications
responseString += "<title>OpenSim Login</title>";
responseString += "<body><br />";
responseString += "<div id=\"login_box\">";
responseString += "<form action=\"/go.cgi\" method=\"GET\" id=\"login-form\">";
responseString += "<div id=\"message\">[$errors]</div>";
@ -670,13 +670,13 @@ namespace OpenSim.Framework.Communications
password = "$1$" + Util.Md5Hash(password);
password = password.Remove(0, 3); //remove $1$
string s = Util.Md5Hash(password + ":" + profile.PasswordSalt);
// Testing...
// Testing...
//m_log.Info("[LOGIN]: SubHash:" + s + " userprofile:" + profile.passwordHash);
//m_log.Info("[LOGIN]: userprofile:" + profile.passwordHash + " SubCT:" + password);
passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
passwordSuccess = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
|| profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase));
return passwordSuccess;
@ -694,7 +694,7 @@ namespace OpenSim.Framework.Communications
}
/// <summary>
///
///
/// </summary>
/// <param name="profile"></param>
/// <param name="request"></param>
@ -709,7 +709,7 @@ namespace OpenSim.Framework.Communications
}
/// <summary>
///
///
/// </summary>
/// <param name="firstname"></param>
/// <param name="lastname"></param>
@ -720,7 +720,7 @@ namespace OpenSim.Framework.Communications
}
/// <summary>
///
///
/// </summary>
/// <returns></returns>
public virtual string GetMessage()
@ -741,17 +741,17 @@ namespace OpenSim.Framework.Communications
}
return buddylistreturn;
}
/// <summary>
/// Converts the inventory library skeleton into the form required by the rpc request.
/// </summary>
/// <returns></returns>
protected virtual ArrayList GetInventoryLibrary()
{
Dictionary<LLUUID, InventoryFolderImpl> rootFolders
Dictionary<LLUUID, InventoryFolderImpl> rootFolders
= m_libraryRootFolder.RequestSelfAndDescendentFolders();
ArrayList folderHashes = new ArrayList();
foreach (InventoryFolderBase folder in rootFolders.Values)
{
Hashtable TempHash = new Hashtable();
@ -762,12 +762,12 @@ namespace OpenSim.Framework.Communications
TempHash["folder_id"] = folder.ID.ToString();
folderHashes.Add(TempHash);
}
return folderHashes;
}
/// <summary>
///
///
/// </summary>
/// <returns></returns>
protected virtual ArrayList GetLibraryOwner()

View File

@ -28,7 +28,7 @@
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// General information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
@ -41,8 +41,8 @@ using System.Runtime.InteropServices;
[assembly : AssemblyTrademark("")]
[assembly : AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly : ComVisible(false)]
@ -54,11 +54,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]

View File

@ -16,14 +16,14 @@ namespace OpenSim.Framework.Communications
/// <remarks>
/// This class is a generic implementation of a REST (Representational State Transfer) web service. This
/// class is designed to execute both synchronously and asynchronously.
///
///
/// Internally the implementation works as a two stage asynchronous web-client.
/// When the request is initiated, RestClient will query asynchronously for for a web-response,
/// sleeping until the initial response is returned by the server. Once the initial response is retrieved
/// the second stage of asynchronous requests will be triggered, in an attempt to read of the response
/// object into a memorystream as a sequence of asynchronous reads.
///
/// The asynchronisity of RestClient is designed to move as much processing into the back-ground, allowing
///
/// The asynchronisity of RestClient is designed to move as much processing into the back-ground, allowing
/// other threads to execute, while it waits for a response from the web-service. RestClient itself can be
/// invoked by the caller in either synchronous mode or asynchronous modes.
/// </remarks>
@ -36,7 +36,7 @@ namespace OpenSim.Framework.Communications
#region member variables
/// <summary>
/// The base Uri of the web-service e.g. http://www.google.com
/// The base Uri of the web-service e.g. http://www.google.com
/// </summary>
private string _url;
@ -92,7 +92,7 @@ namespace OpenSim.Framework.Communications
/// <summary>
/// if an exception occours during async processing, we need to save it, so it can be
/// if an exception occours during async processing, we need to save it, so it can be
/// rethrown on the primary thread;
/// </summary>
private Exception _asyncException;
@ -341,7 +341,7 @@ namespace OpenSim.Framework.Communications
{
AsyncResult<Stream> ar = (AsyncResult<Stream>) asyncResult;
// Wait for operation to complete, then return result or
// Wait for operation to complete, then return result or
// throw exception
return ar.EndInvoke();
}

View File

@ -43,12 +43,12 @@ namespace OpenSim.Framework.Communications
/// </summary>
public abstract class UserManagerBase : IUserService
{
private static readonly ILog m_log
private static readonly ILog m_log
= LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public UserConfig _config;
private Dictionary<string, IUserData> _plugins = new Dictionary<string, IUserData>();
/// <summary>
/// Adds a new user server plugin - user servers will be requested in the order they were loaded.
/// </summary>
@ -85,7 +85,7 @@ namespace OpenSim.Framework.Communications
m_log.Info("[USERSTORAGE]: Added IUserData Interface");
}
#region Get UserProfile
#region Get UserProfile
// see IUserService
public UserProfileData GetUserProfile(string fname, string lname)
@ -103,8 +103,8 @@ namespace OpenSim.Framework.Communications
return null;
}
// see IUserService
// see IUserService
public UserProfileData GetUserProfile(LLUUID uuid)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
@ -408,7 +408,7 @@ namespace OpenSim.Framework.Communications
profile.CurrentAgent = agent;
}
/// <summary>
/// Process a user logoff from OpenSim.
/// </summary>
@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications
{
if (StatsManager.UserStats != null)
StatsManager.UserStats.AddLogout();
UserProfileData userProfile;
UserAgentData userAgent;
LLVector3 currentPos = new LLVector3(posx, posy, posz);
@ -433,7 +433,7 @@ namespace OpenSim.Framework.Communications
{
// This line needs to be in side the above if statement or the UserServer will crash on some logouts.
m_log.Info("[LOGOUT]: " + userProfile.FirstName + " " + userProfile.SurName + " from " + regionhandle + "(" + posx + "," + posy + "," + posz + ")");
userAgent = userProfile.CurrentAgent;
if (userAgent != null)
{
@ -462,7 +462,7 @@ namespace OpenSim.Framework.Communications
m_log.Warn("[LOGOUT]: Unknown User logged out");
}
}
public void CreateAgent(UserProfileData profile, LLSD request)
{
UserAgentData agent = new UserAgentData();
@ -516,7 +516,7 @@ namespace OpenSim.Framework.Communications
#endregion
/// <summary>
///
///
/// </summary>
/// <param name="user"></param>
public LLUUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
@ -598,7 +598,7 @@ namespace OpenSim.Framework.Communications
/// Appearance
/// TODO: stubs for now to get us to a compiling state gently
public AvatarAppearance GetUserAppearance(LLUUID user)
public AvatarAppearance GetUserAppearance(LLUUID user)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{
@ -643,7 +643,7 @@ namespace OpenSim.Framework.Communications
}
}
}
public void RemoveAttachment(LLUUID user, LLUUID item)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)
@ -658,7 +658,7 @@ namespace OpenSim.Framework.Communications
}
}
}
public List<LLUUID> GetAttachments(LLUUID user)
{
foreach (KeyValuePair<string, IUserData> plugin in _plugins)

View File

@ -58,7 +58,7 @@ namespace OpenSim.Framework.Console
}
/// <summary>
/// derive an ansi color from a string, ignoring the darker colors.
/// derive an ansi color from a string, ignoring the darker colors.
/// This is used to help automatically bin component tags with colors
/// in various print functions.
/// </summary>
@ -195,7 +195,7 @@ namespace OpenSim.Framework.Console
System.Console.WriteLine(args);
}
}
}
}
catch (ObjectDisposedException)
{
}
@ -232,7 +232,7 @@ namespace OpenSim.Framework.Console
{
}
}
public string ReadLine()
{
try
@ -245,7 +245,7 @@ namespace OpenSim.Framework.Console
return String.Empty;
}
}
public int Read()
{
return System.Console.Read();

View File

@ -40,32 +40,32 @@ namespace OpenSim.Framework.Console
string loggingMessage = RenderLoggingEvent(le);
string regex = @"^(?<Front>.*?)\[(?<Category>[^\]]+)\]:?(?<End>.*)";
Regex RE = new Regex(regex, RegexOptions.Multiline);
MatchCollection matches = RE.Matches(loggingMessage);
// Get some direct matches $1 $4 is a
// Get some direct matches $1 $4 is a
if (matches.Count == 1)
{
System.Console.Write(matches[0].Groups["Front"].Value);
System.Console.Write("[");
WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), matches[0].Groups["Category"].Value);
System.Console.Write("]:");
if (le.Level == Level.Error)
if (le.Level == Level.Error)
{
WriteColorText(ConsoleColor.Red, matches[0].Groups["End"].Value);
}
else if (le.Level == Level.Warn)
else if (le.Level == Level.Warn)
{
WriteColorText(ConsoleColor.Yellow, matches[0].Groups["End"].Value);
}
else
else
{
System.Console.Write(matches[0].Groups["End"].Value);
}
System.Console.WriteLine();
}
}
else
{
System.Console.Write(loggingMessage);

View File

@ -156,7 +156,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
public IScene Scene
{
@ -181,7 +181,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
public uint PacketNumber
{
@ -190,7 +190,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
public sbyte DiscardLevel
{
@ -199,7 +199,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
public LLUUID RequestedAssetID
{
@ -213,7 +213,7 @@ namespace OpenSim.Framework
private List<Wearable> m_nowWearing = new List<Wearable>();
/// <summary>
///
///
/// </summary>
public List<Wearable> NowWearing
{
@ -381,7 +381,7 @@ namespace OpenSim.Framework
public delegate void ImprovedInstantMessage(IClientAPI remoteclient,
LLUUID fromAgentID, LLUUID fromAgentSession, LLUUID toAgentID, LLUUID imSessionID, uint timestamp,
string fromAgentName, string message, byte dialog, bool fromGroup, byte offline, uint ParentEstateID,
LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down...
LLVector3 Position, LLUUID RegionID, byte[] binaryBucket); // This shouldn't be cut down...
// especially if we're ever going to implement groups, presence, estate message dialogs...
public delegate void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 RayEnd, LLVector3 RayStart,
@ -607,7 +607,7 @@ namespace OpenSim.Framework
public delegate void RequestPayPrice(IClientAPI remoteClient, LLUUID objectID);
public delegate void ForceReleaseControls(IClientAPI remoteClient, LLUUID agentID);
//Estate Requests
public delegate void DetailedEstateDataRequest(IClientAPI remoteClient, LLUUID invoice);
public delegate void SetEstateFlagsRequest(bool blockTerraform, bool noFly, bool allowDamage, bool blockLandResell, int maxAgents, float objectBonusFactor, int matureLevel, bool restrictPushObject, bool allowParcelChanges);
@ -764,7 +764,7 @@ namespace OpenSim.Framework
event ParcelPropertiesUpdateRequest OnParcelPropertiesUpdateRequest;
event ParcelSelectObjects OnParcelSelectObjects;
event ParcelObjectOwnerRequest OnParcelObjectOwnerRequest;
event ParcelAbandonRequest OnParcelAbandonRequest;
event ParcelAbandonRequest OnParcelAbandonRequest;
event RegionInfoRequest OnRegionInfoRequest;
event EstateCovenantRequest OnEstateCovenantRequest;
@ -808,7 +808,7 @@ namespace OpenSim.Framework
event EstateTeleportOneUserHomeRequest OnEstateTeleportOneUserHomeRequest;
[Obsolete("IClientAPI.OutPacket SHOULD NOT EXIST outside of LLClientView please refactor appropriately.")]
void OutPacket(Packet newPack, ThrottleOutPacketType packType);
void SendWearables(AvatarWearable[] wearables, int serial);
@ -858,16 +858,16 @@ namespace OpenSim.Framework
void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint);
void SetChildAgentThrottle(byte[] throttle);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
uint flags,
LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint, LLUUID AssetId);
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape,
LLVector3 pos, LLVector3 vel, LLVector3 acc, LLQuaternion rotation, LLVector3 rvel,
uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
uint flags, LLUUID objectID, LLUUID ownerID, string text, byte[] color,
uint parentID, byte[] particleSystem, byte clickAction);
void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
@ -889,7 +889,7 @@ namespace OpenSim.Framework
void SendInventoryItemCreateUpdate(InventoryItemBase Item);
void SendRemoveInventoryItem(LLUUID itemID);
void SendTakeControls(int controls, bool passToAgent, bool TakeControls);
void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName);
@ -950,7 +950,7 @@ namespace OpenSim.Framework
void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, LLUUID AssetFullID);
void SendConfirmXfer(ulong xferID, uint PacketID);
void SendXferRequest(ulong XferID, short AssetType, LLUUID vFileID, byte FilePath, byte[] FileName);
void SendImagePart(ushort numParts, LLUUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec);
void SendShutdownConnectionNotice();
@ -973,9 +973,9 @@ namespace OpenSim.Framework
LLVector3 CameraAtOffset, LLVector3 CameraEyeOffset, bool ForceMouseLook);
void SendAdminResponse(LLUUID Token, uint AdminLevel);
void SendGroupMembership(GroupData[] GroupMembership);
byte[] GetThrottlesPacked(float multiplier);

View File

@ -5,14 +5,14 @@ namespace OpenSim.Framework
#region Args Classes
public class ICA2_ConnectionArgs : EventArgs
{
}
public class ICA2_DisconnectionArgs : EventArgs
{
public bool Forced;
// Static Constructor
// Static Constructor
// Allows us to recycle these classes later more easily from a pool.
public static ICA2_DisconnectionArgs Create(bool forced)
{

View File

@ -120,7 +120,7 @@ namespace OpenSim.Framework
void updateInventoryItem(InventoryItemBase item);
/// <summary>
///
///
/// </summary>
/// <param name="item"></param>
void deleteInventoryItem(LLUUID item);

View File

@ -87,7 +87,7 @@ namespace OpenSim.Framework
void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey);
/// <summary>
/// Adds a new User profile to the database
/// Adds a new User profile to the database
/// </summary>
/// <param name="user">UserProfile to add</param>
void AddNewUserProfile(UserProfileData user);
@ -181,8 +181,8 @@ namespace OpenSim.Framework
AvatarAppearance GetUserAppearance(LLUUID user);
void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance);
void AddAttachment(LLUUID user, LLUUID item);
void RemoveAttachment(LLUUID user, LLUUID item);
List<LLUUID> GetAttachments(LLUUID user);

View File

@ -50,7 +50,7 @@ namespace OpenSim.Framework
private LLUUID _owner;
/// <summary>
/// The folder this folder is contained in
/// The folder this folder is contained in
/// </summary>
private LLUUID _parentID;

View File

@ -45,7 +45,7 @@ namespace OpenSim.Framework
private int _assetType;
/// <summary>
///
///
/// </summary>
private uint _basePermissions;
@ -69,12 +69,12 @@ namespace OpenSim.Framework
private string _description;
/// <summary>
///
///
/// </summary>
private uint _everyOnePermissions;
/// <summary>
/// The folder this item is contained in
/// The folder this item is contained in
/// </summary>
private LLUUID _folder;
@ -93,34 +93,34 @@ namespace OpenSim.Framework
/// </summary>
private string _name;
/// <summary>
///
///
/// </summary>
private LLUUID _groupID;
/// <summary>
///
///
/// </summary>
private bool _groupOwned;
/// <summary>
///
///
/// </summary>
private int _salePrice;
/// <summary>
///
///
/// </summary>
private byte _saleType;
/// <summary>
///
///
/// </summary>
private uint _flags;
/// <summary>
///
///
/// </summary>
public int _creationDate;

View File

@ -63,7 +63,7 @@ namespace OpenSim.Framework
#endregion
/// <summary>
///
///
/// </summary>
/// <param name="agent"></param>
/// <returns></returns>
@ -171,7 +171,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
/// <remarks>TODO: Doesnt take any args??</remarks>
/// <returns></returns>
@ -188,7 +188,7 @@ namespace OpenSim.Framework
}
/// <summary>
///
///
/// </summary>
/// <remarks>Added to avoid a unused compiler warning on OnNeighboursUpdate, TODO: Check me</remarks>
/// <param name="neighbours"></param>

View File

@ -37,7 +37,7 @@ namespace OpenSim.Framework
[Serializable]
public class SimpleRegionInfo
{
// private static readonly log4net.ILog m_log
// private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
protected bool Allow_Alternate_Ports;
@ -114,7 +114,7 @@ namespace OpenSim.Framework
/// <value>
/// This accessor can throw all the exceptions that Dns.GetHostAddresses can throw.
///
///
/// XXX Isn't this really doing too much to be a simple getter, rather than an explict method?
/// </value>
public IPEndPoint ExternalEndPoint
@ -187,7 +187,7 @@ namespace OpenSim.Framework
public class RegionInfo : SimpleRegionInfo
{
// private static readonly log4net.ILog m_log
// private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public bool commFailTF = false;
@ -327,7 +327,7 @@ namespace OpenSim.Framework
if (errorMessage != String.Empty)
{
// a error
// a error
}
}

View File

@ -87,7 +87,7 @@ namespace OpenSim.Framework
/// <summary>
/// Signs a new bit of data with the current hash. Returns a byte array which should be affixed to the message.
/// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the
/// Signing a piece of data will automatically increment the hash - if you sign data and do not send it, the
/// hashes will get out of sync and throw an exception when validation is attempted.
/// </summary>
/// <param name="data">The outgoing data</param>

View File

@ -30,7 +30,7 @@ using System.Xml.Serialization;
namespace OpenSim.Framework
{
/*
/*
* .Net has some issues, serializing a dictionary, so we cannot reuse the InventoryFolder
* class defined in Communications.Framework.Communications.Caches. So we serialize/deserialize
* into this simpler class, and then use that.

View File

@ -40,8 +40,8 @@ namespace OpenSim.Framework
/// <value>
/// The port by which http communication occurs with the region (most noticeably, CAPS communication)
///
/// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region
///
/// FIXME: Defaulting to 9000 temporarily (on the basis that this is the http port most region
/// servers are running) until the revision in which this change is made propogates around grids.
/// </value>
protected uint m_httpPort = 9000;

View File

@ -82,10 +82,10 @@ namespace OpenSim.Framework.Servers
string path = handler.Path;
string handlerKey = GetHandlerKey(httpMethod, path);
if (!m_streamHandlers.ContainsKey(handlerKey))
{
//m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey);
//m_log.DebugFormat("[BASE HTTP SERVER]: Adding handler key {0}", handlerKey);
m_streamHandlers.Add(handlerKey, handler);
}
}
@ -135,20 +135,20 @@ namespace OpenSim.Framework.Servers
try
{
HttpListenerContext context = (HttpListenerContext) stateinfo;
HttpListenerRequest request = context.Request;
HttpListenerResponse response = context.Response;
response.KeepAlive = false;
response.SendChunked = false;
string path = request.RawUrl;
string handlerKey = GetHandlerKey(request.HttpMethod, path);
//m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
IRequestHandler requestHandler;
if (TryGetStreamHandler(handlerKey, out requestHandler))
{
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
@ -156,13 +156,13 @@ namespace OpenSim.Framework.Servers
if (requestHandler is IStreamedRequestHandler)
{
IStreamedRequestHandler streamedRequestHandler = requestHandler as IStreamedRequestHandler;
buffer = streamedRequestHandler.Handle(path, request.InputStream);
}
else
{
IStreamHandler streamHandler = (IStreamHandler) requestHandler;
using (MemoryStream memoryStream = new MemoryStream())
{
streamHandler.Handle(path, request.InputStream, memoryStream);
@ -170,11 +170,11 @@ namespace OpenSim.Framework.Servers
buffer = memoryStream.ToArray();
}
}
request.InputStream.Close();
response.ContentType = requestHandler.ContentType;
response.ContentLength64 = buffer.LongLength;
try
{
response.OutputStream.Write(buffer, 0, buffer.Length);
@ -273,7 +273,7 @@ namespace OpenSim.Framework.Servers
return true;
}
}
/// <summary>
/// Try all the registered xmlrpc handlers when an xmlrpc request is received.
/// Sends back an XMLRPC unknown request response if no handler is registered for the requested method.
@ -434,7 +434,7 @@ namespace OpenSim.Framework.Servers
{
// This is a test. There's a workable alternative.. as this way sucks.
// We'd like to put this into a text file parhaps that's easily editable.
//
//
// For this test to work, I used the following secondlife.exe parameters
// "C:\Program Files\SecondLifeWindLight\SecondLifeWindLight.exe" -settings settings_windlight.xml -channel "Second Life WindLight" -set SystemLanguage en-us -loginpage http://10.1.1.2:8002/?show_login_form=TRUE -loginuri http://10.1.1.2:8002 -user 10.1.1.2
//
@ -461,7 +461,7 @@ namespace OpenSim.Framework.Servers
string[] querystringkeys = request.QueryString.AllKeys;
string[] rHeaders = request.Headers.AllKeys;
foreach (string queryname in querystringkeys)
{
keysvals.Add(queryname, request.QueryString[queryname]);
@ -489,7 +489,7 @@ namespace OpenSim.Framework.Servers
{
Hashtable responsedata = requestprocessor(keysvals);
DoHTTPGruntWork(responsedata,response);
//SendHTML500(response);
}
else
@ -519,7 +519,7 @@ namespace OpenSim.Framework.Servers
contentType = "text/html";
}
// We're forgoing the usual error status codes here because the client
// We're forgoing the usual error status codes here because the client
// ignores anything but 200 and 301
response.StatusCode = 200;
@ -649,10 +649,10 @@ namespace OpenSim.Framework.Servers
public void RemoveStreamHandler(string httpMethod, string path)
{
string handlerKey = GetHandlerKey(httpMethod, path);
string handlerKey = GetHandlerKey(httpMethod, path);
//m_log.DebugFormat("[BASE HTTP SERVER]: Removing handler key {0}", handlerKey);
m_streamHandlers.Remove(handlerKey);
}
@ -660,7 +660,7 @@ namespace OpenSim.Framework.Servers
{
m_HTTPHandlers.Remove(GetHandlerKey(httpMethod, path));
}
public string GetHTTP404(string host)
{
string file = Path.Combine(Util.configDir(), "http_404.html");

View File

@ -44,16 +44,16 @@ namespace OpenSim.Framework.Servers
{
get { return m_httpServer; }
}
/// <summary>
/// Holds the non-viewer statistics collection object for this service/server
/// </summary>
protected IStatsCollector m_stats;
public BaseOpenSimServer()
{
m_startuptime = DateTime.Now;
}
}
/// <summary>
/// Should be overriden by descendents if they need to perform extra shutdown processing
@ -66,7 +66,7 @@ namespace OpenSim.Framework.Servers
}
Environment.Exit(0);
}
/// <summary>
/// Runs commands issued by the server console from the operator
/// </summary>
@ -75,17 +75,17 @@ namespace OpenSim.Framework.Servers
public virtual void RunCmd(string command, string[] cmdparams)
{
switch (command)
{
{
case "help":
Notice("quit - equivalent to shutdown.");
if (m_stats != null)
Notice("show stats - statistical information for this server");
Notice("show uptime - show server startup and uptime.");
Notice("shutdown - shutdown the server.\n");
break;
case "show":
if (cmdparams.Length > 0)
{
@ -96,10 +96,10 @@ namespace OpenSim.Framework.Servers
case "quit":
case "shutdown":
Shutdown();
break;
break;
}
}
/// <summary>
/// Outputs to the console information about the region
/// </summary>
@ -107,18 +107,18 @@ namespace OpenSim.Framework.Servers
public virtual void Show(string ShowWhat)
{
switch (ShowWhat)
{
{
case "stats":
if (m_stats != null)
{
Notice(m_stats.Report());
}
break;
break;
case "uptime":
Notice("Server has been running since " + m_startuptime.DayOfWeek + ", " + m_startuptime.ToString());
Notice("That is an elapsed time of " + (DateTime.Now - m_startuptime).ToString());
break;
break;
}
}

View File

@ -38,12 +38,12 @@ namespace OpenSim.Framework.Servers
/// <summary>
/// Makes an asynchronous REST request with a callback to invoke with the response.
/// </summary>
/// </summary>
public class RestObjectPosterResponse<TResponse>
{
// private static readonly log4net.ILog m_log
// private static readonly log4net.ILog m_log
// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public ReturnResponse<TResponse> ResponseCallback;
public void BeginPostObject<TRequest>(string requestUrl, TRequest obj)
@ -87,11 +87,11 @@ namespace OpenSim.Framework.Servers
TResponse deserial;
XmlSerializer deserializer = new XmlSerializer(typeof (TResponse));
Stream stream = resp.GetResponseStream();
// This is currently a bad debug stanza since it gobbles us the response...
// StreamReader reader = new StreamReader(stream);
// m_log.DebugFormat("[REST OBJECT POSTER RESPONSE]: Received {0}", reader.ReadToEnd());
deserial = (TResponse) deserializer.Deserialize(stream);
if (deserial != null && ResponseCallback != null)

View File

@ -34,7 +34,7 @@ namespace OpenSim.Framework.Servers
{
private RestMethod m_restMethod;
public RestMethod Method
public RestMethod Method
{
get { return m_restMethod; }
}

View File

@ -75,7 +75,7 @@ namespace OpenSim.Framework.Servers
using (WebResponse resp = request.GetResponse())
{
XmlSerializer deserializer = new XmlSerializer(typeof (TResponse));
deserial = (TResponse) deserializer.Deserialize(resp.GetResponseStream());
deserial = (TResponse) deserializer.Deserialize(resp.GetResponseStream());
}
return deserial;
}

View File

@ -37,35 +37,35 @@ namespace OpenSim.Framework.Statistics
{
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
private DateTime startTime = DateTime.Now;
private long assetRequestsToday;
private long assetRequestsToday;
private long assetRequestsNotFoundToday;
private long assetRequestsYesterday;
private long assetRequestsNotFoundYesterday;
public long AssetRequestsToday { get { return assetRequestsToday; } }
public long AssetRequestsNotFoundToday { get { return assetRequestsNotFoundToday; } }
public long AssetRequestsNotFoundToday { get { return assetRequestsNotFoundToday; } }
public long AssetRequestsYesterday { get { return assetRequestsYesterday; } }
public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } }
public long AssetRequestsNotFoundYesterday { get { return assetRequestsNotFoundYesterday; } }
public AssetStatsCollector()
{
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
ageStatsTimer.Enabled = true;
}
private void OnAgeing(object source, ElapsedEventArgs e)
{
assetRequestsYesterday = assetRequestsToday;
// There is a possibility that an asset request could occur between the execution of these
// two statements. But we're better off without the synchronization overhead.
assetRequestsToday = 0;
assetRequestsToday = 0;
assetRequestsNotFoundYesterday = assetRequestsNotFoundToday;
assetRequestsNotFoundToday = 0;
}
/// <summary>
/// Record that an asset request failed to find an asset
/// </summary>
@ -73,7 +73,7 @@ namespace OpenSim.Framework.Statistics
{
assetRequestsNotFoundToday++;
}
/// <summary>
/// Record that a request was made to the asset server
/// </summary>
@ -90,10 +90,10 @@ namespace OpenSim.Framework.Statistics
{
double elapsedHours = (DateTime.Now - startTime).TotalHours;
if (elapsedHours <= 0) { elapsedHours = 1; } // prevent divide by zero
long assetRequestsTodayPerHour = (long)Math.Round(AssetRequestsToday / elapsedHours);
long assetRequestsYesterdayPerHour = (long)Math.Round(AssetRequestsYesterday / 24.0);
return string.Format(
@"Asset requests today : {0} ({1} per hour) of which {2} were not found
Asset requests yesterday : {3} ({4} per hour) of which {5} were not found",

View File

@ -26,7 +26,7 @@
*/
namespace OpenSim.Framework.Statistics
{
{
/// <summary>
/// Implemented by classes which collect up non-viewer statistical information
/// </summary>
@ -36,6 +36,6 @@ namespace OpenSim.Framework.Statistics
/// Report back collected statistical information.
/// </summary>
/// <returns></returns>
string Report();
string Report();
}
}

View File

@ -32,20 +32,20 @@ using libsecondlife;
using OpenSim.Framework.Statistics.Interfaces;
namespace OpenSim.Framework.Statistics
{
{
/// <summary>
/// Collects sim statistics which aren't already being collected for the linden viewer's statistics pane
/// </summary>
public class SimExtraStatsCollector : IStatsCollector
{
{
private long assetsInCache;
private long texturesInCache;
private long texturesInCache;
private long assetCacheMemoryUsage;
private long textureCacheMemoryUsage;
private long blockedMissingTextureRequests;
private long inventoryServiceRetrievalFailures;
public long AssetsInCache { get { return assetsInCache; } }
public long TexturesInCache { get { return texturesInCache; } }
public long AssetCacheMemoryUsage { get { return assetCacheMemoryUsage; } }
@ -58,47 +58,47 @@ namespace OpenSim.Framework.Statistics
/// driver bugs on clients (though this seems less likely).
/// </summary>
public long BlockedMissingTextureRequests { get { return blockedMissingTextureRequests; } }
/// <summary>
/// Number of known failures to retrieve avatar inventory from the inventory service. This does not
/// cover situations where the inventory service accepts the request but never returns any data, since
/// we do not yet timeout this situation.
/// </summary>
public long InventoryServiceRetrievalFailures { get { return inventoryServiceRetrievalFailures; } }
/// <summary>
/// Retain a dictionary of all packet queues stats reporters
/// </summary>
private IDictionary<LLUUID, PacketQueueStatsCollector> packetQueueStatsCollectors
= new Dictionary<LLUUID, PacketQueueStatsCollector>();
public void AddAsset(AssetBase asset)
{
assetsInCache++;
assetCacheMemoryUsage += asset.Data.Length;
}
public void AddTexture(AssetBase image)
{
if (image.Data != null)
{
texturesInCache++;
// This could have been a pull stat, though there was originally a nebulous idea to measure flow rates
textureCacheMemoryUsage += image.Data.Length;
}
}
}
public void AddBlockedMissingTextureRequest()
{
blockedMissingTextureRequests++;
}
public void AddInventoryServiceRetrievalFailure()
{
inventoryServiceRetrievalFailures++;
}
/// <summary>
/// Register as a packet queue stats provider
/// </summary>
@ -111,7 +111,7 @@ namespace OpenSim.Framework.Statistics
packetQueueStatsCollectors[uuid] = new PacketQueueStatsCollector(provider);
}
}
/// <summary>
/// Deregister a packet queue stats provider
/// </summary>
@ -129,25 +129,25 @@ namespace OpenSim.Framework.Statistics
/// </summary>
/// <returns></returns>
public string Report()
{
{
StringBuilder sb = new StringBuilder(Environment.NewLine);
sb.Append("ASSET STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
@"Asset cache contains {0,6} assets using {1,10:0.000}K" + Environment.NewLine,
AssetsInCache, AssetCacheMemoryUsage / 1024.0));
sb.Append(Environment.NewLine);
sb.Append("TEXTURE STATISTICS");
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
sb.Append(
string.Format(
@"Texture cache contains {0,6} textures using {1,10:0.000}K
Blocked requests for missing textures: {2}" + Environment.NewLine,
TexturesInCache, TextureCacheMemoryUsage / 1024.0,
BlockedMissingTextureRequests));
BlockedMissingTextureRequests));
sb.Append(Environment.NewLine);
sb.Append("INVENTORY STATISTICS");
sb.Append(Environment.NewLine);
@ -155,26 +155,26 @@ Blocked requests for missing textures: {2}" + Environment.NewLine,
string.Format(
"Initial inventory caching failures: {0}" + Environment.NewLine,
InventoryServiceRetrievalFailures));
sb.Append(Environment.NewLine);
sb.Append("PACKET QUEUE STATISTICS");
sb.Append(Environment.NewLine);
sb.Append("Agent UUID ");
sb.Append(
string.Format(
" {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
" {0,7} {1,7} {2,7} {3,7} {4,7} {5,7} {6,7} {7,7} {8,7} {9,7}",
"Send", "In", "Out", "Resend", "Land", "Wind", "Cloud", "Task", "Texture", "Asset"));
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
foreach (LLUUID key in packetQueueStatsCollectors.Keys)
{
sb.Append(string.Format("{0}: ", key));
sb.Append(packetQueueStatsCollectors[key].Report());
sb.Append(Environment.NewLine);
}
return sb.ToString();
}
}
}
/// <summary>
@ -183,16 +183,16 @@ Blocked requests for missing textures: {2}" + Environment.NewLine,
public class PacketQueueStatsCollector : IStatsCollector
{
private IPullStatsProvider m_statsProvider;
public PacketQueueStatsCollector(IPullStatsProvider provider)
{
m_statsProvider = provider;
m_statsProvider = provider;
}
/// <summary>
/// Report back collected statistical information.
/// </summary>
/// <returns></returns>
/// <returns></returns>
public string Report()
{
return m_statsProvider.GetStats();

View File

@ -26,7 +26,7 @@
*/
namespace OpenSim.Framework.Statistics
{
{
/// <summary>
/// Singleton used to provide access to statistics reporters
/// </summary>
@ -34,44 +34,44 @@ namespace OpenSim.Framework.Statistics
{
private static AssetStatsCollector assetStats;
private static UserStatsCollector userStats;
private static SimExtraStatsCollector simExtraStats;
private static SimExtraStatsCollector simExtraStats;
public static AssetStatsCollector AssetStats { get { return assetStats; } }
public static UserStatsCollector UserStats { get { return userStats; } }
public static SimExtraStatsCollector SimExtraStats { get { return simExtraStats; } }
private StatsManager() {}
/// <summary>
/// Start collecting statistics related to assets.
/// Should only be called once.
/// </summary>
/// </summary>
public static AssetStatsCollector StartCollectingAssetStats()
{
assetStats = new AssetStatsCollector();
return assetStats;
}
/// <summary>
/// Start collecting statistics related to users.
/// Should only be called once.
/// </summary>
/// </summary>
public static UserStatsCollector StartCollectingUserStats()
{
userStats = new UserStatsCollector();
return userStats;
}
}
/// <summary>
/// Start collecting extra sim statistics apart from those collected for the client.
/// Start collecting extra sim statistics apart from those collected for the client.
/// Should only be called once.
/// </summary>
public static SimExtraStatsCollector StartCollectingSimExtraStats()
{
simExtraStats = new SimExtraStatsCollector();
return simExtraStats;
}
}

View File

@ -35,43 +35,43 @@ namespace OpenSim.Framework.Statistics
public class UserStatsCollector : IStatsCollector
{
private Timer ageStatsTimer = new Timer(24 * 60 * 60 * 1000);
private int successfulLoginsToday;
public int SuccessfulLoginsToday { get { return successfulLoginsToday; } }
private int successfulLoginsYesterday;
public int SuccessfulLoginsYesterday { get { return successfulLoginsYesterday; } }
public int SuccessfulLoginsYesterday { get { return successfulLoginsYesterday; } }
private int successfulLogins;
public int SuccessfulLogins { get { return successfulLogins; } }
private int logouts;
public int Logouts { get { return logouts; } }
public UserStatsCollector()
{
ageStatsTimer.Elapsed += new ElapsedEventHandler(OnAgeing);
ageStatsTimer.Enabled = true;
}
private void OnAgeing(object source, ElapsedEventArgs e)
{
successfulLoginsYesterday = successfulLoginsToday;
// There is a possibility that an asset request could occur between the execution of these
// two statements. But we're better off without the synchronization overhead.
successfulLoginsToday = 0;
successfulLoginsToday = 0;
}
/// <summary>
/// Record a successful login
/// </summary>
public void AddSuccessfulLogin()
{
successfulLogins++;
successfulLogins++;
successfulLoginsToday++;
}
public void AddLogout()
{
logouts++;

View File

@ -38,7 +38,7 @@ namespace OpenSim.Framework
{
/// <summary>
/// A dictionary for task inventory.
///
///
/// This class is not thread safe. Callers must synchronize on Dictionary methods.
/// </summary>
public class TaskInventoryDictionary : Dictionary<LLUUID, TaskInventoryItem>,
@ -72,10 +72,10 @@ namespace OpenSim.Framework
//
// System.TypeInitializationException: An exception was thrown by the type initializer for OpenSim.Framework.TaskInventoryDictionary ---> System.ArgumentOutOfRangeException: < 0
// Parameter name: length
// at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.2.4/mcs/class/corlib/System/String.cs:381
// at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type runtimeType, System.String xmlDataType) [0x001f6] in /build/buildd/mono-1.2.4/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs:217
// at System.String.Substring (Int32 startIndex, Int32 length) [0x00088] in /build/buildd/mono-1.2.4/mcs/class/corlib/System/String.cs:381
// at System.Xml.Serialization.TypeTranslator.GetTypeData (System.Type runtimeType, System.String xmlDataType) [0x001f6] in /build/buildd/mono-1.2.4/mcs/class/System.XML/System.Xml.Serialization/TypeTranslator.cs:217
// ...
// private static XmlSerializer tiiSerializer
// private static XmlSerializer tiiSerializer
// = new XmlSerializer(typeof(Dictionary<LLUUID, TaskInventoryItem>.ValueCollection));
// see IXmlSerializable
@ -110,7 +110,7 @@ namespace OpenSim.Framework
m_log.DebugFormat("[TASK INVENTORY]: Skipping empty element {0}", reader.Name);
}
// For some .net implementations, this last read is necessary so that we advance beyond the end tag
// For some .net implementations, this last read is necessary so that we advance beyond the end tag
// of the element wrapping this object so that the rest of the serialization can complete normally.
reader.Read();
@ -221,7 +221,7 @@ namespace OpenSim.Framework
public uint NextOwnerMask = FULL_MASK_PERMISSIONS_GENERAL;
public LLUUID OwnerID = LLUUID.Zero;
public uint OwnerMask = FULL_MASK_PERMISSIONS_GENERAL;
public LLUUID ParentID = LLUUID.Zero; //parent folder id
public LLUUID ParentID = LLUUID.Zero; //parent folder id
public LLUUID ParentPartID = LLUUID.Zero;
public LLUUID PermsGranter;
public int PermsMask;

Some files were not shown because too many files have changed in this diff Show More